Previous 199869 Revisions Next

r29405 Monday 7th April, 2014 at 06:04:18 UTC by Miodrag Milanović
Cleanups and version bump
[hash]a7800.xml coco_flop.xml msx1_cart.xml msx1_flop.xml pico.xml psx.xml
[src]version.c
[src/build]flags_gcc.mak png2bdc.c
[src/emu]clifront.h crsshair.c delegate.h devfind.c digfx.c digfx.h diimage.c diimage.h dioutput.c diserial.h drawgfx.h drivenum.c emualloc.h emuopts.c emupal.c emupal.h ioport.c ioport.h machine.h mame.c memarray.h output.c render.c rendfont.c rendfont.h rendlay.c rendlay.h screen.c screen.h softlist.c softlist.h tilemap.h validity.c validity.h video.c
[src/emu/bus/a2bus]a2cffa.c a2corvus.c a2pic.c a2ssc.c a2ultraterm.c a2videoterm.c a2videoterm.h a2vulcan.c
[src/emu/bus/adam]exp.h
[src/emu/bus/adamnet]fdc.h spi.c spi.h
[src/emu/bus/bml3]bml3mp1805.h
[src/emu/bus/c64]magic_formel.c
[src/emu/bus/cbm2]hrg.c hrg.h user.h
[src/emu/bus/cbmiec]c1541.c c1541.h c1571.c c1571.h
[src/emu/bus/coco]coco_fdc.c coco_fdc.h
[src/emu/bus/coleco]exp.h hand.h sac.h std.h
[src/emu/bus/compucolor]floppy.c
[src/emu/bus/comx35]exp.h printer.c
[src/emu/bus/ecbbus]ecbbus.h grip.c
[src/emu/bus/econet]e01.c econet.c econet.h
[src/emu/bus/ep64]exp.h
[src/emu/bus/gameboy]gb_slot.c
[src/emu/bus/ieee488]c2031.c c2031.h c2040.c c2040.h c2040fdc.c c8050.c hardbox.c softbox.c
[src/emu/bus/imi7000]imi5000h.h
[src/emu/bus/isa]3c505.c adlib.h aga.c aga.h cga.c cga.h dectalk.c ega.h gblaster.h isa.c isa.h mda.c mda.h mufdc.c mufdc.h omti8621.c omti8621.h pds.c sblaster.c sblaster.h sc499.c side116.h
[src/emu/bus/megadrive]md_carts.c md_slot.c
[src/emu/bus/nes]act53.c aladdin.c aladdin.h bandai.c bandai.h camerica.c datach.c datach.h jy.c jy.h karastudio.c karastudio.h mmc5.c mmc5.h nes_carts.c nes_ines.inc nes_slot.h nxrom.c sunsoft_dcs.c sunsoft_dcs.h
[src/emu/bus/nubus]nubus_specpdq.c nubus_specpdq.h
[src/emu/bus/plus4]c1551.c c1551.h
[src/emu/bus/sms_exp]smsexp.h
[src/emu/bus/vidbrain]exp.h
[src/emu/bus/wangpc]tig.c tig.h wangpc.h
[src/emu/cpu]cpu.mak
[src/emu/cpu/avr8]avr8.c avr8.h avr8dasm.c
[src/emu/cpu/cosmac]cosmac.h
[src/emu/cpu/cubeqcpu]cubeqcpu.h
[src/emu/cpu/dsp32]dsp32.c
[src/emu/cpu/esrip]esrip.h
[src/emu/cpu/g65816]g65816.h
[src/emu/cpu/h8]h8.c h8.h h8.lst h83002.h h83006.h h83008.h h83048.h h83337.c h83337.h h8_adc.c h8_adc.h h8_intc.c h8_intc.h h8_port.c h8_port.h h8_sci.c h8_sci.h h8_timer16.c h8_timer16.h h8_timer8.c h8_timer8.h h8s2245.c h8s2245.h h8s2320.c h8s2320.h h8s2357.c h8s2357.h h8s2655.c h8s2655.h
[src/emu/cpu/i386]i386.c
[src/emu/cpu/i86]i186.c
[src/emu/cpu/mn10200]mn10200.c mn10200.h
[src/emu/cpu/pdp1]pdp1.c pdp1.h tx0.c tx0.h
[src/emu/cpu/powerpc]ppccom.c
[src/emu/cpu/rsp]rsp.h rspdrc.c
[src/emu/cpu/sc61860]sc61860.c
[src/emu/cpu/scmp]scmp.c
[src/emu/cpu/se3208]se3208.c se3208.h
[src/emu/cpu/sh2]sh2comn.c
[src/emu/cpu/sharc]sharc.c sharc.h
[src/emu/cpu/ssp1601]ssp1601.c
[src/emu/cpu/superfx]superfx.c
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms32010]tms32010.c
[src/emu/cpu/tms32025]tms32025.c tms32025.h
[src/emu/cpu/tms32051]tms32051.c tms32051.h
[src/emu/cpu/tms34010]34010gfx.c tms34010.c tms34010.h
[src/emu/cpu/tms7000]tms7000.c
[src/emu/cpu/unsp]unsp.c
[src/emu/cpu/upd7810]upd7810.c upd7810.h
[src/emu/cpu/v60]v60.c v60.h
[src/emu/cpu/v810]v810.c
[src/emu/cpu/z180]z180.c z180tbl.h
[src/emu/cpu/z80]tlcs_z80.c z80.c
[src/emu/cpu/z8000]z8000.c z8000.h z8000ops.inc
[src/emu/drivers]xtal.h
[src/emu/imagedev]flopdrv.c harddriv.h
[src/emu/machine]64h156.c 6522via.c 6526cia.h 6850acia.c 68561mpcc.c 74145.h 8042kbdc.h 8530scc.c bcreader.c bcreader.h com8116.h ds75161a.h generic.c hd63450.c hd63450.h hd64610.h i8251.c i8271.c i8271.h i8355.h im6402.h ins8154.h k053252.h kb3600.c kb3600.h kr2376.c kr2376.h laserdsc.c latch8.c latch8.h lh5810.h mb87078.c mb87078.h mc2661.h mc68328.h mc6843.c mc6843.h mc6846.h mc68681.c mc68681.h mc68901.c mc68901.h mm58167.c mm58167.h mm74c922.h mos6530.h mos6551.c msm6242.h ncr5380.h netlist.c netlist.h nsc810.c pc_lpt.c pci.c pckeybrd.c pckeybrd.h rp5c01.h rp5c15.h rtc4543.c rtc65271.h s3c2400.c s3c2400.h s3c2410.c s3c2410.h s3c2440.c s3c2440.h s3c24xx.inc saturn.c seibu_cop.h smc91c9x.h smc92x4.c smc92x4.h tc009xlvc.h terminal.c tmp68301.h tms5501.c upd1990a.c upd1990a.h upd7002.c upd7002.h upd765.c wd17xx.c wd17xx.h wd33c93.h z80dma.c z8536.h
[src/emu/netlist]nl_base.c nl_base.h nl_dice_compat.h nl_lists.h nl_parser.c nl_parser.h nl_setup.c nl_setup.h pstate.c pstate.h pstring.h
[src/emu/netlist/analog]nld_bjt.c nld_bjt.h nld_fourterm.c nld_fourterm.h nld_solver.c nld_solver.h nld_switches.c nld_switches.h nld_twoterm.c nld_twoterm.h
[src/emu/netlist/devices]net_lib.c nld_4066.c nld_4066.h nld_7400.c nld_7400.h nld_7402.c nld_7402.h nld_7404.c nld_7404.h nld_7410.c nld_7410.h nld_74107.c nld_74107.h nld_74153.c nld_74153.h nld_7420.c nld_7420.h nld_7425.c nld_7425.h nld_7427.c nld_7427.h nld_7430.c nld_7430.h nld_7448.c nld_7448.h nld_7450.c nld_7450.h nld_7474.c nld_7474.h nld_7483.c nld_7483.h nld_7486.c nld_7486.h nld_7490.c nld_7490.h nld_7493.c nld_7493.h nld_74ls629.c nld_74ls629.h nld_9316.c nld_9316.h nld_legacy.c nld_ne555.c nld_ne555.h nld_signal.h nld_system.c nld_system.h
[src/emu/sound]aica.c aica.h ay8910.c cdp1869.c cdp1869.h dmadac.c dmadac.h es5503.c es5503.h ics2115.c k007232.h mos6560.h msm5205.h msm5232.c msm5232.h qs1000.c qs1000.h qsound.c scsp.c scsp.h sp0256.h spu.c tc8830f.c upd7759.c upd7759.h votrax.h ymf278b.c ymz280b.c zsg2.c zsg2.h
[src/emu/ui]barcode.c barcode.h devctrl.h filemngr.c filesel.c filesel.h imgcntrl.c imginfo.c mainmenu.c menu.c menu.h selgame.c selgame.h swlist.c swlist.h ui.c ui.h viewgfx.c
[src/emu/video]315_5124.h 315_5313.c 315_5313.h crt9007.h crt9021.h crt9212.h dl1416.h ef9345.h epic12.c epic12.h epic12_blit2.c epic12_blit3.c epic12_blit4.c epic12_blit6.c epic12_blit7.c epic12_blit8.c epic12in.inc epic12pixel.inc fixfreq.c hd44352.h hd44780.h hd61830.h huc6260.h huc6270.h mb_vcu.h mc6845.c mc6847.c mc6847.h pc_vga.c ramdac.h tms34061.c tms34061.h upd3301.c upd7220.h v9938.h vic4567.h
[src/lib/formats]cassimg.c ccvf_dsk.c d64_dsk.c fmtowns_dsk.c g64_dsk.c mbee_cas.h phc25_cas.c phc25_cas.h sol_cas.c sol_cas.h sorc_cas.h spc1000_cas.h z80ne_dsk.c
[src/lib/libflac/include/FLAC]export.h format.h metadata.h stream_decoder.h stream_encoder.h
[src/lib/libflac/include/private]fixed.h float.h lpc.h window.h
[src/lib/libflac/libFLAC]bitreader.c float.c lpc.c md5.c metadata_iterators.c metadata_object.c stream_decoder.c stream_encoder.c
[src/lib/util]chd.h corealloc.c cstrpool.c cstrpool.h options.h palette.c palette.h tagmap.c tagmap.h
[src/mame]mame.lst
[src/mame/audio]cclimber.c cclimber.h cps3.c namco52.c namco52.h namco54.c namco54.h taito_en.h taito_zm.c taito_zm.h
[src/mame/drivers]1942.c 1945kiii.c 20pacgal.c 3x3puzzl.c 4enlinea.c 5clown.c 88games.c a1supply.c acefruit.c aerofgt.c albazc.c aleisttl.c amusco.c arcadia.c aristmk4.c asteroid.c astinvad.c astrof.c asuka.c atarigx2.c atarittl.c atetris.c backfire.c bailey.c battlnts.c beathead.c big10.c blackt96.c bladestl.c blmbycar.c blockhl.c bloodbro.c blstroid.c bmcbowl.c bmcpokr.c bnstars.c boogwing.c bowltry.c boxer.c btime.c bzone.c cabal.c calomega.c carrera.c cavepc.c cball.c cbuster.c cd32.c centiped.c chanbara.c chicago.c chqflag.c cliffhgr.c cmmb.c cninja.c cntsteer.c cobra.c coinmstr.c coolridr.c cps1.c cps3.c crystal.c cswat.c cubeqst.c cv1k.c d9final.c dacholer.c dai3wksi.c dassault.c dblcrown.c dblewing.c ddealer.c ddenlovr.c ddragon3.c dec0.c deco32.c deco_ld.c deshoros.c destroyr.c dfruit.c discoboy.c dkong.c docastle.c dominob.c dooyong.c dorachan.c dotrikun.c dreamwld.c dunhuang.c dwarfd.c ecoinf2.c electra.c enigma2.c exedexes.c exerion.c exidyttl.c exprraid.c f1gp.c fantland.c fcrash.c feversoc.c firefox.c firetrk.c flipjack.c flkatck.c flyball.c fungames.c funkyjet.c funworld.c gaelco3d.c gaiden.c galaga.c galaxi.c galaxian.c galaxold.c galivan.c galpani2.c gaplus.c gatron.c gbusters.c gei.c ggconnie.c ghosteo.c gladiatr.c go2000.c goldnpkr.c goldstar.c gstream.c gsword.c gticlub.c gunpey.c gunsmoke.c halleys.c highvdeo.c hng64.c hornet.c hshavoc.c hvyunit.c hyperspt.c igs017.c igs_m027.c igspoker.c ikki.c intrscti.c itgambl3.c itgamble.c jackie.c jclub2.c kaneko16.c kingobox.c koftball.c konamigx.c konendev.c kopunch.c lastbank.c lethal.c littlerb.c ltcasino.c m14.c m62.c m63.c mappy.c mazerbla.c mcr3.c mcr68.c meadwttl.c megaphx.c megaplay.c megatech.c metalmx.c metro.c mgolf.c mhavoc.c micro3d.c mil4000.c mirage.c mitchell.c mlanding.c model1.c model2.c model3.c monacogp.c mpoker.c mpu4.c mpu4hw.c mpu4misc.c mugsmash.c multfish.c multfish_boot.c multfish_ref.c murogmbl.c mystwarr.c namcos12.c namcos22.c naomi.c nbmj8891.c nbmj8900.c neogeo.c neptunp2.c nightgal.c ninjaw.c nmg5.c nss.c nwk-tr.c nycaptor.c nyny.c offtwall.c ohmygod.c olibochu.c onetwo.c othello.c overdriv.c pacman.c panicr.c pcxt.c pengadvb.c peplus.c pgm.c pgm2.c photon.c pinkiri8.c pkscram.c pktgaldx.c polepos.c pong.c popeye.c popobear.c puckpkmn.c pzletime.c qdrmfgp.c quantum.c r2dx_v33.c raiden2.c ramtek.c rcorsair.c realbrk.c rltennis.c rockrage.c rohga.c rollerg.c rungun.c s7.c safarir.c scobra.c scramble.c seabattl.c segac2.c segaorun.c segas16a.c segas18.c segaybd.c seicross.c seta.c seta2.c sf.c sidearms.c sigmab98.c simpl156.c skylncr.c slapfght.c slapshot.c smsmcorp.c spy.c statriv2.c stuntair.c subs.c subsino.c subsino2.c supbtime.c supercrd.c superwng.c system16.c taito_b.c taito_f2.c taitoair.c taitogn.c taitojc.c taitottl.c taotaido.c tceptor.c tecmo16.c thunderx.c toaplan1.c toaplan2.c tourtabl.c toypop.c triforce.c truco.c tugboat.c tumbleb.c tumblep.c turrett.c uapce.c ultraman.c vamphalf.c vaportra.c vball.c vega.c vendetta.c vlc.c volfied.c vp101.c wardner.c warpwarp.c wecleman.c welltris.c witch.c wiz.c wolfpack.c xmen.c xybots.c xyonix.c zaxxon.c zr107.c
[src/mame/etc]template_driver.c
[src/mame/includes]1943.h airbustr.h amiga.h atari.h atarisy1.h aztarac.h balsente.h battlane.h battlera.h bfm_sc45.h bigevglf.h bladestl.h btime.h bublbobl.h bwing.h calomega.h carpolo.h cave.h ccastles.h cchasm.h centiped.h cidelsa.h citycon.h cninja.h combatsc.h contra.h cop01.h copsnrob.h cps1.h crbaloon.h crimfght.h crshrace.h cvs.h darius.h dbz.h dcheese.h deadang.h dec8.h deco32.h djboy.h dkong.h docastle.h equites.h espial.h esripsys.h exerion.h exidy.h exidy440.h exprraid.h f1gp.h fastfred.h fcombat.h fgoal.h firetrap.h firetrk.h fuukifg2.h fuukifg3.h gaelco3d.h galaga.h galpanic.h gaplus.h gcpinbal.h gladiatr.h gottlieb.h gradius3.h grchamp.h gridlee.h gsword.h gyruss.h harddriv.h homedata.h homerun.h hyprduel.h ikki.h irobot.h ironhors.h itech32.h jackal.h kaneko16.h karnov.h konamigx.h labyrunr.h ladybug.h laserbat.h lasso.h lastduel.h lazercmd.h liberate.h lkage.h lockon.h lsasquad.h m10.h m107.h m52.h m72.h m92.h macrossp.h matmania.h mcatadv.h mcr68.h meadows.h metlclsh.h micro3d.h model3.h mouser.h mrflea.h ms32.h mugsmash.h multfish.h munchmo.h n8080.h namcona1.h namcos1.h namcos2.h naughtyb.h nemesis.h ninjaw.h nitedrvr.h nycaptor.h ojankohs.h orbit.h othunder.h pandoras.h paradise.h pcktgal.h pktgaldx.h playch10.h pooyan.h popeye.h portrait.h powerins.h psikyo4.h pushman.h rainbow.h rockrage.h rohga.h rungun.h sbasketb.h scramble.h segas16b.h segas18.h seicross.h seta.h skyfox.h slapfght.h slapshot.h snes.h snowbros.h spacefb.h sprcros2.h ssv.h stadhero.h stv.h system16.h tail2nos.h taito_f2.h taito_h.h taito_o.h taitojc.h taitosj.h tceptor.h thedeep.h thunderx.h timeplt.h toki.h topspeed.h tp84.h tubep.h tumbleb.h tunhunt.h turbo.h twin16.h undrfire.h vaportra.h volfied.h warriorb.h wecleman.h wgp.h wiz.h zac2650.h zodiack.h
[src/mame/layout]cherryb3.lay dblcrown.lay gamball.lay goldstar.lay
[src/mame/machine]asteroid.c atari.c atarigen.h cdi070.h gaelco3d.h igs036crypt.c igs036crypt.h inder_sb.c inder_sb.h inder_vid.c inder_vid.h megadriv.c namco06.c namco06.h namco50.c namco50.h namco51.h namco53.c namco53.h namco62.h namcoio.h namcos1.c naomim4.c pcecommn.c pcecommn.h slapfght.c tait8741.c tait8741.h taitoio.h
[src/mame/video]alpha68k.c amspdwy.c angelkds.c appoooh.c argus.c atarimo.c avgdvg.c avgdvg.h baraduke.c battlane.c battlex.c bfm_adr2.c bfm_adr2.h bfm_dm01.c bfm_dm01.h bogeyman.c bwing.c c45.c c45.h canyon.c carpolo.c cclimber.c chaknpop.c champbas.c cheekyms.c combatsc.c cps1.c crimfght.c darkmist.c ddribble.c dec8.c decbac06.h deckarn.h decmxc06.c decmxc06.h deco16ic.h decocomn.h decospr.h djmain.c drgnmst.c exerion.c fcombat.c firetrk.c fitfight.c gaelco2.c galaxian.c goindol.c gottlieb.c gotya.c gp9001.h grchamp.c gticlub.c gyruss.c hyperspt.c jalblend.c k001005.h k001604.h k007121.h k007342.c k007342.h k007420.c k007420.h k051316.h k053244_k053245.h k053246_k053247_k055673.h k053250.h k054338.c kaneko16.c kaneko_spr.c kaneko_spr.h kopunch.c ladyfrog.c lastduel.c m10.c m52.c mermaid.c mikie.c mrflea.c ms32.c mugsmash.c munchmo.c mystston.c namcona1.c namcos22.c ninjakd2.c nova2001.c oneshot.c pooyan.c popeye.c ppu2c0x.c ppu2c0x.h psikyo4.c raiden.c sbasketb.c segaic16.h segaic24.h seibu_crtc.h shangkid.c sidearms.c slapfght.c solomon.c sonson.c ssozumo.c sspeedr.c stadhero.c starcrus.c stlforce.c strnskil.c tagteam.c taito_h.c taito_o.c taitoair.c taitosj.c tc0080vco.h tc0110pcr.c tc0110pcr.h tc0480scp.h tceptor.c tecmo_spr.c thepit.c tia.h tigeroad.c trackfld.c tunhunt.c twincobr.c wecleman.c wiz.c wolfpack.c ygv608.c ygv608.h yiear.c zaxxon.c
[src/mess]mess.lst mess.mak
[src/mess/audio]upd1771.h
[src/mess/drivers]a2600.c a7000.c a7800.c abc1600.c ace.c adam.c alphasma.c alphatro.c amiga.c amstr_pc.c amstrad.c amust.c apc.c apf.c apollo.c apple2.c apple2gs.c apple3.c applix.c apricot.c apricotf.c apricotp.c argo.c asst128.c at.c atari400.c atarist.c atm.c avigo.c bcs3.c beehive.c bigbord2.c binbug.c bmjr.c bml3.c c128.c casloopy.c cat.c coco12.c compis.c compucolor.c d6800.c dct11em.c dm7000.c dms5000.c esq1.c esq5505.c esqasr.c esqkt.c esqmr.c europc.c fanucs15.c fanucspmg.c fk1.c fmtowns.c fp6000.c gb.c geniusiq.c grfd2301.c hec2hrp.c homelab.c homez80.c hp48.c hp9k.c hprot1.c hunter2.c hx20.c ibm6580.c ibmpcjr.c ie15.c indiana.c intv.c ip20.c ip22.c iq151.c irisha.c itt3030.c jonos.c jupiter.c k8915.c kaypro.c konin.c kyocera.c lcmate2.c llc.c lola8a.c m20.c mac.c mbc200.c mbee.c mc80.c megadriv.c mes.c micronic.c mirage.c mk85.c mk90.c modellot.c molecular.c msx.c multi16.c multi8.c mx2178.c myb3k.c mycom.c mz2500.c mz3500.c mz700.c mz80.c nakajies.c nanos.c nc.c ng_aes.c ngp.c octopus.c odyssey2.c p2000t.c palm.c paso1600.c pasopia7.c pb1000.c pc.c pc100.c pc1500.c pc4.c pc6001.c pc8001.c pc8801.c pc9801.c pcm.c pcw16.c pda600.c pentagon.c phc25.c phunsy.c pipbug.c plan80.c plus4.c pocketc.c portfoli.c pp01.c psion.c psx.c pt68k4.c ptcsol.c pv1000.c pve500.c px4.c ql.c qx10.c rainbow.c rd110.c replicator.c rex6000.c rm380z.c rmt32.c rsc55.c rx78.c sapi1.c saturn.c sbrain.c sgi_ip2.c sitcom.c sm1800.c smc777.c socrates.c softbox.c sorcerer.c special.c spectrum.c ssem.c stratos.c super80.c supracan.c sv8000.c svmu.c swtpc09.c sym1.c tandy1t.c tandy2k.c tavernie.c thomson.c ti85.c ti89.c tim011.c tim100.c tk80bs.c trs80.c uknc.c unior.c unistar.c univac.c ut88.c v6809.c vboy.c vector06.c victor9k.c vip.c vt100.c vt220.c vt320.c vt520.c vta2000.c vtech1.c wangpc.c wswan.c x07.c x68k.c xerox820.c ymmu100.c z100.c z1013.c z80ne.c z9001.c zorba.c zrt80.c
[src/mess/includes]a7800.h advision.h amstrad.h apollo.h apple2gs.h apple3.h apricotf.h aquarius.h atarist.h avigo.h b2m.h bbc.h dm7000.h einstein.h fm7.h genpc.h intv.h kaypro.h lisa.h mc1502.h mikromik.h nascom1.h p2000t.h partner.h pcw.h pocketc.h ql.h rmnimbus.h softbox.h special.h studio2.h super80.h svi318.h swtpc09.h thomson.h tiki100.h tvc.h vc4000.h vector06.h x68k.h z88.h zx.h
[src/mess/layout]pve500.lay rainbow.lay
[src/mess/machine]6883sam.h a7800.c amstrad.c apollo.c apollo_kbd.c apple2.c apple2gs.c apple3.c apricotkb.c apricotkb.h atarifdc.c atarifdc.h bbc.c beta.h dec_lk201.c dgn_beta.c hp48.c mac.c mackbd.h mega32x.c mega32x.h megacd.h micropolis.h nes.c oric.c partner.c pecom.c sgi.c sgi.h smartmed.c sms.c svi318.c swtpc09.c thomson.c x68k_kbd.c zx8302.h
[src/mess/machine/ti99]990_hd.h grom.c grom.h gromport.c speech8.h
[src/mess/video]a7800.c abc80.c abc800.c apollo.c apple3.c gb_lcd.c gime.h intv.c mikromik.c nascom1.c osi.c pc1251.c pc1350.c pc1401.c tmc600.c v1050.c vtvideo.c vtvideo.h zx8301.h
[src/osd]osdcomm.h osdcore.h
[src/osd/sdl]blit13.h drawogl.c gl_shader_mgr.c window.c
[src/tools]nltool.c srcclean.c unidasm.c

trunk/hash/psx.xml
r29404r29405
22<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
33<softwarelist name="psx" description="Sony Playstation CD-ROMs">
44
5  <!-- todo, reconvert original dumps using current CHDMAN verison - Feb 2014 -->
6 
5   <!-- todo, reconvert original dumps using current CHDMAN verison - Feb 2014 -->
6
77<!--
88***********************
99NON-REDUMP Rips
r29404r29405
4949
5050<!-- Prototype disks -->
5151
52 
52
5353   <software name="bublbob2" >
5454      <!-- Original images
55      bb2.bin 62,620,864  1c2c9f63
56      bb2.cue         69  096e5077
55      bb2.bin 62,620,864  1c2c9f63
56      bb2.cue         69  096e5077
5757      -->
5858      <description>Bubble Bobble II (prototype)</description>
5959      <year>1995</year>
r29404r29405
6565      </part>
6666   </software>
6767
68 
69   
68
69
7070   <software name="baldgate" supported="no">
7171      <!-- Original images (from drx)
7272      <rom name="baldur's gate - disc 1.bin" size="657475728" crc="96e9befa"/>
trunk/hash/msx1_flop.xml
r29404r29405
66   Things listed here should have a requirement of BASIC 1.0 + Disk Basic 1.0 (ie a Standard MSX1 type system with FDD)
77   I've noticed some 'MSX1' floppy images in TOSEC seem to require a higher BASIC version?
88   Some also require more RAM? the driver currently isn't very flexible.
9   
9
1010   This for now is just a skeleton list for quick testing.
11   
11
1212   To use the floppy drive the disk basic ROM must be mounted, example use case.
1313   msx -cart1 diskbas -flop1 ohshit
14   
14
1515-->
1616
1717   <software name="jsw2">
r29404r29405
2525      </part>
2626   </software>
2727
28  <software name="ohmummy">
29    <description>Oh Mummy!!</description>
30    <year>1984</year>
31    <publisher>Longman Software</publisher>
32    <part name="flop1" interface="floppy_5_25">
33      <dataarea name="flop" size="737280">
34        <rom name="oh mummy!! (1984)(longman software)(gb).dsk" size="737280" crc="9cf775cc" sha1="cd7db0faf25ae33699b1708a19a874e3662e158a" offset="0" />
35      </dataarea>
36    </part>
37  </software>
28   <software name="ohmummy">
29   <description>Oh Mummy!!</description>
30   <year>1984</year>
31   <publisher>Longman Software</publisher>
32   <part name="flop1" interface="floppy_5_25">
33      <dataarea name="flop" size="737280">
34      <rom name="oh mummy!! (1984)(longman software)(gb).dsk" size="737280" crc="9cf775cc" sha1="cd7db0faf25ae33699b1708a19a874e3662e158a" offset="0" />
35      </dataarea>
36   </part>
37   </software>
3838
39  <software name="ohshit">
40    <description>Oh Shit!</description>
41    <year>1986</year>
42    <publisher>Aackosoft</publisher>
43    <part name="flop1" interface="floppy_5_25">
44      <dataarea name="flop" size="737280">
45        <rom name="oh shit! (1986)(aackosoft)(nl).dsk" size="737280" crc="735ebc21" sha1="7de3f69a8a5136e0dd25214d36b1194a6506b377" offset="0" />
46      </dataarea>
47    </part>
48  </software>
39   <software name="ohshit">
40   <description>Oh Shit!</description>
41   <year>1986</year>
42   <publisher>Aackosoft</publisher>
43   <part name="flop1" interface="floppy_5_25">
44      <dataarea name="flop" size="737280">
45      <rom name="oh shit! (1986)(aackosoft)(nl).dsk" size="737280" crc="735ebc21" sha1="7de3f69a8a5136e0dd25214d36b1194a6506b377" offset="0" />
46      </dataarea>
47   </part>
48   </software>
4949
50  <software name="ohno" cloneof="ohshit">
51    <description>Oh No!</description>
52    <year>1986</year>
53    <publisher>Eaglesoft</publisher>
54    <part name="flop1" interface="floppy_5_25">
55      <dataarea name="flop" size="737280">
56        <rom name="oh no! (1986)(eaglesoft)(nl)[aka oh shit!].dsk" size="737280" crc="aee65f34" sha1="5c2cd6dd8192a8c29fc0e272181272cb26cc2af6" offset="0" />
57      </dataarea>
58    </part>
59  </software>
50   <software name="ohno" cloneof="ohshit">
51   <description>Oh No!</description>
52   <year>1986</year>
53   <publisher>Eaglesoft</publisher>
54   <part name="flop1" interface="floppy_5_25">
55      <dataarea name="flop" size="737280">
56      <rom name="oh no! (1986)(eaglesoft)(nl)[aka oh shit!].dsk" size="737280" crc="aee65f34" sha1="5c2cd6dd8192a8c29fc0e272181272cb26cc2af6" offset="0" />
57      </dataarea>
58   </part>
59   </software>
6060
6161
6262</softwarelist>
trunk/hash/pico.xml
r29404r29405
23542354         </dataarea>
23552355      </part>
23562356   </software>
2357   
2357
23582358   <software name="okaissod">
23592359      <description>NHK Okaasan to Issho Do Re Mi Fa Do~nuts! Oekaki Daisuki! Omoshiro Oekaki Daishuugou! (Jpn)</description>
23602360      <year>1998</year>
trunk/hash/a7800.xml
r29404r29405
22642264      </part>
22652265   </software>
22662266
2267    <!-- XM board enhanced -->
2267   <!-- XM board enhanced -->
22682268
2269  <!-- these should require an XM board? but the emulation seems to be built into the base driver?-->
2270  <!-- these have had the header stripped vs the .a78 files offered
2271       there was also a 'binary' with size 0x24000, CRC fd503bd4 -->
2272  <software name="dkongxm">
2273    <description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo)</description>
2274    <year>2012</year>
2275    <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2276    <sharedfeat name="compatibility" value="PAL"/>
2277    <part name="cart" interface="a7800_cart">
2278      <feature name="pcb_type" value="TYPE-XM" />
2279      <dataarea name="rom" size="0x24000">
2280        <rom name="dkxm_final_demo_pal_hsc.a78" size="0x24000" crc="6510b674" sha1="65b723b470d287af51e9888813149c43fb11ac26" offset="0" />
2281      </dataarea>
2282    </part>
2283  </software>
2269   <!-- these should require an XM board? but the emulation seems to be built into the base driver?-->
2270   <!-- these have had the header stripped vs the .a78 files offered
2271      there was also a 'binary' with size 0x24000, CRC fd503bd4 -->
2272   <software name="dkongxm">
2273   <description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo)</description>
2274   <year>2012</year>
2275   <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2276   <sharedfeat name="compatibility" value="PAL"/>
2277   <part name="cart" interface="a7800_cart">
2278      <feature name="pcb_type" value="TYPE-XM" />
2279      <dataarea name="rom" size="0x24000">
2280      <rom name="dkxm_final_demo_pal_hsc.a78" size="0x24000" crc="6510b674" sha1="65b723b470d287af51e9888813149c43fb11ac26" offset="0" />
2281      </dataarea>
2282   </part>
2283   </software>
22842284
2285  <software name="dkongxmu" cloneof="dkongxm" >
2286    <description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo) (NTSC)</description>
2287    <year>2012</year>
2288    <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2289    <sharedfeat name="compatibility" value="NTSC"/>
2290    <part name="cart" interface="a7800_cart">
2291      <feature name="pcb_type" value="TYPE-XM" />
2292      <dataarea name="rom" size="0x24000">
2293        <rom name="dkxm_final_demo_ntsc_hsc.a78" size="0x24000" crc="2c67fea7" sha1="7825c1946e3c7492fa9bbfae33029cd68c0d1135" offset="0" />
2294      </dataarea>
2295    </part>
2296  </software>
2285   <software name="dkongxmu" cloneof="dkongxm" >
2286   <description>Donkey Kong (homebrew, XM enhanced, HSC support) (Demo) (NTSC)</description>
2287   <year>2012</year>
2288   <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2289   <sharedfeat name="compatibility" value="NTSC"/>
2290   <part name="cart" interface="a7800_cart">
2291      <feature name="pcb_type" value="TYPE-XM" />
2292      <dataarea name="rom" size="0x24000">
2293      <rom name="dkxm_final_demo_ntsc_hsc.a78" size="0x24000" crc="2c67fea7" sha1="7825c1946e3c7492fa9bbfae33029cd68c0d1135" offset="0" />
2294      </dataarea>
2295   </part>
2296   </software>
22972297
2298  <software name="dkongxmn" cloneof="dkongxm">
2299    <description>Donkey Kong (homebrew, XM enhanced) (Demo)</description>
2300    <year>2012</year>
2301    <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2302    <sharedfeat name="compatibility" value="PAL"/>
2303    <part name="cart" interface="a7800_cart">
2304      <feature name="pcb_type" value="TYPE-XM" />
2305      <dataarea name="rom" size="0x24000">
2306        <rom name="dkxm_final_demo_pal.a78" size="0x24000" crc="d362712e" sha1="118c462d6698bd23c378785f80062fdd7d65ca00" offset="0" />
2307      </dataarea>
2308    </part>
2309  </software>
2298   <software name="dkongxmn" cloneof="dkongxm">
2299   <description>Donkey Kong (homebrew, XM enhanced) (Demo)</description>
2300   <year>2012</year>
2301   <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2302   <sharedfeat name="compatibility" value="PAL"/>
2303   <part name="cart" interface="a7800_cart">
2304      <feature name="pcb_type" value="TYPE-XM" />
2305      <dataarea name="rom" size="0x24000">
2306      <rom name="dkxm_final_demo_pal.a78" size="0x24000" crc="d362712e" sha1="118c462d6698bd23c378785f80062fdd7d65ca00" offset="0" />
2307      </dataarea>
2308   </part>
2309   </software>
23102310
2311  <software name="dkongxmnu" cloneof="dkongxm" >
2312    <description>Donkey Kong (homebrew, XM enhanced) (Demo) (NTSC)</description>
2313    <year>2012</year>
2314    <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2315    <sharedfeat name="compatibility" value="NTSC"/>
2316    <part name="cart" interface="a7800_cart">
2317      <feature name="pcb_type" value="TYPE-XM" />
2318      <dataarea name="rom" size="0x24000">
2319        <rom name="dkxm_final_demo_ntsc.a78" size="0x24000" crc="6e170055" sha1="f4da231312da06ff9e8af5681b5013b14886b455" offset="0" />
2320      </dataarea>
2321    </part>
2322  </software>
2311   <software name="dkongxmnu" cloneof="dkongxm" >
2312   <description>Donkey Kong (homebrew, XM enhanced) (Demo) (NTSC)</description>
2313   <year>2012</year>
2314   <publisher>&lt;homebrew&gt;</publisher> <!-- TEP392  -->
2315   <sharedfeat name="compatibility" value="NTSC"/>
2316   <part name="cart" interface="a7800_cart">
2317      <feature name="pcb_type" value="TYPE-XM" />
2318      <dataarea name="rom" size="0x24000">
2319      <rom name="dkxm_final_demo_ntsc.a78" size="0x24000" crc="6e170055" sha1="f4da231312da06ff9e8af5681b5013b14886b455" offset="0" />
2320      </dataarea>
2321   </part>
2322   </software>
23232323</softwarelist>
trunk/hash/msx1_cart.xml
r29404r29405
1684516845
1684616846
1684716847
16848  <!-- Devices -->
16848   <!-- Devices -->
1684916849
16850  <!-- mounting this should add the floppy drive, rather than it always being there? -->
16851  <software name="diskbas">
16852    <description>Disk BASIC v1.0 for FS-FD1 (Japan)</description>
16853    <year>1987</year>
16854    <publisher>Matsushita</publisher>
16855    <part name="cart" interface="msx_cart">
16856      <feature name="mapper" value="DISK_ROM" />
16857      <dataarea name="rom" size="0x4000">
16858        <rom name="disk basic v1.0 for fs-fd1 (1987)(matsushita electric industrial)(jp).rom" size="0x4000" crc="4c9b8214" sha1="8e3f6f08309f082a82be8298a66c9b90f2d34ad4" offset="0" />
16859      </dataarea>
16860    </part>
16861  </software>
16850   <!-- mounting this should add the floppy drive, rather than it always being there? -->
16851   <software name="diskbas">
16852   <description>Disk BASIC v1.0 for FS-FD1 (Japan)</description>
16853   <year>1987</year>
16854   <publisher>Matsushita</publisher>
16855   <part name="cart" interface="msx_cart">
16856      <feature name="mapper" value="DISK_ROM" />
16857      <dataarea name="rom" size="0x4000">
16858      <rom name="disk basic v1.0 for fs-fd1 (1987)(matsushita electric industrial)(jp).rom" size="0x4000" crc="4c9b8214" sha1="8e3f6f08309f082a82be8298a66c9b90f2d34ad4" offset="0" />
16859      </dataarea>
16860   </part>
16861   </software>
1686216862
16863  <!-- SORT -->
16863   <!-- SORT -->
1686416864
1686516865
1686616866
trunk/hash/coco_flop.xml
r29404r29405
33
44<softwarelist name="coco_flop" description="Tandy Radio Shack Color Computer disk images">
55
6    <!-- coco3 only requires 512Kb, audio is a farty, run best with a a 6309? - coco3h driver) -->
7    <!-- RUN"DONKEY" -->
8    <software name="dkong" supported ="partial">
6   <!-- coco3 only requires 512Kb, audio is a farty, run best with a a 6309? - coco3h driver) -->
7   <!-- RUN"DONKEY" -->
8   <software name="dkong" supported ="partial">
99      <description>Donkey Kong (Sock Master's Donkey Kong Emulator for CoCo 3) (512Kb)</description>
1010      <year>2007</year>
1111      <publisher>Sock Master</publisher>
trunk/src/build/flags_gcc.mak
r29404r29405
88ifeq ($(findstring 4.8.,$(TEST_GCC)),4.8.)
99   CCOMFLAGS += -Wno-narrowing -Wno-attributes -Wno-unused-local-typedefs
1010   # array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds)
11   CCOMFLAGS += -Wno-unused-variable -Wno-array-bounds -Wno-strict-overflow   
11   CCOMFLAGS += -Wno-unused-variable -Wno-array-bounds -Wno-strict-overflow
1212endif
1313
1414ifeq ($(findstring arm,$(UNAME)),arm)
trunk/src/build/png2bdc.c
r29404r29405
7474   INT32               width;              // width from this character to the next
7575   INT32               xoffs, yoffs;       // X and Y offset from baseline to top,left of bitmap
7676   INT32               bmwidth, bmheight;  // width and height of bitmap
77   bitmap_argb32 *       bitmap;             // pointer to the bitmap containing the raw data
77   bitmap_argb32 *     bitmap;             // pointer to the bitmap containing the raw data
7878};
7979
8080
r29404r29405
107107
108108//-------------------------------------------------
109109//  write_data - write data to the given file and
110//   throw an exception if an error occurs
110//  throw an exception if an error occurs
111111//-------------------------------------------------
112112
113113static void write_data(core_file &file, UINT8 *base, UINT8 *end)
r29404r29405
123123
124124//-------------------------------------------------
125125//  render_font_save_cached - write the cached
126//   data out to the file
126//  data out to the file
127127//-------------------------------------------------
128128
129129static bool render_font_save_cached(render_font &font, const char *filename, UINT32 hash)
r29404r29405
248248
249249//-------------------------------------------------
250250//  bitmap_to_chars - convert a bitmap to
251//   characters in the given font
251//  characters in the given font
252252//-------------------------------------------------
253253
254254static bool bitmap_to_chars(bitmap_argb32 &bitmap, render_font &font)
trunk/src/mame/etc/template_driver.c
r29404r29405
146146
147147   /* video hardware */
148148   MCFG_SCREEN_ADD("screen", RASTER)
149//   MCFG_SCREEN_REFRESH_RATE(60)
150//   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
149//  MCFG_SCREEN_REFRESH_RATE(60)
150//  MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
151151   MCFG_SCREEN_UPDATE_DRIVER(xxx_state, screen_update)
152//   MCFG_SCREEN_SIZE(32*8, 32*8)
153//   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
152//  MCFG_SCREEN_SIZE(32*8, 32*8)
153//  MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
154154   MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 442, 0, 320, 264, 0, 240) /* generic video timing, change accordingly */
155155   MCFG_SCREEN_PALETTE("palette")
156156
trunk/src/mame/layout/gamball.lay
r29404r29405
1010      <bounds x="0" y="0" width="1" height="1" />
1111         <color red="0" green="0" blue="0" />
1212      </rect>
13   </element>     
13   </element>
1414   <element name="reellamp">
1515      <rect state ="0">
1616         <bounds x="0" y="0" width="7" height="3" />
r29404r29405
309309      <backdrop name="sreel1" element="SteppersReel1" state="0">
310310         <bounds x="85" y="463" width="49" height="87.9999"/>
311311      </backdrop>
312     
312
313313      <backdrop name="blk" element="bezelblock" state="0">
314314         <bounds x="85" y="463" width="49" height="29.3333"/>
315315      </backdrop>
trunk/src/mame/layout/cherryb3.lay
r29404r29405
11<?xml version="1.0"?>
22<mamelayout version="2">
33<!--
4     Cherry Bonus III control panel
5     Written by Roberto Fresca.
4      Cherry Bonus III control panel
5      Written by Roberto Fresca.
66-->
77
88<!-- define button-lamps -->
trunk/src/mame/layout/dblcrown.lay
r29404r29405
11<?xml version="1.0"?>
22<mamelayout version="2">
33<!--
4     Double Crown control panel
5     Written by Roberto Fresca.
4      Double Crown control panel
5      Written by Roberto Fresca.
66-->
77
88<!-- define button-lamps -->
trunk/src/mame/layout/goldstar.lay
r29404r29405
11<?xml version="1.0"?>
22<mamelayout version="2">
33<!--
4     Golden Star control panel.
5     Written by Roberto Fresca.
4      Golden Star control panel.
5      Written by Roberto Fresca.
66-->
77
88<!-- define button-lamps -->
trunk/src/mame/drivers/mhavoc.c
r29404r29405
516516   MCFG_SCREEN_SIZE(400, 300)
517517   MCFG_SCREEN_VISIBLE_AREA(0, 300, 0, 260)
518518   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
519   
519
520520   MCFG_DEVICE_ADD("avg", AVG_MHAVOC, 0)
521521   MCFG_AVGDVG_VECTOR("vector")
522522
trunk/src/mame/drivers/simpl156.c
r29404r29405
441441   MCFG_DECO16IC_ADD("tilegen1", simpl156_deco16ic_tilegen1_intf)
442442   MCFG_DECO16IC_GFXDECODE("gfxdecode")
443443   MCFG_DECO16IC_PALETTE("palette")
444   
444
445445   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
446446   decospr_device::set_gfx_region(*device, 2);
447447   decospr_device::set_pri_callback(*device, simpl156_pri_callback);
trunk/src/mame/drivers/cliffhgr.c
r29404r29405
120120   TIMER_CALLBACK_MEMBER(cliff_irq_callback);
121121   required_device<cpu_device> m_maincpu;
122122   required_device<discrete_device> m_discrete;
123   required_device<screen_device> m_screen;   
123   required_device<screen_device> m_screen;
124124};
125125
126126
trunk/src/mame/drivers/multfish.c
r29404r29405
33       to make it clearer why all the sets with hacked bank
44       setup existed in the wild
55
6   note:
7    this file contains the originals only
8    for bootlegs see multfish_boot.c
9    for reference information about undumped sets see multfish_Ref.c - if adding a new set ALWAYS check that, anything not listed in there is
10                                                                       almost certainly a bootleg.
6    note:
7     this file contains the originals only
8     for bootlegs see multfish_boot.c
9     for reference information about undumped sets see multfish_Ref.c - if adding a new set ALWAYS check that, anything not listed in there is
10                                                                        almost certainly a bootleg.
1111
1212*/
1313
r29404r29405
10581058   MCFG_SCREEN_VISIBLE_AREA(17*16, 1024-16*7-1, 1*16, 32*16-1*16-1)
10591059   MCFG_SCREEN_UPDATE_DRIVER(igrosoft_gamble_state, screen_update_igrosoft_gamble)
10601060   MCFG_SCREEN_PALETTE("palette")
1061   
1061
10621062   MCFG_GFXDECODE_ADD("gfxdecode", "palette", igrosoft_gamble)
10631063   MCFG_PALETTE_ADD("palette", 0x1000)
10641064
r29404r29405
28072807GAME( 2010, crzmon2,     0,               igrosoft_gamble, igrosoft_gamble, igrosoft_gamble_state,crzmon2,   ROT0, "Igrosoft", "Crazy Monkey 2 (100310)",  GAME_NOT_WORKING|GAME_SUPPORTS_SAVE ) /* World */ // xored and bitswapped palette and gfx roms
28082808GAME( 2010, crzmon2_2,   crzmon2_parent,  igrosoft_gamble, igrosoft_gamble, igrosoft_gamble_state,crzmon2lot,ROT0, "Igrosoft", "Crazy Monkey 2 (100311 Lottery)",  GAME_NOT_WORKING|GAME_SUPPORTS_SAVE ) /* Lottery */
28092809GAME( 2010, crzmon2_3,   crzmon2_parent,  igrosoft_gamble, igrosoft_gamble, igrosoft_gamble_state,crzmon2ent,ROT0, "Igrosoft", "Crazy Monkey 2 (100315 Entertainment)",  GAME_NOT_WORKING|GAME_SUPPORTS_SAVE ) /* Entertainment */
2810
2811
trunk/src/mame/drivers/battlnts.c
r29404r29405
253253   MCFG_K007342_GFXNUM(0)
254254   MCFG_K007342_CALLBACK_OWNER(battlnts_state, battlnts_tile_callback)
255255   MCFG_K007342_GFXDECODE("gfxdecode")
256   
256
257257   MCFG_K007420_ADD("k007420")
258258   MCFG_K007420_BANK_LIMIT(0x3ff)
259259   MCFG_K007420_CALLBACK_OWNER(battlnts_state, battlnts_sprite_callback)
trunk/src/mame/drivers/galpani2.c
r29404r29405
966966
967967ROM_START( galpani2e2 )
968968   ROM_REGION( 0x100000, "maincpu", 0 )            /* CPU#1 Code */
969   ROM_LOAD16_BYTE( "g000i1-u133-0.u133", 0x000000, 0x080000, CRC(7df7b759) SHA1(2479a6389649ee6042b175b71d7ed54bc116add5) )   //english version specific
970   ROM_LOAD16_BYTE( "g001i1-u134-0.u134", 0x000001, 0x080000, CRC(c92937c3) SHA1(0c9e894c0e23e319bd2d01ec573f02ed510e3ed6) )   //same as german version
969   ROM_LOAD16_BYTE( "g000i1-u133-0.u133", 0x000000, 0x080000, CRC(7df7b759) SHA1(2479a6389649ee6042b175b71d7ed54bc116add5) )   //english version specific
970   ROM_LOAD16_BYTE( "g001i1-u134-0.u134", 0x000001, 0x080000, CRC(c92937c3) SHA1(0c9e894c0e23e319bd2d01ec573f02ed510e3ed6) )   //same as german version
971971
972972   ROM_REGION( 0x40000, "sub", 0 )         /* CPU#2 Code */
973973   ROM_LOAD16_BYTE( "g002i1.125", 0x000000, 0x020000, CRC(a3034e1c) SHA1(493e4be36f2aea0083d5d37e16486ed66dab952e) )
trunk/src/mame/drivers/bowltry.c
r29404r29405
11/************************************************************************************************************
22
3   Bowling Try
3    Bowling Try
44
5   (c)200? Atlus
5    (c)200? Atlus
66
7   TODO:
8   - Tight loops at 0x60e090-0x60e093, control status from video chip?
9   - YGV631-B ... what's that?
7    TODO:
8    - Tight loops at 0x60e090-0x60e093, control status from video chip?
9    - YGV631-B ... what's that?
1010
11   ATLUS PCB  BT-208001
12   ------------------------
11    ATLUS PCB  BT-208001
12    ------------------------
1313
14   At U12 the chip is Toshiba TA8428FG
14    At U12 the chip is Toshiba TA8428FG
1515
16   At U1 the chip is H8/3008
16    At U1 the chip is H8/3008
1717
18   At X1 on the crystal it is printed S753
18    At X1 on the crystal it is printed S753
1919
20   big gfx chip marked
20    big gfx chip marked
2121
22   YAMAHA JAPAN
23   YGV631-B
24   0806LU004
22    YAMAHA JAPAN
23    YGV631-B
24    0806LU004
2525
2626************************************************************************************************************/
2727
r29404r29405
9494static MACHINE_CONFIG_START( bowltry, bowltry_state )
9595   MCFG_CPU_ADD("maincpu", H83008, 16000000 )
9696   MCFG_CPU_PROGRAM_MAP( bowltry_map )
97//   MCFG_CPU_VBLANK_INT_DRIVER("screen", bowltry_state,  irq0_line_hold) // uses vector $64, IMIAB according to the manual (timer/compare B, internal to the CPU)
97//  MCFG_CPU_VBLANK_INT_DRIVER("screen", bowltry_state,  irq0_line_hold) // uses vector $64, IMIAB according to the manual (timer/compare B, internal to the CPU)
9898
9999   MCFG_SCREEN_ADD("screen", RASTER)
100100   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mame/drivers/monacogp.c
r29404r29405
11/***************************************************************************
2
2
33 Sega Monaco GP
44
55 1980
66
7
7
88 Board 96598-P is an oscillator board that generates the game sounds.  It is activated by outputs from Board Assy A (96577X).
9
9
1010 Board Assy's A (96577X) and B (96578X) are the main guts of the gameplay and contain the roms (all sprites).
11 Board Assy A accepts all of the game inputs (Coin, wheel, shift, accelerator pedal), sends the    signals for the sounds to the Oscillator board, outputs to the L.E.D. score display board, and    directly  interacts with Board Assy B
11 Board Assy A accepts all of the game inputs (Coin, wheel, shift, accelerator pedal), sends the     signals for the sounds to the Oscillator board, outputs to the L.E.D. score display board, and directly  interacts with Board Assy B
1212 Board Assy B outputs the video, outputs to the L.E.D. score display board. and directly interacts with Board Assy A.
13 
14 On the second set, boards A and B have different part numbers (97091X and 97092X) and two less roms.  These boards were made later then the first set. 
13
14 On the second set, boards A and B have different part numbers (97091X and 97092X) and two less roms.  These boards were made later then the first set.
1515 These boards  seem to be interchangable, the only difference seems to be the rom size, which only 2 of the roms utilize the full 1024 bytes (second set).
16 
17 ROM SET A   <type 7461, 24 pin>   ROM SET B    <type MB7132E, 24 pin>
18 Board 96577X            Board 97091X
19 ROM ID         IC#      ROM ID
20 PRa125 (Light data)   IC59      PRb-01   (identical to PRa125)
21 PRa126 (Explosion)   IC65      PRb-02   (identical to PRa126)
22 PRa131 (????)      IC71      PRb-04   (identical to PRa131)
23 PRa127 (car(2))      IC77      PRb-13   (identical to PRa127)
24 PRa128 (car(2)rotated)   IC84      PRb-03   (identical to PRa128)
25 PRa129 (car)      IC91      -----
26 PRa130 (car(2) spinout)   IC98      PRb-14   (contains PRa130 and half of PRa129)
27 PRa132 (car(2)(main))   IC111      PRb-15  (identical to PRa132)
28 
29 PRm-39         IC105      PRm-39         <both type 6331-1, 16 pin>
30 PRm-38         IC115      PRm-38      <both type 6331-1, 16 pin>   
31 
32 Board 96578X            Board 97092X
33 ROM ID         IC#      ROM ID
34 PRa140 (brdge-water)   IC12      ----- 
35 PRa141 (brdge-pillar)   IC17      PRb-16  (contains both PRa140 and PRa141)
36 PRa138 (firetruck)   IC30      PRb-10  (identical to PRa138)
37 PRa139 (car+bridge symb)IC51      PRb-11  (identical to PRa139)
38 PRa133 (text(4)      IC64      PRb-05  (identical to PRa133)
39 PRa136 (house)      IC99      PRb-08  (identical to PRa136)
40 PRa135 (shrub)      IC106      PRb-07  (identical to PRa135)
41 PRa134 (tree, grass)   IC113      PRb-06  (identical to PRa134)
42 PRa137 (tunnel,oil slip)IC120      PRb-09  (identical to PRa137)
43 
16
17 ROM SET A  <type 7461, 24 pin> ROM SET B   <type MB7132E, 24 pin>
18 Board 96577X               Board 97091X
19 ROM ID         IC#     ROM ID
20 PRa125 (Light data)    IC59        PRb-01  (identical to PRa125)
21 PRa126 (Explosion) IC65        PRb-02  (identical to PRa126)
22 PRa131 (????)      IC71        PRb-04  (identical to PRa131)
23 PRa127 (car(2))        IC77        PRb-13  (identical to PRa127)
24 PRa128 (car(2)rotated) IC84        PRb-03  (identical to PRa128)
25 PRa129 (car)       IC91        -----
26 PRa130 (car(2) spinout)    IC98        PRb-14  (contains PRa130 and half of PRa129)
27 PRa132 (car(2)(main))  IC111       PRb-15  (identical to PRa132)
28
29 PRm-39         IC105       PRm-39          <both type 6331-1, 16 pin>
30 PRm-38         IC115       PRm-38      <both type 6331-1, 16 pin>
31
32 Board 96578X               Board 97092X
33 ROM ID         IC#     ROM ID
34 PRa140 (brdge-water)   IC12        -----
35 PRa141 (brdge-pillar)  IC17        PRb-16  (contains both PRa140 and PRa141)
36 PRa138 (firetruck) IC30        PRb-10  (identical to PRa138)
37 PRa139 (car+bridge symb)IC51       PRb-11  (identical to PRa139)
38 PRa133 (text(4)        IC64        PRb-05  (identical to PRa133)
39 PRa136 (house)     IC99        PRb-08  (identical to PRa136)
40 PRa135 (shrub)     IC106       PRb-07  (identical to PRa135)
41 PRa134 (tree, grass)   IC113       PRb-06  (identical to PRa134)
42 PRa137 (tunnel,oil slip)IC120      PRb-09  (identical to PRa137)
43
4444 Oscillator Board 96598
45 ROM ID      IC#
46 PRm-40      IC21         PRm-40      <both type 6331-1, 16 pin>
47 
45 ROM ID     IC#
46 PRm-40     IC21            PRm-40      <both type 6331-1, 16 pin>
47
4848 --------------------------------------------------------
49
49
5050  7641
51
51
5252     512*8
5353    +------+
5454 A7 |1   24| Vcc
r29404r29405
6363 D1 |10  15| D5
6464 D2 |11  14| D4
6565 GND|12  13| D3
66   +------+
66    +------+
6767 -----------------------------------------------
68
68
6969  6331-1 PROM
70 
71         32*8
72       +------+
70
71           32*8
72         +------+
7373 O1     |1     16| Vcc
7474 O2     |2     15| CE/
7575 O3     |3     14| A4
r29404r29405
7878 O6     |6     11| A1
7979 O7     |7     10| A0
8080 GND    |8      9| O8
81       +------+
82 
81         +------+
82
8383 -----------------------------------------------
84
84
8585  7132:
86 
87    1024*8
88   +------+
86
87     1024*8
88    +------+
8989 A7 |1   24| Vcc
9090 A6 |2   23| A8
9191 A5 |3   22| A9
r29404r29405
9898 D1 |10  15| D5
9999 D2 |11  14| D4
100100 GND|12  13| D3
101   +------+
102 
103 
101    +------+
102
103
104104 ***************************************************************************/
105105
106106
r29404r29405
140140public:
141141   monacogp_state(const machine_config &mconfig, device_type type, const char *tag)
142142   : driver_device(mconfig, type, tag),
143     m_maincpu(*this, "maincpu"),
144     m_video(*this, "fixfreq")
143      m_maincpu(*this, "maincpu"),
144      m_video(*this, "fixfreq")
145145   {
146146   }
147   
147
148148   // devices
149149   required_device<netlist_mame_device_t> m_maincpu;
150150   required_device<fixedfreq_device> m_video;
151   
151
152152protected:
153   
153
154154   // driver_device overrides
155155   virtual void machine_start();
156156   virtual void machine_reset();
157   
157
158158   virtual void video_start();
159   
159
160160private:
161   
161
162162};
163163
164164
165165static NETLIST_START(monacogp)
166166   SOLVER(Solver, 48000)
167//   PARAM(Solver.FREQ, 48000)
167//  PARAM(Solver.FREQ, 48000)
168168   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
169169
170170   // schematics
171171   //...
172172
173//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
174//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
173//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
174//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
175175NETLIST_END()
176176
177177
r29404r29405
201201
202202
203203/***************************************************************************
204
204
205205 Game driver(s)
206
206
207207 ***************************************************************************/
208208
209209
trunk/src/mame/drivers/seta2.c
r29404r29405
518518   devcb = &funcube_touchscreen_device::set_tx_cb(*device, DEVCB2_##_devcb);
519519
520520class funcube_touchscreen_device : public device_t,
521                           public device_serial_interface
521                           public device_serial_interface
522522{
523523public:
524524   funcube_touchscreen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r29404r29405
539539   required_ioport m_x;
540540   required_ioport m_y;
541541   required_ioport m_btn;
542   
542
543543   UINT8 m_button_state;
544544   int m_serial_pos;
545545   UINT8 m_serial[4];
trunk/src/mame/drivers/flkatck.c
r29404r29405
289289   ROM_LOAD( "669_m02.16b", 0x000000, 0x008000, CRC(7e11e6b9) SHA1(7a7d65a458b15842a6345388007c8f682aec20a7) )
290290
291291   ROM_REGION( 0x080000, "gfx1", 0 ) /* tiles + sprites */ // same data as above set, on PWB 450593 sub-board instead.
292   ROM_LOAD16_BYTE( "669_f03a.4b",   0x000001, 0x010000, CRC(f0ed4c1e) SHA1(58efe3cd81054d22de54a7d195aa3b865bde4a01) )
293   ROM_LOAD16_BYTE( "669_f03e.4d",   0x000000, 0x010000, CRC(95a57a26) SHA1(c8aa30c2c734c0740630b1b04ae43c69931cc7c1) )
294   ROM_LOAD16_BYTE( "669_f03b.5b",   0x020001, 0x010000, CRC(e2593f3c) SHA1(aa0f6d04015650eaef17c4a39f228eaccf9a2948) )
295   ROM_LOAD16_BYTE( "669_f03f.5d",   0x020000, 0x010000, CRC(c6c9903e) SHA1(432ad6d03992499cc533273226944a666b40fa58) )
296   ROM_LOAD16_BYTE( "669_f03c.6b",   0x040001, 0x010000, CRC(47be92dd) SHA1(9ccc62d7d42fccbd5ad60e35e3a0478a04405cf1) )
297   ROM_LOAD16_BYTE( "669_f03g.6d",   0x040000, 0x010000, CRC(70d35fbd) SHA1(21384f738684c5da4a7a84a1c9aa173fffddf47a) )
298   ROM_LOAD16_BYTE( "669_f03d.7b",   0x060001, 0x010000, CRC(18d48f9e) SHA1(b95e38aa813e0f3a0dc6bd45fdb4bf71f7e2066c) )
299   ROM_LOAD16_BYTE( "669_f03h.7d",   0x060000, 0x010000, CRC(abfe76e7) SHA1(f8661f189308e83056ec442fa6c936efff67ba0a) )
292   ROM_LOAD16_BYTE( "669_f03a.4b",   0x000001, 0x010000, CRC(f0ed4c1e) SHA1(58efe3cd81054d22de54a7d195aa3b865bde4a01) )
293   ROM_LOAD16_BYTE( "669_f03e.4d",   0x000000, 0x010000, CRC(95a57a26) SHA1(c8aa30c2c734c0740630b1b04ae43c69931cc7c1) )
294   ROM_LOAD16_BYTE( "669_f03b.5b",   0x020001, 0x010000, CRC(e2593f3c) SHA1(aa0f6d04015650eaef17c4a39f228eaccf9a2948) )
295   ROM_LOAD16_BYTE( "669_f03f.5d",   0x020000, 0x010000, CRC(c6c9903e) SHA1(432ad6d03992499cc533273226944a666b40fa58) )
296   ROM_LOAD16_BYTE( "669_f03c.6b",   0x040001, 0x010000, CRC(47be92dd) SHA1(9ccc62d7d42fccbd5ad60e35e3a0478a04405cf1) )
297   ROM_LOAD16_BYTE( "669_f03g.6d",   0x040000, 0x010000, CRC(70d35fbd) SHA1(21384f738684c5da4a7a84a1c9aa173fffddf47a) )
298   ROM_LOAD16_BYTE( "669_f03d.7b",   0x060001, 0x010000, CRC(18d48f9e) SHA1(b95e38aa813e0f3a0dc6bd45fdb4bf71f7e2066c) )
299   ROM_LOAD16_BYTE( "669_f03h.7d",   0x060000, 0x010000, CRC(abfe76e7) SHA1(f8661f189308e83056ec442fa6c936efff67ba0a) )
300300
301301   ROM_REGION( 0x040000, "k007232", 0 ) /* 007232 data (chip 1) */
302302   ROM_LOAD( "mask2m.11a",  0x000000, 0x040000, CRC(6d1ea61c) SHA1(9e6eb9ac61838df6e1f74e74bb72f3edf1274aed) )
trunk/src/mame/drivers/sigmab98.c
r29404r29405
116116   required_device<gfxdecode_device> m_gfxdecode;
117117   dynamic_array<UINT8> m_paletteram;
118118   required_device<screen_device> m_screen;
119   required_device<palette_device> m_palette;   
119   required_device<palette_device> m_palette;
120120
121121   UINT8 m_reg;
122122   UINT8 m_rombank;
r29404r29405
21502150
21512151   // RAM banks
21522152   m_paletteram.resize_and_clear(0x3000);
2153   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);   
2153   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
21542154   membank("palbank")->set_base(m_paletteram);
21552155   m_rambank = 0x64;
21562156
trunk/src/mame/drivers/pong.c
r29404r29405
6767};
6868
6969fixedfreq_interface fixedfreq_mode_pong = {
70    MASTER_CLOCK,
71    H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL,
72    V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL,
73    1,  /* non-interlaced */
74    0.31
70   MASTER_CLOCK,
71   H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL,
72   V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL,
73   1,  /* non-interlaced */
74   0.31
7575};
7676
7777fixedfreq_interface fixedfreq_mode_pongX2 = {
r29404r29405
102102
103103
104104static NETLIST_START(pong_schematics)
105    SOLVER(Solver, 48000)
106    PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
105   SOLVER(Solver, 48000)
106   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
107107
108    ANALOG_INPUT(V5, 5)
108   ANALOG_INPUT(V5, 5)
109109
110110   TTL_INPUT(high, 1)
111111   TTL_INPUT(low, 0)
r29404r29405
128128   PARAM(xclk.FREQ, 7159000.0*2)
129129#endif
130130
131    /* 3V Logic - Just a resistor - the value is not given in schematics */
131   /* 3V Logic - Just a resistor - the value is not given in schematics */
132132
133    RES(R3V, 50)   // Works ...
134    NET_C(R3V.1, V5)
135    ALIAS(V3, R3V.2)
133   RES(R3V, 50)   // Works ...
134   NET_C(R3V.1, V5)
135   ALIAS(V3, R3V.2)
136136
137    /* Coin, antenna and startup circuit */
137   /* Coin, antenna and startup circuit */
138138
139    ANALOG_INPUT(STOPG, 0)
140   
141    ALIAS(SRSTQ, c9f.Q)
142    ALIAS(SRST, c9c.Q)
139   ANALOG_INPUT(STOPG, 0)
143140
144    /* SRSTQ has a diode to +3V to protect against overvoltage - omitted */
141   ALIAS(SRSTQ, c9f.Q)
142   ALIAS(SRST, c9c.Q)
145143
146    TTL_INPUT(antenna, 0)
144   /* SRSTQ has a diode to +3V to protect against overvoltage - omitted */
147145
148    ALIAS(runQ, Q1.C)
146   TTL_INPUT(antenna, 0)
149147
150    TTL_7404_INVERT(e4d, STOPG)
148   ALIAS(runQ, Q1.C)
151149
152    TTL_7404_INVERT(c9f, c9c.Q)
153    TTL_7404_INVERT(c9c, c9f.Q)
150   TTL_7404_INVERT(e4d, STOPG)
154151
155    SWITCH2(coinsw)
156    NET_C(c9c.Q, coinsw.1)
157    NET_C(c9f.Q, coinsw.2)
152   TTL_7404_INVERT(c9f, c9c.Q)
153   TTL_7404_INVERT(c9c, c9f.Q)
158154
159    NET_C(coinsw.Q, GND)
155   SWITCH2(coinsw)
156   NET_C(c9c.Q, coinsw.1)
157   NET_C(c9f.Q, coinsw.2)
160158
161    /* Antenna circuit */
162    /* Has a diode to clamp negative voltages - omitted here */
159   NET_C(coinsw.Q, GND)
163160
164    QBJT_SW(Q3, "BC237B")
165    NET_C(antenna, Q3.B)
166    NET_C(GND, Q3.E)
167    RES(RX5, 100)
168    CAP(CX1, CAP_U(0.1))
161   /* Antenna circuit */
162   /* Has a diode to clamp negative voltages - omitted here */
169163
170    NET_C(RX5.1, CX1.1)
171    NET_C(RX5.1, Q3.C)
172    NET_C(RX5.2, GND)
173    NET_C(CX1.2, GND)
174    QBJT_SW(Q1, "BC237B")
175    NET_C(Q1.B, RX5.1)
176    NET_C(Q1.E, GND)
164   QBJT_SW(Q3, "BC237B")
165   NET_C(antenna, Q3.B)
166   NET_C(GND, Q3.E)
167   RES(RX5, 100)
168   CAP(CX1, CAP_U(0.1))
177169
178    DIODE(D3, "1N914")
179    NET_C(D3.A, Q1.C)
180    NET_C(D3.K, SRSTQ)
170   NET_C(RX5.1, CX1.1)
171   NET_C(RX5.1, Q3.C)
172   NET_C(RX5.2, GND)
173   NET_C(CX1.2, GND)
174   QBJT_SW(Q1, "BC237B")
175   NET_C(Q1.B, RX5.1)
176   NET_C(Q1.E, GND)
181177
182    DIODE(D2, "1N914")
183    RES(RX4, 220)
184    NET_C(D2.K, e4d.Q)
185    NET_C(D2.A, RX4.1)
186    NET_C(RX4.2, Q3.C)
178   DIODE(D3, "1N914")
179   NET_C(D3.A, Q1.C)
180   NET_C(D3.K, SRSTQ)
187181
188    RES(RX1, 100)
189    RES(RX2, 100)
190    RES(RX3, 330)
191    CAP(CX2, CAP_U(0.1))
182   DIODE(D2, "1N914")
183   RES(RX4, 220)
184   NET_C(D2.K, e4d.Q)
185   NET_C(D2.A, RX4.1)
186   NET_C(RX4.2, Q3.C)
192187
193    NET_C(RX3.2, D3.A)
194    NET_C(RX3.1, RX1.2)
195    NET_C(RX1.1, V3)
188   RES(RX1, 100)
189   RES(RX2, 100)
190   RES(RX3, 330)
191   CAP(CX2, CAP_U(0.1))
196192
197    NET_C(RX1.1, CX2.1)
198    NET_C(RX1.2, CX2.2)
193   NET_C(RX3.2, D3.A)
194   NET_C(RX3.1, RX1.2)
195   NET_C(RX1.1, V3)
199196
200    QBJT_SW(Q2, "BC556B")
201    NET_C(Q2.E, V3)
202    NET_C(Q2.B, RX1.2)
203    NET_C(Q2.C, RX2.2)
197   NET_C(RX1.1, CX2.1)
198   NET_C(RX1.2, CX2.2)
204199
205    NET_C(RX2.1, D2.A)
200   QBJT_SW(Q2, "BC556B")
201   NET_C(Q2.E, V3)
202   NET_C(Q2.B, RX1.2)
203   NET_C(Q2.C, RX2.2)
206204
207    /* hit logic */
205   NET_C(RX2.1, D2.A)
208206
209    TTL_7404_INVERT(hitQ, hit)
210    TTL_7400_NAND(hit, hit1Q, hit2Q)
207   /* hit logic */
211208
212    TTL_7402_NOR(attractQ, StopG, runQ)
213    TTL_7404_INVERT(attract, attractQ)
209   TTL_7404_INVERT(hitQ, hit)
210   TTL_7400_NAND(hit, hit1Q, hit2Q)
214211
215    TTL_7420_NAND(ic_h6a, hvidQ, hvidQ, hvidQ, hvidQ)
216    ALIAS(hvid, ic_h6a.Q)
212   TTL_7402_NOR(attractQ, StopG, runQ)
213   TTL_7404_INVERT(attract, attractQ)
217214
218    TTL_7400_NAND(ic_e6c, hvid, hblank)
219    ALIAS(MissQ, ic_e6c.Q)
215   TTL_7420_NAND(ic_h6a, hvidQ, hvidQ, hvidQ, hvidQ)
216   ALIAS(hvid, ic_h6a.Q)
220217
221    TTL_7404_INVERT(ic_d1e, MissQ)
222    TTL_7400_NAND(ic_e1a, ic_d1e.Q, attractQ)
223    ALIAS(Missed, ic_e1a.Q)
218   TTL_7400_NAND(ic_e6c, hvid, hblank)
219   ALIAS(MissQ, ic_e6c.Q)
224220
225    TTL_7400_NAND(rstspeed, SRSTQ, MissQ)
226    TTL_7400_NAND(StopG, StopG1Q, StopG2Q)
227    ALIAS(L, ic_h3b.Q)
228    ALIAS(R, ic_h3b.QQ)
221   TTL_7404_INVERT(ic_d1e, MissQ)
222   TTL_7400_NAND(ic_e1a, ic_d1e.Q, attractQ)
223   ALIAS(Missed, ic_e1a.Q)
229224
230    TTL_7400_NAND(hit1Q, pad1, ic_g1b.Q)
231    TTL_7400_NAND(hit2Q, pad2, ic_g1b.Q)
225   TTL_7400_NAND(rstspeed, SRSTQ, MissQ)
226   TTL_7400_NAND(StopG, StopG1Q, StopG2Q)
227   ALIAS(L, ic_h3b.Q)
228   ALIAS(R, ic_h3b.QQ)
232229
233    TTL_7400_NAND(ic_g3c, 128H, ic_h3a.QQ)
234    TTL_7427_NOR(ic_g2c, ic_g3c.Q, 256H, vpad1Q)
235    ALIAS(pad1, ic_g2c.Q)
236    TTL_7427_NOR(ic_g2a, ic_g3c.Q, 256HQ, vpad2Q)
237    ALIAS(pad2, ic_g2a.Q)
230   TTL_7400_NAND(hit1Q, pad1, ic_g1b.Q)
231   TTL_7400_NAND(hit2Q, pad2, ic_g1b.Q)
238232
239    // ----------------------------------------------------------------------------------------
240    // horizontal counter
241    // ----------------------------------------------------------------------------------------
242    TTL_7493(ic_f8, clk, ic_f8.QA, ic_e7b.QQ, ic_e7b.QQ)    // f8, f9, f6b
243    TTL_7493(ic_f9, ic_f8.QD, ic_f9.QA, ic_e7b.QQ, ic_e7b.QQ)   // f8, f9, f6b
244    TTL_74107(ic_f6b, ic_f9.QD, high, high, ic_e7b.Q)
245    TTL_7430_NAND(ic_f7, ic_f8.QB, ic_f8.QC, ic_f9.QC, ic_f9.QD, ic_f6b.Q, high, high, high)
246    TTL_7474(ic_e7b, clk, ic_f7, high, high)
233   TTL_7400_NAND(ic_g3c, 128H, ic_h3a.QQ)
234   TTL_7427_NOR(ic_g2c, ic_g3c.Q, 256H, vpad1Q)
235   ALIAS(pad1, ic_g2c.Q)
236   TTL_7427_NOR(ic_g2a, ic_g3c.Q, 256HQ, vpad2Q)
237   ALIAS(pad2, ic_g2a.Q)
247238
248    ALIAS(hreset, ic_e7b.QQ)
249    ALIAS(hresetQ, ic_e7b.Q)
250    ALIAS(  4H, ic_f8.QC)
251    ALIAS(  8H, ic_f8.QD)
252    ALIAS( 16H, ic_f9.QA)
253    ALIAS( 32H, ic_f9.QB)
254    ALIAS( 64H, ic_f9.QC)
255    ALIAS(128H, ic_f9.QD)
256    ALIAS(256H, ic_f6b.Q)
257    ALIAS(256HQ, ic_f6b.QQ)
239   // ----------------------------------------------------------------------------------------
240   // horizontal counter
241   // ----------------------------------------------------------------------------------------
242   TTL_7493(ic_f8, clk, ic_f8.QA, ic_e7b.QQ, ic_e7b.QQ)    // f8, f9, f6b
243   TTL_7493(ic_f9, ic_f8.QD, ic_f9.QA, ic_e7b.QQ, ic_e7b.QQ)   // f8, f9, f6b
244   TTL_74107(ic_f6b, ic_f9.QD, high, high, ic_e7b.Q)
245   TTL_7430_NAND(ic_f7, ic_f8.QB, ic_f8.QC, ic_f9.QC, ic_f9.QD, ic_f6b.Q, high, high, high)
246   TTL_7474(ic_e7b, clk, ic_f7, high, high)
258247
259    // ----------------------------------------------------------------------------------------
260    // vertical counter
261    // ----------------------------------------------------------------------------------------
262    TTL_7493(ic_e8, hreset, ic_e8.QA, ic_e7a.QQ, ic_e7a.QQ) // e8, e9, d9b
263    TTL_7493(ic_e9, ic_e8.QD,ic_e9.QA,  ic_e7a.QQ, ic_e7a.QQ)   // e8, e9, d9b
264    TTL_74107(ic_d9b, ic_e9.QD, high, high, ic_e7a.Q)
265    TTL_7474(ic_e7a, hreset, e7a_data, high, high)
266    TTL_7410_NAND(e7a_data, ic_e8.QA, ic_e8.QC, ic_d9b.Q)
248   ALIAS(hreset, ic_e7b.QQ)
249   ALIAS(hresetQ, ic_e7b.Q)
250   ALIAS(  4H, ic_f8.QC)
251   ALIAS(  8H, ic_f8.QD)
252   ALIAS( 16H, ic_f9.QA)
253   ALIAS( 32H, ic_f9.QB)
254   ALIAS( 64H, ic_f9.QC)
255   ALIAS(128H, ic_f9.QD)
256   ALIAS(256H, ic_f6b.Q)
257   ALIAS(256HQ, ic_f6b.QQ)
267258
268    ALIAS(vreset, ic_e7a.QQ)
269    ALIAS(  4V, ic_e8.QC)
270    ALIAS(  8V, ic_e8.QD)
271    ALIAS( 16V, ic_e9.QA)
272    ALIAS( 32V, ic_e9.QB)
273    ALIAS( 64V, ic_e9.QC)
274    ALIAS(128V, ic_e9.QD)
275    ALIAS(256V,  ic_d9b.Q)
276    ALIAS(256VQ, ic_d9b.QQ)
259   // ----------------------------------------------------------------------------------------
260   // vertical counter
261   // ----------------------------------------------------------------------------------------
262   TTL_7493(ic_e8, hreset, ic_e8.QA, ic_e7a.QQ, ic_e7a.QQ) // e8, e9, d9b
263   TTL_7493(ic_e9, ic_e8.QD,ic_e9.QA,  ic_e7a.QQ, ic_e7a.QQ)   // e8, e9, d9b
264   TTL_74107(ic_d9b, ic_e9.QD, high, high, ic_e7a.Q)
265   TTL_7474(ic_e7a, hreset, e7a_data, high, high)
266   TTL_7410_NAND(e7a_data, ic_e8.QA, ic_e8.QC, ic_d9b.Q)
277267
268   ALIAS(vreset, ic_e7a.QQ)
269   ALIAS(  4V, ic_e8.QC)
270   ALIAS(  8V, ic_e8.QD)
271   ALIAS( 16V, ic_e9.QA)
272   ALIAS( 32V, ic_e9.QB)
273   ALIAS( 64V, ic_e9.QC)
274   ALIAS(128V, ic_e9.QD)
275   ALIAS(256V,  ic_d9b.Q)
276   ALIAS(256VQ, ic_d9b.QQ)
278277
279    // ----------------------------------------------------------------------------------------
280    // hblank flip flop
281    // ----------------------------------------------------------------------------------------
282278
283    TTL_7400_NAND(ic_g5b, 16H, 64H)
279   // ----------------------------------------------------------------------------------------
280   // hblank flip flop
281   // ----------------------------------------------------------------------------------------
284282
285    // the time critical one
286    TTL_7400_NAND(ic_h5c, ic_h5b.Q, hresetQ)
287    TTL_7400_NAND(ic_h5b, ic_h5c.Q, ic_g5b.Q)
283   TTL_7400_NAND(ic_g5b, 16H, 64H)
288284
289    ALIAS(hblank,  ic_h5c.Q)
290    ALIAS(hblankQ,  ic_h5b.Q)
291    TTL_7400_NAND(hsyncQ, hblank, 32H)
285   // the time critical one
286   TTL_7400_NAND(ic_h5c, ic_h5b.Q, hresetQ)
287   TTL_7400_NAND(ic_h5b, ic_h5c.Q, ic_g5b.Q)
292288
293    // ----------------------------------------------------------------------------------------
294    // vblank flip flop
295    // ----------------------------------------------------------------------------------------
296    TTL_7402_NOR(ic_f5c, ic_f5d.Q, vreset)
297    TTL_7402_NOR(ic_f5d, ic_f5c.Q, 16V)
289   ALIAS(hblank,  ic_h5c.Q)
290   ALIAS(hblankQ,  ic_h5b.Q)
291   TTL_7400_NAND(hsyncQ, hblank, 32H)
298292
299    ALIAS(vblank,  ic_f5d.Q)
300    ALIAS(vblankQ, ic_f5c.Q)
293   // ----------------------------------------------------------------------------------------
294   // vblank flip flop
295   // ----------------------------------------------------------------------------------------
296   TTL_7402_NOR(ic_f5c, ic_f5d.Q, vreset)
297   TTL_7402_NOR(ic_f5d, ic_f5c.Q, 16V)
301298
302    TTL_7400_NAND(ic_h5a, 8V, 8V)
303    TTL_7410_NAND(ic_g5a, vblank, 4V, ic_h5a.Q)
304    ALIAS(vsyncQ, ic_g5a.Q)
299   ALIAS(vblank,  ic_f5d.Q)
300   ALIAS(vblankQ, ic_f5c.Q)
305301
306    // ----------------------------------------------------------------------------------------
307    // move logic
308    // ----------------------------------------------------------------------------------------
302   TTL_7400_NAND(ic_h5a, 8V, 8V)
303   TTL_7410_NAND(ic_g5a, vblank, 4V, ic_h5a.Q)
304   ALIAS(vsyncQ, ic_g5a.Q)
309305
310    TTL_7400_NAND(ic_e1d, hit_sound, ic_e1c.Q)
311    TTL_7400_NAND(ic_e1c, ic_f1.QC, ic_f1.QD)
312    TTL_7493(ic_f1, ic_e1d.Q, ic_f1.QA, rstspeed, rstspeed)
306   // ----------------------------------------------------------------------------------------
307   // move logic
308   // ----------------------------------------------------------------------------------------
313309
314    TTL_7402_NOR(ic_g1d, ic_f1.QC, ic_f1.QD)
315    TTL_7400_NAND(ic_h1a, ic_g1d.Q, ic_g1d.Q)
316    TTL_7400_NAND(ic_h1d, ic_e1c.Q, ic_h1a.Q)
310   TTL_7400_NAND(ic_e1d, hit_sound, ic_e1c.Q)
311   TTL_7400_NAND(ic_e1c, ic_f1.QC, ic_f1.QD)
312   TTL_7493(ic_f1, ic_e1d.Q, ic_f1.QA, rstspeed, rstspeed)
317313
318    TTL_7400_NAND(ic_h1c, ic_h1d.Q, vreset)
319    TTL_7400_NAND(ic_h1b, ic_h1a.Q, vreset)
320    TTL_7402_NOR(ic_g1c, 256HQ, vreset)
314   TTL_7402_NOR(ic_g1d, ic_f1.QC, ic_f1.QD)
315   TTL_7400_NAND(ic_h1a, ic_g1d.Q, ic_g1d.Q)
316   TTL_7400_NAND(ic_h1d, ic_e1c.Q, ic_h1a.Q)
321317
322    TTL_74107(ic_h2a, ic_g1c.Q, ic_h2b.Q, low, ic_h1b.Q)
323    TTL_74107(ic_h2b, ic_g1c.Q, high, move, ic_h1c.Q)
318   TTL_7400_NAND(ic_h1c, ic_h1d.Q, vreset)
319   TTL_7400_NAND(ic_h1b, ic_h1a.Q, vreset)
320   TTL_7402_NOR(ic_g1c, 256HQ, vreset)
324321
325    TTL_7400_NAND(ic_h4a, ic_h2b.Q, ic_h2a.Q)
326    ALIAS(move, ic_h4a.Q)
322   TTL_74107(ic_h2a, ic_g1c.Q, ic_h2b.Q, low, ic_h1b.Q)
323   TTL_74107(ic_h2b, ic_g1c.Q, high, move, ic_h1c.Q)
327324
328    TTL_7400_NAND(ic_c1d, SC, attract)
329    TTL_7404_INVERT(ic_d1a, ic_c1d.Q)
330    TTL_7474(ic_h3b, ic_d1a.Q, ic_h3b.QQ, hit1Q, hit2Q)
325   TTL_7400_NAND(ic_h4a, ic_h2b.Q, ic_h2a.Q)
326   ALIAS(move, ic_h4a.Q)
331327
332    TTL_7400_NAND(ic_h4d, ic_h3b.Q, move)
333    TTL_7400_NAND(ic_h4b, ic_h3b.QQ, move)
334    TTL_7400_NAND(ic_h4c, ic_h4d.Q, ic_h4b.Q)
335    ALIAS(Aa, ic_h4c.Q)
336    ALIAS(Ba, ic_h4b.Q)
328   TTL_7400_NAND(ic_c1d, SC, attract)
329   TTL_7404_INVERT(ic_d1a, ic_c1d.Q)
330   TTL_7474(ic_h3b, ic_d1a.Q, ic_h3b.QQ, hit1Q, hit2Q)
337331
338    // ----------------------------------------------------------------------------------------
339    // hvid circuit
340    // ----------------------------------------------------------------------------------------
332   TTL_7400_NAND(ic_h4d, ic_h3b.Q, move)
333   TTL_7400_NAND(ic_h4b, ic_h3b.QQ, move)
334   TTL_7400_NAND(ic_h4c, ic_h4d.Q, ic_h4b.Q)
335   ALIAS(Aa, ic_h4c.Q)
336   ALIAS(Ba, ic_h4b.Q)
341337
342    TTL_7400_NAND(hball_resetQ, Serve, attractQ)
338   // ----------------------------------------------------------------------------------------
339   // hvid circuit
340   // ----------------------------------------------------------------------------------------
343341
344    TTL_9316(ic_g7, clk, high, hblankQ, hball_resetQ, ic_g5c.Q, Aa, Ba, low, high)
345    TTL_9316(ic_h7, clk, ic_g7.RC, high, hball_resetQ, ic_g5c.Q, low, low, low, high)
346    TTL_74107(ic_g6b, ic_h7.RC, high, high, hball_resetQ)
347    TTL_7410_NAND(ic_g5c, ic_g6b.Q, ic_h7.RC, ic_g7.RC)
348    TTL_7420_NAND(ic_h6b, ic_g6b.Q, ic_h7.RC, ic_g7.QC, ic_g7.QD)
349    ALIAS(hvidQ, ic_h6b.Q)
342   TTL_7400_NAND(hball_resetQ, Serve, attractQ)
350343
351    // ----------------------------------------------------------------------------------------
352    // vvid circuit
353    // ----------------------------------------------------------------------------------------
344   TTL_9316(ic_g7, clk, high, hblankQ, hball_resetQ, ic_g5c.Q, Aa, Ba, low, high)
345   TTL_9316(ic_h7, clk, ic_g7.RC, high, hball_resetQ, ic_g5c.Q, low, low, low, high)
346   TTL_74107(ic_g6b, ic_h7.RC, high, high, hball_resetQ)
347   TTL_7410_NAND(ic_g5c, ic_g6b.Q, ic_h7.RC, ic_g7.RC)
348   TTL_7420_NAND(ic_h6b, ic_g6b.Q, ic_h7.RC, ic_g7.QC, ic_g7.QD)
349   ALIAS(hvidQ, ic_h6b.Q)
354350
355    TTL_9316(ic_b3, hsyncQ, high, vblankQ, high, ic_b2b.Q, a6, b6, c6, d6)
356    TTL_9316(ic_a3, hsyncQ, ic_b3.RC, high, high, ic_b2b.Q, low, low, low, low)
357    TTL_7400_NAND(ic_b2b, ic_a3.RC, ic_b3.RC)
358    TTL_7410_NAND(ic_e2b, ic_a3.RC, ic_b3.QC, ic_b3.QD)
359    ALIAS(vvidQ, ic_e2b.Q)
360    TTL_7404_INVERT(vvid, vvidQ)    // D2D
361    ALIAS(vpos256, ic_a3.RC)
362    ALIAS(vpos32, ic_a3.QB)
363    ALIAS(vpos16, ic_a3.QA)
351   // ----------------------------------------------------------------------------------------
352   // vvid circuit
353   // ----------------------------------------------------------------------------------------
364354
365    // ----------------------------------------------------------------------------------------
366    // vball ctrl circuit
367    // ----------------------------------------------------------------------------------------
355   TTL_9316(ic_b3, hsyncQ, high, vblankQ, high, ic_b2b.Q, a6, b6, c6, d6)
356   TTL_9316(ic_a3, hsyncQ, ic_b3.RC, high, high, ic_b2b.Q, low, low, low, low)
357   TTL_7400_NAND(ic_b2b, ic_a3.RC, ic_b3.RC)
358   TTL_7410_NAND(ic_e2b, ic_a3.RC, ic_b3.QC, ic_b3.QD)
359   ALIAS(vvidQ, ic_e2b.Q)
360   TTL_7404_INVERT(vvid, vvidQ)    // D2D
361   ALIAS(vpos256, ic_a3.RC)
362   ALIAS(vpos32, ic_a3.QB)
363   ALIAS(vpos16, ic_a3.QA)
368364
369    TTL_7450_ANDORINVERT(ic_a6a, b1, 256HQ, b2, 256H)
370    TTL_7450_ANDORINVERT(ic_a6b, c1, 256HQ, c2, 256H)
371    TTL_7450_ANDORINVERT(ic_b6b, d1, 256HQ, d2, 256H)
365   // ----------------------------------------------------------------------------------------
366   // vball ctrl circuit
367   // ----------------------------------------------------------------------------------------
372368
373    TTL_7474(ic_a5b, hit, ic_a6a, attractQ, high)
374    TTL_7474(ic_a5a, hit, ic_a6b, attractQ, high)
375    TTL_7474(ic_b5a, hit, ic_b6b, attractQ, high)
376    TTL_74107(ic_h2x, vblank, vvid, vvid, hitQ) // two marked at position h2a ==> this h2x
369   TTL_7450_ANDORINVERT(ic_a6a, b1, 256HQ, b2, 256H)
370   TTL_7450_ANDORINVERT(ic_a6b, c1, 256HQ, c2, 256H)
371   TTL_7450_ANDORINVERT(ic_b6b, d1, 256HQ, d2, 256H)
377372
378    TTL_7486_XOR(ic_a4c, ic_a5b.Q, ic_h2x.Q)
379    TTL_7486_XOR(ic_a4b, ic_a5a.Q, ic_h2x.Q)
373   TTL_7474(ic_a5b, hit, ic_a6a, attractQ, high)
374   TTL_7474(ic_a5a, hit, ic_a6b, attractQ, high)
375   TTL_7474(ic_b5a, hit, ic_b6b, attractQ, high)
376   TTL_74107(ic_h2x, vblank, vvid, vvid, hitQ) // two marked at position h2a ==> this h2x
380377
381    TTL_7450_ANDORINVERT(ic_b6a, ic_b5a.Q, ic_h2x.Q, ic_b5a.QQ, ic_h2x.QQ)
378   TTL_7486_XOR(ic_a4c, ic_a5b.Q, ic_h2x.Q)
379   TTL_7486_XOR(ic_a4b, ic_a5a.Q, ic_h2x.Q)
382380
383    TTL_7404_INVERT(ic_c4a, ic_b6a)
381   TTL_7450_ANDORINVERT(ic_b6a, ic_b5a.Q, ic_h2x.Q, ic_b5a.QQ, ic_h2x.QQ)
384382
385    TTL_7483(ic_b4, ic_a4c, ic_a4b, ic_b6a, low, ic_c4a, high, high, low, low)
386    ALIAS(a6, ic_b4.S1)
387    ALIAS(b6, ic_b4.S2)
388    ALIAS(c6, ic_b4.S3)
389    ALIAS(d6, ic_b4.S4)
383   TTL_7404_INVERT(ic_c4a, ic_b6a)
390384
391    // ----------------------------------------------------------------------------------------
392    // serve monoflop
393    // ----------------------------------------------------------------------------------------
385   TTL_7483(ic_b4, ic_a4c, ic_a4b, ic_b6a, low, ic_c4a, high, high, low, low)
386   ALIAS(a6, ic_b4.S1)
387   ALIAS(b6, ic_b4.S2)
388   ALIAS(c6, ic_b4.S3)
389   ALIAS(d6, ic_b4.S4)
394390
395    TTL_7404_INVERT(f4_trig, rstspeed)
391   // ----------------------------------------------------------------------------------------
392   // serve monoflop
393   // ----------------------------------------------------------------------------------------
396394
397    RES(ic_f4_serve_R, RES_K(330))
398    CAP(ic_f4_serve_C, CAP_U(4.7))
399    NE555(ic_f4_serve)
395   TTL_7404_INVERT(f4_trig, rstspeed)
400396
401    NET_C(ic_f4_serve.VCC, V5)
402    NET_C(ic_f4_serve.GND, GND)
403    NET_C(ic_f4_serve.RESET, V5)
404    NET_C(ic_f4_serve_R.1, V5)
405    NET_C(ic_f4_serve_R.2, ic_f4_serve.THRESH)
406    NET_C(ic_f4_serve_R.2, ic_f4_serve.DISCH)
407    NET_C(f4_trig, ic_f4_serve.TRIG)
408    NET_C(ic_f4_serve_R.2, ic_f4_serve_C.1)
409    NET_C(GND, ic_f4_serve_C.2)
397   RES(ic_f4_serve_R, RES_K(330))
398   CAP(ic_f4_serve_C, CAP_U(4.7))
399   NE555(ic_f4_serve)
410400
411    TTL_7427_NOR(ic_e5a, ic_f4_serve.OUT, StopG, runQ)
412    TTL_7474(ic_b5b_serve, pad1, ic_e5a, ic_e5a, high)
401   NET_C(ic_f4_serve.VCC, V5)
402   NET_C(ic_f4_serve.GND, GND)
403   NET_C(ic_f4_serve.RESET, V5)
404   NET_C(ic_f4_serve_R.1, V5)
405   NET_C(ic_f4_serve_R.2, ic_f4_serve.THRESH)
406   NET_C(ic_f4_serve_R.2, ic_f4_serve.DISCH)
407   NET_C(f4_trig, ic_f4_serve.TRIG)
408   NET_C(ic_f4_serve_R.2, ic_f4_serve_C.1)
409   NET_C(GND, ic_f4_serve_C.2)
413410
414    ALIAS(Serve, ic_b5b_serve.QQ)
415    ALIAS(ServeQ, ic_b5b_serve.Q)
411   TTL_7427_NOR(ic_e5a, ic_f4_serve.OUT, StopG, runQ)
412   TTL_7474(ic_b5b_serve, pad1, ic_e5a, ic_e5a, high)
416413
417    // ----------------------------------------------------------------------------------------
418    // score logic
419    // ----------------------------------------------------------------------------------------
414   ALIAS(Serve, ic_b5b_serve.QQ)
415   ALIAS(ServeQ, ic_b5b_serve.Q)
420416
421    TTL_7474(ic_h3a, 4H, 128H, high, attractQ)
417   // ----------------------------------------------------------------------------------------
418   // score logic
419   // ----------------------------------------------------------------------------------------
422420
423    // ----------------------------------------------------------------------------------------
424    // sound logic
425    // ----------------------------------------------------------------------------------------
426    TTL_7474(ic_c2a, vpos256, high, hitQ, high)
427    TTL_74107(ic_f3_topbot, vblank, vvid, vvidQ, ServeQ)
421   TTL_7474(ic_h3a, 4H, 128H, high, attractQ)
428422
429    // ----------------------------------------------------------------------------------------
430    // monoflop with NE555 determines duration of score sound
431    // ----------------------------------------------------------------------------------------
423   // ----------------------------------------------------------------------------------------
424   // sound logic
425   // ----------------------------------------------------------------------------------------
426   TTL_7474(ic_c2a, vpos256, high, hitQ, high)
427   TTL_74107(ic_f3_topbot, vblank, vvid, vvidQ, ServeQ)
432428
433    RES(ic_g4_R, RES_K(220))
434    CAP(ic_g4_C, CAP_U(1))
435    NE555(ic_g4_sc)
436    ALIAS(SC, ic_g4_sc.OUT)
429   // ----------------------------------------------------------------------------------------
430   // monoflop with NE555 determines duration of score sound
431   // ----------------------------------------------------------------------------------------
437432
438    NET_C(ic_g4_sc.VCC, V5)
439    NET_C(ic_g4_sc.GND, GND)
440    NET_C(ic_g4_sc.RESET, V5)
441    NET_C(ic_g4_R.1, V5)
442    NET_C(ic_g4_R.2, ic_g4_sc.THRESH)
443    NET_C(ic_g4_R.2, ic_g4_sc.DISCH)
444    NET_C(MissQ, ic_g4_sc.TRIG)
445    NET_C(ic_g4_R.2, ic_g4_C.1)
446    NET_C(GND, ic_g4_C.2)
433   RES(ic_g4_R, RES_K(220))
434   CAP(ic_g4_C, CAP_U(1))
435   NE555(ic_g4_sc)
436   ALIAS(SC, ic_g4_sc.OUT)
447437
448    ALIAS(hit_sound_en, ic_c2a.QQ)
449    TTL_7400_NAND(hit_sound, hit_sound_en, vpos16)
450    TTL_7400_NAND(score_sound, SC, vpos32)
451    TTL_7400_NAND(topbothitsound, ic_f3_topbot.Q, vpos32)
438   NET_C(ic_g4_sc.VCC, V5)
439   NET_C(ic_g4_sc.GND, GND)
440   NET_C(ic_g4_sc.RESET, V5)
441   NET_C(ic_g4_R.1, V5)
442   NET_C(ic_g4_R.2, ic_g4_sc.THRESH)
443   NET_C(ic_g4_R.2, ic_g4_sc.DISCH)
444   NET_C(MissQ, ic_g4_sc.TRIG)
445   NET_C(ic_g4_R.2, ic_g4_C.1)
446   NET_C(GND, ic_g4_C.2)
452447
453    TTL_7410_NAND(ic_c4b, topbothitsound, hit_sound, score_sound)
454    TTL_7400_NAND(ic_c1b, ic_c4b.Q, attractQ)
455    ALIAS(sound, ic_c1b.Q)
448   ALIAS(hit_sound_en, ic_c2a.QQ)
449   TTL_7400_NAND(hit_sound, hit_sound_en, vpos16)
450   TTL_7400_NAND(score_sound, SC, vpos32)
451   TTL_7400_NAND(topbothitsound, ic_f3_topbot.Q, vpos32)
456452
453   TTL_7410_NAND(ic_c4b, topbothitsound, hit_sound, score_sound)
454   TTL_7400_NAND(ic_c1b, ic_c4b.Q, attractQ)
455   ALIAS(sound, ic_c1b.Q)
457456
458    // ----------------------------------------------------------------------------------------
459    // paddle1 logic 1
460    // ----------------------------------------------------------------------------------------
461457
462    POT(ic_b9_POT, RES_K(1))     // This is a guess!!
463    PARAM(ic_b9_POT.DIALLOG, 1)  // Log Dial ...
464    RES(ic_b9_RPRE, 470)
458   // ----------------------------------------------------------------------------------------
459   // paddle1 logic 1
460   // ----------------------------------------------------------------------------------------
465461
466    NET_C(ic_b9_POT.1, V5)
467    NET_C(ic_b9_POT.3, GND)
468    NET_C(ic_b9_POT.2, ic_b9_RPRE.1)
469    NET_C(ic_b9_RPRE.2, ic_b9.CONT)
462   POT(ic_b9_POT, RES_K(1))     // This is a guess!!
463   PARAM(ic_b9_POT.DIALLOG, 1)  // Log Dial ...
464   RES(ic_b9_RPRE, 470)
470465
471    RES(ic_b9_R, RES_K(81))        // Adjustment pot
472    CAP(ic_b9_C, CAP_U(.1))
473    DIODE(ic_b9_D, "1N914")
474    NE555(ic_b9)
466   NET_C(ic_b9_POT.1, V5)
467   NET_C(ic_b9_POT.3, GND)
468   NET_C(ic_b9_POT.2, ic_b9_RPRE.1)
469   NET_C(ic_b9_RPRE.2, ic_b9.CONT)
475470
476    NET_C(ic_b9.VCC, V5)
477    NET_C(ic_b9.GND, GND)
478    NET_C(ic_b9.RESET, V5)
479    NET_C(ic_b9_R.1, V5)
480    NET_C(ic_b9_R.2, ic_b9.THRESH)
481    NET_C(ic_b9_R.2, ic_b9_D.A)
482    NET_C(ic_b9_D.K, ic_b9.DISCH)
483    NET_C(256VQ, ic_b9.TRIG)
484    NET_C(ic_b9_R.2, ic_b9_C.1)
485    NET_C(GND, ic_b9_C.2)
471   RES(ic_b9_R, RES_K(81))        // Adjustment pot
472   CAP(ic_b9_C, CAP_U(.1))
473   DIODE(ic_b9_D, "1N914")
474   NE555(ic_b9)
486475
487    TTL_7404_INVERT(ic_c9b, ic_b9.OUT)
488    TTL_7400_NAND(ic_b7b, ic_a7b.Q, hsyncQ)
489    TTL_7493(ic_b8, ic_b7b.Q, ic_b8.QA, ic_b9.OUT, ic_b9.OUT)
490    TTL_7400_NAND(ic_b7a, ic_c9b.Q, ic_a7b.Q)
491    TTL_7420_NAND(ic_a7b, ic_b8.QA, ic_b8.QB, ic_b8.QC, ic_b8.QD)
492    ALIAS(vpad1Q, ic_b7a.Q)
476   NET_C(ic_b9.VCC, V5)
477   NET_C(ic_b9.GND, GND)
478   NET_C(ic_b9.RESET, V5)
479   NET_C(ic_b9_R.1, V5)
480   NET_C(ic_b9_R.2, ic_b9.THRESH)
481   NET_C(ic_b9_R.2, ic_b9_D.A)
482   NET_C(ic_b9_D.K, ic_b9.DISCH)
483   NET_C(256VQ, ic_b9.TRIG)
484   NET_C(ic_b9_R.2, ic_b9_C.1)
485   NET_C(GND, ic_b9_C.2)
493486
494    ALIAS(b1, ic_b8.QB)
495    ALIAS(c1, ic_b8.QC)
496    ALIAS(d1, ic_b8.QD)
487   TTL_7404_INVERT(ic_c9b, ic_b9.OUT)
488   TTL_7400_NAND(ic_b7b, ic_a7b.Q, hsyncQ)
489   TTL_7493(ic_b8, ic_b7b.Q, ic_b8.QA, ic_b9.OUT, ic_b9.OUT)
490   TTL_7400_NAND(ic_b7a, ic_c9b.Q, ic_a7b.Q)
491   TTL_7420_NAND(ic_a7b, ic_b8.QA, ic_b8.QB, ic_b8.QC, ic_b8.QD)
492   ALIAS(vpad1Q, ic_b7a.Q)
497493
498    // ----------------------------------------------------------------------------------------
499    // paddle1 logic 2
500    // ----------------------------------------------------------------------------------------
494   ALIAS(b1, ic_b8.QB)
495   ALIAS(c1, ic_b8.QC)
496   ALIAS(d1, ic_b8.QD)
501497
502    POT(ic_a9_POT, RES_K(1))     // This is a guess!!
503    PARAM(ic_a9_POT.DIALLOG, 1)  // Log Dial ...
504    RES(ic_a9_RPRE, 470)
498   // ----------------------------------------------------------------------------------------
499   // paddle1 logic 2
500   // ----------------------------------------------------------------------------------------
505501
506    NET_C(ic_a9_POT.1, V5)
507    NET_C(ic_a9_POT.3, GND)
508    NET_C(ic_a9_POT.2, ic_a9_RPRE.1)
509    NET_C(ic_a9_RPRE.2, ic_a9.CONT)
502   POT(ic_a9_POT, RES_K(1))     // This is a guess!!
503   PARAM(ic_a9_POT.DIALLOG, 1)  // Log Dial ...
504   RES(ic_a9_RPRE, 470)
510505
511    RES(ic_a9_R, RES_K(81))        // Adjustment pot
512    CAP(ic_a9_C, CAP_U(.1))
513    DIODE(ic_a9_D, "1N914")
514    NE555(ic_a9)
506   NET_C(ic_a9_POT.1, V5)
507   NET_C(ic_a9_POT.3, GND)
508   NET_C(ic_a9_POT.2, ic_a9_RPRE.1)
509   NET_C(ic_a9_RPRE.2, ic_a9.CONT)
515510
516    NET_C(ic_a9.VCC, V5)
517    NET_C(ic_a9.GND, GND)
518    NET_C(ic_a9.RESET, V5)
519    NET_C(ic_a9_R.1, V5)
520    NET_C(ic_a9_R.2, ic_a9.THRESH)
521    NET_C(ic_a9_R.2, ic_a9_D.A)
522    NET_C(ic_a9_D.K, ic_a9.DISCH)
523    NET_C(256VQ, ic_a9.TRIG)
524    NET_C(ic_a9_R.2, ic_a9_C.1)
525    NET_C(GND, ic_a9_C.2)
511   RES(ic_a9_R, RES_K(81))        // Adjustment pot
512   CAP(ic_a9_C, CAP_U(.1))
513   DIODE(ic_a9_D, "1N914")
514   NE555(ic_a9)
526515
527    TTL_7404_INVERT(ic_c9a, ic_a9.OUT)
528    TTL_7400_NAND(ic_b7c, ic_a7a.Q, hsyncQ)
529    TTL_7493(ic_a8, ic_b7c.Q, ic_a8.QA, ic_a9.OUT, ic_a9.OUT)
530    TTL_7400_NAND(ic_b7d, ic_c9a.Q, ic_a7a.Q)
531    TTL_7420_NAND(ic_a7a, ic_a8.QA, ic_a8.QB, ic_a8.QC, ic_a8.QD)
532    ALIAS(vpad2Q, ic_b7d.Q)
516   NET_C(ic_a9.VCC, V5)
517   NET_C(ic_a9.GND, GND)
518   NET_C(ic_a9.RESET, V5)
519   NET_C(ic_a9_R.1, V5)
520   NET_C(ic_a9_R.2, ic_a9.THRESH)
521   NET_C(ic_a9_R.2, ic_a9_D.A)
522   NET_C(ic_a9_D.K, ic_a9.DISCH)
523   NET_C(256VQ, ic_a9.TRIG)
524   NET_C(ic_a9_R.2, ic_a9_C.1)
525   NET_C(GND, ic_a9_C.2)
533526
534    ALIAS(b2, ic_a8.QB)
535    ALIAS(c2, ic_a8.QC)
536    ALIAS(d2, ic_a8.QD)
527   TTL_7404_INVERT(ic_c9a, ic_a9.OUT)
528   TTL_7400_NAND(ic_b7c, ic_a7a.Q, hsyncQ)
529   TTL_7493(ic_a8, ic_b7c.Q, ic_a8.QA, ic_a9.OUT, ic_a9.OUT)
530   TTL_7400_NAND(ic_b7d, ic_c9a.Q, ic_a7a.Q)
531   TTL_7420_NAND(ic_a7a, ic_a8.QA, ic_a8.QB, ic_a8.QC, ic_a8.QD)
532   ALIAS(vpad2Q, ic_b7d.Q)
537533
538    // ----------------------------------------------------------------------------------------
539    // C5-EN Logic
540    // ----------------------------------------------------------------------------------------
534   ALIAS(b2, ic_a8.QB)
535   ALIAS(c2, ic_a8.QC)
536   ALIAS(d2, ic_a8.QD)
541537
542    TTL_7404_INVERT(ic_e3a, 128H)
543    TTL_7427_NOR( ic_e3b, 256H, 64H, ic_e3a.Q)
544    TTL_7410_NAND(ic_e2c, 256H, 64H, ic_e3a.Q)
545    TTL_7404_INVERT(ic_e3c, ic_e2c.Q)
546    TTL_7402_NOR(ic_d2c, ic_e3c.Q, ic_e3b.Q)
547    TTL_7404_INVERT(ic_g1a, 32V)
548    TTL_7425_NOR(ic_f2a, ic_g1a.Q, 64V, 128V, ic_d2c.Q)
549    ALIAS(c5_en, ic_f2a.Q)
538   // ----------------------------------------------------------------------------------------
539   // C5-EN Logic
540   // ----------------------------------------------------------------------------------------
550541
551    // ----------------------------------------------------------------------------------------
552    // Score logic ...
553    // ----------------------------------------------------------------------------------------
542   TTL_7404_INVERT(ic_e3a, 128H)
543   TTL_7427_NOR( ic_e3b, 256H, 64H, ic_e3a.Q)
544   TTL_7410_NAND(ic_e2c, 256H, 64H, ic_e3a.Q)
545   TTL_7404_INVERT(ic_e3c, ic_e2c.Q)
546   TTL_7402_NOR(ic_d2c, ic_e3c.Q, ic_e3b.Q)
547   TTL_7404_INVERT(ic_g1a, 32V)
548   TTL_7425_NOR(ic_f2a, ic_g1a.Q, 64V, 128V, ic_d2c.Q)
549   ALIAS(c5_en, ic_f2a.Q)
554550
555    TTL_7402_NOR(ic_f5b, L, Missed)
556    TTL_7490(ic_c7, ic_f5b, ic_c7.QA, SRST, SRST, low, low)
557    TTL_74107(ic_c8a, ic_c7.QD, high, high, SRSTQ)
558    SWITCH2(sw1a)
559    PARAM(sw1a.POS, 0)
551   // ----------------------------------------------------------------------------------------
552   // Score logic ...
553   // ----------------------------------------------------------------------------------------
560554
561    NET_C(sw1a.1, high)
562    //NET_C(sw1a.1, V5)
563    NET_C(sw1a.2, ic_c7.QC)
555   TTL_7402_NOR(ic_f5b, L, Missed)
556   TTL_7490(ic_c7, ic_f5b, ic_c7.QA, SRST, SRST, low, low)
557   TTL_74107(ic_c8a, ic_c7.QD, high, high, SRSTQ)
558   SWITCH2(sw1a)
559   PARAM(sw1a.POS, 0)
564560
565    TTL_7410_NAND(ic_d8a, ic_c7.QA, sw1a.Q, ic_c8a.Q)       // would be nand2 for 11 instead of 15 points, need a switch dev!
561   NET_C(sw1a.1, high)
562   //NET_C(sw1a.1, V5)
563   NET_C(sw1a.2, ic_c7.QC)
566564
567    ALIAS(StopG1Q, ic_d8a.Q)
568    ALIAS(score1_1, ic_c7.QA)
569    ALIAS(score1_2, ic_c7.QB)
570    ALIAS(score1_4, ic_c7.QC)
571    ALIAS(score1_8, ic_c7.QD)
572    ALIAS(score1_10, ic_c8a.Q)
573    ALIAS(score1_10Q, ic_c8a.QQ)
565   TTL_7410_NAND(ic_d8a, ic_c7.QA, sw1a.Q, ic_c8a.Q)       // would be nand2 for 11 instead of 15 points, need a switch dev!
574566
575    TTL_7402_NOR(ic_f5a, R, Missed)
576    TTL_7490(ic_d7, ic_f5a, ic_d7.QA, SRST, SRST, low, low)
577    TTL_74107(ic_c8b, ic_d7.QD, high, high, SRSTQ)
578    SWITCH2(sw1b)
579    PARAM(sw1b.POS, 0)
567   ALIAS(StopG1Q, ic_d8a.Q)
568   ALIAS(score1_1, ic_c7.QA)
569   ALIAS(score1_2, ic_c7.QB)
570   ALIAS(score1_4, ic_c7.QC)
571   ALIAS(score1_8, ic_c7.QD)
572   ALIAS(score1_10, ic_c8a.Q)
573   ALIAS(score1_10Q, ic_c8a.QQ)
580574
581    NET_C(sw1b.1, high)
582    //NET_C(sw1b.1, V5)
583    NET_C(sw1b.2, ic_d7.QC)
575   TTL_7402_NOR(ic_f5a, R, Missed)
576   TTL_7490(ic_d7, ic_f5a, ic_d7.QA, SRST, SRST, low, low)
577   TTL_74107(ic_c8b, ic_d7.QD, high, high, SRSTQ)
578   SWITCH2(sw1b)
579   PARAM(sw1b.POS, 0)
584580
581   NET_C(sw1b.1, high)
582   //NET_C(sw1b.1, V5)
583   NET_C(sw1b.2, ic_d7.QC)
585584
586    TTL_7410_NAND(ic_d8b, ic_d7.QA, sw1b.Q, ic_c8b.Q)       // would be nand2 for 11 instead of 15 points, need a switch dev!
587585
588    ALIAS(StopG2Q, ic_d8b.Q)
589    ALIAS(score2_1, ic_d7.QA)
590    ALIAS(score2_2, ic_d7.QB)
591    ALIAS(score2_4, ic_d7.QC)
592    ALIAS(score2_8, ic_d7.QD)
593    ALIAS(score2_10, ic_c8b.Q)
594    ALIAS(score2_10Q, ic_c8b.QQ)
586   TTL_7410_NAND(ic_d8b, ic_d7.QA, sw1b.Q, ic_c8b.Q)       // would be nand2 for 11 instead of 15 points, need a switch dev!
595587
596    // ----------------------------------------------------------------------------------------
597    // Score display
598    // ----------------------------------------------------------------------------------------
588   ALIAS(StopG2Q, ic_d8b.Q)
589   ALIAS(score2_1, ic_d7.QA)
590   ALIAS(score2_2, ic_d7.QB)
591   ALIAS(score2_4, ic_d7.QC)
592   ALIAS(score2_8, ic_d7.QD)
593   ALIAS(score2_10, ic_c8b.Q)
594   ALIAS(score2_10Q, ic_c8b.QQ)
599595
600    TTL_74153(ic_d6a, score1_10Q, score1_4, score2_10Q, score2_4, 32H, 64H, low)
601    TTL_74153(ic_d6b, score1_10Q, score1_8, score2_10Q, score2_8, 32H, 64H, low)
596   // ----------------------------------------------------------------------------------------
597   // Score display
598   // ----------------------------------------------------------------------------------------
602599
603    TTL_74153(ic_c6a, high, score1_1, high, score2_1, 32H, 64H, low)
604    TTL_74153(ic_c6b, score1_10Q, score1_2, score2_10Q, score2_2, 32H, 64H, low)
600   TTL_74153(ic_d6a, score1_10Q, score1_4, score2_10Q, score2_4, 32H, 64H, low)
601   TTL_74153(ic_d6b, score1_10Q, score1_8, score2_10Q, score2_8, 32H, 64H, low)
605602
606    TTL_7448(ic_c5, ic_c6a.AY, ic_c6b.AY, ic_d6a.AY, ic_d6b.AY, high, c5_en, high)
603   TTL_74153(ic_c6a, high, score1_1, high, score2_1, 32H, 64H, low)
604   TTL_74153(ic_c6b, score1_10Q, score1_2, score2_10Q, score2_2, 32H, 64H, low)
607605
608    TTL_7404_INVERT(ic_e4b, 16H)
609    TTL_7427_NOR(ic_e5c, ic_e4b.Q, 8H, 4H)
610    ALIAS(scoreFE, ic_e5c.Q)
606   TTL_7448(ic_c5, ic_c6a.AY, ic_c6b.AY, ic_d6a.AY, ic_d6b.AY, high, c5_en, high)
611607
612    TTL_7400_NAND(ic_c3d, 8H, 4H)
613    //TTL_7400_NAND(ic_c3d, 4H, 8H)
614    TTL_7402_NOR(ic_d2b, ic_e4b.Q, ic_c3d.Q)
615    ALIAS(scoreBC, ic_d2b.Q)
608   TTL_7404_INVERT(ic_e4b, 16H)
609   TTL_7427_NOR(ic_e5c, ic_e4b.Q, 8H, 4H)
610   ALIAS(scoreFE, ic_e5c.Q)
616611
617    TTL_7427_NOR(ic_e5b, ic_e4b.Q, 8V, 4V)
618    ALIAS(scoreA, ic_e5b.Q)
612   TTL_7400_NAND(ic_c3d, 8H, 4H)
613   //TTL_7400_NAND(ic_c3d, 4H, 8H)
614   TTL_7402_NOR(ic_d2b, ic_e4b.Q, ic_c3d.Q)
615   ALIAS(scoreBC, ic_d2b.Q)
619616
620    TTL_7410_NAND(ic_e2a, 16H, 8V, 4V)
621    TTL_7404_INVERT(ic_e4a, ic_e2a.Q)
622    ALIAS(scoreGD, ic_e4a.Q)
617   TTL_7427_NOR(ic_e5b, ic_e4b.Q, 8V, 4V)
618   ALIAS(scoreA, ic_e5b.Q)
623619
624    TTL_7404_INVERT(ic_e4c, 16V)
620   TTL_7410_NAND(ic_e2a, 16H, 8V, 4V)
621   TTL_7404_INVERT(ic_e4a, ic_e2a.Q)
622   ALIAS(scoreGD, ic_e4a.Q)
625623
626    TTL_7410_NAND(ic_d4a, ic_e4c.Q, ic_c5.f, scoreFE)
627    TTL_7410_NAND(ic_d5c,      16V, ic_c5.e, scoreFE)
628    TTL_7410_NAND(ic_c4c, ic_e4c.Q, ic_c5.b, scoreBC)
629    TTL_7410_NAND(ic_d5a,      16V, ic_c5.c, scoreBC)
630    TTL_7410_NAND(ic_d4c, ic_e4c.Q, ic_c5.a, scoreA)
631    TTL_7410_NAND(ic_d4b, ic_e4c.Q, ic_c5.g, scoreGD)
632    TTL_7410_NAND(ic_d5b,      16V, ic_c5.d, scoreGD)
624   TTL_7404_INVERT(ic_e4c, 16V)
633625
634    TTL_7430_NAND(ic_d3, ic_d4a, ic_d5c, ic_c4c, ic_d5a, ic_d4c, ic_d4b, ic_d5b, high)
635    ALIAS(score, ic_d3.Q)       //FIXME
626   TTL_7410_NAND(ic_d4a, ic_e4c.Q, ic_c5.f, scoreFE)
627   TTL_7410_NAND(ic_d5c,      16V, ic_c5.e, scoreFE)
628   TTL_7410_NAND(ic_c4c, ic_e4c.Q, ic_c5.b, scoreBC)
629   TTL_7410_NAND(ic_d5a,      16V, ic_c5.c, scoreBC)
630   TTL_7410_NAND(ic_d4c, ic_e4c.Q, ic_c5.a, scoreA)
631   TTL_7410_NAND(ic_d4b, ic_e4c.Q, ic_c5.g, scoreGD)
632   TTL_7410_NAND(ic_d5b,      16V, ic_c5.d, scoreGD)
636633
637    // net
638    TTL_74107(ic_f3b, clk, 256H, 256HQ, high)
639    TTL_7400_NAND(ic_g3b, ic_f3b.QQ, 256H)
640    TTL_7427_NOR(ic_g2b, ic_g3b.Q, vblank, 4V)
641    ALIAS(net, ic_g2b.Q)
634   TTL_7430_NAND(ic_d3, ic_d4a, ic_d5c, ic_c4c, ic_d5a, ic_d4c, ic_d4b, ic_d5b, high)
635   ALIAS(score, ic_d3.Q)       //FIXME
642636
643    // ----------------------------------------------------------------------------------------
644    // video
645    // ----------------------------------------------------------------------------------------
637   // net
638   TTL_74107(ic_f3b, clk, 256H, 256HQ, high)
639   TTL_7400_NAND(ic_g3b, ic_f3b.QQ, 256H)
640   TTL_7427_NOR(ic_g2b, ic_g3b.Q, vblank, 4V)
641   ALIAS(net, ic_g2b.Q)
646642
647    TTL_7402_NOR(ic_g1b, hvidQ, vvidQ)
648    TTL_7425_NOR(ic_f2b, ic_g1b.Q, pad1, pad2, net)
649    TTL_7404_INVERT(ic_e4e, ic_f2b.Q)
650    ALIAS(video, ic_e4e.Q)
643   // ----------------------------------------------------------------------------------------
644   // video
645   // ----------------------------------------------------------------------------------------
651646
652    TTL_7486_XOR(ic_a4d, hsyncQ, vsyncQ)
653    TTL_7404_INVERT(ic_e4f, ic_a4d.Q)
647   TTL_7402_NOR(ic_g1b, hvidQ, vvidQ)
648   TTL_7425_NOR(ic_f2b, ic_g1b.Q, pad1, pad2, net)
649   TTL_7404_INVERT(ic_e4e, ic_f2b.Q)
650   ALIAS(video, ic_e4e.Q)
654651
655    RES(RV1, RES_K(1))
656    RES(RV2, RES_K(1.2))
657    RES(RV3, RES_K(22))
658    NET_C(video, RV1.1)
659    NET_C(score, RV2.1)
660    NET_C(ic_e4f.Q, RV3.1)
661    NET_C(RV1.2, RV2.2)
662    NET_C(RV2.2, RV3.2)
652   TTL_7486_XOR(ic_a4d, hsyncQ, vsyncQ)
653   TTL_7404_INVERT(ic_e4f, ic_a4d.Q)
663654
664    ALIAS(videomix, RV3.2)
655   RES(RV1, RES_K(1))
656   RES(RV2, RES_K(1.2))
657   RES(RV3, RES_K(22))
658   NET_C(video, RV1.1)
659   NET_C(score, RV2.1)
660   NET_C(ic_e4f.Q, RV3.1)
661   NET_C(RV1.2, RV2.2)
662   NET_C(RV2.2, RV3.2)
665663
664   ALIAS(videomix, RV3.2)
665
666666NETLIST_END()
667667
668668class pong_state : public driver_device
r29404r29405
725725   INCLUDE(pong_schematics)
726726
727727   //NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
728    //NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
728   //NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
729729
730730NETLIST_END()
731731
r29404r29405
733733
734734static NETLIST_START(pongd)
735735
736    INCLUDE(pongdoubles)
736   INCLUDE(pongdoubles)
737737
738    //NETDEV_ANALOG_CALLBACK(sound_cb, AUDIO, pong_state, sound_cb, "")
739    //NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
738   //NETDEV_ANALOG_CALLBACK(sound_cb, AUDIO, pong_state, sound_cb, "")
739   //NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
740740
741741NETLIST_END()
742742#endif
r29404r29405
744744#ifdef TEST_SOUND
745745static NETLIST_START(test)
746746
747    /*
748     * Astable multivibrator using two 7400 gates (or inverters)
749     *
750     */
747   /*
748    * Astable multivibrator using two 7400 gates (or inverters)
749    *
750    */
751751
752    /* Standard stuff */
752   /* Standard stuff */
753753
754    SOLVER(Solver)
755    PARAM(Solver.FREQ, 48000)
754   SOLVER(Solver)
755   PARAM(Solver.FREQ, 48000)
756756
757    //NETDEV_SOUND_IN(SND_IN)
758    //PARAM(SND_IN.CHAN0, "tin.IN")
757   //NETDEV_SOUND_IN(SND_IN)
758   //PARAM(SND_IN.CHAN0, "tin.IN")
759759
760    ANALOG_INPUT(tin, 0)
760   ANALOG_INPUT(tin, 0)
761761
762    // astable NAND Multivibrator
763    RES(R1, 1000)
764    CAP(C1, 1e-6)
765    TTL_7400_NAND(n1,R1.1,R1.1)
766    TTL_7400_NAND(n2,R1.2,R1.2)
767    NET_C(n1.Q, R1.2)
768    NET_C(n2.Q, C1.1)
769    NET_C(C1.2, R1.1)
770    LOG(log1, n2.Q)
762   // astable NAND Multivibrator
763   RES(R1, 1000)
764   CAP(C1, 1e-6)
765   TTL_7400_NAND(n1,R1.1,R1.1)
766   TTL_7400_NAND(n2,R1.2,R1.2)
767   NET_C(n1.Q, R1.2)
768   NET_C(n2.Q, C1.1)
769   NET_C(C1.2, R1.1)
770   LOG(log1, n2.Q)
771771
772772#if 0
773    NETDEV_SOUND_OUT(CH0, 0)
774    NET_C(CH0.IN, n2.Q)
773   NETDEV_SOUND_OUT(CH0, 0)
774   NET_C(CH0.IN, n2.Q)
775775
776    NETDEV_SOUND_OUT(CH1, 1)
777    NET_C(CH1.IN, tin.Q)
776   NETDEV_SOUND_OUT(CH1, 1)
777   NET_C(CH1.IN, tin.Q)
778778#endif
779779
780780NETLIST_END()
r29404r29405
809809
810810static INPUT_PORTS_START( pong )
811811   PORT_START( "PADDLE0" ) /* fake input port for player 1 paddle */
812    PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0)   NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot0")
812   PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0)   NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot0")
813813
814814   PORT_START( "PADDLE1" ) /* fake input port for player 2 paddle */
815    PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1")
815   PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1")
816816
817817   PORT_START("IN0") /* fake as well */
818818   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )     NETLIST_LOGIC_PORT_CHANGED("maincpu", "coinsw")
r29404r29405
821821   PORT_DIPSETTING(    0x00, "11" )
822822   PORT_DIPSETTING(    0x06, "15" )
823823
824    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )  PORT_NAME("Antenna") NETLIST_LOGIC_PORT_CHANGED("maincpu", "antenna")
824   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )  PORT_NAME("Antenna") NETLIST_LOGIC_PORT_CHANGED("maincpu", "antenna")
825825
826826   PORT_START("VR1")
827827   PORT_ADJUSTER( 50, "VR1 - 50k, Paddle 1 adjustment" )   NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr0")
r29404r29405
833833#if PONGD
834834static INPUT_PORTS_START( pongd )
835835#if 0
836    PORT_START( "PADDLE0" ) /* fake input port for player 1 paddle */
837    PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0)   NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot0")
836   PORT_START( "PADDLE0" ) /* fake input port for player 1 paddle */
837   PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0)   NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot0")
838838
839    PORT_START( "PADDLE1" ) /* fake input port for player 2 paddle */
840    PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1")
839   PORT_START( "PADDLE1" ) /* fake input port for player 2 paddle */
840   PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1")
841841#endif
842842
843    PORT_START("IN0") /* fake as well */
844    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )     NETLIST_LOGIC_PORT_CHANGED("maincpu", "coinsw")
845    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )     NETLIST_LOGIC_PORT_CHANGED("maincpu", "startsw")
843   PORT_START("IN0") /* fake as well */
844   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )     NETLIST_LOGIC_PORT_CHANGED("maincpu", "coinsw")
845   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )     NETLIST_LOGIC_PORT_CHANGED("maincpu", "startsw")
846846
847847#if 0
848    PORT_DIPNAME( 0x06, 0x00, "Game Won" )          PORT_DIPLOCATION("SW1A:1,SW1B:1") PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_SWITCH)
849    PORT_DIPSETTING(    0x00, "11" )
850    PORT_DIPSETTING(    0x06, "15" )
848   PORT_DIPNAME( 0x06, 0x00, "Game Won" )          PORT_DIPLOCATION("SW1A:1,SW1B:1") PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_SWITCH)
849   PORT_DIPSETTING(    0x00, "11" )
850   PORT_DIPSETTING(    0x06, "15" )
851851
852    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )  PORT_NAME("Antenna") NETLIST_LOGIC_PORT_CHANGED("maincpu", "antenna")
852   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )  PORT_NAME("Antenna") NETLIST_LOGIC_PORT_CHANGED("maincpu", "antenna")
853853
854    PORT_START("VR1")
855    PORT_ADJUSTER( 50, "VR1 - 50k, Paddle 1 adjustment" )   NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr0")
856    PORT_START("VR2")
857    PORT_ADJUSTER( 50, "VR2 - 50k, Paddle 2 adjustment" )   NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr1")
854   PORT_START("VR1")
855   PORT_ADJUSTER( 50, "VR1 - 50k, Paddle 1 adjustment" )   NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr0")
856   PORT_START("VR2")
857   PORT_ADJUSTER( 50, "VR2 - 50k, Paddle 2 adjustment" )   NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr1")
858858#endif
859859INPUT_PORTS_END
860860
r29404r29405
863863static MACHINE_CONFIG_START( pong, pong_state )
864864
865865   /* basic machine hardware */
866    MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
867    MCFG_NETLIST_SETUP(pong)
866   MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
867   MCFG_NETLIST_SETUP(pong)
868868
869    MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr0", "ic_b9_R.R")
870    MCFG_NETLIST_ANALOG_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
871    MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr1", "ic_a9_R.R")
872    MCFG_NETLIST_ANALOG_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
873    MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "ic_b9_POT.DIAL")
874    MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "ic_a9_POT.DIAL")
875    MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "sw1a.POS", 0, 0x01)
876    MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "sw1b.POS", 0, 0x01)
877    MCFG_NETLIST_LOGIC_INPUT("maincpu", "coinsw", "coinsw.POS", 0, 0x01)
878    MCFG_NETLIST_LOGIC_INPUT("maincpu", "antenna", "antenna.IN", 0, 0x01)
869   MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr0", "ic_b9_R.R")
870   MCFG_NETLIST_ANALOG_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
871   MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr1", "ic_a9_R.R")
872   MCFG_NETLIST_ANALOG_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
873   MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "ic_b9_POT.DIAL")
874   MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "ic_a9_POT.DIAL")
875   MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "sw1a.POS", 0, 0x01)
876   MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "sw1b.POS", 0, 0x01)
877   MCFG_NETLIST_LOGIC_INPUT("maincpu", "coinsw", "coinsw.POS", 0, 0x01)
878   MCFG_NETLIST_LOGIC_INPUT("maincpu", "antenna", "antenna.IN", 0, 0x01)
879879
880    MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "snd0", "sound", pong_state, sound_cb, "")
881    MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "vid0", "videomix", fixedfreq_device, update_vid, "fixfreq")
880   MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "snd0", "sound", pong_state, sound_cb, "")
881   MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "vid0", "videomix", fixedfreq_device, update_vid, "fixfreq")
882882
883883   /* video hardware */
884884
r29404r29405
890890   MCFG_SPEAKER_STANDARD_MONO("mono")
891891   MCFG_SOUND_ADD("dac", DAC, 48000)
892892#ifdef TEST_SOUND
893    MCFG_SOUND_ROUTE_EX(0, "snd_test", 1.0, 0)
893   MCFG_SOUND_ROUTE_EX(0, "snd_test", 1.0, 0)
894894#else
895    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
895   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
896896#endif
897897
898898#ifdef TEST_SOUND
899    MCFG_SOUND_ADD("snd_test", NETLIST_SOUND, 48000)
900    MCFG_NETLIST_SETUP(test)
901    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
899   MCFG_SOUND_ADD("snd_test", NETLIST_SOUND, 48000)
900   MCFG_NETLIST_SETUP(test)
901   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
902902
903    MCFG_NETLIST_STREAM_INPUT("snd_test", 0, "tin.IN")
904    MCFG_NETLIST_ANALOG_MULT_OFFSET(0.001, 0.0)
903   MCFG_NETLIST_STREAM_INPUT("snd_test", 0, "tin.IN")
904   MCFG_NETLIST_ANALOG_MULT_OFFSET(0.001, 0.0)
905905
906    //MCFG_NETLIST_STREAM_OUTPUT("snd_test", 0, "tin.Q", 100)
907    MCFG_NETLIST_STREAM_OUTPUT("snd_test", 0, "n2.Q")
908    MCFG_NETLIST_ANALOG_MULT_OFFSET(1000.0, 0.0)
909    MCFG_NETLIST_STREAM_OUTPUT("snd_test", 1, "tin.Q")
910    MCFG_NETLIST_ANALOG_MULT_OFFSET(1000.0, 0.0)
906   //MCFG_NETLIST_STREAM_OUTPUT("snd_test", 0, "tin.Q", 100)
907   MCFG_NETLIST_STREAM_OUTPUT("snd_test", 0, "n2.Q")
908   MCFG_NETLIST_ANALOG_MULT_OFFSET(1000.0, 0.0)
909   MCFG_NETLIST_STREAM_OUTPUT("snd_test", 1, "tin.Q")
910   MCFG_NETLIST_ANALOG_MULT_OFFSET(1000.0, 0.0)
911911
912912#endif
913913
r29404r29405
916916static MACHINE_CONFIG_DERIVED( pongf, pong )
917917
918918   /* basic machine hardware */
919    MCFG_DEVICE_MODIFY("maincpu")
919   MCFG_DEVICE_MODIFY("maincpu")
920920   MCFG_NETLIST_SETUP(pong_fast)
921921
922922MACHINE_CONFIG_END
r29404r29405
924924#if PONGD
925925static MACHINE_CONFIG_START( pongd, pong_state )
926926
927    /* basic machine hardware */
928    MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
929    MCFG_NETLIST_SETUP(pongd)
927   /* basic machine hardware */
928   MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
929   MCFG_NETLIST_SETUP(pongd)
930930
931931#if 0
932    MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr0", "ic_b9_R.R")
933    MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
934    MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr1", "ic_a9_R.R")
935    MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
936    MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "ic_b9_POT.DIAL")
937    MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "ic_a9_POT.DIAL")
932   MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr0", "ic_b9_R.R")
933   MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
934   MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr1", "ic_a9_R.R")
935   MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
936   MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "ic_b9_POT.DIAL")
937   MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "ic_a9_POT.DIAL")
938938#endif
939    MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "DIPSW1.POS", 0, 0x01)
940    MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "DIPSW2.POS", 0, 0x01)
941    MCFG_NETLIST_LOGIC_INPUT("maincpu", "coinsw", "COIN_SW.POS", 0, 0x01)
942    MCFG_NETLIST_LOGIC_INPUT("maincpu", "startsw", "START_SW.POS", 0, 0x01)
939   MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "DIPSW1.POS", 0, 0x01)
940   MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "DIPSW2.POS", 0, 0x01)
941   MCFG_NETLIST_LOGIC_INPUT("maincpu", "coinsw", "COIN_SW.POS", 0, 0x01)
942   MCFG_NETLIST_LOGIC_INPUT("maincpu", "startsw", "START_SW.POS", 0, 0x01)
943943#if 0
944    MCFG_NETLIST_LOGIC_INPUT("maincpu", "antenna", "antenna.IN", 0, 0x01)
944   MCFG_NETLIST_LOGIC_INPUT("maincpu", "antenna", "antenna.IN", 0, 0x01)
945945#endif
946946
947    MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "snd0", "AUDIO", pong_state, sound_cb, "")
948    MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "vid0", "videomix", fixedfreq_device, update_vid, "fixfreq")
947   MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "snd0", "AUDIO", pong_state, sound_cb, "")
948   MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "vid0", "videomix", fixedfreq_device, update_vid, "fixfreq")
949949
950    /* video hardware */
950   /* video hardware */
951951
952    //MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_ntsc720)
953    //MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_pongX2)
954    MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_pongd)
952   //MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_ntsc720)
953   //MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_pongX2)
954   MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_pongd)
955955
956    /* sound hardware */
957    MCFG_SPEAKER_STANDARD_MONO("mono")
958    MCFG_SOUND_ADD("dac", DAC, 48000)
959    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
956   /* sound hardware */
957   MCFG_SPEAKER_STANDARD_MONO("mono")
958   MCFG_SOUND_ADD("dac", DAC, 48000)
959   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
960960
961961MACHINE_CONFIG_END
962962
r29404r29405
970970
971971ROM_START( pong ) /* dummy to satisfy game entry*/
972972   ROM_REGION( 0x10000, "maincpu", 0 ) /* enough for netlist */
973    ROM_LOAD( "pong.netlist", 0x000000, 0x00457f, CRC(72d5e4fe) SHA1(7bb15828223c34915c5e2869dd7917532a4bb7b4) )
973   ROM_LOAD( "pong.netlist", 0x000000, 0x00457f, CRC(72d5e4fe) SHA1(7bb15828223c34915c5e2869dd7917532a4bb7b4) )
974974ROM_END
975975
976976ROM_START( pongf ) /* dummy to satisfy game entry*/
r29404r29405
979979
980980#if PONGD
981981ROM_START( pongd ) /* dummy to satisfy game entry*/
982    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
982   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
983983ROM_END
984984#endif
985985
trunk/src/mame/drivers/popobear.c
r29404r29405
110110   required_shared_ptr<UINT16> m_vregs;
111111   optional_device<gfxdecode_device> m_gfxdecode;
112112   required_device<palette_device> m_palette;
113   
113
114114   UINT16* m_vram;
115115   UINT16* m_vram_rearranged;
116116
r29404r29405
661661   MCFG_SPEAKER_STANDARD_MONO("mono")
662662
663663   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
664   
664
665665   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_42MHz/16)  // XTAL CORRECT, DIVISOR GUESSED
666666   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
667667
trunk/src/mame/drivers/gaiden.c
r29404r29405
15111511   int i;
15121512   UINT8 *ROM = memregion("maincpu")->base();
15131513   size_t size = memregion("maincpu")->bytes();
1514   
1514
15151515   {
15161516      dynamic_buffer buffer(size);
15171517
trunk/src/mame/drivers/astrof.c
r29404r29405
13111311
13121312DRIVER_INIT_MEMBER(astrof_state,acombat3)
13131313{
1314
13151314   /* set up protection handlers */
13161315   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this));
13171316   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this));
trunk/src/mame/drivers/kopunch.c
r29404r29405
11/********************************************************
22
33  KO Punch (c) 1981 Sega
4 
4
55  XTAL: ?
66  CPU: 8085 (proof: it uses SIM opcode)
77  Other: 4 x i8255 for all I/O
r29404r29405
1313
1414
1515*********************************************************
16 
16
1717  This is a simple boxing bag game, but for visual feedback
1818  it has a small CRT instead of LEDs or a dial.
19 
19
2020  Insert coin, select your weightclass (7 buttons on cab), and punch.
21 
21
2222  Heavyweight   - 300K
2323  Middleweight  - 260K
2424  Welterweight  - 230K
trunk/src/mame/drivers/segaybd.c
r29404r29405
11891189   MCFG_SCREEN_PALETTE("palette")
11901190
11911191   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1192   
1192
11931193   MCFG_SEGA_SYS16B_SPRITES_ADD("bsprites")
11941194   MCFG_SEGA_YBOARD_SPRITES_ADD("ysprites")
11951195   MCFG_SEGAIC16VID_ADD("segaic16vid")
trunk/src/mame/drivers/igspoker.c
r29404r29405
9090   required_shared_ptr<UINT8> m_fg_color_ram;
9191   required_device<gfxdecode_device> m_gfxdecode;
9292   required_device<screen_device> m_screen;
93   required_device<palette_device> m_palette;   
93   required_device<palette_device> m_palette;
9494   int m_nmi_enable;
9595   int m_bg_enable;
9696   int m_hopper;
trunk/src/mame/drivers/segaorun.c
r29404r29405
404404   const int center = 0x80;
405405   const int right_limit = 0xe0;
406406   const int tolerance = 2;
407   
407
408408   if (pos <= left_limit + tolerance)
409409      ret ^= 0x20;
410410   else if (pos >= center - tolerance && pos <= center + tolerance)
r29404r29405
428428
429429   if (data == 0)
430430      return;
431   
431
432432   m_bankmotor_delta = 8 - data;
433   
433
434434   // convert to speed and direction for output
435435   if (data < 8)
436436   {
r29404r29405
662662               next_scanline = 65;
663663               m_subcpu->set_input_line(4, CLEAR_LINE);
664664               break;
665           
665
666666            default:
667667               break;
668668         }
r29404r29405
688688   const int speed = 100;
689689   const int left_limit = 0x2000;
690690   const int right_limit = 0xe000;
691   
691
692692   m_bankmotor_pos += speed * m_bankmotor_delta;
693693   if (m_bankmotor_pos <= left_limit)
694694      m_bankmotor_pos = left_limit;
r29404r29405
729729
730730      case 0x60/2:
731731         return watchdog_reset_r(space, 0);
732     
732
733733      default:
734734         break;
735735   }
r29404r29405
781781      case 0x70/2:
782782         m_sprites->draw_write(space, offset, data, mem_mask);
783783         return;
784     
784
785785      default:
786786         break;
787787   }
r29404r29405
814814         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
815815         return ioport(ports[m_adc_select])->read_safe(0x0010);
816816      }
817     
817
818818      default:
819819         break;
820820   }
r29404r29405
866866      case 0x3020/2:
867867         // ADC trigger
868868         return;
869     
869
870870      default:
871871         break;
872872   }
r29404r29405
12101210   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224)
12111211   MCFG_SCREEN_UPDATE_DRIVER(segaorun_state, screen_update_outrun)
12121212   MCFG_SCREEN_PALETTE("palette")
1213   
1213
12141214   MCFG_SEGAIC16VID_ADD("segaic16vid")
12151215   MCFG_SEGAIC16VID_GFXDECODE("gfxdecode")
12161216   MCFG_SEGAIC16_ROAD_ADD("segaic16road")
trunk/src/mame/drivers/mazerbla.c
r29404r29405
15051505
15061506   MCFG_PALETTE_ADD("palette", 256+1)
15071507   MCFG_PALETTE_INIT_OWNER(mazerbla_state, mazerbla)
1508   
1508
15091509   /* sound hardware */
15101510MACHINE_CONFIG_END
15111511
trunk/src/mame/drivers/acefruit.c
r29404r29405
3434   required_shared_ptr<UINT8> m_spriteram;
3535   required_device<gfxdecode_device> m_gfxdecode;
3636   required_device<screen_device> m_screen;
37   required_device<palette_device> m_palette;   
37   required_device<palette_device> m_palette;
3838   emu_timer *m_refresh_timer;
3939   DECLARE_WRITE8_MEMBER(acefruit_colorram_w);
4040   DECLARE_WRITE8_MEMBER(acefruit_coin_w);
trunk/src/mame/drivers/itgambl3.c
r29404r29405
483483   ROM_LOAD( "xfivejs.u29", 0x00000, 0x80000, CRC(67d51cb4) SHA1(9182a63473a32a9ad91a7a6a47d5a5d965e3cb03) )
484484ROM_END
485485
486ROM_START( queenotg )   
486ROM_START( queenotg )
487487   ROM_REGION( 0x1000000, "maincpu", 0 )   /* all the program code is in here */
488488   ROM_LOAD( "queenotg_m30624fgafp.mcu", 0x00000, 0x4000, NO_DUMP )
489489
490   ROM_REGION( 0x200000, "gfx1", 0 )   
490   ROM_REGION( 0x200000, "gfx1", 0 )
491491   ROM_LOAD( "u22.bin", 0x000000, 0x200000, CRC(b9bd0fac) SHA1(ce6a6d85e9ae47860cc6d270d8d563df58146b74) )
492492
493   ROM_REGION( 0x80000, "oki", 0 )
493   ROM_REGION( 0x80000, "oki", 0 )
494494   ROM_LOAD( "u3.bin", 0x00000, 0x20000, CRC(f318927e) SHA1(f47ec9eb995b28403066fb2b66aad98c044676bc) )
495495ROM_END
496496
497497
498ROM_START( ejollyx9 )   
498ROM_START( ejollyx9 )
499499   ROM_REGION( 0x1000000, "maincpu", 0 )   /* all the program code is in here */
500500   ROM_LOAD( "ejollyx9_m30624fgafp.mcu", 0x00000, 0x4000, NO_DUMP )
501501
502   ROM_REGION( 0x200000, "gfx1", 0 )   
502   ROM_REGION( 0x200000, "gfx1", 0 )
503503   ROM_LOAD( "nm.u22", 0x000000, 0x200000, CRC(86b86a98) SHA1(cff4e79aaacad79e17e4dc52f2c14755424a2567) )
504504
505   ROM_REGION( 0x80000, "oki", 0 )
505   ROM_REGION( 0x80000, "oki", 0 )
506506   ROM_LOAD( "nm.u3", 0x00000, 0x80000, CRC(0529696b) SHA1(7e182051baae0b7de1f5a2c18f1b68b695f339d8) )
507507ROM_END
508508
r29404r29405
518518GAME( 200?, x5jokers, 0,      itgambl3, itgambl3, driver_device, 0,   ROT0, "Electronic Projects",   "X Five Jokers (Version 1.12)",   GAME_IS_SKELETON )
519519GAME( 200?, queenotg, 0,      itgambl3, itgambl3, driver_device, 0,   ROT0, "<unknown>",             "Queen of the Games",             GAME_IS_SKELETON )
520520GAME( 200?, ejollyx9, 0,      itgambl3, itgambl3, driver_device, 0,   ROT0, "Solar Games",           "Euro Jolly X9",                  GAME_IS_SKELETON )
521
trunk/src/mame/drivers/88games.c
r29404r29405
372372   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
373373
374374   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
375   
375
376376   MCFG_K052109_ADD("k052109", _88games_k052109_intf)
377377   MCFG_K052109_GFXDECODE("gfxdecode")
378   MCFG_K052109_PALETTE("palette")   
378   MCFG_K052109_PALETTE("palette")
379379   MCFG_K051960_ADD("k051960", _88games_k051960_intf)
380380   MCFG_K051960_GFXDECODE("gfxdecode")
381   MCFG_K051960_PALETTE("palette")   
381   MCFG_K051960_PALETTE("palette")
382382   MCFG_K051316_ADD("k051316", _88games_k051316_intf)
383383   MCFG_K051316_GFXDECODE("gfxdecode")
384384   MCFG_K051316_PALETTE("palette")
trunk/src/mame/drivers/a1supply.c
r29404r29405
11/***************************************************************************
2
2
33 A-1 Supply discrete hardware games
4
4
55 TV 21 (197?)
66 TV 21 III (197?)
77 TV Poker (197?)
88
9 These actually seem to use Intel 4040 as a CPU + a lot of discrete circuitry...
9 These actually seem to use Intel 4040 as a CPU + a lot of discrete circuitry...
1010 to be checked!
1111
1212***************************************************************************/
r29404r29405
4848public:
4949   a1supply_state(const machine_config &mconfig, device_type type, const char *tag)
5050   : driver_device(mconfig, type, tag),
51     m_maincpu(*this, "maincpu"),
52     m_video(*this, "fixfreq")
51      m_maincpu(*this, "maincpu"),
52      m_video(*this, "fixfreq")
5353   {
5454   }
55   
55
5656   // devices
5757   required_device<netlist_mame_device_t> m_maincpu;
5858   required_device<fixedfreq_device> m_video;
59   
59
6060protected:
61   
61
6262   // driver_device overrides
6363   virtual void machine_start();
6464   virtual void machine_reset();
65   
65
6666   virtual void video_start();
67   
67
6868private:
69   
69
7070};
7171
7272
7373static NETLIST_START(a1supply)
7474   SOLVER(Solver, 48000)
75//   PARAM(Solver.FREQ, 48000)
75//  PARAM(Solver.FREQ, 48000)
7676   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
7777
7878   // schematics
7979   //...
8080
81//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
82//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
81//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
82//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8383NETLIST_END()
8484
8585
r29404r29405
109109
110110
111111/***************************************************************************
112
112
113113 Game driver(s)
114
114
115115 ***************************************************************************/
116116
117117
trunk/src/mame/drivers/goldstar.c
r29404r29405
155155   output_set_lamp_value(4, (data >> 4) & 1);  /* Stop 2 / Big / Bonus */
156156   output_set_lamp_value(5, (data >> 5) & 1);  /* Start / Stop All / Card 4 */
157157
158//   popmessage("lamps: %02X", data);
158//  popmessage("lamps: %02X", data);
159159}
160160
161161WRITE8_MEMBER(goldstar_state::cb3_lamps_w)
r29404r29405
176176   output_set_lamp_value(4, (data >> 4) & 1);  /* Stop 3 / Small / Info */
177177   output_set_lamp_value(5, (data >> 5) & 1);  /* Start / Stop All */
178178
179//   popmessage("lamps: %02X", data);
179//  popmessage("lamps: %02X", data);
180180}
181181
182182
r29404r29405
244244
245245   AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
246246   AM_RANGE(0xf840, 0xf840) AM_DEVWRITE("aysnd", ay8910_device, address_w)
247   AM_RANGE(0xf850, 0xf850) AM_WRITE(cb3_lamps_w)      /* Control Set 1 lamps */
248   AM_RANGE(0xf860, 0xf860) AM_WRITE(cb3_lamps_w)      /* Control Set 2 lamps */
247   AM_RANGE(0xf850, 0xf850) AM_WRITE(cb3_lamps_w)      /* Control Set 1 lamps */
248   AM_RANGE(0xf860, 0xf860) AM_WRITE(cb3_lamps_w)      /* Control Set 2 lamps */
249249   AM_RANGE(0xf870, 0xf870) AM_DEVWRITE("snsnd", sn76489_device, write)    /* guess... device is initialized, but doesn't seems to be used.*/
250250ADDRESS_MAP_END
251251
r29404r29405
296296   AM_RANGE(0x0000, 0xb7ff) AM_ROM
297297   AM_RANGE(0xb800, 0xbfff) AM_RAM AM_SHARE("nvram")
298298   AM_RANGE(0xc000, 0xc7ff) AM_ROM
299   
299
300300   /* Video RAM and reels stuff are there just as placeholder, and obviously in wrong offset */
301301   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(goldstar_fg_vidram_w ) AM_SHARE("fg_vidram")
302302   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(goldstar_fg_atrram_w ) AM_SHARE("fg_atrram")
r29404r29405
307307   AM_RANGE(0xf080, 0xf0bf) AM_RAM AM_SHARE("reel2_scroll")
308308   AM_RANGE(0xf0c0, 0xf0ff) AM_RAM AM_SHARE("reel3_scroll")
309309
310    /* Not really PPI's... They are emulated/simulated inside the CPLDs */
310   /* Not really PPI's... They are emulated/simulated inside the CPLDs */
311311   AM_RANGE(0xf600, 0xf603) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)    /* Input Ports */
312312   AM_RANGE(0xf610, 0xf613) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)    /* Input Ports */
313313   AM_RANGE(0xf620, 0xf623) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write)    /* Input/Output Ports */
314314
315315   AM_RANGE(0xf630, 0xf630) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w)
316316   AM_RANGE(0xf640, 0xf640) AM_DEVWRITE("aysnd", ay8910_device, address_w)
317   AM_RANGE(0xf650, 0xf650) AM_WRITENOP   // AM_WRITE(output_w)  // unknown register: 0x3e
318   AM_RANGE(0xf660, 0xf660) AM_WRITENOP   // AM_WRITE(output_w)  // unknown register: 0x3e
317   AM_RANGE(0xf650, 0xf650) AM_WRITENOP    // AM_WRITE(output_w)  // unknown register: 0x3e
318   AM_RANGE(0xf660, 0xf660) AM_WRITENOP    // AM_WRITE(output_w)  // unknown register: 0x3e
319319   AM_RANGE(0xf670, 0xf670) AM_DEVWRITE("snsnd", sn76489_device, write)    /* guess... device is initialized, but doesn't seems to be used.*/
320320
321321   AM_RANGE(0xf800, 0xffff) AM_RAM
r29404r29405
17141714
17151715static INPUT_PORTS_START( goldstar )
17161716   PORT_START("IN0")
1717   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   // appear in the input test but seems that lack of functions.
1718   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   // appear in the input test but seems that lack of functions.
1717   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    // appear in the input test but seems that lack of functions.
1718   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )    // appear in the input test but seems that lack of functions.
17191719   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V) PORT_NAME("Bet Red / 2")
17201720   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Stop 3 / Small / 1 / Info")
17211721   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B) PORT_NAME("Bet Blue / D-UP / 3")
r29404r29405
65076507   /* basic machine hardware */
65086508   MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK)
65096509   MCFG_CPU_PROGRAM_MAP(goldstar_map)
6510//   MCFG_CPU_PROGRAM_MAP(nfm_map)
6510//  MCFG_CPU_PROGRAM_MAP(nfm_map)
65116511   MCFG_CPU_IO_MAP(goldstar_readport)
6512//   MCFG_CPU_IO_MAP(unkch_portmap)
6512//  MCFG_CPU_IO_MAP(unkch_portmap)
65136513   MCFG_CPU_VBLANK_INT_DRIVER("screen", goldstar_state,  irq0_line_hold)
65146514
65156515   /* video hardware */
r29404r29405
77037703   ROM_CONTINUE( 0x0000, 0x08000) /* Discarding 2nd quarter 0xff filled*/
77047704   ROM_CONTINUE( 0x0000, 0x08000) /* Discarding 3nd quarter 0xff filled*/
77057705
7706   ROM_REGION( 0x40000, "oki", 0 ) // Audio ADPCM
7706   ROM_REGION( 0x40000, "oki", 0 ) // Audio ADPCM
77077707   ROM_LOAD( "27c1000.u57",  0x0000, 0x20000, CRC(9d58960f) SHA1(c68edf95743e146398aabf6b9617d18e1f9bf25b) )
77087708ROM_END
77097709
77107710
77117711/*
7712   Super Nove by Playmark
7713   
7714   bp 2db
7715   the next call ($0C33) hangs the game
7716   since there are ascii strings there
7717   instead of code.
7718   
7712    Super Nove by Playmark
7713
7714    bp 2db
7715    the next call ($0C33) hangs the game
7716    since there are ascii strings there
7717    instead of code.
7718
77197719*/
77207720ROM_START( super9 )
77217721   ROM_REGION( 0x10000, "maincpu", 0 )
77227722   ROM_LOAD( "27e010.30",       0x0000, 0x10000, CRC(1aaea8d3) SHA1(71395a6d74a7cd55606daa57d17ff4628aa5f577) )
7723   ROM_IGNORE(                          0x10000)   /* Discarding 2nd half */
7724//   ROM_LOAD( "27e010.30",       0x0000, 0x10000, CRC(1aaea8d3) SHA1(71395a6d74a7cd55606daa57d17ff4628aa5f577) )
7725//   ROM_CONTINUE(                0x0000, 0x10000)   /* Discarding 1st half */
7726     
7723   ROM_IGNORE(                          0x10000)   /* Discarding 2nd half */
7724//  ROM_LOAD( "27e010.30",       0x0000, 0x10000, CRC(1aaea8d3) SHA1(71395a6d74a7cd55606daa57d17ff4628aa5f577) )
7725//  ROM_CONTINUE(                0x0000, 0x10000)   /* Discarding 1st half */
7726
77277727   ROM_REGION( 0x20000, "gfx1", 0 )
77287728   ROM_LOAD( "nearcpu.bin",      0x00000, 0x20000, CRC(643cff6f) SHA1(305ca9182c3f6d69e09be38b854b3d7bdfa75439) )
77297729
r29404r29405
77327732   ROM_CONTINUE( 0x0000, 0x08000) // Discarding 1nd quarter 0xff filled
77337733   ROM_CONTINUE( 0x0000, 0x08000) // Discarding 2nd quarter 0xff filled
77347734   ROM_CONTINUE( 0x0000, 0x08000) // Discarding 3nd quarter 0xff filled
7735   
7735
77367736   ROM_REGION( 0x40000, "oki", 0 ) /* Audio ADPCM */
77377737   ROM_LOAD( "27c1001.27",  0x0000, 0x20000, CRC(9d58960f) SHA1(c68edf95743e146398aabf6b9617d18e1f9bf25b) )
77387738ROM_END
r29404r29405
78727872   ROM_LOAD( "4.5h", 0x06000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) )
78737873
78747874   ROM_REGION( 0x0200, "proms", 0 )
7875   ROM_LOAD_NIB_LOW(  "n82s129.13g",  0x0000, 0x0100, CRC(59ac98e4) SHA1(5fc0f1a48c49c956cdb8826e20663dc57a9175e4) )   // 1st bank colors, low 4 bits.
7876   ROM_LOAD_NIB_HIGH( "n82s129.14g",  0x0000, 0x0100, CRC(0d8f35bd) SHA1(0c2a0145cdaaf9beabdce241731a36b0c65f18a2) )   // 1st bank colors, high 4 bits.
7877   ROM_LOAD(          "dm74s288.13d", 0x0080, 0x0020, CRC(77a85e21) SHA1(3b41e0ab7cc55c5d78914d23e8289383f5bd5654) )   // 2nd bank colors
7875   ROM_LOAD_NIB_LOW(  "n82s129.13g",  0x0000, 0x0100, CRC(59ac98e4) SHA1(5fc0f1a48c49c956cdb8826e20663dc57a9175e4) )   // 1st bank colors, low 4 bits.
7876   ROM_LOAD_NIB_HIGH( "n82s129.14g",  0x0000, 0x0100, CRC(0d8f35bd) SHA1(0c2a0145cdaaf9beabdce241731a36b0c65f18a2) )   // 1st bank colors, high 4 bits.
7877   ROM_LOAD(          "dm74s288.13d", 0x0080, 0x0020, CRC(77a85e21) SHA1(3b41e0ab7cc55c5d78914d23e8289383f5bd5654) )   // 2nd bank colors
78787878ROM_END
78797879
78807880
r29404r29405
78857885  5x 8 DIP switches.
78867886  1x 12 MHz xtal.
78877887
7888  ROM 3v202 is the prg.
7888  ROM 3v202 is the prg.
78897889*/
78907890ROM_START( cb3e )
78917891   ROM_REGION( 0x10000, "maincpu", 0 )
r29404r29405
78997899
79007900   ROM_REGION( 0x0200, "proms", 0 )
79017901   ROM_LOAD( "82s147.u1",      0x00000, 0x0100, CRC(d4eaa276) SHA1(b6598ee64ac3d41ca979c8667de8576cfb304451) )
7902   ROM_CONTINUE(               0x00000, 0x0100)   // 2nd half has the data.
7902   ROM_CONTINUE(               0x00000, 0x0100)    // 2nd half has the data.
79037903ROM_END
79047904
79057905
r29404r29405
1161411614   ROM_LOAD( "wincherrya.ic9",  0x00000, 0x08000, CRC(919bd692) SHA1(1aeb66f1e4555b731858833445000593e613f74d) )
1161511615
1161611616   ROM_REGION( 0x0200, "proms", 0 )
11617   ROM_LOAD( "am27c29pc",      0x00000, 0x0200, BAD_DUMP CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) )   // borrowed from other game.
11617   ROM_LOAD( "am27c29pc",      0x00000, 0x0200, BAD_DUMP CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) )    // borrowed from other game.
1161811618ROM_END
1161911619
1162011620
r29404r29405
1225912259   UINT8 *src = memregion("gfx1")->base();
1226012260   for (i = 0;i < 0x20000;i++)
1226112261   {
12262//      src[i] = BITSWAP8(src[i], 7,4,2,1,6,5,3,0);
12263//      src[i] = BITSWAP8(src[i], 7,3,2,6,1,5,4,0);
12262//      src[i] = BITSWAP8(src[i], 7,4,2,1,6,5,3,0);
12263//      src[i] = BITSWAP8(src[i], 7,3,2,6,1,5,4,0);
1226412264      src[i] = BITSWAP8(src[i], 7,3,2,6,5,1,4,0);
1226512265   }
1226612266
1226712267   UINT8 *src2 = memregion("gfx2")->base();
1226812268   for (i = 0;i < 0x8000;i++)
1226912269   {
12270//      src2[i] = BITSWAP8(src2[i], 7,4,2,1,6,5,3,0);
12271//      src2[i] = BITSWAP8(src2[i], 7,3,2,6,1,5,4,0);
12272      src2[i] = BITSWAP8(src2[i], 3,7,6,2,5,1,0,4);   // endianess
12270//      src2[i] = BITSWAP8(src2[i], 7,4,2,1,6,5,3,0);
12271//      src2[i] = BITSWAP8(src2[i], 7,3,2,6,1,5,4,0);
12272      src2[i] = BITSWAP8(src2[i], 3,7,6,2,5,1,0,4);   // endianess
1227312273   }
1227412274
1227512275}
r29404r29405
1228912289   }
1229012290
1229112291/*  bank 1 graphics */
12292//   int i;
12292//  int i;
1229312293   UINT8 *src = memregion("gfx1")->base();
1229412294   for (i = 0; i < 0x20000; i++)
1229512295   {
12296      src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7);      // OK
12296      src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7);      // OK
1229712297   }
1229812298
1229912299/*  bank 2 graphics */
1230012300   UINT8 *src2 = memregion("gfx2")->base();
1230112301   for (i = 0; i < 0x8000; i++)
1230212302   {
12303      src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7);   // OK
12303      src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7);    // OK
1230412304   }
1230512305}
1230612306
r29404r29405
1231112311   UINT8 *src = memregion("gfx1")->base();
1231212312   for (i = 0; i < 0x20000; i++)
1231312313   {
12314      src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7);      // OK
12314      src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7);      // OK
1231512315   }
1231612316
1231712317/*  bank 2 graphics */
1231812318   UINT8 *src2 = memregion("gfx2")->base();
1231912319   for (i = 0; i < 0x8000; i++)
1232012320   {
12321      src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7);   // OK
12321      src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7);    // OK
1232212322   }
1232312323}
1232412324
r29404r29405
1233312333GAME(  199?, moonlght,  goldstar, moonlght, goldstar, driver_device,  0,         ROT0, "bootleg",           "Moon Light (bootleg of Golden Star)",         0 )
1233412334GAME(  199?, chrygld,   0,        chrygld,  chrygld,  goldstar_state, chrygld,   ROT0, "bootleg",           "Cherry Gold I",                               0 )
1233512335GAME(  199?, chry10,    0,        chrygld,  chry10,   goldstar_state, chry10,    ROT0, "bootleg",           "Cherry 10 (bootleg with PIC16F84)",           0 )
12336GAME(  199?, goldfrui,  goldstar, goldfrui, goldstar, driver_device,  0,         ROT0, "bootleg",           "Gold Fruit",                                  0 )               // maybe fullname should be 'Gold Fruit (main 40%)'
12337GAME(  2001, super9,    goldstar, super9,   goldstar, goldstar_state, super9,    ROT0, "Playmark",          "Super Nove (Playmark)",                       GAME_NOT_WORKING)   // need to decode gfx and see the program loops/reset...
12336GAME(  199?, goldfrui,  goldstar, goldfrui, goldstar, driver_device,  0,         ROT0, "bootleg",           "Gold Fruit",                                  0 )                  // maybe fullname should be 'Gold Fruit (main 40%)'
12337GAME(  2001, super9,    goldstar, super9,   goldstar, goldstar_state, super9,    ROT0, "Playmark",          "Super Nove (Playmark)",                       GAME_NOT_WORKING)    // need to decode gfx and see the program loops/reset...
1233812338GAME(  2001, wcherry,   0,        wcherry,  chrygld,  goldstar_state, wcherry,   ROT0, "bootleg",           "Win Cherry (ver 0.16 - 19990219)",            GAME_NOT_WORKING)
1233912339
1234012340
trunk/src/mame/drivers/20pacgal.c
r29404r29405
206206// likewise the sound table.. is it being uploaded in a different format at 0x0c000?
207207// we also need the palette data because there is only a single rom on this pcb?
208208static ADDRESS_MAP_START( 25pacman_map, AS_PROGRAM, 8, _25pacman_state )
209   
209
210210   AM_RANGE(0x04000, 0x047ff) AM_RAM AM_SHARE("video_ram")
211211
212212   AM_RANGE(0x04800, 0x05fff) AM_RAM
213213
214214   AM_RANGE(0x06000, 0x06fff) AM_WRITEONLY AM_SHARE("char_gfx_ram")
215215   AM_RANGE(0x07000, 0x0717f) AM_WRITE(sprite_ram_w)
216//   AM_RANGE(0x08000, 0x09fff) AM_READ_BANK("bank1") AM_WRITE(ram_48000_w)
216//  AM_RANGE(0x08000, 0x09fff) AM_READ_BANK("bank1") AM_WRITE(ram_48000_w)
217217   AM_RANGE(0x08000, 0x09fff) AM_WRITENOP
218218   AM_RANGE(0x0a000, 0x0bfff) AM_WRITE(sprite_gfx_w)
219219
r29404r29405
270270   AM_RANGE(0x85, 0x86) AM_WRITEONLY AM_SHARE("stars_seed")    /* stars: rng seed (lo/hi) */
271271   AM_RANGE(0x87, 0x87) AM_READ( _25pacman_io_87_r ) // not eeprom on this
272272   AM_RANGE(0x87, 0x87) AM_WRITENOP
273//   AM_RANGE(0x88, 0x88) AM_WRITE(ram_bank_select_w)
273//  AM_RANGE(0x88, 0x88) AM_WRITE(ram_bank_select_w)
274274   AM_RANGE(0x89, 0x89) AM_DEVWRITE("dac", dac_device, write_signed8)
275275   AM_RANGE(0x8a, 0x8a) AM_WRITEONLY AM_SHARE("stars_ctrl")    /* stars: bits 3-4 = active set; bit 5 = enable */
276276   AM_RANGE(0x8b, 0x8b) AM_WRITEONLY AM_SHARE("flip")
trunk/src/mame/drivers/seicross.c
r29404r29405
5252
5353void seicross_state::nvram_init(nvram_device &nvram, void *data, size_t size)
5454{
55   static const UINT8 init[32] = {
55   static const UINT8 init[32] = {
5656      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
5757      0, 1, 0, 1, 0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, };
58   
58
5959   memset(data, 0x00, size);
6060   memcpy(data, init, sizeof(init));
6161}
trunk/src/mame/drivers/system16.c
r29404r29405
20252025
20262026   /* sound hardware */
20272027   MCFG_SOUND_ADD("7759", UPD7759, UPD7759_STANDARD_CLOCK)
2028   MCFG_UPD7759_DRQ_CALLBACK(WRITELINE(segas1x_bootleg_state,sound_cause_nmi))   
2028   MCFG_UPD7759_DRQ_CALLBACK(WRITELINE(segas1x_bootleg_state,sound_cause_nmi))
20292029   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.48)
20302030   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.48)
20312031MACHINE_CONFIG_END
trunk/src/mame/drivers/nyny.c
r29404r29405
121121   required_device<mc6845_device> m_mc6845;
122122   required_device<pia6821_device> m_pia1;
123123   required_device<pia6821_device> m_pia2;
124   
124
125125   pen_t m_pens[NUM_PENS];
126126   DECLARE_WRITE8_MEMBER(audio_1_command_w);
127127   DECLARE_WRITE8_MEMBER(audio_1_answer_w);
trunk/src/mame/drivers/big10.c
r29404r29405
159159static INPUT_PORTS_START( big10 )
160160
161161   PORT_START("SYSTEM")
162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE   /* Service Mode */
162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE    /* Service Mode */
163163   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_R) PORT_NAME("Reset")
164164   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER )   PORT_CODE(KEYCODE_W) PORT_NAME("Payout")
165165   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)
166   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )               // in test mode, go to the game whilst keep pressed.
167   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )               // in test mode, go to the game whilst keep pressed.
166   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )                    // in test mode, go to the game whilst keep pressed.
167   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )                    // in test mode, go to the game whilst keep pressed.
168168   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_IMPULSE(2)
169169   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_IMPULSE(2)
170170
trunk/src/mame/drivers/stuntair.c
r29404r29405
9393      m_bgattrram(*this, "bgattrram"),
9494      m_sprram(*this, "sprram"),
9595      m_gfxdecode(*this, "gfxdecode"),
96      m_palette(*this, "palette")
96      m_palette(*this, "palette")
9797   { }
9898
9999   required_device<cpu_device> m_maincpu;
trunk/src/mame/drivers/model1.c
r29404r29405
15211521   MCFG_NVRAM_ADD_0FILL("nvram")
15221522
15231523   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1524   
1524
15251525   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
15261526   MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode")
15271527   MCFG_S24TILE_DEVICE_PALETTE("palette")
r29404r29405
15651565   MCFG_NVRAM_ADD_0FILL("nvram")
15661566
15671567   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1568   
1568
15691569   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
15701570   MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode")
15711571   MCFG_S24TILE_DEVICE_PALETTE("palette")
trunk/src/mame/drivers/taito_b.c
r29404r29405
19831983   MCFG_GFXDECODE_ADD("gfxdecode", "palette", taito_b)
19841984   MCFG_PALETTE_ADD("palette", 4096)
19851985   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
1986   
1986
19871987   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
19881988
19891989   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
r29404r29405
20592059
20602060   MCFG_CPU_MODIFY("maincpu")
20612061   MCFG_CPU_PROGRAM_MAP(tetrist_map)
2062   
2062
20632063   MCFG_PALETTE_MODIFY("palette")
20642064   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
20652065MACHINE_CONFIG_END
r29404r29405
23542354   MCFG_TC0640FIO_READ_2_CB(IOPORT("START"))
23552355   MCFG_TC0640FIO_READ_3_CB(IOPORT("P1_P2_A"))
23562356   MCFG_TC0640FIO_READ_7_CB(IOPORT("P1_P2_B"))
2357   
2357
23582358   MCFG_DEVICE_ADD("mb87078", MB87078, 0)
23592359   MCFG_MB87078_GAIN_CHANGED_CB(WRITE8(taitob_state, mb87078_gain_changed))
23602360
r29404r29405
27982798   MCFG_TC0510NIO_READ_2_CB(IOPORT("JOY"))
27992799   MCFG_TC0510NIO_READ_3_CB(IOPORT("START"))
28002800   MCFG_TC0510NIO_READ_7_CB(IOPORT("PHOTOSENSOR"))
2801   
2801
28022802   /* video hardware */
28032803   MCFG_SCREEN_ADD("screen", RASTER)
28042804   MCFG_SCREEN_REFRESH_RATE(60)
r29404r29405
28542854   MCFG_TC0510NIO_READ_2_CB(IOPORT("IN0"))
28552855   MCFG_TC0510NIO_READ_3_CB(IOPORT("IN1"))
28562856   MCFG_TC0510NIO_READ_7_CB(IOPORT("IN2"))
2857   
2857
28582858   /* video hardware */
28592859   MCFG_SCREEN_ADD("screen", RASTER)
28602860   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mame/drivers/btime.c
r29404r29405
13191319   MCFG_MACHINE_RESET_OVERRIDE(btime_state,btime)
13201320
13211321   MCFG_GFXDECODE_ADD("gfxdecode", "palette", btime)
1322   
1322
13231323   MCFG_PALETTE_ADD("palette", 16)
13241324   MCFG_PALETTE_INIT_OWNER(btime_state,btime)
13251325   MCFG_PALETTE_FORMAT(BBGGGRRR)
trunk/src/mame/drivers/m14.c
r29404r29405
7777   /* devices */
7878   required_device<cpu_device> m_maincpu;
7979   required_device<gfxdecode_device> m_gfxdecode;
80   
80
8181   DECLARE_WRITE8_MEMBER(m14_vram_w);
8282   DECLARE_WRITE8_MEMBER(m14_cram_w);
8383   DECLARE_READ8_MEMBER(m14_rng_r);
r29404r29405
346346   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
347347   MCFG_SCREEN_UPDATE_DRIVER(m14_state, screen_update_m14)
348348   MCFG_SCREEN_PALETTE("palette")
349   
349
350350   MCFG_GFXDECODE_ADD("gfxdecode", "palette", m14)
351351   MCFG_PALETTE_ADD("palette", 0x20)
352352   MCFG_PALETTE_INIT_OWNER(m14_state, m14)
trunk/src/mame/drivers/cps1.c
r29404r29405
951951   PORT_DIPSETTING(    0x30, "30K, 60K and every 70K" )
952952   PORT_DIPSETTING(    0x00, "40K, 70K and every 80K" )
953953/* Manuals states the following bonus settings
954   PORT_DIPSETTING(    0x20, "20K, 50K and every 70K" )
955   PORT_DIPSETTING(    0x10, "10K, 30K and every 30K" )
956   PORT_DIPSETTING(    0x30, "40K, 70K and every 80K" )
957   PORT_DIPSETTING(    0x00, "30K, 60K and every 70K" )
954    PORT_DIPSETTING(    0x20, "20K, 50K and every 70K" )
955    PORT_DIPSETTING(    0x10, "10K, 30K and every 30K" )
956    PORT_DIPSETTING(    0x30, "40K, 70K and every 80K" )
957    PORT_DIPSETTING(    0x00, "30K, 60K and every 70K" )
958958*/
959959   /* Debug Dip Switches */
960960   PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1,2,3")
r29404r29405
10771077   PORT_DIPSETTING(    0x20, "30K, 50K then every 70K" )
10781078   PORT_DIPSETTING(    0x10, "20K & 60K only" )
10791079   PORT_DIPSETTING(    0x00, "30K & 60K only" )
1080/* According to manual, these are the proper settings
1081   PORT_DIPSETTING(    0x30, "40K, 70K then every 80K" )
1082   PORT_DIPSETTING(    0x20, "20K, 50K then every 70K" )
1083   PORT_DIPSETTING(    0x10, "10k, 30k then every 30k" )
1084   PORT_DIPSETTING(    0x00, "30K, 60k then every 70k" )
1080/* According to manual, these are the proper settings
1081    PORT_DIPSETTING(    0x30, "40K, 70K then every 80K" )
1082    PORT_DIPSETTING(    0x20, "20K, 50K then every 70K" )
1083    PORT_DIPSETTING(    0x10, "10k, 30k then every 30k" )
1084    PORT_DIPSETTING(    0x00, "30K, 60k then every 70k" )
10851085*/
10861086
10871087   PORT_DIPNAME( 0xc0, 0x80, "Internal Diff. on Life Loss" )   PORT_DIPLOCATION("SW(B):7,8")
r29404r29405
86338633Original 88622-c-2 C board
86348634
86358635Bootleg B board with
8636   PIC16c55 near PRG roms seem protected
8637   8 dipswith near both sound roms and gfx roms
8638   1,4,5,8 ON
8639   2,3,6,7 OFF
8636    PIC16c55 near PRG roms seem protected
8637    8 dipswith near both sound roms and gfx roms
8638    1,4,5,8 ON
8639    2,3,6,7 OFF
86408640
86418641Sound rom match various romset
86428642*/
r29404r29405
86528652   ROM_LOAD16_BYTE( "prg34.bin",      0x80001, 0x20000, CRC(f06a12f2) SHA1(ddc431ce01392d4a7562760743abd9ea73b06cf3) )
86538653   ROM_LOAD16_BYTE( "prg28.bin",      0xc0000, 0x40000, CRC(b7ad5214) SHA1(17b05e0aa9a4eb5f1aaafe35fa029d2a9aea530d) )
86548654   ROM_LOAD16_BYTE( "prg33.bin",      0xc0001, 0x40000, CRC(6340b914) SHA1(443e37a06058548c8ce7a15ecd10a6635e69d09f) )
8655   
8655
86568656   ROM_REGION( 0x600000, "gfx", 0 )
86578657   ROMX_LOAD( "24.bin",   0x000000, 0x40000, CRC(a8b5633a) SHA1(6548a89d616910d06db126eb1a9c6b5979baff03) , ROM_SKIP(7) )
86588658   ROMX_LOAD( "14.bin",   0x000001, 0x40000, CRC(5db24ca7) SHA1(0543e89174fecc866a08e0ecc7c31a6efca15da5) , ROM_SKIP(7) )
r29404r29405
86888688   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
86898689   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
86908690   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
8691   
8692   ROM_REGION( 0x2000, "protectin_pic", 0 )
8691
8692   ROM_REGION( 0x2000, "protectin_pic", 0 )
86938693   ROM_LOAD( "pic16c55",    0x00000, 0x2000, BAD_DUMP CRC(f22e2311) SHA1(320edfba140728599e91c01e863a8b6d071e4bbf) )
86948694ROM_END
86958695
trunk/src/mame/drivers/vp101.c
r29404r29405
9393   MCFG_SCREEN_SIZE(320, 240)
9494   MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
9595   MCFG_SCREEN_PALETTE("palette")
96   
96
9797   MCFG_PALETTE_ADD("palette", 32768)
9898MACHINE_CONFIG_END
9999
trunk/src/mame/drivers/scobra.c
r29404r29405
12731273
12741274   ROM_REGION( 0x0020, "proms", 0 )
12751275   ROM_LOAD( "mni6331.e6",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
1276   
1276
12771277   ROM_REGION( 0x0800, "unk", 0 )
12781278   ROM_LOAD( "top.c5",  0x0000, 0x0800, CRC(88226086) SHA1(fe2da172313063e5b056fc8c8d8b2a5c64db5179) )
1279ROM_END
1279ROM_END
12801280ROM_START( mimonkey )
12811281   ROM_REGION( 0x10000, "maincpu", 0 )
12821282   ROM_LOAD( "mm1.2e",       0x0000, 0x1000, CRC(9019f1b1) SHA1(0c45f64e39b9a182f6162ab520ced6ef0686466c) )
trunk/src/mame/drivers/galaxian.c
r29404r29405
70017001   ROM_LOAD( "gal09.ic13",        0x2400, 0x0400, CRC(5876f695) SHA1(e8c0d13066cfe4a409293b9e1380513099b35330) )
70027002
70037003   ROM_REGION( 0x0400, "unknown", 0 )
7004   ROM_LOAD( "gal00eg.ic4",       0x0000, 0x0400, CRC(1038467f) SHA1(e34cc53a1203335cf9c9a94c3f96cab5a444a34a) )    // the first 0x100 bytes of this is ic41, the rest is different? should it bank in somehow to give extra features??
7005   
7004   ROM_LOAD( "gal00eg.ic4",       0x0000, 0x0400, CRC(1038467f) SHA1(e34cc53a1203335cf9c9a94c3f96cab5a444a34a) )   // the first 0x100 bytes of this is ic41, the rest is different? should it bank in somehow to give extra features??
7005
70067006   ROM_REGION( 0x1000, "gfx1", 0 )
70077007   ROM_LOAD( "galaxian.1h",       0x0000, 0x0800, CRC(39fb43a4) SHA1(4755609bd974976f04855d51e08ec0d62ab4bc07) )
70087008   ROM_LOAD( "galaxian.1k",       0x0800, 0x0800, CRC(7e3f56a2) SHA1(a9795d8b7388f404f3b0e2c6ce15d713a4c5bafa) )
trunk/src/mame/drivers/othello.c
r29404r29405
8181   mc6845_device *m_mc6845;
8282   device_t *m_n7751;
8383   required_device<palette_device> m_palette;
84   
84
8585   DECLARE_READ8_MEMBER(unk_87_r);
8686   DECLARE_WRITE8_MEMBER(unk_8a_w);
8787   DECLARE_WRITE8_MEMBER(unk_8c_w);
trunk/src/mame/drivers/calomega.c
r29404r29405
26822682   MCFG_SOUND_CONFIG(sys905_ay8912_intf)
26832683
26842684   MCFG_DEVICE_REMOVE("acia6850_0")
2685   
2685
26862686   MCFG_DEVICE_REMOVE("aciabaud")
26872687MACHINE_CONFIG_END
26882688
r29404r29405
27062706   MCFG_SOUND_CONFIG(sys905_ay8912_intf)
27072707
27082708   MCFG_DEVICE_REMOVE("acia6850_0")
2709   
2709
27102710   MCFG_DEVICE_REMOVE("aciabaud")
27112711MACHINE_CONFIG_END
27122712
r29404r29405
27382738   MCFG_SOUND_CONFIG(sys906_ay8912_intf)
27392739
27402740   MCFG_DEVICE_REMOVE("acia6850_0")
2741   
2741
27422742   MCFG_DEVICE_REMOVE("aciabaud")
27432743MACHINE_CONFIG_END
27442744
r29404r29405
38793879         BPR[x] = 0x04;  /* blue background */
38803880   }
38813881   m_palette->update();
3882   
3882
38833883   /* Injecting missing Start and NMI vectors...
38843884      Start = $2042;  NMI = $26f8;
38853885      Also a fake vector at $3ff8-$3ff9. The code checks these values to continue.
trunk/src/mame/drivers/gstream.c
r29404r29405
11/********************************************************************
22
33    G-Stream (c)2002 Oriental Soft Japan
4   X2222 (prototype) (c)2000 Oriental Soft
4    X2222 (prototype) (c)2000 Oriental Soft
55
6   ---
7   X2222 has corrupt boss graphics because the program roms we use don't match the sprite roms.
8   --
6    ---
7    X2222 has corrupt boss graphics because the program roms we use don't match the sprite roms.
8    --
99
1010    Hyperstone based hardware
1111
1212    Simple Sprites (16x16x8bpp tiles)
1313    3 Simple Tilemaps (32x32x8bpp tiles)
1414
15   X2222 uses raw 16bpp palette data instead of 8bpp indexed colours.
15    X2222 uses raw 16bpp palette data instead of 8bpp indexed colours.
1616
1717    todo: sprite lag (sprites need buffering?)
1818          sprite wraparound is imperfect
1919
2020    The following is confirmed on G-Stream only
21   ---
21    ---
2222
2323    CPU:  E1-32XT
2424    Sound: 2x AD-65 (OKIM6295 clone)
r29404r29405
4141    ---
4242
4343    Dump Notes:::
44   
44
4545    G-Stream 2020, 2002 Oriental Soft Japan
4646
4747    Shooter from Oriental soft, heavy influence from XII Stag
r29404r29405
146146      m_workram(*this, "workram"),
147147      m_vram(*this, "vram"),
148148      m_gfxdecode(*this, "gfxdecode"),
149      m_palette(*this, "palette")
149      m_palette(*this, "palette")
150150   {
151151      m_toggle = 0;
152152   }
r29404r29405
172172   /* misc */
173173   int       m_oki_bank_1;
174174   int       m_oki_bank_2;
175   int        m_toggle;
176   int        m_xoffset;
175   int       m_toggle;
176   int       m_xoffset;
177177
178178   DECLARE_WRITE32_MEMBER(gstream_vram_w);
179179   DECLARE_WRITE32_MEMBER(gstream_tilemap1_scrollx_w);
r29404r29405
201201
202202   void rearrange_sprite_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2);
203203   void rearrange_tile_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2);
204   
204
205205   required_device<gfxdecode_device> m_gfxdecode;
206206   required_device<palette_device> m_palette;
207207};
r29404r29405
599599   code %= gfx->elements();
600600
601601   // render
602                       
602
603603   do {
604604      g_profiler.start(PROFILER_DRAWGFX);
605605      do {
606
607606         const UINT8 *srcdata, *srcdata2;
608607         INT32 destendx, destendy;
609608         INT32 srcx, srcy;
r29404r29405
695694               {
696695                  UINT32 srcdata = (srcptr[0]);
697696                  UINT32 srcdata2 = (srcptr2[0]);
698           
697
699698                  UINT32 fullval = (srcdata | (srcdata2 << 8));
700699                  UINT32 r = ((fullval >> 0) & 0x1f) << 3;
701700                  UINT32 g = ((fullval >> 5) & 0x3f) << 2;
r29404r29405
703702                  UINT32 full = (r << 16) | (g << 8) | (b << 0);
704703                  if (full != 0)
705704                     destptr[0] = full;
706                 
705
707706                  srcptr++;
708707                  srcptr2++;
709708                  destptr++;
r29404r29405
729728               {
730729                  UINT32 srcdata = (srcptr[0]);
731730                  UINT32 srcdata2 = (srcptr2[0]);
732                 
731
733732                  UINT32 fullval = (srcdata | (srcdata2 << 8));
734733                  UINT32 r = ((fullval >> 0) & 0x1f) << 3;
735734                  UINT32 g = ((fullval >> 5) & 0x3f) << 2;
r29404r29405
737736                  UINT32 full = (r << 16) | (g << 8) | (b << 0);
738737                  if (full != 0)
739738                     destptr[0] = full;
740                 
739
741740                  srcptr--;
742741                  srcptr2--;
743742                  destptr++;
r29404r29405
766765         int vram_data = (ram[(basex&0x0f)+((basey&0x0f)*0x10)]);
767766         int pal = (vram_data & 0xc0000000) >> 30;
768767         int code = (vram_data & 0x0fff0000) >> 16;
769         
768
770769         pal += palbase;
771770
772771         if (m_gfxdecode->gfx(map+5))
r29404r29405
806805
807806
808807   draw_bg_gstream(bitmap, cliprect, m_tmap3_scrollx >> 16, m_tmap3_scrolly >> 16, 2, m_vram + 0x800/4, 0x18);
809   draw_bg_gstream(bitmap, cliprect, m_tmap2_scrollx >> 16, m_tmap2_scrolly >> 16, 1, m_vram + 0x400/4, 0x14);
808   draw_bg_gstream(bitmap, cliprect, m_tmap2_scrollx >> 16, m_tmap2_scrolly >> 16, 1, m_vram + 0x400/4, 0x14);
810809   draw_bg_gstream(bitmap, cliprect, m_tmap1_scrollx >> 16, m_tmap1_scrolly >> 16, 0, m_vram + 0x000/4, 0x10); // move on top for x2222 , check
811810
812811
r29404r29405
907906   MCFG_CPU_VBLANK_INT_DRIVER("screen", gstream_state,  irq0_line_hold)
908907
909908
910//   MCFG_NVRAM_ADD_1FILL("nvram")
909//  MCFG_NVRAM_ADD_1FILL("nvram")
911910
912911   /* video hardware */
913912   MCFG_SCREEN_ADD("screen", RASTER)
r29404r29405
979978
980979   ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */
981980   ROM_LOAD( "test.hye", 0x000000, 0x0112dda, CRC(c1142b2f) SHA1(5807930820a53604013a6ac66e4d4ebe3628e1fc) ) // the above binary was built from this
982   
981
983982   /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */
984983   ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )  /* sprite tiles (16x16x8) */
985984   /* filled in at init*/
r29404r29405
10411040
10421041   ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */
10431042   ROM_LOAD( "older.hye", 0x000000, 0x010892f, CRC(cf3a004e) SHA1(1cba64cfa235b9540f33a5ee0cc02dfd267e00fc) ) // this corresponds to the older.bin we're using, for reference
1044   
1043
10451044   /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */
10461045   ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )  /* sprite tiles (16x16x8) */
10471046   /* filled in at init*/
trunk/src/mame/drivers/toaplan1.c
r29404r29405
20352035   MCFG_SCREEN_UPDATE_DRIVER(toaplan1_state, screen_update_toaplan1)
20362036   MCFG_SCREEN_VBLANK_DRIVER(toaplan1_state, screen_eof_toaplan1)
20372037   MCFG_SCREEN_PALETTE("palette")
2038   
2038
20392039   MCFG_GFXDECODE_ADD("gfxdecode", "palette", toaplan1)
20402040   MCFG_PALETTE_ADD("palette", (64*16)+(64*16))
20412041   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
trunk/src/mame/drivers/dacholer.c
r29404r29405
6262   optional_device<msm5205_device> m_msm;
6363   required_device<gfxdecode_device> m_gfxdecode;
6464   required_device<palette_device> m_palette;
65   
65
6666   /* video-related */
6767   tilemap_t  *m_bg_tilemap;
6868   tilemap_t  *m_fg_tilemap;
trunk/src/mame/drivers/pgm.c
r29404r29405
42194219GAME( 2004, kovlsqh2,     kovshp,    pgm_arm_type1,     kovsh, pgm_arm_type1_state, kovlsqh2,   ROT0,   "bootleg", "Knights of Valour: Luan Shi Quan Huang 2 / Sangoku Senki: Luan Shi Quan Huang 2 (ver. 200CN)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */
42204220GAME( 2004, kovlsjb,      kovshp,    pgm_arm_type1,     kovsh, pgm_arm_type1_state, kovlsqh2,   ROT0,   "bootleg", "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN, set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */
42214221GAME( 2004, kovlsjba,     kovshp,    pgm_arm_type1,     kovsh, pgm_arm_type1_state, kovlsqh2,   ROT0,   "bootleg", "Knights of Valour: Luan Shi Jie Ba / Sangoku Senki: Luan Shi Jie Ba (ver. 200CN, set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */
4222
trunk/src/mame/drivers/model3.c
r29404r29405
29412941ROM_END
29422942
29432943/*
2944In Mame getbass is marked as GET BASS STD, while my pcb came from a DLX cab.
2944In Mame getbass is marked as GET BASS STD, while my pcb came from a DLX cab.
29452945Rom board 833-13317
29462946834-13318 sticker is on rom board too.
29472947On cage the follow sticker are present
29482948BSS-4500-CVT2
29492949833-13317 GAME BD BSS-CVT2
2950
2950
29512951I/O board 837-13283 (GET BASS MEC CONT BD in manual)  171-7558c
29522952
29532953epr20690.ic11 is controller board prg
r29404r29405
54425442   MCFG_SCREEN_SIZE(512, 400)
54435443   MCFG_SCREEN_UPDATE_DRIVER(model3_state, screen_update_model3)
54445444   MCFG_SCREEN_PALETTE("palette")
5445   
5445
54465446   MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
54475447
54485448
trunk/src/mame/drivers/funkyjet.c
r29404r29405
345345   MCFG_DECO16IC_ADD("tilegen1", funkyjet_deco16ic_tilegen1_intf)
346346   MCFG_DECO16IC_GFXDECODE("gfxdecode")
347347   MCFG_DECO16IC_PALETTE("palette")
348   
348
349349   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
350350   decospr_device::set_gfx_region(*device, 2);
351351   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
trunk/src/mame/drivers/cps3.c
r29404r29405
25832583   MCFG_PALETTE_ADD("palette", 0x10000) // actually 0x20000 ...
25842584
25852585   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
2586   
2586
25872587   /* sound hardware */
25882588   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
25892589
trunk/src/mame/drivers/mlanding.c
r29404r29405
108108   required_shared_ptr<UINT16> m_cha_ram;
109109   required_shared_ptr<UINT16> m_dot_ram;
110110   required_shared_ptr<UINT8>  m_power_ram;
111   
111
112112   required_device<palette_device> m_palette;
113113
114114   UINT16  *m_dma_ram;
trunk/src/mame/drivers/boxer.c
r29404r29405
5151   required_device<gfxdecode_device> m_gfxdecode;
5252   required_device<screen_device> m_screen;
5353   required_device<palette_device> m_palette;
54   
54
5555   DECLARE_READ8_MEMBER(boxer_input_r);
5656   DECLARE_READ8_MEMBER(boxer_misc_r);
5757   DECLARE_WRITE8_MEMBER(boxer_bell_w);
r29404r29405
180180
181181            code = p[32 * l + 4 * i + j];
182182
183           
183
184184               m_gfxdecode->gfx(n)->transpen(bitmap,cliprect,
185185               code,
186186               0,
r29404r29405
190190
191191            code = p[32 * r + 4 * i - j + 3];
192192
193           
193
194194               m_gfxdecode->gfx(n)->transpen(bitmap,cliprect,
195195               code,
196196               0,
r29404r29405
215215      {
216216         UINT8 code = m_tile_ram[32 * i + j];
217217
218         
218
219219            m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
220220            code,
221221            0,
trunk/src/mame/drivers/namcos22.c
r29404r29405
15961596   // reading random values in some games for example in timecris to determine
15971597   // where certain enemies will emerge.
15981598   // It works in combination with keycus_w, but not yet understood how.
1599   
1599
16001600//  printf("Hit keycus offs %x mask %x PC=%x\n", offset, mem_mask, space.device().safe_pc());
16011601
16021602   // protection (not used for all games)
r29404r29405
16081608      case NAMCOS22_RIDGE_RACER2:
16091609         if (offset == 0) return 0x0172;
16101610         break;
1611     
1611
16121612      case NAMCOS22_ACE_DRIVER:
16131613         if (offset == 3) return 0x0173;
16141614         break;
1615     
1615
16161616      case NAMCOS22_CYBER_COMMANDO:
16171617         if (offset == 1) return 0x0185;
16181618         break;
r29404r29405
16401640      case NAMCOS22_TOKYO_WARS:
16411641         if (offset == 4) return 0x01a8;
16421642         break;
1643     
1643
16441644      default:
16451645         break;
16461646   }
1647   
1647
16481648   // pick a random number, but don't pick the same twice in a row
16491649   UINT16 old_rng = m_keycus_rng;
16501650   do
trunk/src/mame/drivers/galaxold.c
r29404r29405
25502550   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
25512551   MCFG_SCREEN_UPDATE_DRIVER(galaxold_state, screen_update_galaxold)
25522552   MCFG_SCREEN_PALETTE("palette")
2553   
2553
25542554   MCFG_PALETTE_ADD("palette", 64)
25552555   MCFG_PALETTE_INIT_OWNER(galaxold_state,rockclim)
25562556
r29404r29405
26222622   MCFG_GFXDECODE_ADD("gfxdecode", "palette", galaxian)
26232623   MCFG_PALETTE_ADD("palette", 32)
26242624   MCFG_PALETTE_INIT_OWNER(galaxold_state,rockclim)
2625   
2625
26262626   MCFG_SCREEN_ADD("screen", RASTER)
26272627   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
26282628   MCFG_SCREEN_UPDATE_DRIVER(galaxold_state, screen_update_galaxold)
trunk/src/mame/drivers/cv1k.c
r29404r29405
163163
164164Blitter Timing
165165 - Correct slowdown emulation and flags (depends on blit mode, and speed of RAM) - could do with the recompiler or alt idle skips on the busy flag wait looops
166 - End of Blit IRQ? (one game has a valid irq routine that looks like it was used for profiling, but nothing depends on it)
166 - End of Blit IRQ? (one game has a valid irq routine that looks like it was used for profiling, but nothing depends on it)
167167
168168*/
169169
r29404r29405
204204
205205   INTERRUPT_GEN_MEMBER(cv1k_interrupt);
206206   UINT32 screen_update_cv1k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
207   
207
208208   DECLARE_MACHINE_RESET( cv1k );
209209
210210   /* game specific */
211    DECLARE_READ64_MEMBER(mushisam_speedup_r);
212    DECLARE_READ64_MEMBER(mushisama_speedup_r);
213    DECLARE_READ64_MEMBER(espgal2_speedup_r);
214    DECLARE_DRIVER_INIT(mushisam);
215    DECLARE_DRIVER_INIT(mushisama);
216    DECLARE_DRIVER_INIT(espgal2);
211   DECLARE_READ64_MEMBER(mushisam_speedup_r);
212   DECLARE_READ64_MEMBER(mushisama_speedup_r);
213   DECLARE_READ64_MEMBER(espgal2_speedup_r);
214   DECLARE_DRIVER_INIT(mushisam);
215   DECLARE_DRIVER_INIT(mushisama);
216   DECLARE_DRIVER_INIT(espgal2);
217217};
218218
219219
r29404r29405
237237
238238READ64_MEMBER( cv1k_state::cv1k_flash_port_e_r )
239239{
240   return   ((m_serflash->flash_ready_r(space, offset) ? 0x20 : 0x00)) | 0xdf;
240   return  ((m_serflash->flash_ready_r(space, offset) ? 0x20 : 0x00)) | 0xdf;
241241}
242242
243243
r29404r29405
324324   AM_RANGE(0x10000000, 0x10000007) AM_READWRITE8(cv1k_flash_io_r, cv1k_flash_io_w, U64(0xffffffffffffffff))
325325   AM_RANGE(0x10400000, 0x10400007) AM_DEVWRITE8("ymz770", ymz770_device, write, U64(0xffffffffffffffff))
326326   AM_RANGE(0x10C00000, 0x10C00007) AM_READWRITE8(serial_rtc_eeprom_r, serial_rtc_eeprom_w, U64(0xffffffffffffffff))
327//   AM_RANGE(0x18000000, 0x18000057) // blitter, installed on reset
327//  AM_RANGE(0x18000000, 0x18000057) // blitter, installed on reset
328328   AM_RANGE(0xf0000000, 0xf0ffffff) AM_RAM // mem mapped cache (sh3 internal?)
329329ADDRESS_MAP_END
330330
r29404r29405
334334   AM_RANGE(0x10000000, 0x10000007) AM_READWRITE8(cv1k_flash_io_r, cv1k_flash_io_w, U64(0xffffffffffffffff))
335335   AM_RANGE(0x10400000, 0x10400007) AM_DEVWRITE8("ymz770", ymz770_device, write, U64(0xffffffffffffffff))
336336   AM_RANGE(0x10C00000, 0x10C00007) AM_READWRITE8(serial_rtc_eeprom_r, serial_rtc_eeprom_w, U64(0xffffffffffffffff))
337//   AM_RANGE(0x18000000, 0x18000057) // blitter, installed on reset
337//  AM_RANGE(0x18000000, 0x18000057) // blitter, installed on reset
338338   AM_RANGE(0xf0000000, 0xf0ffffff) AM_RAM // mem mapped cache (sh3 internal?)
339339ADDRESS_MAP_END
340340
r29404r29405
349349
350350
351351static INPUT_PORTS_START( cv1k )
352   PORT_START("DSW")      // 18000050.l (18000050.b + 3 i.e. MSB + 3, is shown as DIPSW)
352   PORT_START("DSW")       // 18000050.l (18000050.b + 3 i.e. MSB + 3, is shown as DIPSW)
353353//  PORT_BIT(        0xfcfffffc, IP_ACTIVE_LOW, IPT_UNKNOWN )
354354   PORT_DIPNAME(    0x00000002, 0x00000000, DEF_STR( Unknown ) )
355355   PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) )
r29404r29405
357357   PORT_SERVICE(    0x00000001, IP_ACTIVE_HIGH )
358358
359359   PORT_START("PORT_C")
360   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )   // Service coin
361   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 )   // Test button copied here
362   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1  )   // IMPLEMENT COIN ERROR!
360   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )   // Service coin
361   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 )   // Test button copied here
362   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1  ) // IMPLEMENT COIN ERROR!
363363   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2  )
364364   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
365365   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
r29404r29405
376376   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4        ) PORT_PLAYER(1)
377377
378378   PORT_START("PORT_F")
379   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE2 )   // Test Push Button
379   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE2 )  // Test Push Button
380380   PORT_BIT( 0xfd, IP_ACTIVE_LOW,  IPT_UNKNOWN )
381381
382   PORT_START("PORT_L")   // 4000134.b, 4000136.b
382   PORT_START("PORT_L")    // 4000134.b, 4000136.b
383383   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(2)
384384   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(2)
385385   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(2)
r29404r29405
528528
529529   ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
530530   ROM_LOAD("mushisamb_u2", 0x000000, 0x8400000, CRC(6cc9d1a9) SHA1(17907798dce1defadd10354cec6c8d364e045570) ) /* (2004/10/12 MASTER VER) */
531     
531
532532   ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
533533   ROM_LOAD16_WORD_SWAP("u23", 0x000000, 0x400000, CRC(138e2050) SHA1(9e86489a4e65af5efb5495adf6d4b3e01d5b2816) )
534534   ROM_LOAD16_WORD_SWAP("u24", 0x400000, 0x400000, CRC(e3d05c9f) SHA1(130c3d62317da1729c85bd178bd51500edd73ada) )
r29404r29405
798798   int pc = m_maincpu->pc();
799799   if ( pc == 0xc04a0aa ) m_maincpu->spin_until_time( attotime::from_usec(10)); // mushisam
800800   else if (pc == 0xc04a0da)  m_maincpu->spin_until_time( attotime::from_usec(10)); // mushitam
801//   else printf("read %08x\n", m_maincpu->pc());
801//  else printf("read %08x\n", m_maincpu->pc());
802802   return cv1k_ram[0x0022f0/8];
803803}
804804
805805DRIVER_INIT_MEMBER(cv1k_state,mushisam)
806806{
807    m_maincpu->space(AS_PROGRAM).install_read_handler(0xc0022f0, 0xc0022f7, read64_delegate(FUNC(cv1k_state::mushisam_speedup_r),this));
807   m_maincpu->space(AS_PROGRAM).install_read_handler(0xc0022f0, 0xc0022f7, read64_delegate(FUNC(cv1k_state::mushisam_speedup_r),this));
808808}
809809
810810READ64_MEMBER( cv1k_state::mushisama_speedup_r )
811811{
812812   if (m_maincpu->pc()== 0xc04a2aa ) m_maincpu->spin_until_time( attotime::from_usec(10)); // mushisam
813//   else printf("read %08x\n", m_maincpu->pc());
813//  else printf("read %08x\n", m_maincpu->pc());
814814   return cv1k_ram[0x00024d8/8];
815815}
816816
817817DRIVER_INIT_MEMBER(cv1k_state,mushisama)
818818{
819    m_maincpu->space(AS_PROGRAM).install_read_handler(0xc0024d8, 0xc0024df, read64_delegate(FUNC(cv1k_state::mushisama_speedup_r),this));
819   m_maincpu->space(AS_PROGRAM).install_read_handler(0xc0024d8, 0xc0024df, read64_delegate(FUNC(cv1k_state::mushisama_speedup_r),this));
820820}
821821
822822READ64_MEMBER( cv1k_state::espgal2_speedup_r )
r29404r29405
827827   if ( pc == 0xc05176a ) m_maincpu->spin_until_time( attotime::from_usec(10)); // futari15 / futari15a / futari10 / futariblk / ibarablk / ibarablka / mmpork / mmmbanc
828828   if ( pc == 0xc0519a2 ) m_maincpu->spin_until_time( attotime::from_usec(10)); // deathsml
829829   if ( pc == 0xc1d1346 ) m_maincpu->spin_until_time( attotime::from_usec(10)); // dpddfk / dsmbl
830//   else printf("read %08x\n", m_maincpu->pc());
830//  else printf("read %08x\n", m_maincpu->pc());
831831   return cv1k_ram[0x002310/8];
832832}
833833
834834DRIVER_INIT_MEMBER(cv1k_state,espgal2)
835835{
836    m_maincpu->space(AS_PROGRAM).install_read_handler(0xc002310, 0xc002317, read64_delegate(FUNC(cv1k_state::espgal2_speedup_r),this));
836   m_maincpu->space(AS_PROGRAM).install_read_handler(0xc002310, 0xc002317, read64_delegate(FUNC(cv1k_state::espgal2_speedup_r),this));
837837}
838838
839839
trunk/src/mame/drivers/dec0.c
r29404r29405
14871487   deco_mxc06_device::set_gfx_region(*device, 3);
14881488   MCFG_DECO_MXC06_GFXDECODE("gfxdecode")
14891489   MCFG_DECO_MXC06_PALETTE("palette")
1490   
14911490
1491
14921492   MCFG_PALETTE_ADD("palette", 1024)
14931493   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
14941494   MCFG_GFXDECODE_ADD("gfxdecode", "palette", secretab)
trunk/src/mame/drivers/tceptor.c
r29404r29405
383383   MCFG_PALETTE_ADD("palette", 4096)
384384   MCFG_PALETTE_INDIRECT_ENTRIES(1024)
385385   MCFG_PALETTE_INIT_OWNER(tceptor_state, tceptor)
386   
386
387387   MCFG_DEFAULT_LAYOUT(layout_horizont)
388388
389389   MCFG_NAMCO_C45_ROAD_ADD("c45_road")
trunk/src/mame/drivers/metro.c
r29404r29405
17311731
17321732puzzlet_io_device::puzzlet_io_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
17331733   : device_t(mconfig, PUZZLET_IO, "Puzzlet Coin/Start I/O", tag, owner, clock, "puzzlet_io", __FILE__),
1734     data_cb(*this),
1735     port(*this, ":IN0")
1734      data_cb(*this),
1735      port(*this, ":IN0")
17361736{
17371737}
17381738
r29404r29405
53165316/* an 'Electronic Devices' manufactured board has been seen with the following roms. The data is 100% identical to the above set
53175317   but due to lazy manufacturing larger ROMs were used and the first half filled with 0xff
53185318
5319   ROM_LOAD16_BYTE( "ladyki_3.h9",   0x000000, 0x080000, CRC(c658f954) SHA1(d50043457e67a94feff1328fe9bf522aa3c124b6) ) // == e2.8g
5320   ROM_LOAD16_BYTE( "ladyki_2.h10",  0x000001, 0x080000, CRC(bf58e4db) SHA1(9d7f74dc348b0ccb3bcf1b618d6092292b6945b8) ) // == e3.10g
5321   ROM_LOAD( "ladyki_1.d1", 0x000000, 0x080000, CRC(3dca957c) SHA1(4b815b7cb124a38c639a4b425ed6e8b1f0946451) ) // == e8.1d
5319    ROM_LOAD16_BYTE( "ladyki_3.h9",   0x000000, 0x080000, CRC(c658f954) SHA1(d50043457e67a94feff1328fe9bf522aa3c124b6) ) // == e2.8g
5320    ROM_LOAD16_BYTE( "ladyki_2.h10",  0x000001, 0x080000, CRC(bf58e4db) SHA1(9d7f74dc348b0ccb3bcf1b618d6092292b6945b8) ) // == e3.10g
5321    ROM_LOAD( "ladyki_1.d1", 0x000000, 0x080000, CRC(3dca957c) SHA1(4b815b7cb124a38c639a4b425ed6e8b1f0946451) ) // == e8.1d
53225322*/
53235323
53245324ROM_START( moegonta )
trunk/src/mame/drivers/hshavoc.c
r29404r29405
222222   }
223223
224224   DRIVER_INIT_CALL(megadriv);
225   
225
226226   m_vdp->stop_timers();
227227}
228228
trunk/src/mame/drivers/dunhuang.c
r29404r29405
130130   required_device<cpu_device> m_maincpu;
131131   required_device<gfxdecode_device> m_gfxdecode;
132132   required_device<screen_device> m_screen;
133   required_device<palette_device> m_palette;   
133   required_device<palette_device> m_palette;
134134};
135135
136136
trunk/src/mame/drivers/truco.c
r29404r29405
8383  - U15: 20-pin IC  YES   PLD         PALCE16V8H-25                  EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic.
8484  - U16: 20-pin IC  YES   PLD         PALCE16V8H-25                  EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic.
8585  - U17: 14-pin IC  YES   TTL         HD74LS00P                      Quadruple 2-Input NAND Gates.
86  - U18: 14-pin IC  YES   TTL         KS74HCTLS86N                   Quad 2−Input Exclusive OR Gate.
86  - U18: 14-pin IC  YES   TTL         KS74HCTLS86N                   Quad 2???Input Exclusive OR Gate.
8787  - U19: 16-pin IC  YES   WATCHDOG    MAXIM MAX691                   Microprocessor Supervisory Circuits.
8888  - U20: 16-pin IC  YES   DARLINGTON  ULN2003                        7 NPN Darlington transistor pairs with high voltage and current capability.
8989
trunk/src/mame/drivers/vball.c
r29404r29405
409409   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 8, 248)   /* based on ddragon driver */
410410   MCFG_SCREEN_UPDATE_DRIVER(vball_state, screen_update_vb)
411411   MCFG_SCREEN_PALETTE("palette")
412   
412
413413   MCFG_GFXDECODE_ADD("gfxdecode", "palette", vb)
414414   MCFG_PALETTE_ADD("palette", 256)
415415
trunk/src/mame/drivers/naomi.c
r29404r29405
25162516   MCFG_AICA_MASTER
25172517   MCFG_AICA_IRQ_CB(WRITELINE(naomi_state, aica_irq))
25182518   MCFG_AICA_MAIN_IRQ_CB(WRITELINE(naomi_state, sh4_aica_irq))
2519   
2519
25202520   MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
25212521   MCFG_SOUND_ROUTE(1, "rspeaker", 2.0)
25222522
r29404r29405
36383638ROM_START( f355twin )
36393639   F355_BIOS
36403640   NAOMI_DEFAULT_EEPROM
3641   
3641
36423642   ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF)
36433643   ROM_LOAD( "epr-22848.ic22",  0x0000000, 0x400000, CRC(a29edec2) SHA1(21ab3b5805e5aac20f51d0c468bcef1a655194bb) )
36443644   ROM_LOAD( "mpr-22827.ic1",   0x0800000, 0x800000, CRC(eeb1b975) SHA1(929f453eaf5565ae3e660dbbb8f406ff8aa7897d) )
r29404r29405
54635463
54645464   ROM_REGION( 4, "rom_key", 0 )
54655465   ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
5466   
5466
54675467   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02))
54685468ROM_END
54695469
r29404r29405
54785478
54795479   ROM_REGION( 4, "rom_key", 0 )
54805480   ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
5481   
5481
54825482   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x82))
54835483ROM_END
54845484
r29404r29405
54925492
54935493   ROM_REGION( 4, "rom_key", 0 )
54945494   ROM_LOAD( "zunou-key.bin", 0, 4, CRC(cbe35afb) SHA1(78877655800aae27661bf720e1c37d6c6f2e3d1c) )
5495   
5495
54965496   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02))
54975497ROM_END
54985498
r29404r29405
55085508
55095509   ROM_REGION( 4, "rom_key", 0 )
55105510   ROM_LOAD( "sl2007-key.bin", 0, 4, CRC(d5d1e807) SHA1(8a0cc371729c622bb05c5d26b3e39ec31d29ace1) )
5511   
5511
55125512   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
55135513ROM_END
55145514
r29404r29405
55245524
55255525   ROM_REGION( 4, "rom_key", 0 )
55265526   ROM_LOAD( "asndynmt-key.bin", 0, 4, CRC(bf5396a9) SHA1(0b27fdc800143fb977cb2f1e937078d7a7006939) )
5527   
5527
55285528   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
55295529ROM_END
55305530
r29404r29405
55405540
55415541   ROM_REGION( 4, "rom_key", 0 )
55425542   ROM_LOAD( "illvelo-key.bin", 0, 4, CRC(e164952f) SHA1(6c0dfe567640e1e843a5d7bf858a24c101dfcf95) )
5543   
5543
55445544   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
55455545ROM_END
55465546
r29404r29405
55565556
55575557   ROM_REGION( 4, "rom_key", 0 )
55585558   ROM_LOAD( "mamonoro-key.bin", 0x000000, 0x000004, CRC(264ca27a) SHA1(3b81b9794d86697f8eac7ea6945d992564ad6199) )
5559   
5559
55605560   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
55615561ROM_END
55625562
r29404r29405
55745574
55755575   ROM_REGION( 4, "rom_key", 0 )
55765576   ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) )
5577   
5577
55785578   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x06))
55795579ROM_END
55805580
r29404r29405
55935593
55945594   ROM_REGION( 4, "rom_key", 0 )
55955595   ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) )
5596   
5596
55975597   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x86))
55985598ROM_END
55995599
r29404r29405
56085608
56095609   ROM_REGION( 4, "rom_key", 0 )
56105610   ROM_LOAD( "radirgyn-key.bin", 0x000000, 0x000004, CRC(c158cf3b) SHA1(c128646d7fee79fc10bf7bbaa23121f347df77f4) )
5611   
5611
56125612   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56135613ROM_END
56145614
r29404r29405
56235623
56245624   ROM_REGION( 4, "rom_key", 0 )
56255625   ROM_LOAD( "ausfache-key.bin", 0, 4, CRC(93cdc793) SHA1(f0a0c321a3bdf8ca87cbd840a168a9057c08f16a) )
5626   
5626
56275627   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56285628ROM_END
56295629
r29404r29405
56335633
56345634   ROM_REGION( 0x14000000, "rom_board", ROMREGION_ERASEFF)
56355635   ROM_LOAD( "fpr-24408.ic8",  0x00000000, 0x4000000, CRC(cc6c722d) SHA1(5a3deb5c4e3e0c518f71fe76d8c1f9ffdf6c527d) )
5636   ROM_LOAD( "fpr-24372.ic9",  0x04000000, 0x4000000, CRC(869eb096) SHA1(60135ecc2b48c748ba98c26a3a266e7f5622971a) )
5637   ROM_LOAD( "fpr-24373.ic10", 0x08000000, 0x4000000, CRC(60a1cf35) SHA1(35d0f6cc7f8d3c0330e3ee0e23a24c7f94c1b607) )
5638   ROM_LOAD( "fpr-24374.ic11", 0x0c000000, 0x4000000, CRC(57023e31) SHA1(5191728a9c717150d694e6709fe84ec800b0eac9) )
5639   ROM_LOAD( "fpr-24375.ic12", 0x10000000, 0x4000000, CRC(959c5396) SHA1(d0f5b96c0e20a7d91fcf6961a5eb9f36f143a590) )
5636   ROM_LOAD( "fpr-24372.ic9",  0x04000000, 0x4000000, CRC(869eb096) SHA1(60135ecc2b48c748ba98c26a3a266e7f5622971a) )
5637   ROM_LOAD( "fpr-24373.ic10", 0x08000000, 0x4000000, CRC(60a1cf35) SHA1(35d0f6cc7f8d3c0330e3ee0e23a24c7f94c1b607) )
5638   ROM_LOAD( "fpr-24374.ic11", 0x0c000000, 0x4000000, CRC(57023e31) SHA1(5191728a9c717150d694e6709fe84ec800b0eac9) )
5639   ROM_LOAD( "fpr-24375.ic12", 0x10000000, 0x4000000, CRC(959c5396) SHA1(d0f5b96c0e20a7d91fcf6961a5eb9f36f143a590) )
56405640
56415641   ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4
56425642   ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) )
56435643
56445644   ROM_REGION( 4, "rom_key", 0 )
56455645   ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
5646   
5646
56475647   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05))
56485648ROM_END
56495649
r29404r29405
56635663
56645664   ROM_REGION( 4, "rom_key", 0 )
56655665   ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
5666   
5666
56675667   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05))
56685668ROM_END
56695669
r29404r29405
57615761   ROM_LOAD( "bhf1ma13.6n",  0xd000000, 0x1000000, CRC(055718ad) SHA1(355c4780231a4361aa6237dd34819b60d9df0fc7) )
57625762   ROM_LOAD( "bhf1ma14.6m",  0xe000000, 0x1000000, CRC(d06c9bd7) SHA1(54668a2fd31059976890da92709c18f308634887) )
57635763   ROM_LOAD( "bhf1ma15.6l",  0xf000000, 0x1000000, CRC(db3c396b) SHA1(da0e125d627ce890906ca100081ab0685e11c0ef) )
5764   
5764
57655765   ROM_REGION( 4, "rom_key", 0 )
57665766   ROM_LOAD( "bhf1-key.bin", 0x0000000, 0x0000004, CRC(9899e931) SHA1(c0837262b9069b33d0e72b418e80b5f0da8b9251) )
57675767ROM_END
r29404r29405
62806280   NAOMI_DEFAULT_EEPROM
62816281
62826282   ROM_REGION( 0x4800000, "rom_board", ROMREGION_ERASEFF)
6283   ROM_LOAD( "epr-23625.ic22", 0x000000, 0x0400000, CRC(7300bc6c) SHA1(f0bfff190c9f02895cc1f98eb695f327c948fca3) )
6283   ROM_LOAD( "epr-23625.ic22", 0x000000, 0x0400000, CRC(7300bc6c) SHA1(f0bfff190c9f02895cc1f98eb695f327c948fca3) )
62846284   ROM_RELOAD( 0x400000, 0x400000)
6285   ROM_LOAD( "mpr-23231.ic1",  0x0800000, 0x1000000, CRC(e41ddc53) SHA1(f565d68d8ce4010a2181b0343fa49bfdc81ba4cf) )
6286   ROM_LOAD( "mpr-23232.ic2",  0x1800000, 0x1000000, CRC(30f963a0) SHA1(dc56203ceae20f7a7354e505dd7f27cbce5c70e0) )
6287   ROM_LOAD( "mpr-23233.ic3",  0x2800000, 0x1000000, CRC(d6451cab) SHA1(6508e27d0370b19df01150da7baf4875479c166a) )
6288   ROM_LOAD( "mpr-23234.ic4",  0x3800000, 0x1000000, CRC(44044c14) SHA1(4934cb8d5f9b4085ffb5ddc711343f488aae4c4d) )
6285   ROM_LOAD( "mpr-23231.ic1",  0x0800000, 0x1000000, CRC(e41ddc53) SHA1(f565d68d8ce4010a2181b0343fa49bfdc81ba4cf) )
6286   ROM_LOAD( "mpr-23232.ic2",  0x1800000, 0x1000000, CRC(30f963a0) SHA1(dc56203ceae20f7a7354e505dd7f27cbce5c70e0) )
6287   ROM_LOAD( "mpr-23233.ic3",  0x2800000, 0x1000000, CRC(d6451cab) SHA1(6508e27d0370b19df01150da7baf4875479c166a) )
6288   ROM_LOAD( "mpr-23234.ic4",  0x3800000, 0x1000000, CRC(44044c14) SHA1(4934cb8d5f9b4085ffb5ddc711343f488aae4c4d) )
62896289
62906290   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
62916291   ROM_REGION(0x84, "some_eeprom", 0)
6292   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(951684e4) SHA1(0beaf5827064252293223b946c04b8698e7207bb) )
6292   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(951684e4) SHA1(0beaf5827064252293223b946c04b8698e7207bb) )
62936293ROM_END
62946294
62956295ROM_START( starhrct )
r29404r29405
62976297   NAOMI_DEFAULT_EEPROM
62986298
62996299   ROM_REGION( 0x9800000, "rom_board", ROMREGION_ERASEFF)
6300   ROM_LOAD( "epr-23626.ic22", 0x0000000, 0x200000, CRC(d5893a19) SHA1(861624ef3e5061b6ed9d6c4714e35fa508643b05) )
6300   ROM_LOAD( "epr-23626.ic22", 0x0000000, 0x200000, CRC(d5893a19) SHA1(861624ef3e5061b6ed9d6c4714e35fa508643b05) )
63016301   ROM_RELOAD( 0x400000, 0x200000)
6302   ROM_LOAD( "ic1s.bin",  0x0800000, 0x800000, CRC(e45ab26f) SHA1(1e40ae9778a026b0f4c3c9681cf5d08397b72c48) )
6303   ROM_LOAD( "ic2s.bin",  0x1000000, 0x800000, CRC(4d0e4e64) SHA1(4fe1c35f4cf34391eb1e4486bde92bd6104f05f2) )
6304   ROM_LOAD( "ic3s.bin",  0x1800000, 0x800000, CRC(a18c7ce7) SHA1(1e4fb63c0d8f901b077590ccc0af4bba3135f56c) )
6305   ROM_LOAD( "ic4s.bin",  0x2000000, 0x800000, CRC(82001b50) SHA1(d06e70d2ae4cf0635872663c5b6f1dbbd12897e0) )
6306   ROM_LOAD( "ic5s.bin",  0x2800000, 0x800000, CRC(5e4af8b2) SHA1(98598a0f5932cf79f54ff79cfa03632550dee373) )
6307   ROM_LOAD( "ic6s.bin",  0x3000000, 0x800000, CRC(2950c543) SHA1(041548e79afcadc1b0e3524432ed52320f395f3e) )
6308   ROM_LOAD( "ic7s.bin",  0x3800000, 0x800000, CRC(a2bb8ebb) SHA1(c5329cedf5f746c0d684d8dea301a0786909ea1d) )
6309   ROM_LOAD( "ic8s.bin",  0x4000000, 0x800000, CRC(fde9b537) SHA1(b186da26bef43b483fd32c486bb018dc631bf485) )
6310   ROM_LOAD( "ic9s.bin",  0x4800000, 0x800000, CRC(4db3e79a) SHA1(de2480792e7dfc01195000607be90fd4b29fdcc0) )
6311   ROM_LOAD( "ic10s.bin", 0x5000000, 0x800000, CRC(37167167) SHA1(e379d20bcda84e6aaa0b930dce95d97812cd45d6) )
6312   ROM_LOAD( "ic11s.bin", 0x5800000, 0x800000, CRC(927f1edb) SHA1(64f2f2f4546cc6b45ee78aeae68ce829cb57a124) )
6313   ROM_LOAD( "ic12s.bin", 0x6000000, 0x800000, CRC(05de610d) SHA1(715124a3e7a23589c4ca9f0dccd55a21f7d48123) )
6314   ROM_LOAD( "ic13s.bin", 0x6800000, 0x800000, CRC(17ed44c3) SHA1(ec34276006c3be7bd6d23c11314b0369a082e1ef) )
6315   ROM_LOAD( "ic14s.bin", 0x7000000, 0x800000, CRC(66d7e2a1) SHA1(69178d4995ac3c2d73d953544101d23da1812f65) )
6316   ROM_LOAD( "ic15s.bin", 0x7800000, 0x800000, CRC(0c701416) SHA1(6c9e882e2a00768f5e0a28d38a5695c65594d8dd) )
6317   ROM_LOAD( "ic16s.bin", 0x8000000, 0x800000, CRC(5d8e6e8d) SHA1(03045f3a9257632c325eba9752855b42355dff6c) )
6318   ROM_LOAD( "ic17s.bin", 0x8800000, 0x800000, CRC(b4c40606) SHA1(4f187dfe44bd89c90b6fa4b90f16222bc0a74d22) )
6302   ROM_LOAD( "ic1s.bin",  0x0800000, 0x800000, CRC(e45ab26f) SHA1(1e40ae9778a026b0f4c3c9681cf5d08397b72c48) )
6303   ROM_LOAD( "ic2s.bin",  0x1000000, 0x800000, CRC(4d0e4e64) SHA1(4fe1c35f4cf34391eb1e4486bde92bd6104f05f2) )
6304   ROM_LOAD( "ic3s.bin",  0x1800000, 0x800000, CRC(a18c7ce7) SHA1(1e4fb63c0d8f901b077590ccc0af4bba3135f56c) )
6305   ROM_LOAD( "ic4s.bin",  0x2000000, 0x800000, CRC(82001b50) SHA1(d06e70d2ae4cf0635872663c5b6f1dbbd12897e0) )
6306   ROM_LOAD( "ic5s.bin",  0x2800000, 0x800000, CRC(5e4af8b2) SHA1(98598a0f5932cf79f54ff79cfa03632550dee373) )
6307   ROM_LOAD( "ic6s.bin",  0x3000000, 0x800000, CRC(2950c543) SHA1(041548e79afcadc1b0e3524432ed52320f395f3e) )
6308   ROM_LOAD( "ic7s.bin",  0x3800000, 0x800000, CRC(a2bb8ebb) SHA1(c5329cedf5f746c0d684d8dea301a0786909ea1d) )
6309   ROM_LOAD( "ic8s.bin",  0x4000000, 0x800000, CRC(fde9b537) SHA1(b186da26bef43b483fd32c486bb018dc631bf485) )
6310   ROM_LOAD( "ic9s.bin",  0x4800000, 0x800000, CRC(4db3e79a) SHA1(de2480792e7dfc01195000607be90fd4b29fdcc0) )
6311   ROM_LOAD( "ic10s.bin", 0x5000000, 0x800000, CRC(37167167) SHA1(e379d20bcda84e6aaa0b930dce95d97812cd45d6) )
6312   ROM_LOAD( "ic11s.bin", 0x5800000, 0x800000, CRC(927f1edb) SHA1(64f2f2f4546cc6b45ee78aeae68ce829cb57a124) )
6313   ROM_LOAD( "ic12s.bin", 0x6000000, 0x800000, CRC(05de610d) SHA1(715124a3e7a23589c4ca9f0dccd55a21f7d48123) )
6314   ROM_LOAD( "ic13s.bin", 0x6800000, 0x800000, CRC(17ed44c3) SHA1(ec34276006c3be7bd6d23c11314b0369a082e1ef) )
6315   ROM_LOAD( "ic14s.bin", 0x7000000, 0x800000, CRC(66d7e2a1) SHA1(69178d4995ac3c2d73d953544101d23da1812f65) )
6316   ROM_LOAD( "ic15s.bin", 0x7800000, 0x800000, CRC(0c701416) SHA1(6c9e882e2a00768f5e0a28d38a5695c65594d8dd) )
6317   ROM_LOAD( "ic16s.bin", 0x8000000, 0x800000, CRC(5d8e6e8d) SHA1(03045f3a9257632c325eba9752855b42355dff6c) )
6318   ROM_LOAD( "ic17s.bin", 0x8800000, 0x800000, CRC(b4c40606) SHA1(4f187dfe44bd89c90b6fa4b90f16222bc0a74d22) )
63196319   // .18s chip is not present but is tested for an FF fill (pull-up resistors on the PCB's data bus presumably accomplish this)
63206320
63216321   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
63226322   ROM_REGION(0x84, "some_eeprom", 0)
6323   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(1557297e) SHA1(41e8a7a8eaf5076b124d378afdf97e328d100e72) )
6323   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(1557297e) SHA1(41e8a7a8eaf5076b124d378afdf97e328d100e72) )
63246324ROM_END
63256325
63266326ROM_START( starhrcl )
r29404r29405
63286328   NAOMI_DEFAULT_EEPROM
63296329
63306330   ROM_REGION( 0x7000000, "rom_board", ROMREGION_ERASEFF)
6331   ROM_LOAD( "epr-23627.ic22", 0x0000000, 0x0400000, CRC(7caccc5e) SHA1(86bff30b76b4b02467b37341582062de5c507a39) )
6332   ROM_LOAD( "mpr-23275.ic1",  0x0800000, 0x1000000, CRC(ffc62eab) SHA1(bb9dd3cc6540de1c194df99d5629583216f4c557) )
6333   ROM_LOAD( "mpr-23276.ic2",  0x1800000, 0x1000000, CRC(8b7ce666) SHA1(2848786659349598e019fbb05c92ed3ce6e2ec11) )
6334   ROM_LOAD( "mpr-23277.ic3",  0x2800000, 0x1000000, CRC(47a6f9c5) SHA1(9af5c3129a44fcffb87b1b021d8812e0b695967f) )
6335   ROM_LOAD( "mpr-23278.ic4",  0x3800000, 0x1000000, CRC(c12b189c) SHA1(7743500400a4e23a5e97a53ee16775c32d9abd5d) )
6336   ROM_LOAD( "mpr-23279.ic5",  0x4800000, 0x1000000, CRC(b8b39559) SHA1(082c9b6926557654c3f3bf00d741f32c560b50ce) )
6337   ROM_LOAD( "mpr-23280.ic6",  0x5800000, 0x1000000, CRC(b1c8daa2) SHA1(a05fb374156ea013e35502abccc92f5117c39daa) )
6338   ROM_LOAD( "mpr-23281.ic7",  0x6800000, 0x0800000, CRC(c0378369) SHA1(c728a181eddb01b9f8574669d4550baed559a5a4) )
6331   ROM_LOAD( "epr-23627.ic22", 0x0000000, 0x0400000, CRC(7caccc5e) SHA1(86bff30b76b4b02467b37341582062de5c507a39) )
6332   ROM_LOAD( "mpr-23275.ic1",  0x0800000, 0x1000000, CRC(ffc62eab) SHA1(bb9dd3cc6540de1c194df99d5629583216f4c557) )
6333   ROM_LOAD( "mpr-23276.ic2",  0x1800000, 0x1000000, CRC(8b7ce666) SHA1(2848786659349598e019fbb05c92ed3ce6e2ec11) )
6334   ROM_LOAD( "mpr-23277.ic3",  0x2800000, 0x1000000, CRC(47a6f9c5) SHA1(9af5c3129a44fcffb87b1b021d8812e0b695967f) )
6335   ROM_LOAD( "mpr-23278.ic4",  0x3800000, 0x1000000, CRC(c12b189c) SHA1(7743500400a4e23a5e97a53ee16775c32d9abd5d) )
6336   ROM_LOAD( "mpr-23279.ic5",  0x4800000, 0x1000000, CRC(b8b39559) SHA1(082c9b6926557654c3f3bf00d741f32c560b50ce) )
6337   ROM_LOAD( "mpr-23280.ic6",  0x5800000, 0x1000000, CRC(b1c8daa2) SHA1(a05fb374156ea013e35502abccc92f5117c39daa) )
6338   ROM_LOAD( "mpr-23281.ic7",  0x6800000, 0x0800000, CRC(c0378369) SHA1(c728a181eddb01b9f8574669d4550baed559a5a4) )
63396339
63406340   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
63416341   ROM_REGION(0x84, "some_eeprom", 0)
6342   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(4929e940) SHA1(f8c4277ca0ae5e36b2eed033cc731b8fc4fccafc) )
6342   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(4929e940) SHA1(f8c4277ca0ae5e36b2eed033cc731b8fc4fccafc) )
63436343ROM_END
63446344
63456345ROM_START( starhrsp )
r29404r29405
63646364   NAOMI_DEFAULT_EEPROM
63656365
63666366   ROM_REGION( 0xc000000, "rom_board", ROMREGION_ERASEFF)
6367   ROM_LOAD32_WORD( "ic17s.bin", 0x01000000, 0x800000, CRC(f51ce63b) SHA1(7642d5a78d103986ebe7bf9ecea7602490fcdfa2) )
6368   ROM_LOAD32_WORD( "ic18s.bin", 0x01000002, 0x800000, CRC(7109decc) SHA1(91481f427d4d28c3ff1805eb00b63deb9d691b27) )
6369   ROM_LOAD32_WORD( "ic19s.bin", 0x02000000, 0x800000, CRC(a58efa9c) SHA1(ff83c25ef4094c1033b906bd048569927b0828c2) )
6370   ROM_LOAD32_WORD( "ic20s.bin", 0x02000002, 0x800000, CRC(6dee24b2) SHA1(ef6eb8aa239af6b02169618dd2594fc9c62086dc) )
6371   ROM_LOAD32_WORD( "ic21s.bin", 0x03000000, 0x800000, CRC(9a0564c2) SHA1(71fa98fd4815a119ff2cbe07298fefc25a2cde79) )
6372   ROM_LOAD32_WORD( "ic22s.bin", 0x03000002, 0x800000, CRC(df692133) SHA1(9433010ca070003d59a18239cd2637e6f9bffeae) )
6373   ROM_LOAD32_WORD( "ic23s.bin", 0x04000000, 0x800000, CRC(61c98256) SHA1(a1e4e6fa7c2672d49ff6a0a5a239d9f405797248) )
6374   ROM_LOAD32_WORD( "ic24s.bin", 0x04000002, 0x800000, CRC(c7e8ec24) SHA1(7cf7fc4954caff3fe2bb14964889d79250e6e4db) )
6375   ROM_LOAD32_WORD( "ic25s.bin", 0x05000000, 0x800000, CRC(2cb47ef5) SHA1(3f6cea2ca7857bd441f9632cd295c5f57a3d59fc) )
6376   ROM_LOAD32_WORD( "ic26s.bin", 0x05000002, 0x800000, CRC(f5b477d5) SHA1(f79d65bee22800dce2964666278c285d15c059e7) )
6377   ROM_LOAD32_WORD( "ic27s.bin", 0x06000000, 0x800000, CRC(22c07470) SHA1(4e64b632a4dad2d6a565d90aa34a00739a2a4ad4) )
6378   ROM_LOAD32_WORD( "ic28s.bin", 0x06000002, 0x800000, CRC(018233e0) SHA1(168430d66c59db49d113b65ae6dac9ddb9919661) )
6379   ROM_LOAD32_WORD( "ic29s.bin", 0x07000000, 0x800000, CRC(96101b95) SHA1(b818f24b551eaf3a35d8eb23b7e7df2af5ceef5f) )
6380   ROM_LOAD32_WORD( "ic30s.bin", 0x07000002, 0x800000, CRC(16dff39b) SHA1(b3899ab22056015ed3fd4ee06f687d9dca540ece) )
6381   ROM_LOAD32_WORD( "ic31s.bin", 0x08000000, 0x800000, CRC(510c03dd) SHA1(1488a574590be8927bc8c403105b6fb72c829177) )
6382   ROM_LOAD32_WORD( "ic32s.bin", 0x08000002, 0x800000, CRC(b184e263) SHA1(5089b13c160708c4ddee36e4fb89110ab6281690) )
6383   ROM_LOAD32_WORD( "ic33s.bin", 0x09000000, 0x800000, CRC(be2a164b) SHA1(a1d93e84e7e35ec55e738dc27069295cd0610f27) )
6384   ROM_LOAD32_WORD( "ic34s.bin", 0x09000002, 0x800000, CRC(01e0a163) SHA1(7730ce21e9041c70d39700d4ea2ff3adf54a315e) )
6385   ROM_LOAD32_WORD( "ic35s.bin", 0x0a000000, 0x800000, CRC(ae0c1caa) SHA1(548c5e6cb0c99ba8f0a758bb66fb8d949b2da1a0) )
6386   ROM_LOAD32_WORD( "ic36s.bin", 0x0a000002, 0x800000, CRC(6de8d5c7) SHA1(896520ab7cf458fddeacdad7a535976445048d8f) )
6387   ROM_LOAD32_WORD( "ic37s.bin", 0x0b000000, 0x800000, CRC(fc89454c) SHA1(f0550e17930c71d81050f18eceb312fe82c084c2) )
6388   ROM_LOAD32_WORD( "ic38s.bin", 0x0b000002, 0x800000, CRC(86954476) SHA1(ba2b31032321abf5ddfe7cff7803ae4fa944812c) )
6367   ROM_LOAD32_WORD( "ic17s.bin", 0x01000000, 0x800000, CRC(f51ce63b) SHA1(7642d5a78d103986ebe7bf9ecea7602490fcdfa2) )
6368   ROM_LOAD32_WORD( "ic18s.bin", 0x01000002, 0x800000, CRC(7109decc) SHA1(91481f427d4d28c3ff1805eb00b63deb9d691b27) )
6369   ROM_LOAD32_WORD( "ic19s.bin", 0x02000000, 0x800000, CRC(a58efa9c) SHA1(ff83c25ef4094c1033b906bd048569927b0828c2) )
6370   ROM_LOAD32_WORD( "ic20s.bin", 0x02000002, 0x800000, CRC(6dee24b2) SHA1(ef6eb8aa239af6b02169618dd2594fc9c62086dc) )
6371   ROM_LOAD32_WORD( "ic21s.bin", 0x03000000, 0x800000, CRC(9a0564c2) SHA1(71fa98fd4815a119ff2cbe07298fefc25a2cde79) )
6372   ROM_LOAD32_WORD( "ic22s.bin", 0x03000002, 0x800000, CRC(df692133) SHA1(9433010ca070003d59a18239cd2637e6f9bffeae) )
6373   ROM_LOAD32_WORD( "ic23s.bin", 0x04000000, 0x800000, CRC(61c98256) SHA1(a1e4e6fa7c2672d49ff6a0a5a239d9f405797248) )
6374   ROM_LOAD32_WORD( "ic24s.bin", 0x04000002, 0x800000, CRC(c7e8ec24) SHA1(7cf7fc4954caff3fe2bb14964889d79250e6e4db) )
6375   ROM_LOAD32_WORD( "ic25s.bin", 0x05000000, 0x800000, CRC(2cb47ef5) SHA1(3f6cea2ca7857bd441f9632cd295c5f57a3d59fc) )
6376   ROM_LOAD32_WORD( "ic26s.bin", 0x05000002, 0x800000, CRC(f5b477d5) SHA1(f79d65bee22800dce2964666278c285d15c059e7) )
6377   ROM_LOAD32_WORD( "ic27s.bin", 0x06000000, 0x800000, CRC(22c07470) SHA1(4e64b632a4dad2d6a565d90aa34a00739a2a4ad4) )
6378   ROM_LOAD32_WORD( "ic28s.bin", 0x06000002, 0x800000, CRC(018233e0) SHA1(168430d66c59db49d113b65ae6dac9ddb9919661) )
6379   ROM_LOAD32_WORD( "ic29s.bin", 0x07000000, 0x800000, CRC(96101b95) SHA1(b818f24b551eaf3a35d8eb23b7e7df2af5ceef5f) )
6380   ROM_LOAD32_WORD( "ic30s.bin", 0x07000002, 0x800000, CRC(16dff39b) SHA1(b3899ab22056015ed3fd4ee06f687d9dca540ece) )
6381   ROM_LOAD32_WORD( "ic31s.bin", 0x08000000, 0x800000, CRC(510c03dd) SHA1(1488a574590be8927bc8c403105b6fb72c829177) )
6382   ROM_LOAD32_WORD( "ic32s.bin", 0x08000002, 0x800000, CRC(b184e263) SHA1(5089b13c160708c4ddee36e4fb89110ab6281690) )
6383   ROM_LOAD32_WORD( "ic33s.bin", 0x09000000, 0x800000, CRC(be2a164b) SHA1(a1d93e84e7e35ec55e738dc27069295cd0610f27) )
6384   ROM_LOAD32_WORD( "ic34s.bin", 0x09000002, 0x800000, CRC(01e0a163) SHA1(7730ce21e9041c70d39700d4ea2ff3adf54a315e) )
6385   ROM_LOAD32_WORD( "ic35s.bin", 0x0a000000, 0x800000, CRC(ae0c1caa) SHA1(548c5e6cb0c99ba8f0a758bb66fb8d949b2da1a0) )
6386   ROM_LOAD32_WORD( "ic36s.bin", 0x0a000002, 0x800000, CRC(6de8d5c7) SHA1(896520ab7cf458fddeacdad7a535976445048d8f) )
6387   ROM_LOAD32_WORD( "ic37s.bin", 0x0b000000, 0x800000, CRC(fc89454c) SHA1(f0550e17930c71d81050f18eceb312fe82c084c2) )
6388   ROM_LOAD32_WORD( "ic38s.bin", 0x0b000002, 0x800000, CRC(86954476) SHA1(ba2b31032321abf5ddfe7cff7803ae4fa944812c) )
63896389
63906390   ROM_COPY( "rom_board", 0x01000000, 0x400000, 0xc00000 )
63916391
r29404r29405
63946394
63956395   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
63966396   ROM_REGION(0x84, "some_eeprom", 0)
6397   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(17150bc9) SHA1(c3af7d91e12141938d2b9e67eb9f5ff961cd09ff) )
6397   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(17150bc9) SHA1(c3af7d91e12141938d2b9e67eb9f5ff961cd09ff) )
63986398ROM_END
63996399
64006400/* GD-ROM titles - a PIC supplies a decryption key
r29404r29405
75367536   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
75377537   //PIC16C621A (317-0567-EXP)
75387538   //(sticker 253-5508-0567)
7539   ROM_LOAD("317-0567-exp.pic", 0x00, 0x4000, NO_DUMP )
7539   ROM_LOAD("317-0567-exp.pic", 0x00, 0x4000, NO_DUMP )
75407540ROM_END
75417541
75427542
r29404r29405
77317731   NAOMI_DEFAULT_EEPROM
77327732
77337733   ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF)
7734   ROM_LOAD( "epr-24083.ic11", 0x000000, 0x400000, CRC(2733e65a) SHA1(4a5d109d0531bebd8e8f585789adce98cac2ab93) )
7734   ROM_LOAD( "epr-24083.ic11", 0x000000, 0x400000, CRC(2733e65a) SHA1(4a5d109d0531bebd8e8f585789adce98cac2ab93) )
77357735
77367736   ROM_REGION( 0x40000, "flash", ROMREGION_ERASEFF)
7737   ROM_LOAD( "315-6358a.ic2", 0x000000, 0x020008, CRC(ef442e67) SHA1(70ac91e2ca1ff2dfba48d566e4de68bd8b82f282) )
7737   ROM_LOAD( "315-6358a.ic2", 0x000000, 0x020008, CRC(ef442e67) SHA1(70ac91e2ca1ff2dfba48d566e4de68bd8b82f282) )
77387738
77397739   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
77407740   ROM_REGION(0x84, "some_eeprom", 0)
7741   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(ddedf494) SHA1(f1529615711a9871051cd09c2a9b95c90d356874) )
7741   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(ddedf494) SHA1(f1529615711a9871051cd09c2a9b95c90d356874) )
77427742ROM_END
77437743
77447744ROM_START( clubkrte )
r29404r29405
77907790   NAOMI_DEFAULT_EEPROM
77917791
77927792   ROM_REGION( 0x9000000, "rom_board", ROMREGION_ERASEFF)
7793   ROM_LOAD( "epr-24065.ic11", 0x000000, 0x400000, CRC(7c331cb8) SHA1(f7e1cffbad576482a91bc1dc9129c689f0bebb25) )
7794   ROM_LOAD32_WORD( "opr-24066.17s", 0x1000000, 0x800000, CRC(b22cfa7b) SHA1(e0f795dc9d3a2dd1869f85f3eedd0f8d703a1be8) )
7795   ROM_LOAD32_WORD( "opr-24067.18",  0x1000002, 0x800000, CRC(0d2d1290) SHA1(a26fa82fc87d6ed60095b2e778b649fcbb8bb1ee) )
7796   ROM_LOAD32_WORD( "opr-24068.19s", 0x2000000, 0x800000, CRC(d320009b) SHA1(76677eacd18770d091fc19e31be3d84410ed3256) )
7797   ROM_LOAD32_WORD( "opr-24069.20",  0x2000002, 0x800000, CRC(56145c73) SHA1(a74a97a431a315f86a1b25d1fc9cc1fb93146776) )
7798   ROM_LOAD32_WORD( "opr-24070.21s", 0x3000000, 0x800000, CRC(10a0c315) SHA1(337902393e215d94954f123c6b016925486c3374) )
7799   ROM_LOAD32_WORD( "opr-24071.22",  0x3000002, 0x800000, CRC(040e1329) SHA1(cebf8bc48a745811bcc6bce0ad880eca392428f9) )
7800   ROM_LOAD32_WORD( "opr-24072.23s", 0x4000000, 0x800000, CRC(1e9834e4) SHA1(a226689190739a39016b78c881f92b9bbb8d830e) )
7801   ROM_LOAD32_WORD( "opr-24073.24",  0x4000002, 0x800000, CRC(51fb7d42) SHA1(fb0bffeb181b1f3efcfa22aabda1bea926d9048b) )
7802   ROM_LOAD32_WORD( "opr-24074.25s", 0x5000000, 0x800000, CRC(636625fe) SHA1(fffd766cf14e66d10071a342573535ac708f87b7) )
7803   ROM_LOAD32_WORD( "opr-24075.26",  0x5000002, 0x800000, CRC(9eee9689) SHA1(831ac7713cc4f47679609361f0e1c67bb028e795) )
7804   ROM_LOAD32_WORD( "opr-24076.27s", 0x6000000, 0x800000, CRC(a89a5555) SHA1(c2c0eeb50f1afe6c7c3d978a99c6eaac96062bf0) )
7805   ROM_LOAD32_WORD( "opr-24077.28",  0x6000002, 0x800000, CRC(1e11d0aa) SHA1(1cc4dd05e1fbd0fde669b40aa49098c14eafd035) )
7806   ROM_LOAD32_WORD( "opr-24078.29",  0x7000000, 0x800000, CRC(a83f5f88) SHA1(ef0787cf84847e74fa3bb38d7133d87607df84fb) )
7807   ROM_LOAD32_WORD( "opr-24079.30s", 0x7000002, 0x800000, CRC(57efa68f) SHA1(5dd863dfb035489de3bbb3c3f72ee5d87ec322be) )
7808   ROM_LOAD32_WORD( "opr-24080.31",  0x8000000, 0x800000, CRC(307c480e) SHA1(6e52f252f557988e52c42d495713a374507b5895) )
7809   ROM_LOAD32_WORD( "opr-24081.32s", 0x8000002, 0x800000, CRC(61085bdc) SHA1(48fe7f34bb5f50825b3c77d587e07f3adab1cf86) )
7793   ROM_LOAD( "epr-24065.ic11", 0x000000, 0x400000, CRC(7c331cb8) SHA1(f7e1cffbad576482a91bc1dc9129c689f0bebb25) )
7794   ROM_LOAD32_WORD( "opr-24066.17s", 0x1000000, 0x800000, CRC(b22cfa7b) SHA1(e0f795dc9d3a2dd1869f85f3eedd0f8d703a1be8) )
7795   ROM_LOAD32_WORD( "opr-24067.18",  0x1000002, 0x800000, CRC(0d2d1290) SHA1(a26fa82fc87d6ed60095b2e778b649fcbb8bb1ee) )
7796   ROM_LOAD32_WORD( "opr-24068.19s", 0x2000000, 0x800000, CRC(d320009b) SHA1(76677eacd18770d091fc19e31be3d84410ed3256) )
7797   ROM_LOAD32_WORD( "opr-24069.20",  0x2000002, 0x800000, CRC(56145c73) SHA1(a74a97a431a315f86a1b25d1fc9cc1fb93146776) )
7798   ROM_LOAD32_WORD( "opr-24070.21s", 0x3000000, 0x800000, CRC(10a0c315) SHA1(337902393e215d94954f123c6b016925486c3374) )
7799   ROM_LOAD32_WORD( "opr-24071.22",  0x3000002, 0x800000, CRC(040e1329) SHA1(cebf8bc48a745811bcc6bce0ad880eca392428f9) )
7800   ROM_LOAD32_WORD( "opr-24072.23s", 0x4000000, 0x800000, CRC(1e9834e4) SHA1(a226689190739a39016b78c881f92b9bbb8d830e) )
7801   ROM_LOAD32_WORD( "opr-24073.24",  0x4000002, 0x800000, CRC(51fb7d42) SHA1(fb0bffeb181b1f3efcfa22aabda1bea926d9048b) )
7802   ROM_LOAD32_WORD( "opr-24074.25s", 0x5000000, 0x800000, CRC(636625fe) SHA1(fffd766cf14e66d10071a342573535ac708f87b7) )
7803   ROM_LOAD32_WORD( "opr-24075.26",  0x5000002, 0x800000, CRC(9eee9689) SHA1(831ac7713cc4f47679609361f0e1c67bb028e795) )
7804   ROM_LOAD32_WORD( "opr-24076.27s", 0x6000000, 0x800000, CRC(a89a5555) SHA1(c2c0eeb50f1afe6c7c3d978a99c6eaac96062bf0) )
7805   ROM_LOAD32_WORD( "opr-24077.28",  0x6000002, 0x800000, CRC(1e11d0aa) SHA1(1cc4dd05e1fbd0fde669b40aa49098c14eafd035) )
7806   ROM_LOAD32_WORD( "opr-24078.29",  0x7000000, 0x800000, CRC(a83f5f88) SHA1(ef0787cf84847e74fa3bb38d7133d87607df84fb) )
7807   ROM_LOAD32_WORD( "opr-24079.30s", 0x7000002, 0x800000, CRC(57efa68f) SHA1(5dd863dfb035489de3bbb3c3f72ee5d87ec322be) )
7808   ROM_LOAD32_WORD( "opr-24080.31",  0x8000000, 0x800000, CRC(307c480e) SHA1(6e52f252f557988e52c42d495713a374507b5895) )
7809   ROM_LOAD32_WORD( "opr-24081.32s", 0x8000002, 0x800000, CRC(61085bdc) SHA1(48fe7f34bb5f50825b3c77d587e07f3adab1cf86) )
78107810
78117811   ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 )
78127812
78137813   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
78147814   ROM_REGION(0x84, "some_eeprom", 0)
7815   ROM_LOAD( "at25010.ic3s", 0x000000, 0x000084, CRC(0142d8be) SHA1(5922b6c47b12b19e1fa7bbe9aae391905038a7ff) )
7815   ROM_LOAD( "at25010.ic3s", 0x000000, 0x000084, CRC(0142d8be) SHA1(5922b6c47b12b19e1fa7bbe9aae391905038a7ff) )
78167816
7817   ROM_REGION( 4, "rom_key", 0 )   // 317-0368-COM
7818   ROM_LOAD( "clubkprz-key.bin", 0x000000, 0x000004, CRC(c9ed13c1) SHA1(2907985375cd5b04846e7214d200926be64d06fd) )
7817   ROM_REGION( 4, "rom_key", 0 )   // 317-0368-COM
7818   ROM_LOAD( "clubkprz-key.bin", 0x000000, 0x000004, CRC(c9ed13c1) SHA1(2907985375cd5b04846e7214d200926be64d06fd) )
78197819ROM_END
78207820
78217821ROM_START( clubkpzb )
r29404r29405
78237823   NAOMI_DEFAULT_EEPROM
78247824
78257825   ROM_REGION( 0x9000000, "rom_board", ROMREGION_ERASEFF)
7826   ROM_LOAD( "epr-24149.ic11", 0x000000, 0x400000, CRC(175b57a5) SHA1(de8ddd140c39d62a10d90ec46060d84c3b226c6b) )
7827   ROM_LOAD32_WORD( "opr-24178.ic17s", 0x1000000, 0x800000, CRC(836764ca) SHA1(e91cf7abeb27013d33726029d060075fa6352610) )
7828   ROM_LOAD32_WORD( "opr-24179.ic18",  0x1000002, 0x800000, CRC(03a0eb5b) SHA1(3f377d5a13d54c40c521f0faf6d50dc4fc077bb7) )
7829   ROM_LOAD32_WORD( "opr-24180.ic19s", 0x2000000, 0x800000, CRC(6a6c41f4) SHA1(3b01476b0483ce5e2f7e208e618ad56769b5c064) )
7830   ROM_LOAD32_WORD( "opr-24181.ic20",  0x2000002, 0x800000, CRC(38fd96fd) SHA1(c26ffc01529b4533c5e1448a774fa6e5f7e08080) )
7831   ROM_LOAD32_WORD( "opr-24182.ic21s", 0x3000000, 0x800000, CRC(b1116d71) SHA1(c840ae3602055528e4282283e5bc99465c6b5d28) )
7832   ROM_LOAD32_WORD( "opr-24183.ic22",  0x3000002, 0x800000, CRC(c1aef164) SHA1(e9a830a3a4bac4f5b2b40615bc43036aa0dd0a56) )
7833   ROM_LOAD32_WORD( "opr-24184.ic23s", 0x4000000, 0x800000, CRC(4ce1b902) SHA1(41b2fb02e3b9a0bb6ea8c7d77a9fb92248d62bcc) )
7834   ROM_LOAD32_WORD( "opr-24185.ic24",  0x4000002, 0x800000, CRC(94a4e6ab) SHA1(8738fcc75becf2acd5bc2c1be75e9a5c35359973) )
7835   ROM_LOAD32_WORD( "opr-24186.ic25s", 0x5000000, 0x800000, CRC(6884d0e9) SHA1(74ef002a752fcd377c5e6e6c17334ca22e561c76) )
7836   ROM_LOAD32_WORD( "opr-24187.ic26",  0x5000002, 0x800000, CRC(87c79534) SHA1(ab6e5246c388d0839ea6a45c8d2db035b33cd1d2) )
7837   ROM_LOAD32_WORD( "opr-24188.ic27s", 0x6000000, 0x800000, CRC(cfe107a2) SHA1(2f98bc00aa2b2eea0a26452542098c389f5e836c) )
7838   ROM_LOAD32_WORD( "opr-24189.ic28",  0x6000002, 0x800000, CRC(302de147) SHA1(442204439c509a6aa7dd25156bf17fb3853ae632) )
7839   ROM_LOAD32_WORD( "opr-24190.ic29",  0x7000000, 0x800000, CRC(71551313) SHA1(4b43d754b9511ae2d73ec04d7baf0e466337a82f) )
7840   ROM_LOAD32_WORD( "opr-24191.ic30s", 0x7000002, 0x800000, CRC(200cbeaf) SHA1(ccca2b873177d148a391cfcc8b1632856bd0e3b4) )
7841   ROM_LOAD32_WORD( "opr-24192.ic31",  0x8000000, 0x800000, CRC(869ef0ce) SHA1(227189dedfa72c56d9eedf5faeed9a4fd0a8393f) )
7842   ROM_LOAD32_WORD( "opr-24193.ic32s", 0x8000002, 0x800000, CRC(fb39946d) SHA1(d9fa077869709c6fda640bd4be18cf3db7ebe1d1) )
7826   ROM_LOAD( "epr-24149.ic11", 0x000000, 0x400000, CRC(175b57a5) SHA1(de8ddd140c39d62a10d90ec46060d84c3b226c6b) )
7827   ROM_LOAD32_WORD( "opr-24178.ic17s", 0x1000000, 0x800000, CRC(836764ca) SHA1(e91cf7abeb27013d33726029d060075fa6352610) )
7828   ROM_LOAD32_WORD( "opr-24179.ic18",  0x1000002, 0x800000, CRC(03a0eb5b) SHA1(3f377d5a13d54c40c521f0faf6d50dc4fc077bb7) )
7829   ROM_LOAD32_WORD( "opr-24180.ic19s", 0x2000000, 0x800000, CRC(6a6c41f4) SHA1(3b01476b0483ce5e2f7e208e618ad56769b5c064) )
7830   ROM_LOAD32_WORD( "opr-24181.ic20",  0x2000002, 0x800000, CRC(38fd96fd) SHA1(c26ffc01529b4533c5e1448a774fa6e5f7e08080) )
7831   ROM_LOAD32_WORD( "opr-24182.ic21s", 0x3000000, 0x800000, CRC(b1116d71) SHA1(c840ae3602055528e4282283e5bc99465c6b5d28) )
7832   ROM_LOAD32_WORD( "opr-24183.ic22",  0x3000002, 0x800000, CRC(c1aef164) SHA1(e9a830a3a4bac4f5b2b40615bc43036aa0dd0a56) )
7833   ROM_LOAD32_WORD( "opr-24184.ic23s", 0x4000000, 0x800000, CRC(4ce1b902) SHA1(41b2fb02e3b9a0bb6ea8c7d77a9fb92248d62bcc) )
7834   ROM_LOAD32_WORD( "opr-24185.ic24",  0x4000002, 0x800000, CRC(94a4e6ab) SHA1(8738fcc75becf2acd5bc2c1be75e9a5c35359973) )
7835   ROM_LOAD32_WORD( "opr-24186.ic25s", 0x5000000, 0x800000, CRC(6884d0e9) SHA1(74ef002a752fcd377c5e6e6c17334ca22e561c76) )
7836   ROM_LOAD32_WORD( "opr-24187.ic26",  0x5000002, 0x800000, CRC(87c79534) SHA1(ab6e5246c388d0839ea6a45c8d2db035b33cd1d2) )
7837   ROM_LOAD32_WORD( "opr-24188.ic27s", 0x6000000, 0x800000, CRC(cfe107a2) SHA1(2f98bc00aa2b2eea0a26452542098c389f5e836c) )
7838   ROM_LOAD32_WORD( "opr-24189.ic28",  0x6000002, 0x800000, CRC(302de147) SHA1(442204439c509a6aa7dd25156bf17fb3853ae632) )
7839   ROM_LOAD32_WORD( "opr-24190.ic29",  0x7000000, 0x800000, CRC(71551313) SHA1(4b43d754b9511ae2d73ec04d7baf0e466337a82f) )
7840   ROM_LOAD32_WORD( "opr-24191.ic30s", 0x7000002, 0x800000, CRC(200cbeaf) SHA1(ccca2b873177d148a391cfcc8b1632856bd0e3b4) )
7841   ROM_LOAD32_WORD( "opr-24192.ic31",  0x8000000, 0x800000, CRC(869ef0ce) SHA1(227189dedfa72c56d9eedf5faeed9a4fd0a8393f) )
7842   ROM_LOAD32_WORD( "opr-24193.ic32s", 0x8000002, 0x800000, CRC(fb39946d) SHA1(d9fa077869709c6fda640bd4be18cf3db7ebe1d1) )
78437843
78447844   ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 )
78457845
78467846   ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 )
7847   ROM_LOAD( "clubkprz-key.bin", 0x000000, 0x000004, CRC(c9ed13c1) SHA1(2907985375cd5b04846e7214d200926be64d06fd) )
7847   ROM_LOAD( "clubkprz-key.bin", 0x000000, 0x000004, CRC(c9ed13c1) SHA1(2907985375cd5b04846e7214d200926be64d06fd) )
78487848
78497849   // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes
78507850   ROM_REGION(0x84, "some_eeprom", 0)
7851   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(afff6471) SHA1(c1e1d349ff25191eba09cd7d7186fbe2c6565b81) )
7851   ROM_LOAD( "sflash.bin",   0x000000, 0x000084, CRC(afff6471) SHA1(c1e1d349ff25191eba09cd7d7186fbe2c6565b81) )
78527852ROM_END
78537853
78547854// needs verification is this dump really from 840-0139C cart, mask rom labels not known
r29404r29405
81888188
81898189   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
81908190   //PIC16C621A (317-0406-COM)
8191   //(sticker 253-5508-0406)
8191   //(sticker 253-5508-0406)
81928192   ROM_LOAD("317-0406-com.pic", 0x00, 0x4000, NO_DUMP )
81938193ROM_END
81948194
r29404r29405
87578757/* 0087 */ GAME( 2002, kingrt66, naomi2,  naomi2,   naomi, naomi_state, naomi2,   ROT0, "Sega", "King of Route 66 (Rev A)", GAME_FLAGS )
87588758/* 0095 */ GAME( 2002, soulsurf, naomi2,  naomi2,   naomi, naomi_state, naomi2,   ROT0, "Sega", "Soul Surfer (Rev A)", GAME_FLAGS )
87598759/* 0106 */ GAME( 2002, vf4evoct, naomi2,  naomi2m1, naomi, naomi_state, vf4evoct, ROT0, "Sega", "Virtua Fighter 4 Evolution (Cartridge)", GAME_FLAGS )
8760/* 0129 */ GAME( 2003, clubkprz, naomi2,  naomi2m1, naomi, naomi_state, naomi2,   ROT0, "Sega", "Club Kart Prize", GAME_FLAGS )
8760/* 0129 */ GAME( 2003, clubkprz, naomi2,  naomi2m1, naomi, naomi_state, naomi2,   ROT0, "Sega", "Club Kart Prize", GAME_FLAGS )
87618761/* Note: the game's full name is exactly "Club Kart Prize Ver. B".  The "Ver. B" does not denote a new revision of Club Kart Prize; the different 840- number confirms this. */
87628762/* 0137 */ GAME( 2004, clubkpzb, naomi2,  naomi2m1, naomi, naomi_state, naomi2,   ROT0, "Sega", "Club Kart Prize Ver. B", GAME_FLAGS )
87638763// needs verification is this dump really from 840-0139C cart
trunk/src/mame/drivers/jackie.c
r29404r29405
7676   required_device<gfxdecode_device> m_gfxdecode;
7777   required_device<screen_device> m_screen;
7878   required_device<palette_device> m_palette;
79   
79
8080   int m_exp_bank;
8181   tilemap_t *m_fg_tilemap;
8282   tilemap_t *m_reel1_tilemap;
trunk/src/mame/drivers/bnstars.c
r29404r29405
12591259   AM_RANGE(0x00000000, 0x001fffff) AM_ROM
12601260
12611261   AM_RANGE(0xfc800000, 0xfc800003) AM_WRITE(ms32_sound_w)
1262   
1262
12631263   AM_RANGE(0xfcc00004, 0xfcc00007) AM_READ(bnstars1_r )
12641264   AM_RANGE(0xfcc00008, 0xfcc0000b) AM_READ_PORT("IN4")
12651265   AM_RANGE(0xfcc00010, 0xfcc00013) AM_READ_PORT("IN5")
r29404r29405
12821282   AM_RANGE(0xfce00e00, 0xfce00e03) AM_WRITE(bnstars1_mahjong_select_w) // ?
12831283
12841284   AM_RANGE(0xfd000000, 0xfd000003) AM_READ(ms32_sound_r)
1285   
1285
12861286   /* wrote together */
12871287   AM_RANGE(0xfd040000, 0xfd047fff) AM_RAM // priority ram
12881288   AM_RANGE(0xfd080000, 0xfd087fff) AM_RAM
trunk/src/mame/drivers/blackt96.c
r29404r29405
329329   AM_RANGE(0x207000, 0x207fff) AM_RAM_WRITE(bg_videoram7_w) AM_SHARE("spriteram7")
330330
331331
332   AM_RANGE(0x400000, 0x400fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
332   AM_RANGE(0x400000, 0x400fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
333333   AM_RANGE(0xc00000, 0xc03fff) AM_RAM // main ram
334334
335335ADDRESS_MAP_END
trunk/src/mame/drivers/3x3puzzl.c
r29404r29405
7272   required_device<okim6295_device> m_oki;
7373   required_device<gfxdecode_device> m_gfxdecode;
7474   required_device<screen_device> m_screen;
75   
75
7676   // screen updates
7777   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7878
trunk/src/mame/drivers/realbrk.c
r29404r29405
788788static MACHINE_CONFIG_DERIVED( pkgnsh, realbrk )
789789   MCFG_CPU_MODIFY("maincpu")
790790   MCFG_CPU_PROGRAM_MAP(pkgnsh_mem)
791   
791
792792   MCFG_DEVICE_MODIFY("tmp68301")
793793   MCFG_TMP68301_OUT_PARALLEL_CB(NULL)
794794MACHINE_CONFIG_END
trunk/src/mame/drivers/arcadia.c
r29404r29405
1818        World Darts
1919        Xenon
2020        World Trophy Soccer
21      Delta Command (N.Y Warriors)
22      Blastaball
23      Aaargh
24      Pharaohs Match
21        Delta Command (N.Y Warriors)
22        Blastaball
23        Aaargh
24        Pharaohs Match
2525
2626    Other Arcadia games (not dumped):
2727
r29404r29405
218218   AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE(amiga_custom_r, amiga_custom_w) AM_SHARE("custom_regs")
219219   AM_RANGE(0xe80000, 0xe8ffff) AM_READWRITE(amiga_autoconfig_r, amiga_autoconfig_w)
220220   AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0)       /* Kickstart BIOS */
221   
221
222222   AM_RANGE(0x800000, 0x97ffff) AM_ROMBANK("bank2") AM_REGION("user3", 0)
223223   AM_RANGE(0x980000, 0x9fbfff) AM_ROM AM_REGION("user2", 0)
224224   AM_RANGE(0x9fc000, 0x9ffffd) AM_RAM AM_SHARE("nvram")
r29404r29405
235235   AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0)       /* Kickstart BIOS */
236236
237237   AM_RANGE(0x800000, 0x97ffff) AM_ROMBANK("bank2") AM_REGION("user3", 0)
238//   AM_RANGE(0x980000, 0x9fefff) AM_ROM AM_REGION("user3", 0)
238//  AM_RANGE(0x980000, 0x9fefff) AM_ROM AM_REGION("user3", 0)
239239   AM_RANGE(0x9ff000, 0x9fffff) AM_RAM AM_SHARE("nvram")
240240   AM_RANGE(0xf00000, 0xf7ffff) AM_ROM AM_REGION("user3", 0)
241241ADDRESS_MAP_END
r29404r29405
915915   #if 0
916916   {
917917      UINT8 *ROM = memregion(tag)->base();
918   //   int size = memregion(tag)->bytes();
918   //  int size = memregion(tag)->bytes();
919919
920920      FILE *fp;
921921      char filename[256];
r29404r29405
962962
963963   /* OnePlay bios is encrypted, TenPlay is not */
964964   biosrom = (UINT16 *)memregion("user2")->base();
965   
965
966966   if (biosrom)
967967      if (biosrom[0] != 0x4afc)
968968         generic_decode("user2", 6, 1, 0, 2, 3, 4, 5, 7);
trunk/src/mame/drivers/supercrd.c
r29404r29405
411411//static MC6845_INTERFACE( mc6845_intf )
412412//{
413413//  false,
414//   0,0,0,0,    /* visarea adjustment */
414//  0,0,0,0,    /* visarea adjustment */
415415//  4,          /* number of pixels per video memory address */
416416//  NULL,       /* before pixel update callback */
417417//  NULL,       /* row update callback */
trunk/src/mame/drivers/gatron.c
r29404r29405
1919
2020
2121    * PCB1: PULL TABS.
22   
22
2323    Board silkscreend:
2424
2525     GAME-A-TRON CORP.
r29404r29405
7272    Identified the unknown writes as a init sequence for 1x PSG sound device.
7373    The type/class is unknown due to almost all devices are plastic covered.
7474
75   
75
7676    * PCB 3: BINGO.
7777
7878    The PCB doesn't looks like an official Game-A-Tron board. Maybe it's a bootleg,
r29404r29405
190190    Press "LADY LUCK TICKET" (key X) to play with Lady Luck (center) Ticket.
191191    Press "BIG BAR TICKET" (key C) to play with Big Bar (right) Ticket.
192192
193   
193
194194    * Bingo:
195195
196196    Pressing SERVICE 1 (key 9) you enter the Test/Settings Mode. You can test
r29404r29405
213213    Press "CHANGE CARD" (key Z) to change for another card with a different set of numbers.
214214    Press "START" (key X) to start the game.
215215    Press "CHANGE GAME" (key C) to switch between games X-L-T-C-N-U.
216   
217   Note that letters in games X-L-T-C-N-U are just references to the shape of the special
216
217    Note that letters in games X-L-T-C-N-U are just references to the shape of the special
218218    numbers group inside the card, which will play.
219219
220220    You must setup double-ups to something different of 0 (default), to play with these
r29404r29405
253253
254254    [2014-02-04]
255255    - Added Bingo (1983). PCB seems bootleg, but the game looks legit.
256   - Worked from the scratch a whole set of inputs and button-lamps support for this game.
256    - Worked from the scratch a whole set of inputs and button-lamps support for this game.
257257    - Changed the poker41 description to Four in One Poker (as seen in the official brochure).
258   - Added game and technical notes.
258    - Added game and technical notes.
259259
260260    [2008-10-14]
261261    - Improved the button-lamps layouts to look more realistic.
r29404r29405
625625GAMEL( 1983, poker41,  0,      gat,     poker41,   driver_device,  0,    ROT0, "Game-A-Tron",  "Four in One Poker",  0,     layout_poker41  )
626626GAMEL( 1983, pulltabs, 0,      gat,     pulltabs,  driver_device,  0,    ROT0, "Game-A-Tron",  "Pull Tabs",          0,     layout_pulltabs )
627627GAMEL( 1983, bingo,    0,      gat,     bingo,     driver_device,  0,    ROT0, "Game-A-Tron?", "Bingo",              0,     layout_bingo  )
628
trunk/src/mame/drivers/dreamwld.c
r29404r29405
223223      {
224224         for (xct = 0; xct < xsize; xct++)
225225         {
226             gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, xpos + xct * xinc, ypos + yct * yinc, 0);
227             gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, (xpos + xct * xinc) - 0x200, ypos + yct * yinc, 0);
228             gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, (xpos + xct * xinc) - 0x200, (ypos + yct * yinc) - 0x200, 0);
229             gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, xpos + xct * xinc, (ypos + yct * yinc) - 0x200 , 0);
226               gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, xpos + xct * xinc, ypos + yct * yinc, 0);
227               gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, (xpos + xct * xinc) - 0x200, ypos + yct * yinc, 0);
228               gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, (xpos + xct * xinc) - 0x200, (ypos + yct * yinc) - 0x200, 0);
229               gfx->transpen(bitmap,cliprect, redirect[tileno], colour, xflip, yflip, xpos + xct * xinc, (ypos + yct * yinc) - 0x200 , 0);
230230
231231            tileno++;
232232         }
trunk/src/mame/drivers/firefox.c
r29404r29405
730730
731731
732732   MCFG_LASERDISC_22VP931_ADD("laserdisc")
733   MCFG_LASERDISC_OVERLAY_DRIVER(64*8, 525, firefox_state, screen_update_firefox)   
733   MCFG_LASERDISC_OVERLAY_DRIVER(64*8, 525, firefox_state, screen_update_firefox)
734734   MCFG_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 44, 480+44)
735735   MCFG_LASERDISC_OVERLAY_PALETTE("palette")
736736
trunk/src/mame/drivers/galaga.c
r29404r29405
16231623
16241624   MCFG_NAMCO_50XX_ADD("50xx_1", MASTER_CLOCK/6/2) /* 1.536 MHz */
16251625   MCFG_NAMCO_50XX_ADD("50xx_2", MASTER_CLOCK/6/2) /* 1.536 MHz */
1626   MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */   
1626   MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */
16271627   MCFG_NAMCO_51XX_INPUT_0_CB(IOPORT("IN0L"))
16281628   MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0H"))
16291629   MCFG_NAMCO_51XX_INPUT_2_CB(IOPORT("IN1L"))
16301630   MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("IN1H"))
16311631   MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(galaga_state,out_0))
16321632   MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(galaga_state,out_1))
1633   
1634   
1633
1634
16351635   MCFG_NAMCO_52XX_ADD("52xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */
16361636   MCFG_NAMCO_52XX_DISCRETE("discrete")
16371637   MCFG_NAMCO_52XX_BASENODE(NODE_04)
r29404r29405
16421642   MCFG_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */
16431643   MCFG_NAMCO_54XX_DISCRETE("discrete")
16441644   MCFG_NAMCO_54XX_BASENODE(NODE_01)
1645   
1645
16461646   MCFG_NAMCO_06XX_ADD("06xx_0", MASTER_CLOCK/6/64)
16471647   MCFG_NAMCO_06XX_MAINCPU("maincpu")
16481648   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
1649   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))   
1649   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
16501650   MCFG_NAMCO_06XX_READ_2_CB(DEVREAD8("50xx_1", namco_50xx_device, read))
16511651   MCFG_NAMCO_06XX_READ_REQUEST_2_CB(DEVWRITELINE("50xx_1", namco_50xx_device, read_request))
1652   MCFG_NAMCO_06XX_WRITE_2_CB(DEVWRITE8("50xx_1", namco_50xx_device, write))   
1652   MCFG_NAMCO_06XX_WRITE_2_CB(DEVWRITE8("50xx_1", namco_50xx_device, write))
16531653   MCFG_NAMCO_06XX_WRITE_3_CB(DEVWRITE8("54xx", namco_54xx_device, write))
1654   
1654
16551655   MCFG_NAMCO_06XX_ADD("06xx_1", MASTER_CLOCK/6/64)
16561656   MCFG_NAMCO_06XX_MAINCPU("sub")
16571657   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("50xx_2", namco_50xx_device, read))
16581658   MCFG_NAMCO_06XX_READ_REQUEST_0_CB(DEVWRITELINE("50xx_2", namco_50xx_device, read_request))
1659   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("50xx_2", namco_50xx_device, write))   
1659   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("50xx_2", namco_50xx_device, write))
16601660   MCFG_NAMCO_06XX_WRITE_1_CB(DEVWRITE8("52xx", namco_52xx_device, write))
16611661
16621662   MCFG_WATCHDOG_VBLANK_INIT(8)
r29404r29405
17121712   MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("IN1H"))
17131713   MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(galaga_state,out_0))
17141714   MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(galaga_state,out_1))
1715   
1715
17161716   MCFG_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */
17171717   MCFG_NAMCO_54XX_DISCRETE("discrete")
17181718   MCFG_NAMCO_54XX_BASENODE(NODE_01)
r29404r29405
17201720   MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/6/64)
17211721   MCFG_NAMCO_06XX_MAINCPU("maincpu")
17221722   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
1723   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))   
1723   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
17241724   MCFG_NAMCO_06XX_WRITE_3_CB(DEVWRITE8("54xx", namco_54xx_device, write))
1725   
1725
17261726   MCFG_WATCHDOG_VBLANK_INIT(8)
17271727   MCFG_QUANTUM_TIME(attotime::from_hz(6000))  /* 100 CPU slices per frame - an high value to ensure proper */
17281728                     /* synchronization of the CPUs */
r29404r29405
17661766   MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/6/64)
17671767   MCFG_NAMCO_06XX_MAINCPU("maincpu")
17681768   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
1769   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))   
1770   
1769   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
1770
17711771   MCFG_CPU_ADD("sub3", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
17721772   MCFG_CPU_PROGRAM_MAP(galaga_mem4)
17731773
r29404r29405
17981798   MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("IN1H"))
17991799   MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(galaga_state,out_0))
18001800   MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(galaga_state,out_1))
1801   
1801
18021802   MCFG_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */
18031803   MCFG_NAMCO_54XX_DISCRETE("discrete")
18041804   MCFG_NAMCO_54XX_BASENODE(NODE_01)
r29404r29405
18061806   MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/6/64)
18071807   MCFG_NAMCO_06XX_MAINCPU("maincpu")
18081808   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
1809   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))   
1809   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
18101810   MCFG_NAMCO_06XX_READ_2_CB(DEVREAD8("50xx", namco_50xx_device, read))
18111811   MCFG_NAMCO_06XX_READ_REQUEST_2_CB(DEVWRITELINE("50xx", namco_50xx_device, read_request))
1812   MCFG_NAMCO_06XX_WRITE_2_CB(DEVWRITE8("50xx", namco_50xx_device, write))   
1812   MCFG_NAMCO_06XX_WRITE_2_CB(DEVWRITE8("50xx", namco_50xx_device, write))
18131813   MCFG_NAMCO_06XX_WRITE_3_CB(DEVWRITE8("54xx", namco_54xx_device, write))
18141814
18151815   MCFG_WATCHDOG_VBLANK_INIT(8)
r29404r29405
18551855   MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/6/64)
18561856   MCFG_NAMCO_06XX_MAINCPU("maincpu")
18571857   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
1858   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))   
1858   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
18591859
18601860   MCFG_CPU_ADD("sub3", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
18611861   MCFG_CPU_PROGRAM_MAP(battles_mem4)
r29404r29405
18971897   MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("IN1H"))
18981898   MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(galaga_state,out_0))
18991899   MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(galaga_state,out_1))
1900   
1900
19011901   MCFG_NAMCO_53XX_ADD("53xx", MASTER_CLOCK/6/2)      /* 1.536 MHz */
19021902   MCFG_NAMCO_53XX_K_CB(READ8(galaga_state,custom_mod_r))
19031903   MCFG_NAMCO_53XX_INPUT_0_CB(IOPORT("DSWA"))
r29404r29405
19081908   MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/6/64)
19091909   MCFG_NAMCO_06XX_MAINCPU("maincpu")
19101910   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
1911   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))   
1911   MCFG_NAMCO_06XX_WRITE_0_CB(DEVWRITE8("51xx", namco_51xx_device, write))
19121912   MCFG_NAMCO_06XX_READ_1_CB(DEVREAD8("53xx", namco_53xx_device, read))
19131913   MCFG_NAMCO_06XX_READ_REQUEST_1_CB(DEVWRITELINE("53xx", namco_53xx_device, read_request))
19141914
trunk/src/mame/drivers/panicr.c
r29404r29405
618618   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
619619   MCFG_SCREEN_SIZE(32*8, 32*8)
620620//  MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
621   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)   
621   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
622622   MCFG_SCREEN_UPDATE_DRIVER(panicr_state, screen_update_panicr)
623623   MCFG_SCREEN_PALETTE("palette")
624624
trunk/src/mame/drivers/xyonix.c
r29404r29405
238238
239239   MCFG_SOUND_ADD("sn1", SN76496, 16000000/4)
240240   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
241   
241
242242   MCFG_SOUND_ADD("sn2", SN76496, 16000000/4)
243243   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
244244MACHINE_CONFIG_END
trunk/src/mame/drivers/wardner.c
r29404r29405
164164static ADDRESS_MAP_START( main_program_map, AS_PROGRAM, 8, wardner_state )
165165   AM_RANGE(0x0000, 0x6fff) AM_ROM
166166   AM_RANGE(0x7000, 0x7fff) AM_RAM
167   AM_RANGE(0x8000, 0x8fff) AM_WRITE(wardner_sprite_w)                  // AM_SHARE("spriteram8")
168   AM_RANGE(0xa000, 0xafff) AM_DEVWRITE("palette", palette_device, write)   // AM_SHARE("palette")
167   AM_RANGE(0x8000, 0x8fff) AM_WRITE(wardner_sprite_w)                     // AM_SHARE("spriteram8")
168   AM_RANGE(0xa000, 0xafff) AM_DEVWRITE("palette", palette_device, write)  // AM_SHARE("palette")
169169   AM_RANGE(0xc000, 0xc7ff) AM_WRITEONLY AM_SHARE("sharedram")
170170   AM_RANGE(0x8000, 0xffff) AM_DEVREAD("membank", address_map_bank_device, read8)
171171ADDRESS_MAP_END
trunk/src/mame/drivers/mirage.c
r29404r29405
340340   MCFG_DECO16IC_ADD("tilegen1", mirage_deco16ic_tilegen1_intf)
341341   MCFG_DECO16IC_GFXDECODE("gfxdecode")
342342   MCFG_DECO16IC_PALETTE("palette")
343   
343
344344   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
345345   decospr_device::set_gfx_region(*device, 2);
346346   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
trunk/src/mame/drivers/sidearms.c
r29404r29405
719719   MCFG_SCREEN_PALETTE("palette")
720720
721721   MCFG_GFXDECODE_ADD("gfxdecode", "palette", turtship)
722   
722
723723   MCFG_PALETTE_ADD("palette", 1024)
724724   MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG)
725725
trunk/src/mame/drivers/kingobox.c
r29404r29405
490490   MCFG_SCREEN_SIZE(32*8, 32*8)
491491   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
492492   MCFG_SCREEN_UPDATE_DRIVER(kingofb_state, screen_update_kingofb)
493   MCFG_SCREEN_PALETTE("palette")   
493   MCFG_SCREEN_PALETTE("palette")
494494
495495   MCFG_GFXDECODE_ADD("gfxdecode", "palette", kingobox)
496496   MCFG_PALETTE_ADD("palette", 256+8*2)
trunk/src/mame/drivers/galivan.c
r29404r29405
441441   MCFG_PALETTE_ADD("palette", 8*16+16*16+256*16)
442442   MCFG_PALETTE_INDIRECT_ENTRIES(256)
443443   MCFG_PALETTE_INIT_OWNER(galivan_state, galivan)
444   
444
445445   MCFG_VIDEO_START_OVERRIDE(galivan_state,galivan)
446446
447447   /* sound hardware */
trunk/src/mame/drivers/f1gp.c
r29404r29405
186186
187187static ADDRESS_MAP_START( f1gpb_cpu2_map, AS_PROGRAM, 16, f1gp_state )
188188   AM_RANGE(0x000000, 0x01ffff) AM_ROM
189   AM_RANGE(0xff8000, 0xffbfff) AM_RAM
189   AM_RANGE(0xff8000, 0xffbfff) AM_RAM
190190   AM_RANGE(0xffc000, 0xffcfff) AM_RAM AM_SHARE("sharedram")
191191   AM_RANGE(0xfff030, 0xfff031) AM_NOP //?
192192ADDRESS_MAP_END
r29404r29405
442442   MCFG_VSYSTEM_SPR2_SET_PRITYPE(2)
443443   MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
444444   MCFG_VSYSTEM_SPR2_PALETTE("palette")
445   
445
446446   MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)
447447   MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( f1gp_state, f1gp_ol2_tile_callback )
448448   MCFG_VSYSTEM_SPR2_SET_GFXREGION(2)
trunk/src/mame/drivers/chicago.c
r29404r29405
11/***************************************************************************
2
2
33 Chicago Coin discrete hardware games
4
4
55 Game Name                        Model #
6 -----------------------------------------
6 -----------------------------------------
77 Demolition Derby (1976)          #466
88 Super Flipper (1975)             #458
99 Olympic TV Football (1973)       #429-A
r29404r29405
1212 TV Ping Pong (1973)              #424
1313 TV Pin Game (1975)               #451
1414 TV Tennis (1973)                 #427
15
15
1616***************************************************************************/
1717
1818
r29404r29405
5252public:
5353   chicago_state(const machine_config &mconfig, device_type type, const char *tag)
5454   : driver_device(mconfig, type, tag),
55     m_maincpu(*this, "maincpu"),
56     m_video(*this, "fixfreq")
55      m_maincpu(*this, "maincpu"),
56      m_video(*this, "fixfreq")
5757   {
5858   }
59   
59
6060   // devices
6161   required_device<netlist_mame_device_t> m_maincpu;
6262   required_device<fixedfreq_device> m_video;
63   
63
6464protected:
65   
65
6666   // driver_device overrides
6767   virtual void machine_start();
6868   virtual void machine_reset();
69   
69
7070   virtual void video_start();
71   
71
7272private:
73   
73
7474};
7575
7676
7777static NETLIST_START(chicago)
7878   SOLVER(Solver, 48000)
79//   PARAM(Solver.FREQ, 48000)
79//  PARAM(Solver.FREQ, 48000)
8080   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
8181
8282   // schematics
8383   //...
8484
85//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
86//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
85//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
86//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8787NETLIST_END()
8888
8989
r29404r29405
113113
114114
115115/***************************************************************************
116
116
117117 Game driver(s)
118
118
119119 ***************************************************************************/
120120
121121
trunk/src/mame/drivers/m63.c
r29404r29405
347347         flipy = !flipy;
348348      }
349349
350     
350
351351         m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
352352         code, color,
353353         flipx, flipy,
r29404r29405
356356      /* sprite wrapping - verified on real hardware*/
357357      if (sx > 0xf0)
358358      {
359         
360359         m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
361360         code, color,
362361         flipx, flipy,
trunk/src/mame/drivers/blstroid.c
r29404r29405
183183
184184   /* video hardware */
185185   MCFG_GFXDECODE_ADD("gfxdecode", "palette", blstroid)
186   
186
187187   MCFG_PALETTE_ADD("palette", 512)
188188   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
189189
trunk/src/mame/drivers/dotrikun.c
r29404r29405
4343   virtual void machine_reset();
4444   UINT32 screen_update_dotrikun(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4545   required_device<cpu_device> m_maincpu;
46   required_device<screen_device> m_screen;   
46   required_device<screen_device> m_screen;
4747};
4848
4949
trunk/src/mame/drivers/flipjack.c
r29404r29405
9898      m_vram(*this, "vram"),
9999      m_cram(*this, "cram"),
100100      m_gfxdecode(*this, "gfxdecode"),
101      m_palette(*this, "palette")
101      m_palette(*this, "palette")
102102   {
103103      m_soundlatch = 0;
104104      m_bank = 0;
r29404r29405
112112   required_shared_ptr<UINT8> m_fbram;
113113   required_shared_ptr<UINT8> m_vram;
114114   required_shared_ptr<UINT8> m_cram;
115   
115
116116   required_device<gfxdecode_device> m_gfxdecode;
117117   required_device<palette_device> m_palette;
118118
r29404r29405
204204         int tile = m_bank << 8 | m_vram[x+y*0x100];
205205         int color = m_cram[x+y*0x100] & 0x3f;
206206
207          gfx->transpen(bitmap,cliprect, tile, color, 0, 0, x*8, y*8, 0);
207            gfx->transpen(bitmap,cliprect, tile, color, 0, 0, x*8, y*8, 0);
208208      }
209209   }
210210
trunk/src/mame/drivers/bladestl.c
r29404r29405
334334   MCFG_K007342_GFXNUM(0)
335335   MCFG_K007342_CALLBACK_OWNER(bladestl_state, bladestl_tile_callback)
336336   MCFG_K007342_GFXDECODE("gfxdecode")
337   
337
338338   MCFG_K007420_ADD("k007420")
339339   MCFG_K007420_BANK_LIMIT(0x3ff)
340   MCFG_K007420_CALLBACK_OWNER(bladestl_state, bladestl_sprite_callback)   
340   MCFG_K007420_CALLBACK_OWNER(bladestl_state, bladestl_sprite_callback)
341341   MCFG_K007420_PALETTE("palette")
342   
342
343343   MCFG_K051733_ADD("k051733")
344344
345345   /* sound hardware */
trunk/src/mame/drivers/funworld.c
r29404r29405
66  65C02 + 2x PIAs + M6845 CRTC + AY8910
77
88  Also from Amatic, CMC, Dino4 encrypted, and Leopard 4.
9
9
1010  Driver by Roberto Fresca.
1111  Based on a preliminary work of Curt Coder & Peter Trauner.
1212
r29404r29405
159159             complex operations for each byte nibble. See DRIVER_INIT for the final algorithm.
160160          - Saloon (french) use bitswaps to address & data in program, graphics and color PROM.
161161          - Dino4 hardware games have address/data bitswap in program, and data bitswap (sometimes
162               with extra boolean XOR operations) in graphics.
162            with extra boolean XOR operations) in graphics.
163163
164164  - Microcontroller. Some games (like Soccer New and Mongolfier New are using an extra MCU mainly
165165    for protection.
166   
166
167167  - Mirrored video and color RAM. A derivative of CMC hardware uses this trick to avoid ROM swaps.
168168    If you run Luna Park in a regular CMC board, you'll get an unplayable mess of graphics.
169169
r29404r29405
226226  Also PRG rom higher address line is connected to DIP switch #1 so it should have 2 games
227227  in the same PCB (2 revisions?).
228228
229
229
230230  There is at least one missing game in the family... 'Hyppo Family', also from C.M.C.
231231  This game should be located and dumped.
232232
r29404r29405
416416
417417  Press DEAL/DRAW to exit the mode.
418418
419 
419
420420  * Unknown Royal Card on Dino4 hardware....
421 
421
422422  This one is really strange. The game is running in a Dino4 hardware, plus a daughterboard
423423  with a mexican Rockwell R65C02 + an unknown PLCC. The program/gfx are totally decrypted.
424424  The game vectors are $C122 (RESET) and $C20F (IRQ)
425 
425
426426  The code starts...
427 
427
428428  C122: A2 FF      LDX #$FF    ; load 0xFF to reg X
429429  C124: 9A         TXS         ; transfer to the stack
430430  C125: 78         SEI         ; set interrupts
r29404r29405
437437  C132: A9 C2      LDA #$C2    ; /
438438  C134: 8D 02 00   STA $0002   ;/
439439  C137: 4C DC 48   JMP $48DC   ; jump to $48DC...
440 
440
441441  48DC: 93         NOP         ;\
442442  48DD: 00         BRK         ; \
443443  48DE: B7 4B      SMB3 $4B    ;  \
r29404r29405
446446  48E3: B7 4D      SMB3 $4B    ; /
447447  48E5: 05 B7      ORA $B7     ;/
448448  48E7: 4C 05 76   JMP $7605   ; jump to $7605 (no code there)
449 
449
450450  And the IRQ vector pointed code... does nothing!
451 
451
452452  C20F: 40         RTI         ; return from interrupt
453 
453
454454  And the code pointed from $0000...
455 
455
456456  C210: 48         PHA         ; transfer accumulator to stack
457457  C211: AD 01 0A   LDA $0A01   ; read the PIA #2 input
458458  C214: 29 F7      AND #$F7    ; \ compare with 0xF7
r29404r29405
472472  Maybe mnemonic 93 is AXA (ab),Y (93 ab) instead of NOP (as seen in some sources)??...
473473
474474  Tooo much obscure/darkness here
475 
475
476476  So... No idea what's wrong here.
477477  If someone could figure a possible transform, please let me know.
478 
479 
478
479
480480***********************************************************************************
481481
482482
r29404r29405
530530  rcdino4:   0x7C  0x60  0x65  0x08  0x21  0x08  0x1F  0x1F  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
531531  chinatow:  0x7C  0x60  0x65  0x08  0x21  0x08  0x1F  0x1F  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
532532
533 
533
534534***********************************************************************************
535535
536536
r29404r29405
11471147   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
11481148   AM_RANGE(0x2000, 0x2000) AM_READNOP /* some unknown reads */
11491149   AM_RANGE(0x3e00, 0x3fff) AM_RAM /* some games use $3e03-05 range for protection */
1150   AM_RANGE(0x4000, 0x5fff) AM_ROM   /* used by rcdino4 (dino4 hw ) */
1150   AM_RANGE(0x4000, 0x5fff) AM_ROM /* used by rcdino4 (dino4 hw ) */
11511151   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(funworld_videoram_w) AM_SHARE("videoram")
11521152   AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(funworld_colorram_w) AM_SHARE("colorram")
11531153   AM_RANGE(0x8000, 0xffff) AM_ROM
r29404r29405
11581158{
11591159   logerror("read from 0x32f0 at offset %02X\n",offset);
11601160   switch (offset)
1161   {   
1162   case 0:   return 0xfe;
1163           
1164   }         
1161   {
1162   case 0: return 0xfe;
1163
1164   }
11651165   return 0xff;
11661166}
11671167
r29404r29405
11751175   AM_RANGE(0x0e01, 0x0e01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
11761176   AM_RANGE(0x2000, 0x2000) AM_READNOP /* some unknown reads */
11771177   AM_RANGE(0x32f0, 0x32ff) AM_READ(chinatow_r_32f0)
1178   AM_RANGE(0x4000, 0x5fff) AM_ROM   /* used by rcdino4 (dino4 hw ) */
1178   AM_RANGE(0x4000, 0x5fff) AM_ROM /* used by rcdino4 (dino4 hw ) */
11791179   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(funworld_videoram_w) AM_SHARE("videoram")
11801180   AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(funworld_colorram_w) AM_SHARE("colorram")
11811181   AM_RANGE(0x8000, 0xffff) AM_ROM
11821182ADDRESS_MAP_END
11831183
1184static ADDRESS_MAP_START( lunapark_map, AS_PROGRAM, 8, funworld_state )   // mirrored video RAM 4000/5000 to 6000/7000
1184static ADDRESS_MAP_START( lunapark_map, AS_PROGRAM, 8, funworld_state ) // mirrored video RAM 4000/5000 to 6000/7000
11851185   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
11861186   AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
11871187   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
r29404r29405
20242024   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20252025
20262026   /* the following one seems to be disconnected
2027    to avoid the use of remote credits or direct payout */
2027   to avoid the use of remote credits or direct payout */
20282028   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
20292029
20302030   /* the following one is connected to 1st DSW and is meant
2031    for switch between different programs stored in different
2032    halves of the program ROM */
2031   for switch between different programs stored in different
2032   halves of the program ROM */
20332033   PORT_START("SELDSW")
20342034   PORT_DIPNAME( 0x01, 0x00, "Game Selector" )           PORT_DIPLOCATION("SW1:1")
20352035   PORT_DIPSETTING(    0x00, "PROGRAM 1, (5 TIRI LIRE 500, ABILITA VINTE)" )
r29404r29405
26222622INPUT_PORTS_END
26232623
26242624static INPUT_PORTS_START( chinatow )
2625        PORT_START("IN0")
2626        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* no remote credits */
2627        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )    PORT_NAME("Stop 1 / Switch Bet (1-Max)")
2628        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_CANCEL )   PORT_NAME("Clear / Bet / Prendi (Take)")
2629        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )         PORT_NAME("Start / Gioca (Play) / Gmable")
2630        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )    PORT_NAME("Stop 5 / Half Gamble / Super Game")
2631        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
2632        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 )
2633        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )    PORT_NAME("Stop 4 / Alta (High)")
2634 
2635        PORT_START("IN1")     
2636        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )    PORT_NAME("Stop 2 / Bassa (Low)")
2637        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )    PORT_NAME("Stop 3")
2638        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )        PORT_NAME("Ticket") PORT_CODE(KEYCODE_8)
2639        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )        PORT_NAME("Hopper") PORT_CODE(KEYCODE_H)
2640        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2641        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
2642        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2643        PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
2644 
2645        PORT_START("IN2")
2646        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2647        PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2648        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2649        PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2650        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2651        PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2652        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2653        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2654 
2655        PORT_START("DSW")
2656        PORT_DIPNAME( 0x01, 0x01, "Test Mode" )            PORT_DIPLOCATION("SW1:8")
2657        PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2658        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2659        PORT_DIPNAME( 0x02, 0x02, "Counter" )              PORT_DIPLOCATION("SW1:7")
2660        PORT_DIPSETTING(    0x02, "X10" )
2661        PORT_DIPSETTING(    0x00, "X1" )
2662        PORT_DIPNAME( 0x04, 0x04, "Royal Flush" )          PORT_DIPLOCATION("SW1:6")
2663        PORT_DIPSETTING(    0x04, "With" )
2664        PORT_DIPSETTING(    0x00, "Without" )
2665        PORT_DIPNAME( 0x08, 0x08, "5 of a kind" )          PORT_DIPLOCATION("SW1:5")
2666        PORT_DIPSETTING(    0x08, "With" )
2667        PORT_DIPSETTING(    0x00, "Without" )
2668        PORT_DIPNAME( 0x60, 0x60, "Payout type" )          PORT_DIPLOCATION("SW1:3,2")
2669        PORT_DIPSETTING(    0x00, "Ticket + Hopper" )
2670        PORT_DIPSETTING(    0x20, "Ticket" )
2671        PORT_DIPSETTING(    0x40, "Hopper" )
2672        PORT_DIPSETTING(    0x60, "Ticket + Hopper" )
2673        PORT_DIPNAME( 0x90, 0x90, "Coin/Credit ratio" )    PORT_DIPLOCATION("SW1:1,4")
2674        PORT_DIPSETTING(    0x00, "1 coin 1 credit" )
2675        PORT_DIPSETTING(    0x10, "1 coin 1 credit" )
2676        PORT_DIPSETTING(    0x80, "1 coin 5 credits" )
2677        PORT_DIPSETTING(    0x90, "1 coin 10 credits" )
2678 INPUT_PORTS_END
2625      PORT_START("IN0")
2626      PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* no remote credits */
2627      PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )    PORT_NAME("Stop 1 / Switch Bet (1-Max)")
2628      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_CANCEL )   PORT_NAME("Clear / Bet / Prendi (Take)")
2629      PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )         PORT_NAME("Start / Gioca (Play) / Gmable")
2630      PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )    PORT_NAME("Stop 5 / Half Gamble / Super Game")
2631      PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
2632      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 )
2633      PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )    PORT_NAME("Stop 4 / Alta (High)")
26792634
2635      PORT_START("IN1")
2636      PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )    PORT_NAME("Stop 2 / Bassa (Low)")
2637      PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )    PORT_NAME("Stop 3")
2638      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )        PORT_NAME("Ticket") PORT_CODE(KEYCODE_8)
2639      PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )        PORT_NAME("Hopper") PORT_CODE(KEYCODE_H)
2640      PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2641      PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
2642      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2643      PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
2644
2645      PORT_START("IN2")
2646      PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2647      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2648      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2649      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2650      PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2651      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2652      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2653      PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2654
2655      PORT_START("DSW")
2656      PORT_DIPNAME( 0x01, 0x01, "Test Mode" )            PORT_DIPLOCATION("SW1:8")
2657      PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2658      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2659      PORT_DIPNAME( 0x02, 0x02, "Counter" )              PORT_DIPLOCATION("SW1:7")
2660      PORT_DIPSETTING(    0x02, "X10" )
2661      PORT_DIPSETTING(    0x00, "X1" )
2662      PORT_DIPNAME( 0x04, 0x04, "Royal Flush" )          PORT_DIPLOCATION("SW1:6")
2663      PORT_DIPSETTING(    0x04, "With" )
2664      PORT_DIPSETTING(    0x00, "Without" )
2665      PORT_DIPNAME( 0x08, 0x08, "5 of a kind" )          PORT_DIPLOCATION("SW1:5")
2666      PORT_DIPSETTING(    0x08, "With" )
2667      PORT_DIPSETTING(    0x00, "Without" )
2668      PORT_DIPNAME( 0x60, 0x60, "Payout type" )          PORT_DIPLOCATION("SW1:3,2")
2669      PORT_DIPSETTING(    0x00, "Ticket + Hopper" )
2670      PORT_DIPSETTING(    0x20, "Ticket" )
2671      PORT_DIPSETTING(    0x40, "Hopper" )
2672      PORT_DIPSETTING(    0x60, "Ticket + Hopper" )
2673      PORT_DIPNAME( 0x90, 0x90, "Coin/Credit ratio" )    PORT_DIPLOCATION("SW1:1,4")
2674      PORT_DIPSETTING(    0x00, "1 coin 1 credit" )
2675      PORT_DIPSETTING(    0x10, "1 coin 1 credit" )
2676      PORT_DIPSETTING(    0x80, "1 coin 5 credits" )
2677      PORT_DIPSETTING(    0x90, "1 coin 10 credits" )
2678   INPUT_PORTS_END
2679
26802680static INPUT_PORTS_START( royal )
26812681   PORT_START("IN0")
26822682   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* no remote credits */
r29404r29405
29932993   MCFG_CPU_PROGRAM_MAP(magicrd2_map)
29942994   MCFG_CPU_VBLANK_INT_DRIVER("screen", funworld_state, nmi_line_pulse)
29952995   MCFG_VIDEO_START_OVERRIDE(funworld_state, magicrd2)
2996   
2996
29972997   MCFG_DEVICE_REMOVE("crtc")
29982998   MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK, magicrd2_mc6845_intf)
29992999
r29404r29405
30483048
30493049static MACHINE_CONFIG_DERIVED( lunapark, fw1stpal )
30503050   MCFG_CPU_REPLACE("maincpu", R65C02, CPU_CLOCK) /* 2MHz */
3051   MCFG_CPU_PROGRAM_MAP(lunapark_map)   // mirrored video RAM (4000/5000 to 6000/7000).
3051   MCFG_CPU_PROGRAM_MAP(lunapark_map)  // mirrored video RAM (4000/5000 to 6000/7000).
30523052   MCFG_CPU_VBLANK_INT_DRIVER("screen", funworld_state, nmi_line_pulse)
30533053   MCFG_MACHINE_START_OVERRIDE(funworld_state, lunapark)
30543054   MCFG_MACHINE_RESET_OVERRIDE(funworld_state, lunapark)
r29404r29405
34603460
34613461   then service1+service2 and reset,
34623462   then another reset.
3463   
3463
34643464   Q is remote (x100)
34653465   W is payout.
34663466*/
r29404r29405
34893489
34903490   then service1+service2 and reset,
34913491   then another reset.
3492   
3492
34933493   This set has spam graphics, but seems
34943494   used by another program.
3495
3495
34963496*/
34973497ROM_START( jolycdie )   /* Bootleg PCB, NON encrypted graphics */
34983498   ROM_REGION( 0x10000, "maincpu", 0 )
r29404r29405
41144114ROM_START( pool10f )
41154115   ROM_REGION( 0x10000, "maincpu", 0 )
41164116   ROM_LOAD( "cmc-pool10+a+.u2", 0x8000, 0x8000, CRC(e8087fb8) SHA1(c012a81f561978bd97708a52f656e7b13e41a3e2) )
4117   
4117
41184118   ROM_REGION( 0x10000, "gfx1", 0 )
41194119   ROM_LOAD( "cmc-pool10-b.u21", 0x0000, 0x8000, CRC(99c8c074) SHA1(f8082b08e895cbcd028a2b7cd961a7a2c8b2762c) )
41204120   ROM_LOAD( "cmc-pool10-c.u20", 0x8000, 0x8000, CRC(9abedd0c) SHA1(f184a82e8ec2387069d631bcb77e890acd44b3f5) )
r29404r29405
41684168   ROM_REGION( 0x10000, "maincpu", 0 )
41694169   ROM_LOAD( "a.u2", 0x8000, 0x8000, CRC(566bc05d) SHA1(eec88c8ba6cb664f38ebf8b71f99b4e7d04a9601) )
41704170   ROM_IGNORE(                 0x8000 )    /* Identical halves. Discarding 2nd half */
4171   
4171
41724172   ROM_REGION( 0x10000, "gfx1", 0 )
41734173   ROM_LOAD( "b.u21", 0x0000, 0x8000, CRC(581c4878) SHA1(5ae61af090feea1745e22f46b33b2c01e6013fbe) )
41744174   ROM_IGNORE(                0x8000 )    /* Identical halves. Discarding 2nd half */
41754175   ROM_LOAD( "c.u20", 0x8000, 0x8000, CRC(3bdf1106) SHA1(fa21cbd49bb27ea4a784cf4e4b3fbd52650a285b) )
41764176   ROM_IGNORE(                0x8000 )    /* Identical halves. Discarding 2nd half */
4177   
4177
41784178   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
41794179   ROM_LOAD( "pool10l_nvram.bin",  0x0000, 0x0800, CRC(89cbee4b) SHA1(ff8031a96ee40e1e62abbae7a0b3d9dc2122759f) )
41804180
r29404r29405
43384338
43394339  The second set, has the same programs, but the strings on the first half
43404340  were changed to match the second program.
4341 
4341
43424342*/
43434343/* The following two have mirrored video RAM 4000/5000 to 6000/7000. */
43444344ROM_START( lunapark )
4345   ROM_REGION( 0x10000, "maincpu", 0 )   /* Two different programs. Selectable through a DIP switch */
4345   ROM_REGION( 0x10000, "maincpu", 0 ) /* Two different programs. Selectable through a DIP switch */
43464346   ROM_LOAD( "lunapark-425-95n003.u2", 0x0000, 0x10000, CRC(b3a620ee) SHA1(67b3498edf7b536e22c4d97c1f6ad5a71521e68f) )
43474347
43484348   ROM_REGION( 0x10000, "gfx1", 0 )
43494349   ROM_LOAD( "lunapark-425-95n002.u21", 0x0000, 0x8000, CRC(2bededb7) SHA1(b8d7e6fe307d347d762adf35d361ade620aab37b) )
4350   ROM_CONTINUE(                        0x0000, 0x8000)   /* Discarding 1nd half 0xff filled*/
4350   ROM_CONTINUE(                        0x0000, 0x8000)    /* Discarding 1nd half 0xff filled*/
43514351   ROM_LOAD( "lunapark-425-95n001.u20", 0x8000, 0x8000, CRC(7d91ce1f) SHA1(7e9bfad76f305d5787faffe3a07b218beb37fda8) )
4352   ROM_CONTINUE(                        0x8000, 0x8000)   /* Discarding 1nd half 0xff filled*/
4352   ROM_CONTINUE(                        0x8000, 0x8000)    /* Discarding 1nd half 0xff filled*/
43534353
43544354   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
43554355   ROM_LOAD( "lunapark_nvram.bin", 0x0000, 0x0800, CRC(f99e749b) SHA1(fafd4205dfaacb4c21215af6997d06ab419c9281) )
r29404r29405
43594359ROM_END
43604360
43614361ROM_START( lunaparkb )
4362   ROM_REGION( 0x10000, "maincpu", 0 )   /* Two different programs. Selectable through a DIP switch */
4362   ROM_REGION( 0x10000, "maincpu", 0 ) /* Two different programs. Selectable through a DIP switch */
43634363   ROM_LOAD( "lunapark-number-03_lunaparkb.u2", 0x0000, 0x10000, CRC(cb819bb7) SHA1(c7fb25eab093de2f644445a713d99ee8024d8499) )
43644364
43654365   ROM_REGION( 0x10000, "gfx1", 0 )
4366   ROM_LOAD( "27512.u21", 0x0000, 0x8000, CRC(d64ac315) SHA1(c67d9e67a988036844efd4f980d47a90c022ba18) )   /* only the first 2 bytes different */
4367   ROM_CONTINUE(          0x0000, 0x8000)   /* Discarding 1nd half 0xff filled*/
4366   ROM_LOAD( "27512.u21", 0x0000, 0x8000, CRC(d64ac315) SHA1(c67d9e67a988036844efd4f980d47a90c022ba18) )   /* only the first 2 bytes different */
4367   ROM_CONTINUE(          0x0000, 0x8000)  /* Discarding 1nd half 0xff filled*/
43684368   ROM_LOAD( "27512.u20", 0x8000, 0x8000, CRC(7d91ce1f) SHA1(7e9bfad76f305d5787faffe3a07b218beb37fda8 ) )
4369   ROM_CONTINUE(          0x8000, 0x8000)   /* Discarding 1nd half 0xff filled*/
4369   ROM_CONTINUE(          0x8000, 0x8000)  /* Discarding 1nd half 0xff filled*/
43704370
43714371   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
43724372   ROM_LOAD( "lunaparkb_nvram.bin", 0x0000, 0x0800, CRC(f99e749b) SHA1(fafd4205dfaacb4c21215af6997d06ab419c9281) )
r29404r29405
56845684
56855685   ROM_REGION( 0x10000, "gfx1", 0 )
56865686   ROM_LOAD( "27c512.u2",  0x0000, 0x8000, CRC(6ace221f) SHA1(d35a6621d9d9231a844d7043da78035855ebf572) )
5687   ROM_CONTINUE(           0x0000, 0x8000)   /* Discarding 1nd half 0xff filled*/
5687   ROM_CONTINUE(           0x0000, 0x8000) /* Discarding 1nd half 0xff filled*/
56885688   ROM_LOAD( "27c512.u20", 0x8000, 0x8000, CRC(efb7f1ec) SHA1(260005526fc9b4087ca03f7cc585e40b6fa007fb) )
5689   ROM_CONTINUE(           0x8000, 0x8000)   /* Discarding 1nd half 0xff filled*/
5690   
5689   ROM_CONTINUE(           0x8000, 0x8000) /* Discarding 1nd half 0xff filled*/
5690
56915691   ROM_REGION( 0x0800, "nvram", 0 )    /* default NVRAM */
56925692   ROM_LOAD( "chinatow_nvram.bin", 0x0000, 0x0800, CRC(eef4c5e7) SHA1(a2d9a9f617d35ccb99236114e5ce3257ad572f49) )
56935693
r29404r29405
57875787   UINT8 *ROM = memregion("maincpu")->base();
57885788
57895789   ROM[0x9115] = 0xa5;
5790   
5790
57915791/* prevent one test from triggering hardware error */
57925792   ROM[0xb8f3] = 0xff;
57935793}
r29404r29405
58015801   ROM[0x80b2] = 0xa9;
58025802   ROM[0x80b3] = 0x00;
58035803   ROM[0x9115] = 0xa5;
5804   
5804
58055805/* prevent one test from triggering hardware error */
58065806   ROM[0xb8f3] = 0xff;
58075807}
r29404r29405
58675867         rom[a] = buffer[i];
58685868      }
58695869   }
5870 
58715870
5871
58725872   /******************************
58735873   *   Graphics ROM decryption   *
58745874   ******************************/
r29404r29405
61716171      }
61726172   }
61736173
6174   
6174
61756175   /******************************
61766176   *   Graphics ROM decryption   *
61776177   ******************************/
r29404r29405
61906190   }
61916191
61926192   /* d4-d5 data lines swap, plus a XOR with 0x81, implemented in two steps for an easy view */
6193   
6193
61946194   int x;
61956195   UINT8 *src = memregion( "gfx1" )->base();
61966196
r29404r29405
61996199      src[x] = BITSWAP8(src[x], 7, 6, 4, 5, 3, 2, 1, 0);
62006200      src[x] = src[x] ^ 0x81;
62016201   }
6202   
6202
62036203}
62046204
62056205/**********************************************
r29404r29405
62196219GAMEL( 1985, sjcd2kx3,  jollycrd, fw1stpal, funworld,  driver_device,  0,        ROT0, "M.P.",            "Super Joly 2000 - 3x",                            0,                       layout_jollycrd )
62206220GAME(  1986, jolycdab,  jollycrd, fw1stpal, funworld,  driver_device,  0,        ROT0, "Inter Games",     "Jolly Card (Austrian, Fun World, bootleg)",       GAME_NOT_WORKING )
62216221GAMEL( 1992, jolycdsp,  jollycrd, cuoreuno, jolycdit,  funworld_state, ctunk,    ROT0, "TAB Austria",     "Jolly Card (Spanish, blue TAB board, encrypted)", 0,                       layout_royalcrd )
6222GAMEL( 1990, jolycdid,  jollycrd, cuoreuno, jolycdcr,  driver_device,  0,        ROT0, "bootleg",         "Jolly Card (Italian, different colors, set 1)",   0,                       layout_jollycrd )   // italian, CPLD, different colors.
6222GAMEL( 1990, jolycdid,  jollycrd, cuoreuno, jolycdcr,  driver_device,  0,        ROT0, "bootleg",         "Jolly Card (Italian, different colors, set 1)",   0,                       layout_jollycrd ) // italian, CPLD, different colors.
62236223GAMEL( 1990, jolycdie,  jollycrd, cuoreuno, jolycdib,  driver_device,  0,        ROT0, "bootleg",         "Jolly Card (Italian, different colors, set 2)",   0,                       layout_jollycrd ) // not from TAB blue PCB
62246224
62256225// Bonus Card based...
r29404r29405
62466246GAMEL( 1996, potgame,   0,        cuoreuno, cuoreuno,  driver_device,  0,        ROT0, "C.M.C.",          "Pot Game (Italian)",                              0,                       layout_jollycrd )
62476247GAMEL( 1996, bottle10,  0,        cuoreuno, cuoreuno,  driver_device,  0,        ROT0, "C.M.C.",          "Bottle 10 (Italian, set 1)",                      0,                       layout_jollycrd )
62486248GAMEL( 1996, bottl10b,  bottle10, cuoreuno, cuoreuno,  driver_device,  0,        ROT0, "C.M.C.",          "Bottle 10 (Italian, set 2)",                      0,                       layout_jollycrd )
6249GAMEL( 1998, lunapark,  0,        lunapark, lunapark,  driver_device,  0,        ROT0, "<unknown>",       "Luna Park (set 1, dual program)",                 0,                       layout_jollycrd )   // mirrored video RAM (4000/5000 to 6000/7000).
6250GAMEL( 1998, lunaparkb, lunapark, lunapark, lunapark,  driver_device,  0,        ROT0, "<unknown>",       "Luna Park (set 2, dual program)",                 0,                       layout_jollycrd )   // mirrored video RAM (4000/5000 to 6000/7000).
6251GAMEL( 1998, lunaparkc, lunapark, cuoreuno, cuoreuno,  driver_device,  0,        ROT0, "<unknown>",       "Luna Park (set 3)",                               0,                       layout_jollycrd )   // regular video RAM 6000/7000.
6249GAMEL( 1998, lunapark,  0,        lunapark, lunapark,  driver_device,  0,        ROT0, "<unknown>",       "Luna Park (set 1, dual program)",                 0,                       layout_jollycrd ) // mirrored video RAM (4000/5000 to 6000/7000).
6250GAMEL( 1998, lunaparkb, lunapark, lunapark, lunapark,  driver_device,  0,        ROT0, "<unknown>",       "Luna Park (set 2, dual program)",                 0,                       layout_jollycrd ) // mirrored video RAM (4000/5000 to 6000/7000).
6251GAMEL( 1998, lunaparkc, lunapark, cuoreuno, cuoreuno,  driver_device,  0,        ROT0, "<unknown>",       "Luna Park (set 3)",                               0,                       layout_jollycrd ) // regular video RAM 6000/7000.
62526252GAMEL( 1998, crystal,   0,        cuoreuno, cuoreuno,  driver_device,  0,        ROT0, "J.C.D. srl",      "Crystal Colours (CMC hardware)",                  0,                       layout_jollycrd )
62536253
62546254// Royal Card based...
trunk/src/mame/drivers/overdriv.c
r29404r29405
350350   MCFG_PALETTE_ENABLE_SHADOWS()
351351
352352   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
353   
353
354354   MCFG_K053246_ADD("k053246", overdriv_k053246_intf)
355355   MCFG_K053246_GFXDECODE("gfxdecode")
356356   MCFG_K053246_PALETTE("palette")
r29404r29405
363363   MCFG_K053251_ADD("k053251")
364364   MCFG_K053250_ADD("k053250_1", "palette", "screen", 0, 0)
365365   MCFG_K053250_ADD("k053250_2", "palette", "screen", 0, 0)
366   
366
367367   MCFG_DEVICE_ADD("k053252", K053252, 24000000/4)
368368   MCFG_K053252_OFFSETS(13*8, 2*8)
369369
trunk/src/mame/drivers/gsword.c
r29404r29405
703703   MCFG_CPU_VBLANK_INT_DRIVER("screen", gsword_state,  irq0_line_hold)
704704
705705   MCFG_MACHINE_RESET_OVERRIDE(gsword_state,josvolly)
706   
706
707707   MCFG_JOSVOLLY8741_ADD("josvolly_8741")
708708   MCFG_JOSVOLLY8741_CONNECT(1,0,0,0)
709709   MCFG_JOSVOLLY8741_PORT_HANDLERS(IOPORT("DSW1"),IOPORT("DSW2"),IOPORT("DSW1"),IOPORT("DSW2"))
trunk/src/mame/drivers/nmg5.c
r29404r29405
267267   required_device<cpu_device> m_soundcpu;
268268   required_device<okim6295_device> m_oki;
269269   required_device<gfxdecode_device> m_gfxdecode;
270     
270
271271   DECLARE_WRITE16_MEMBER(fg_videoram_w);
272272   DECLARE_WRITE16_MEMBER(bg_videoram_w);
273273   DECLARE_WRITE16_MEMBER(nmg5_soundlatch_w);
trunk/src/mame/drivers/nbmj8900.c
r29404r29405
316316   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 8, 248-1)
317317   MCFG_SCREEN_UPDATE_DRIVER(nbmj8900_state, screen_update_nbmj8900)
318318   MCFG_SCREEN_PALETTE("palette")
319   
319
320320   MCFG_PALETTE_ADD("palette", 256)
321321
322322
trunk/src/mame/drivers/xmen.c
r29404r29405
359359   MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 )   /* correct, same issue of TMNT2 */
360360   MCFG_SCREEN_UPDATE_DRIVER(xmen_state, screen_update_xmen)
361361   MCFG_SCREEN_PALETTE("palette")
362   
362
363363   MCFG_PALETTE_ADD("palette", 2048)
364364   MCFG_PALETTE_ENABLE_SHADOWS()
365365   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
r29404r29405
436436   MCFG_K052109_ADD("k052109", xmen_k052109_intf)
437437   MCFG_K052109_GFXDECODE("gfxdecode")
438438   MCFG_K052109_PALETTE("palette")
439   MCFG_K053246_ADD("k053246", xmen6p_k053246_intf)   
439   MCFG_K053246_ADD("k053246", xmen6p_k053246_intf)
440440   MCFG_K053246_SET_SCREEN("screen")
441441   MCFG_K053246_GFXDECODE("gfxdecode")
442442   MCFG_K053246_PALETTE("palette")
trunk/src/mame/drivers/lethal.c
r29404r29405
598598   MCFG_K053244_PALETTE("palette")
599599MACHINE_CONFIG_END
600600
601ROM_START( lethalen )   // US version UAE
602   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
601ROM_START( lethalen )   // US version UAE
602   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
603603   ROM_LOAD( "191uae01.u4", 0x00000, 0x40000, CRC(dca340e3) SHA1(8efbba0e3a459bcfe23c75c584bf3a4ce25148bb) )
604604
605   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
605   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
606606   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
607607
608   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
608   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
609609   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
610610   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
611611   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
612612   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
613613
614   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
614   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
615615   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
616616   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
617617   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
622622   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
623623   ROM_COPY("gfx2",0x200000,0, 0x200000)
624624
625   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
625   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
626626   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
627627
628628   ROM_REGION16_BE( 0x80, "eeprom", 0 )
629629   ROM_LOAD( "lethalenue.nv", 0x0000, 0x0080, CRC(6e7224e6) SHA1(86dea9262d55e58b573d397d0fea437c58728707) )
630630ROM_END
631631
632ROM_START( lethalenub )   // US version UAB
633   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
632ROM_START( lethalenub ) // US version UAB
633   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
634634   ROM_LOAD( "191uab01.u4", 0x00000, 0x40000, CRC(2afd7528) SHA1(65ce4a54fe96ad38d39d335b5d3a644a495c7e31) )
635635
636   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
636   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
637637   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
638638
639   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
639   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
640640   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
641641   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
642642   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
643643   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
644644
645   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
645   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
646646   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
647647   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
648648   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
653653   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
654654   ROM_COPY("gfx2",0x200000,0, 0x200000)
655655
656   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
656   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
657657   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
658658
659659   ROM_REGION16_BE( 0x80, "eeprom", 0 )
660660   ROM_LOAD( "lethalenub.nv", 0x0000, 0x0080, CRC(14c6c6e5) SHA1(8a498b5322266df25fb24d1b7bd7937de459d207) )
661661ROM_END
662662
663ROM_START( lethalenua )   // US version UAA
664   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
663ROM_START( lethalenua ) // US version UAA
664   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
665665   ROM_LOAD( "191uaa01.u4", 0x00000, 0x40000, CRC(ab6b8f16) SHA1(8de6c429a6e71144270e79d18ad47b5aad13fe04) )
666666
667   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
667   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
668668   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
669669
670   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
670   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
671671   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
672672   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
673673   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
674674   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
675675
676   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
676   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
677677   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
678678   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
679679   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
684684   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
685685   ROM_COPY("gfx2",0x200000,0, 0x200000)
686686
687   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
687   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
688688   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
689689
690690   ROM_REGION16_BE( 0x80, "eeprom", 0 )
691691   ROM_LOAD( "lethalenua.nv", 0x0000, 0x0080, CRC(f71ad1c3) SHA1(04c7052d0895797af8a06183b8a877795bf2dbb3) )
692692ROM_END
693693
694ROM_START( lethalenux )   // US version ?, proto / hack?, very different to other sets
695   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
694ROM_START( lethalenux ) // US version ?, proto / hack?, very different to other sets
695   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
696696   ROM_LOAD( "191xxx01.u4", 0x00000, 0x40000, CRC(a3b9e790) SHA1(868b422850be129952c8b11c3c4aa730d8ea1544) ) // hacked? fails rom test, verified on multiple boards
697697
698   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
698   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
699699   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
700700
701   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
701   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
702702   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
703703   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
704704   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
705705   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
706706
707   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
707   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
708708   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
709709   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
710710   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
715715   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
716716   ROM_COPY("gfx2",0x200000,0, 0x200000)
717717
718   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
718   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
719719   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
720720
721721   ROM_REGION16_BE( 0x80, "eeprom", 0 )
722722   ROM_LOAD( "lethalenux.nv", 0x0000, 0x0080, CRC(5d69c39d) SHA1(e468df829ee5094792289f9166d7e39b638ab70d) )
723723ROM_END
724724
725ROM_START( lethaleneab )   // Euro ver. EAB
726   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
725ROM_START( lethaleneab )    // Euro ver. EAB
726   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
727727   ROM_LOAD( "191eab01.u4", 0x00000, 0x40000, CRC(d7ce111e) SHA1(e56137a0ba7664f09b5d05bb39ec6eb4d1e412c7) )
728728
729   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
729   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
730730   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
731731
732   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
732   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
733733   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
734734   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
735735   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
736736   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
737737
738   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
738   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
739739   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
740740   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
741741   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
746746   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
747747   ROM_COPY("gfx2",0x200000,0, 0x200000)
748748
749   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
749   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
750750   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
751751
752752   ROM_REGION16_BE( 0x80, "eeprom", 0 )
753753   ROM_LOAD( "lethaleneab.nv", 0x0000, 0x0080, CRC(4e9bb34d) SHA1(9502583bc9f5f6fc5bba333869398b24bf154b73) )
754754ROM_END
755755
756ROM_START( lethaleneae )   // Euro ver. EAE
757   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
756ROM_START( lethaleneae )    // Euro ver. EAE
757   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
758758   ROM_LOAD( "191eae01.u4",    0x00000,  0x40000, CRC(c6a3c6ac) SHA1(96a209a3a5b4af40af36bd7090c59a74f8c8df59) )
759759
760   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
760   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
761761   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
762762
763   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
763   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
764764   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
765765   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
766766   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
767767   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
768768
769   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
769   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
770770   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
771771   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
772772   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
777777   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
778778   ROM_COPY("gfx2",0x200000,0, 0x200000)
779779
780   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
780   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
781781   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
782782
783783   ROM_REGION16_BE( 0x80, "eeprom", 0 )
784784   ROM_LOAD( "lethaleneae.nv", 0x0000, 0x0080, CRC(eb369a67) SHA1(6c67294669614e96de5efb38372dbed435ee04d3) )
785785ROM_END
786786
787ROM_START( lethalenj )   // Japan version JAD
788   ROM_REGION( 0x40000, "maincpu", 0 )   /* main program */
787ROM_START( lethalenj )  // Japan version JAD
788   ROM_REGION( 0x40000, "maincpu", 0 ) /* main program */
789789   ROM_LOAD( "191jad01.u4",    0x00000,  0x40000, CRC(160a25c0) SHA1(1d3ed5a158e461a73c079fe24a8e9d5e2a87e126) )
790790
791   ROM_REGION( 0x10000, "soundcpu", 0 )   /* Z80 sound program */
791   ROM_REGION( 0x10000, "soundcpu", 0 )    /* Z80 sound program */
792792   ROM_LOAD( "191a02.f4", 0x00000, 0x10000, CRC(72b843cc) SHA1(b44b2f039358c26fa792d740639b66a5c8bf78e7) )
793793
794   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
794   ROM_REGION( 0x400000, "gfx1", 0 )   /* tilemaps */
795795   ROM_LOAD32_WORD( "191a08", 0x000002, 0x100000, CRC(555bd4db) SHA1(d2e55796b4ab2306ae549fa9e7288e41eaa8f3de) )
796796   ROM_LOAD32_WORD( "191a10", 0x000000, 0x100000, CRC(2fa9bf51) SHA1(1e4ec56b41dfd8744347a7b5799e3ebce0939adc) )
797797   ROM_LOAD32_WORD( "191a07", 0x200002, 0x100000, CRC(1dad184c) SHA1(b2c4a8e48084005056aef2c8eaccb3d2eca71b73) )
798798   ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
799799
800   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
800   ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE00 )   /* sprites - fake 6bpp decode is done from here */
801801   ROM_LOAD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
802802   ROM_LOAD( "191a05", 0x100000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
803803   ROM_LOAD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
r29404r29405
808808   ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 )
809809   ROM_COPY("gfx2",0x200000,0, 0x200000)
810810
811   ROM_REGION( 0x200000, "k054539", 0 )   /* K054539 samples */
811   ROM_REGION( 0x200000, "k054539", 0 )    /* K054539 samples */
812812   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
813813
814814   ROM_REGION16_BE( 0x80, "eeprom", 0 )
trunk/src/mame/drivers/exprraid.c
r29404r29405
509509
510510   /* video hardware */
511511   MCFG_SCREEN_ADD("screen", RASTER)
512//   MCFG_SCREEN_REFRESH_RATE(60)
513//   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
514//   MCFG_SCREEN_SIZE(32*8, 32*8)
515//   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
512//  MCFG_SCREEN_REFRESH_RATE(60)
513//  MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
514//  MCFG_SCREEN_SIZE(32*8, 32*8)
515//  MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
516516   MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz/2, 384, 0, 256, 262, 8, 256-8) /* not accurate */
517517   MCFG_SCREEN_UPDATE_DRIVER(exprraid_state, screen_update_exprraid)
518518   MCFG_SCREEN_PALETTE("palette")
trunk/src/mame/drivers/tumbleb.c
r29404r29405
20672067
20682068   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tumbleb)
20692069   MCFG_PALETTE_ADD("palette", 1024)
2070   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)   
2070   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
20712071
20722072   MCFG_VIDEO_START_OVERRIDE(tumbleb_state,tumblepb)
20732073
trunk/src/mame/drivers/bmcpokr.c
r29404r29405
242242   MCFG_SCREEN_SIZE(64*8, 32*8)
243243   MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
244244   MCFG_SCREEN_PALETTE("palette")
245   
245
246246   MCFG_PALETTE_ADD("palette", 256)
247247   MCFG_GFXDECODE_ADD("gfxdecode", "palette", bmcpokr)
248248
trunk/src/mame/drivers/dfruit.c
r29404r29405
403403
404404   MCFG_GFXDECODE_ADD("gfxdecode", "palette", dfruit )
405405   MCFG_PALETTE_ADD("palette", 0x100)
406   
406
407407   MCFG_DEVICE_ADD("tc0091lvc", TC0091LVC, 0)
408408   MCFG_TC0091LVC_GFXDECODE("gfxdecode")
409409   MCFG_TC0091LVC_PALETTE("palette")
410   
410
411411   MCFG_I8255A_ADD( "ppi8255_0", ppi8255_intf )
412412
413413   /* sound hardware */
trunk/src/mame/drivers/micro3d.c
r29404r29405
328328   MCFG_MC68681_B_TX_CALLBACK(WRITELINE(micro3d_state, duart_txb))
329329   MCFG_MC68681_INPORT_CALLBACK(READ8(micro3d_state, duart_input_r))
330330   MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(micro3d_state, duart_output_w))
331   
331
332332   MCFG_DEVICE_ADD("mc68901", MC68901, 4000000)
333333   MCFG_MC68901_TIMER_CLOCK(4000000)
334334   MCFG_MC68901_RX_CLOCK(0)
trunk/src/mame/drivers/tugboat.c
r29404r29405
4949   required_device<gfxdecode_device> m_gfxdecode;
5050   required_device<screen_device> m_screen;
5151   required_device<palette_device> m_palette;
52   
52
5353   UINT8 m_hd46505_0_reg[18];
5454   UINT8 m_hd46505_1_reg[18];
5555   int m_reg0;
trunk/src/mame/drivers/bailey.c
r29404r29405
11/***************************************************************************
2
2
33 Bailey International discrete hardware games
4
4
55 Fun Four (1976)
6
6
77***************************************************************************/
88
99
r29404r29405
4343public:
4444   bailey_state(const machine_config &mconfig, device_type type, const char *tag)
4545   : driver_device(mconfig, type, tag),
46     m_maincpu(*this, "maincpu"),
47     m_video(*this, "fixfreq")
46      m_maincpu(*this, "maincpu"),
47      m_video(*this, "fixfreq")
4848   {
4949   }
50   
50
5151   // devices
5252   required_device<netlist_mame_device_t> m_maincpu;
5353   required_device<fixedfreq_device> m_video;
54   
54
5555protected:
56   
56
5757   // driver_device overrides
5858   virtual void machine_start();
5959   virtual void machine_reset();
60   
60
6161   virtual void video_start();
62   
62
6363private:
64   
64
6565};
6666
6767
6868static NETLIST_START(bailey)
6969   SOLVER(Solver, 48000)
70//   PARAM(Solver.FREQ, 48000)
70//  PARAM(Solver.FREQ, 48000)
7171   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
7272
7373   // schematics
7474   //...
7575
76//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
77//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
76//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
77//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
7878NETLIST_END()
7979
8080
r29404r29405
104104
105105
106106/***************************************************************************
107
107
108108 Game driver(s)
109
109
110110 ***************************************************************************/
111111
112112
trunk/src/mame/drivers/pzletime.c
r29404r29405
342342   MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 28*8-1)
343343   MCFG_SCREEN_UPDATE_DRIVER(pzletime_state, screen_update_pzletime)
344344   MCFG_SCREEN_PALETTE("palette")
345   
345
346346   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pzletime)
347347   MCFG_PALETTE_ADD("palette", 0x300 + 32768)
348348   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
349349   MCFG_PALETTE_INIT_OWNER(pzletime_state, pzletime)
350   
350
351351   MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
352352
353353
trunk/src/mame/drivers/gei.c
r29404r29405
11961196
11971197   MCFG_CPU_MODIFY("maincpu")
11981198   MCFG_CPU_PROGRAM_MAP(quizvid_map)
1199   
1199
12001200   MCFG_PALETTE_MODIFY("palette")
12011201   MCFG_PALETTE_INIT_OWNER(gei_state,quizvid)
12021202MACHINE_CONFIG_END
trunk/src/mame/drivers/konendev.c
r29404r29405
109109   MCFG_CPU_PROGRAM_MAP(konendev_map)
110110
111111   /* video hardware */
112   MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
112   MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
113113
114114   MCFG_SCREEN_ADD("screen", RASTER)
115115   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mame/drivers/ecoinf2.c
r29404r29405
2121public:
2222   ecoinf2_state(const machine_config &mconfig, device_type type, const char *tag)
2323      : driver_device(mconfig, type, tag),
24      m_maincpu(*this, "maincpu"),   
24      m_maincpu(*this, "maincpu"),
2525      m_coins(*this, "COINS"),
2626      m_key(*this, "PERKEY"),
2727      m_panel(*this, "PANEL")
r29404r29405
3838   UINT16 m_lamps[16];
3939   UINT16 m_leds[16];
4040   //UINT16 m_chars[14];
41//   void update_display();
41//  void update_display();
4242   int m_optic_pattern;
4343   int strobe_addr;
4444   int strobe_amount;
r29404r29405
8989   }
9090   DECLARE_WRITE8_MEMBER(ppi8255_ic10_write_c_strobe)
9191   {
92//      if (data>=0xf0)
92//      if (data>=0xf0)
9393      {
9494         strobe_addr = data & 0xf;
9595
r29404r29405
100100         update_lamps();
101101         update_leds();
102102      }
103   //   else logerror("%04x - ppi8255_ic10_(used)write_c %02x (UNUSUAL?)\n", m_maincpu->pcbase(), data);
103   //  else logerror("%04x - ppi8255_ic10_(used)write_c %02x (UNUSUAL?)\n", m_maincpu->pcbase(), data);
104104   }
105105
106106
r29404r29405
149149         return 0x00;
150150      }
151151
152//      return m_misc->read();
152//      return m_misc->read();
153153   }
154154
155155
r29404r29405
177177      coin_lockout_w(machine(), 1, (data & 0x02) );
178178      coin_lockout_w(machine(), 2, (data & 0x04) );
179179      coin_lockout_w(machine(), 3, (data & 0x08) );
180      coin_lockout_w(machine(), 4, (data & 0x10) );   
181     
180      coin_lockout_w(machine(), 4, (data & 0x10) );
181
182182      //int wdog = (data& 0x80);
183183   }
184   
185184
186185
187186
187
188188   DECLARE_WRITE8_MEMBER(ppi8255_ic23_write_a_reel01)
189189   {
190190      stepper_update(0, data&0x0f);
r29404r29405
254254   DEVCB_DRIVER_MEMBER(ecoinf2_state,ppi8255_ic22_read_c_misc),            /* Port C read (0x20 appears to be meter power)*/
255255   DEVCB_NULL
256256};
257   
257
258258// IC24 is the workhorse of the Phoenix, it seems to handle meters, payslides, coin lamps, inhibits and the watchdog! */
259259static I8255_INTERFACE (ppi8255_ic24_intf)//coins and related
260260{
r29404r29405
295295   AM_RANGE(0x48, 0x4b) AM_DEVREADWRITE("ic22_inpt", i8255_device, read, write) //*
296296   AM_RANGE(0x4c, 0x4f) AM_DEVREADWRITE("ic23_reel", i8255_device, read, write)
297297   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("ic13_leds", i8255_device, read, write) //*
298//   AM_RANGE(0x54, 0x57) AM_DEVREADWRITE("ic25_dips", i8255_device, read, write) // is this an 8255, or a mirrored byte read?
298//  AM_RANGE(0x54, 0x57) AM_DEVREADWRITE("ic25_dips", i8255_device, read, write) // is this an 8255, or a mirrored byte read?
299299
300   
301//   AM_RANGE(0x5c, 0x5c) AM_WRITE(ox_port5c_out_w)
300
301//  AM_RANGE(0x5c, 0x5c) AM_WRITE(ox_port5c_out_w)
302302ADDRESS_MAP_END
303303
304304
r29404r29405
494494   PORT_DIPNAME( 0x80, 0x80, "IN7:80" )
495495   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
496496   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
497   
497
498498   PORT_START("PANEL")
499499   PORT_DIPNAME( 0x01, 0x01, "IN8:01" )
500500   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r29404r29405
561561   MCFG_CPU_ADD("maincpu", Z180,4000000) // some of these hit invalid opcodes with a plain z80, some don't?
562562   MCFG_CPU_PROGRAM_MAP(oxo_memmap)
563563   MCFG_CPU_IO_MAP(oxo_portmap)
564   
564
565565   MCFG_DEFAULT_LAYOUT(layout_ecoinf2)
566566
567567   MCFG_MACHINE_START_OVERRIDE(ecoinf2_state, ecoinf2 )
r29404r29405
571571   MCFG_I8255_ADD( "ic22_inpt", ppi8255_ic22_intf )
572572   MCFG_I8255_ADD( "ic23_reel", ppi8255_ic23_intf )
573573   MCFG_I8255_ADD( "ic13_leds", ppi8255_ic13_intf )
574//   MCFG_I8255_ADD( "ic25_dips", ppi8255_ic25_intf )
574//  MCFG_I8255_ADD( "ic25_dips", ppi8255_ic25_intf )
575575
576576MACHINE_CONFIG_END
577577
trunk/src/mame/drivers/mystwarr.c
r29404r29405
987987   MCFG_QUANTUM_TIME(attotime::from_hz(1920))
988988
989989   MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
990   
990
991991   MCFG_DEVICE_ADD("k053252", K053252, 6000000) // 6 MHz?
992992   MCFG_K053252_OFFSETS(24, 16)
993   
993
994994   MCFG_MACHINE_START_OVERRIDE(mystwarr_state,mystwarr)
995995   MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state,mystwarr)
996996
r29404r29405
10091009   MCFG_PALETTE_ENABLE_SHADOWS()
10101010   MCFG_PALETTE_ENABLE_HILIGHTS()
10111011
1012   
1012
10131013   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
10141014   MCFG_K056832_ADD_NOINTF("k056832"/*, mystwarr_k056832_intf*/)
10151015   MCFG_K056832_GFXDECODE("gfxdecode")
r29404r29405
10401040
10411041   MCFG_DEVICE_REPLACE("k053252", K053252, 16000000/2)
10421042   MCFG_K053252_OFFSETS(40, 16)
1043   
1043
10441044   /* basic machine hardware */
10451045   MCFG_CPU_MODIFY("maincpu")
10461046   MCFG_CPU_PROGRAM_MAP(viostorm_map)
r29404r29405
10701070
10711071   MCFG_DEVICE_MODIFY("k053252")
10721072   MCFG_K053252_OFFSETS(24, 15)
1073   
1073
10741074   MCFG_K053250_ADD("k053250_1", "palette", "screen", -7, 0)
10751075
10761076   /* video hardware */
r29404r29405
11221122
11231123   MCFG_DEVICE_MODIFY("k053252")
11241124   MCFG_K053252_OFFSETS(40, 16)
1125   
1125
11261126   MCFG_K054000_ADD("k054000")
11271127
11281128   MCFG_GFXDECODE_MODIFY("gfxdecode", gaiapols)
trunk/src/mame/drivers/halleys.c
r29404r29405
247247   offs_t m_collision_detection;
248248   int m_latch_delay;
249249   dynamic_array<UINT8> m_paletteram;
250   
250
251251   DECLARE_WRITE8_MEMBER(bgtile_w);
252252   DECLARE_READ8_MEMBER(blitter_status_r);
253253   DECLARE_READ8_MEMBER(blitter_r);
r29404r29405
12821282
12831283      m_alpha_table[(src<<8)+dst] = c | BG_RGB;
12841284   }
1285   
1285
12861286   m_paletteram.resize(m_palette->entries());
12871287   m_palette->basemem().set(m_paletteram, ENDIANNESS_LITTLE, 1);
1288   
1288
12891289   m_bgcolor         = m_palette->black_pen();
12901290}
12911291
trunk/src/mame/drivers/peplus.c
r29404r29405
204204      m_maincpu(*this, "maincpu"),
205205      m_i2cmem(*this, "i2cmem"),
206206      m_gfxdecode(*this, "gfxdecode"),
207      m_palette(*this, "palette")
207      m_palette(*this, "palette")
208208   {
209209   }
210210
r29404r29405
68466846
68476847ROM_START( pexmp030 ) /* Superboard : 5-in-1 Wingboard (XMP00030) */
68486848   ROM_REGION( 0x10000, "maincpu", 0 )
6849   ROM_LOAD( "xmp00030.u67",   0x00000, 0x10000, CRC(da3fcb6f) SHA1(114e581e5ebb5c40c3f3da2784122d3281f269ee) ) /*  11/12/00   @ IGT  L01-0197  */
6849   ROM_LOAD( "xmp00030.u67",   0x00000, 0x10000, CRC(da3fcb6f) SHA1(114e581e5ebb5c40c3f3da2784122d3281f269ee) ) /*  11/12/00   @ IGT  L01-0197  */
68506850
68516851   ROM_REGION( 0x10000, "user1", 0 )
68526852   ROM_LOAD( "x002066p.u66",   0x00000, 0x10000, CRC(01236011) SHA1(3edfee014705b3540386c5e42026ab93628b2597) ) /* Double Double Bonus Poker */
trunk/src/mame/drivers/triforce.c
r29404r29405
194194      DSW       - 2-position DIP Switch, present only on Sega GDROM version PCB
195195      PIC16C621 - DIP18 socket and 4MHz OSC on a 90-degrees-mounted small PCB for
196196                  Microchip PIC16C621A protection key chip
197
197
198198ROM Board (attached to CN3 of Media Board, ONLY for use with Namco ROM cart version of the Media Board)
199199---------
200200
trunk/src/mame/drivers/konamigx.c
r29404r29405
17281728
17291729   MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type3)
17301730
1731   
1731
17321732   MCFG_PALETTE_MODIFY("palette")
17331733   MCFG_PALETTE_ENTRIES(16384)
17341734   MCFG_PALETTE_ENABLE_SHADOWS()
trunk/src/mame/drivers/dorachan.c
r29404r29405
3838   virtual void machine_reset();
3939   UINT32 screen_update_dorachan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4040   required_device<cpu_device> m_maincpu;
41   required_device<screen_device> m_screen;   
41   required_device<screen_device> m_screen;
4242};
4343
4444
trunk/src/mame/drivers/carrera.c
r29404r29405
352352   MCFG_GFXDECODE_ADD("gfxdecode", "palette", carrera)
353353   MCFG_PALETTE_ADD("palette", 32)
354354   MCFG_PALETTE_INIT_OWNER(carrera_state, carrera)
355   
355
356356   /* sound hardware */
357357   MCFG_SPEAKER_STANDARD_MONO("mono")
358358
trunk/src/mame/drivers/electra.c
r29404r29405
11/***************************************************************************
2
2
33 Electra discrete hardware games
4
4
55 Game Name
66 Avenger (1975)                EG-1020
77 Eliminator IV (1976)
r29404r29405
99 Pace Car Pro (1975)           EG-1000
1010 UFO Chase (1975)              EG-1010
1111 Wings (1976)
12
12
1313***************************************************************************/
1414
1515
r29404r29405
4949public:
5050   electra_state(const machine_config &mconfig, device_type type, const char *tag)
5151   : driver_device(mconfig, type, tag),
52     m_maincpu(*this, "maincpu"),
53     m_video(*this, "fixfreq")
52      m_maincpu(*this, "maincpu"),
53      m_video(*this, "fixfreq")
5454   {
5555   }
56   
56
5757   // devices
5858   required_device<netlist_mame_device_t> m_maincpu;
5959   required_device<fixedfreq_device> m_video;
60   
60
6161protected:
62   
62
6363   // driver_device overrides
6464   virtual void machine_start();
6565   virtual void machine_reset();
66   
66
6767   virtual void video_start();
68   
68
6969private:
70   
70
7171};
7272
7373
7474static NETLIST_START(electra)
7575   SOLVER(Solve, 48000)
76//   PARAM(Solver.FREQ, 48000)
76//  PARAM(Solver.FREQ, 48000)
7777   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
7878
7979   // schematics
8080   //...
8181
82//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
83//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
82//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
83//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8484NETLIST_END()
8585
8686
r29404r29405
110110
111111
112112/***************************************************************************
113
113
114114 Game driver(s)
115
115
116116 ***************************************************************************/
117117
118118
trunk/src/mame/drivers/d9final.c
r29404r29405
297297   MCFG_SCREEN_REFRESH_RATE(60)
298298   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
299299   MCFG_SCREEN_SIZE(512, 256)
300   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 16, 256-16-1)   
300   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 16, 256-16-1)
301301   MCFG_SCREEN_UPDATE_DRIVER(d9final_state, screen_update_d9final)
302302   MCFG_SCREEN_PALETTE("palette")
303303
trunk/src/mame/drivers/rockrage.c
r29404r29405
261261   MCFG_K007342_GFXNUM(0)
262262   MCFG_K007342_CALLBACK_OWNER(rockrage_state, rockrage_tile_callback)
263263   MCFG_K007342_GFXDECODE("gfxdecode")
264   
264
265265   MCFG_K007420_ADD("k007420")
266266   MCFG_K007420_BANK_LIMIT(0x3ff)
267   MCFG_K007420_CALLBACK_OWNER(rockrage_state, rockrage_sprite_callback)   
267   MCFG_K007420_CALLBACK_OWNER(rockrage_state, rockrage_sprite_callback)
268268   MCFG_K007420_PALETTE("palette")
269269
270270   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rockrage)
trunk/src/mame/drivers/segac2.c
r29404r29405
9797   m_upd7759(*this, "upd"),
9898   m_screen(*this, "screen"),
9999   m_palette(*this, "palette") { }
100   
100
101101   // for Print Club only
102102   int m_cam_data;
103   
103
104104   int m_segac2_enable_display;
105   
105
106106   required_shared_ptr<UINT16> m_paletteram;
107   
107
108108   /* internal states */
109109   UINT8       m_misc_io_data[0x10];   /* holds values written to the I/O chip */
110   
110
111111   /* protection-related tracking */
112112   int (*m_prot_func)(int in);     /* emulation of protection chip */
113113   UINT8       m_prot_write_buf;       /* remembers what was written */
114114   UINT8       m_prot_read_buf;        /* remembers what was returned */
115   
115
116116   /* palette-related variables */
117117   UINT8       m_segac2_alt_palette_mode;
118118   UINT8       m_palbank;
119119   UINT8       m_bg_palbase;
120120   UINT8       m_sp_palbase;
121   
121
122122   /* sound-related variables */
123123   UINT8       m_sound_banks;      /* number of sound banks */
124   
124
125125   DECLARE_DRIVER_INIT(c2boot);
126126   DECLARE_DRIVER_INIT(bloxeedc);
127127   DECLARE_DRIVER_INIT(columns);
r29404r29405
151151   DECLARE_VIDEO_START(segac2_new);
152152   DECLARE_MACHINE_START(segac2);
153153   DECLARE_MACHINE_RESET(segac2);
154   
154
155155   UINT32 screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
156156   int m_segac2_bg_pal_lookup[4];
157157   int m_segac2_sp_pal_lookup[4];
158158   void recompute_palette_tables();
159   
159
160160   DECLARE_WRITE_LINE_MEMBER(vdp_sndirqline_callback_c2);
161161   DECLARE_WRITE_LINE_MEMBER(vdp_lv6irqline_callback_c2);
162162   DECLARE_WRITE_LINE_MEMBER(vdp_lv4irqline_callback_c2);
163   
163
164164   DECLARE_WRITE16_MEMBER( segac2_upd7759_w );
165165   DECLARE_READ16_MEMBER( palette_r );
166166   DECLARE_WRITE16_MEMBER( palette_w );
r29404r29405
177177   optional_device<upd7759_device> m_upd7759;
178178   optional_device<screen_device> m_screen;
179179   required_device<palette_device> m_palette;
180   
180
181181};
182182
183183
r29404r29405
195195   save_item(NAME(m_misc_io_data));
196196   save_item(NAME(m_prot_write_buf));
197197   save_item(NAME(m_prot_read_buf));
198   
198
199199   m_vdp->stop_timers();
200200}
201201
trunk/src/mame/drivers/mugsmash.c
r29404r29405
408408   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
409409   MCFG_SCREEN_UPDATE_DRIVER(mugsmash_state, screen_update_mugsmash)
410410   MCFG_SCREEN_PALETTE("palette")
411   
411
412412   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mugsmash)
413413
414414   MCFG_PALETTE_ADD("palette", 0x300)
trunk/src/mame/drivers/gladiatr.c
r29404r29405
711711   MCFG_TAITO8741_MODES(TAITO8741_MASTER,TAITO8741_SLAVE,TAITO8741_PORT,TAITO8741_PORT)
712712   MCFG_TAITO8741_CONNECT(1,0,0,0)
713713   MCFG_TAITO8741_PORT_HANDLERS(READ8(gladiatr_state,gladiator_dsw1_r),READ8(gladiatr_state,gladiator_dsw2_r),READ8(gladiatr_state,gladiator_button3_r),READ8(gladiatr_state,gladiator_controls_r))
714   
714
715715   /* video hardware */
716716   MCFG_SCREEN_ADD("screen", RASTER)
717717   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mame/drivers/puckpkmn.c
r29404r29405
221221   AM_RANGE(0x700022, 0x700023) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
222222   AM_RANGE(0xa04000, 0xa04003) AM_READWRITE8(megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
223223   AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega315_5313_device, vdp_r, vdp_w)
224   
224
225225   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000)
226226
227227   /* Unknown reads/writes: */
r29404r29405
453453ROM_END
454454
455455
456ROM_START( puckpkmnb )
456ROM_START( puckpkmnb )
457457   ROM_REGION( 0x400000, "maincpu", 0 )
458458   ROM_LOAD16_BYTE( "200061.u5", 0x000000, 0x080000, CRC(502a5093) SHA1(6dc1c79d52ebb653cb2e4388f74fd975ec323566) )
459459   ROM_LOAD16_BYTE( "200060.u4", 0x000001, 0x080000, CRC(5f160c18) SHA1(5a5ce1b9a81afe836e435e9d6f16cf57b63cbd31) )
trunk/src/mame/drivers/seabattl.c
r29404r29405
9999   UINT8 m_collision;
100100   required_device<gfxdecode_device> m_gfxdecode;
101101   required_device<screen_device> m_screen;
102   required_device<palette_device> m_palette;   
102   required_device<palette_device> m_palette;
103103};
104104
105105
trunk/src/mame/drivers/vendetta.c
r29404r29405
443443
444444   m_paletteram.resize(0x1000);
445445   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
446   
446
447447   save_item(NAME(m_paletteram));
448448   save_item(NAME(m_irq_enabled));
449449   save_item(NAME(m_sprite_colorbase));
trunk/src/mame/drivers/pktgaldx.c
r29404r29405
394394
395395   MCFG_PALETTE_ADD("palette", 4096)
396396   MCFG_PALETTE_FORMAT(XBGR)
397   
397
398398   MCFG_GFXDECODE_ADD("gfxdecode", "palette", bootleg)
399399
400400   /* sound hardware */
trunk/src/mame/drivers/atarigx2.c
r29404r29405
168168in those regions precludes applying the same kind of analysis.
169169
170170int parameters3[16][2] = {
171   {0x003a, 0x0032},
172   {0x0076, 0x0064},
173   {0x00ee, 0x00c8},
174   {0x01dc, 0x0190},
175   {0x01b0, 0x012A},
176   {0x0168, 0x005C},
177   {0x00d8, 0x00b8},
178   {0x01b0, 0x0172},
179   {0x016a, 0x00ee},
180   {0x00de, 0x01de},
181   {0x01be, 0x01b6},
182   {0x0174, 0x0164},
183   {0x00e2, 0x00c0},
184   {0x01c6, 0x0180},
185   {0x0186, 0x010a},
186   {0x0104, 0x001c}
171    {0x003a, 0x0032},
172    {0x0076, 0x0064},
173    {0x00ee, 0x00c8},
174    {0x01dc, 0x0190},
175    {0x01b0, 0x012A},
176    {0x0168, 0x005C},
177    {0x00d8, 0x00b8},
178    {0x01b0, 0x0172},
179    {0x016a, 0x00ee},
180    {0x00de, 0x01de},
181    {0x01be, 0x01b6},
182    {0x0174, 0x0164},
183    {0x00e2, 0x00c0},
184    {0x01c6, 0x0180},
185    {0x0186, 0x010a},
186    {0x0104, 0x001c}
187187};
188188
189189// every output bit is a linear function on the input bits except by
190190// a quadratic term always involving bit #0 of the input
191191UINT32 ftest4(UINT32 num)
192192{
193   UINT32 accum = 0;
194   
195   for (int i=0; i<16; ++i)
196   {
197      int b1 = weight(num&parameters3[i][0])&1;  // <- linear function (parameters3[i][0] acts as a mask determining which bits are added)
198      int b2 = weight(num&parameters3[i][1])&1;  // <- idem
199      b2 &= BIT(num, 0);                         // quadratic term
200      int b3 = b1 ^ b2;
201     
202      accum ^= (b3 << i);
203   }
204   
205   return accum;
193    UINT32 accum = 0;
194
195    for (int i=0; i<16; ++i)
196    {
197        int b1 = weight(num&parameters3[i][0])&1;  // <- linear function (parameters3[i][0] acts as a mask determining which bits are added)
198        int b2 = weight(num&parameters3[i][1])&1;  // <- idem
199        b2 &= BIT(num, 0);                         // quadratic term
200        int b3 = b1 ^ b2;
201
202        accum ^= (b3 << i);
203    }
204
205    return accum;
206206}
207207
208208*********************/
trunk/src/mame/drivers/nwk-tr.c
r29404r29405
775775   MCFG_PALETTE_ADD("palette", 65536)
776776
777777   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
778   
778
779779   MCFG_K001604_ADD("k001604", racingj_k001604_intf)
780780   MCFG_K001604_GFXDECODE("gfxdecode")
781781   MCFG_K001604_PALETTE("palette")
trunk/src/mame/drivers/pkscram.c
r29404r29405
5252   DECLARE_WRITE_LINE_MEMBER(irqhandler);
5353   required_device<cpu_device> m_maincpu;
5454   required_device<gfxdecode_device> m_gfxdecode;
55   required_device<screen_device> m_screen;   
55   required_device<screen_device> m_screen;
5656};
5757
5858
trunk/src/mame/drivers/taotaido.c
r29404r29405
356356   MCFG_VSYSTEM_SPR_SET_GFXREGION(0)
357357   MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
358358   MCFG_VSYSTEM_SPR_PALETTE("palette")
359   
359
360360   /* sound hardware */
361361   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
362362
trunk/src/mame/drivers/ninjaw.c
r29404r29405
854854   MCFG_TC0110PCR_PALETTE("palette2")
855855   MCFG_TC0110PCR_ADD("tc0110pcr_3")
856856   MCFG_TC0110PCR_PALETTE("palette3")
857   
857
858858   /* sound hardware */
859859   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
860860
trunk/src/mame/drivers/pacman.c
r29404r29405
42464246   ROM_LOAD( "5f",           0x1000, 0x1000, CRC(615af909) SHA1(fd6a1dde780b39aea76bf1c4befa5882573c2ef4) ) // 6.5f
42474247
42484248   ROM_REGION( 0x0120, "proms", 0 )
4249   ROM_LOAD( "mb7051.7f",    0x0000, 0x0020, CRC(ff344446) SHA1(45eb37533da8912645a089b014f3b3384702114a) )
4249   ROM_LOAD( "mb7051.7f",    0x0000, 0x0020, CRC(ff344446) SHA1(45eb37533da8912645a089b014f3b3384702114a) )
42504250   ROM_LOAD( "82s126.4a",    0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) // m82s129n.4a
42514251
42524252   ROM_REGION( 0x0200, "namco", 0 )    /* sound PROMs */
r29404r29405
46294629   ROM_LOAD( "cr4.5j",       0x1800, 0x0800, CRC(d35d1caf) SHA1(65dd7861e05651485626465dc97215fed58db551) )
46304630
46314631   // the set with the above 'crushbl3' program roms and these gfx roms just seems to be a bad dump (some bad maze tiles?)
4632//   ROM_REGION( 0x2000, "gfx1", 0 )
4633//   ROM_LOAD( "cr1.bin",       0x0000, 0x0800, CRC(cc31c649) SHA1(a0640d2abc21872b0e680e8e31e3bcb7e7a07953) )
4634//   ROM_LOAD( "cr3.bin",       0x0800, 0x0800, CRC(14c121d8) SHA1(05f900a2e2a67401ab357340c1fb36153f365f1b) )
4635//   ROM_LOAD( "cr2.bin",       0x1000, 0x0800, CRC(882dc667) SHA1(5ea01d9c692b3061a0e39e2227fbc6af4baaab11) )  /* copyright sign was removed */
4636//   ROM_LOAD( "cr4.bin",       0x1800, 0x0800, CRC(0d3877c4) SHA1(0a6f4098181480aa85225324129e37bba375252d) )
4632//  ROM_REGION( 0x2000, "gfx1", 0 )
4633//  ROM_LOAD( "cr1.bin",       0x0000, 0x0800, CRC(cc31c649) SHA1(a0640d2abc21872b0e680e8e31e3bcb7e7a07953) )
4634//  ROM_LOAD( "cr3.bin",       0x0800, 0x0800, CRC(14c121d8) SHA1(05f900a2e2a67401ab357340c1fb36153f365f1b) )
4635//  ROM_LOAD( "cr2.bin",       0x1000, 0x0800, CRC(882dc667) SHA1(5ea01d9c692b3061a0e39e2227fbc6af4baaab11) )  /* copyright sign was removed */
4636//  ROM_LOAD( "cr4.bin",       0x1800, 0x0800, CRC(0d3877c4) SHA1(0a6f4098181480aa85225324129e37bba375252d) )
46374637
46384638   ROM_REGION( 0x0120, "proms", 0 )
46394639   ROM_LOAD( "74s288.8a",    0x0000, 0x0020, CRC(ff344446) SHA1(45eb37533da8912645a089b014f3b3384702114a) )
trunk/src/mame/drivers/chqflag.c
r29404r29405
300300
301301   m_paletteram.resize(m_palette->entries() * 2);
302302   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
303   
303
304304   save_item(NAME(m_paletteram));
305305   save_item(NAME(m_k051316_readroms));
306306   save_item(NAME(m_last_vreg));
trunk/src/mame/drivers/sf.c
r29404r29405
835835   MCFG_SCREEN_PALETTE("palette")
836836
837837   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sf)
838   
838
839839   MCFG_PALETTE_ADD("palette", 1024)
840840   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
841841
trunk/src/mame/drivers/dooyong.c
r29404r29405
16611661   ROM_LOAD( "ftiger_2.4h",  0x08000, 0x08000, CRC(ca9d6713) SHA1(645cccc06c7f6744b25e7917f414956856419b8a) )
16621662   ROM_CONTINUE(             0x00000, 0x8000 )
16631663
1664   ROM_REGION( 0x80000, "gfx2", 0 )    /* sprites */
1664   ROM_REGION( 0x80000, "gfx2", 0 )    /* sprites */
16651665   ROM_LOAD16_BYTE( "ftiger_16.4h", 0x00000, 0x20000, CRC(8a158b95) SHA1(ed09d9c40b76a27e06601381e463a00b16555f1e) )
16661666   ROM_LOAD16_BYTE( "ftiger_15.2h", 0x00001, 0x20000, CRC(399f6043) SHA1(ea0debd6d0f8c61f0078809c2828734fc15e891d) )
16671667   ROM_LOAD16_BYTE( "ftiger_14.4k", 0x40000, 0x20000, CRC(df66b6f3) SHA1(3a29ae69a09306c5a2a2786acbf227832b408152) )
trunk/src/mame/drivers/rcorsair.c
r29404r29405
139139   MCFG_SCREEN_ADD("screen", RASTER)
140140   MCFG_SCREEN_REFRESH_RATE(60)
141141   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
142   MCFG_SCREEN_UPDATE_DRIVER(rcorsair_state, screen_update)   
142   MCFG_SCREEN_UPDATE_DRIVER(rcorsair_state, screen_update)
143143   MCFG_SCREEN_SIZE(256, 256)
144144   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
145145   MCFG_SCREEN_PALETTE("palette")
trunk/src/mame/drivers/s7.c
r29404r29405
442442   MCFG_SPEAKER_STANDARD_MONO("speech")
443443   MCFG_SOUND_ADD("hc55516", HC55516, 0)
444444   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speech", 0.50)
445   
445
446446   MCFG_DEVICE_ADD("pias", PIA6821, 0)
447447   MCFG_PIA_READPB_HANDLER(READ8(s7_state, dac_r))
448448   MCFG_PIA_WRITEPA_HANDLER(WRITE8(s7_state, dac_w))
trunk/src/mame/drivers/cubeqst.c
r29404r29405
4444   required_device<cquestrot_cpu_device> m_rotatecpu;
4545   required_device<cquestlin_cpu_device> m_linecpu;
4646   required_device<cquestsnd_cpu_device> m_soundcpu;
47   required_device<screen_device> m_screen;   
47   required_device<screen_device> m_screen;
4848   rgb_t *m_colormap;
4949   DECLARE_WRITE16_MEMBER(palette_w);
5050   DECLARE_READ16_MEMBER(line_r);
trunk/src/mame/drivers/wolfpack.c
r29404r29405
313313   MCFG_SCREEN_UPDATE_DRIVER(wolfpack_state, screen_update_wolfpack)
314314   MCFG_SCREEN_VBLANK_DRIVER(wolfpack_state, screen_eof_wolfpack)
315315   MCFG_SCREEN_PALETTE("palette")
316   
316
317317   MCFG_GFXDECODE_ADD("gfxdecode", "palette", wolfpack)
318318   MCFG_PALETTE_ADD("palette", 12)
319319   MCFG_PALETTE_INDIRECT_ENTRIES(8)
trunk/src/mame/drivers/exerion.c
r29404r29405
400400   MCFG_SCREEN_RAW_PARAMS(EXERION_PIXEL_CLOCK, EXERION_HTOTAL, EXERION_HBEND, EXERION_HBSTART, EXERION_VTOTAL, EXERION_VBEND, EXERION_VBSTART)
401401   MCFG_SCREEN_UPDATE_DRIVER(exerion_state, screen_update_exerion)
402402   MCFG_SCREEN_PALETTE("palette")
403   
403
404404   MCFG_GFXDECODE_ADD("gfxdecode", "palette", exerion)
405405   MCFG_PALETTE_ADD("palette", 256*3)
406406   MCFG_PALETTE_INDIRECT_ENTRIES(32)
trunk/src/mame/drivers/segas18.c
r29404r29405
145145   m_vdp->set_vdp_pal(FALSE);
146146   m_vdp->set_framerate(60);
147147   m_vdp->set_total_scanlines(262);
148   m_vdp->stop_timers();   // 315-5124 timers
148   m_vdp->stop_timers();   // 315-5124 timers
149149
150150   // save state
151151   save_item(NAME(m_mcu_data));
trunk/src/mame/drivers/subs.c
r29404r29405
187187
188188   MCFG_PALETTE_ADD("palette", 4)
189189   MCFG_PALETTE_INIT_OWNER(subs_state, subs)
190   
190
191191   MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
192192
193193   MCFG_SCREEN_ADD("lscreen", RASTER)
trunk/src/mame/drivers/cobra.c
r29404r29405
624624   required_device<ata_interface_device> m_ata;
625625   required_device<screen_device> m_screen;
626626   required_device<palette_device> m_palette;
627   
627
628628   DECLARE_READ64_MEMBER(main_comram_r);
629629   DECLARE_WRITE64_MEMBER(main_comram_w);
630630   DECLARE_READ64_MEMBER(main_fifo_r);
trunk/src/mame/drivers/nycaptor.c
r29404r29405
922922   // pin 1 SOLO  8'       not mapped
923923   // pin 2 SOLO 16'       not mapped
924924   // pin 22 Noise Output  not mapped
925   
925
926926   MCFG_DAC_ADD("dac")
927927   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
928928MACHINE_CONFIG_END
r29404r29405
981981   // pin 1 SOLO  8'       not mapped
982982   // pin 2 SOLO 16'       not mapped
983983   // pin 22 Noise Output  not mapped
984   
984
985985   MCFG_DAC_ADD("dac")
986986   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
987987MACHINE_CONFIG_END
trunk/src/mame/drivers/mitchell.c
r29404r29405
10921092   MCFG_SCREEN_PALETTE("palette")
10931093
10941094   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mgakuen)
1095   
1095
10961096   MCFG_PALETTE_ADD("palette", 1024)   /* less colors than the others */
10971097   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
10981098
trunk/src/mame/drivers/crystal.c
r29404r29405
10761076{
10771077   // patches based on analysis of PIC dump
10781078   UINT16 *Rom = (UINT16*) memregion("user1")->base();
1079   /*
1080      PIC Protection data:
1081      - RAM ADDR - --PATCH--
1082      62 0f 02 02 fc 90 01 90
1083      68 6a 02 02 04 90 01 90
1084      2c cf 03 02 e9 df c2 c3
1085      00 e0 03 02 01 90 00 92
1079   /*
1080       PIC Protection data:
1081       - RAM ADDR - --PATCH--
1082       62 0f 02 02 fc 90 01 90
1083       68 6a 02 02 04 90 01 90
1084       2c cf 03 02 e9 df c2 c3
1085       00 e0 03 02 01 90 00 92
10861086   */
10871087
1088   Rom[WORD_XOR_LE(0x12d7a/2)]=0x90FC;   //PUSH R7-R6-R5-R4-R3-R2
1089   Rom[WORD_XOR_LE(0x12d7c/2)]=0x9001;   //PUSH R0
1088   Rom[WORD_XOR_LE(0x12d7a/2)]=0x90FC; //PUSH R7-R6-R5-R4-R3-R2
1089   Rom[WORD_XOR_LE(0x12d7c/2)]=0x9001; //PUSH R0
10901090
1091   Rom[WORD_XOR_LE(0x18880/2)]=0x9004;   //PUSH R2
1092   Rom[WORD_XOR_LE(0x18882/2)]=0x9001;   //PUSH R0
1091   Rom[WORD_XOR_LE(0x18880/2)]=0x9004; //PUSH R2
1092   Rom[WORD_XOR_LE(0x18882/2)]=0x9001; //PUSH R0
10931093
1094   Rom[WORD_XOR_LE(0x2fe18/2)]=0x9001;   //PUSH R0
1095   Rom[WORD_XOR_LE(0x2fe1a/2)]=0x9200;   //PUSH SR
1094   Rom[WORD_XOR_LE(0x2fe18/2)]=0x9001; //PUSH R0
1095   Rom[WORD_XOR_LE(0x2fe1a/2)]=0x9200; //PUSH SR
10961096
1097   Rom[WORD_XOR_LE(0x2ED44/2)]=0xDFE9;   //CALL 0x3cf00
1098   Rom[WORD_XOR_LE(0x2ED46/2)]=0xC3C2;   //MOV %SR0,%DR1
1097   Rom[WORD_XOR_LE(0x2ED44/2)]=0xDFE9; //CALL 0x3cf00
1098   Rom[WORD_XOR_LE(0x2ED46/2)]=0xC3C2; //MOV %SR0,%DR1
10991099
11001100}
11011101
r29404r29405
11051105   UINT16 *Rom = (UINT16*) memregion("user1")->base();
11061106
11071107   /*
1108      PIC Protection data:
1109      - RAM ADDR - --PATCH--
1110      0a 83 01 02 1c 90 01 90
1111      50 85 01 02 7c 90 01 90
1112      4c 99 05 02 04 90 01 90
1113      3a c1 01 02 1c 90 01 90
1108       PIC Protection data:
1109       - RAM ADDR - --PATCH--
1110       0a 83 01 02 1c 90 01 90
1111       50 85 01 02 7c 90 01 90
1112       4c 99 05 02 04 90 01 90
1113       3a c1 01 02 1c 90 01 90
11141114   */
11151115
1116   Rom[WORD_XOR_LE(0x9c9e/2)]=0x901C;   //PUSH R4-R3-R2
1117   Rom[WORD_XOR_LE(0x9ca0/2)]=0x9001;   //PUSH R0
1116   Rom[WORD_XOR_LE(0x9c9e/2)]=0x901C;  //PUSH R4-R3-R2
1117   Rom[WORD_XOR_LE(0x9ca0/2)]=0x9001;  //PUSH R0
11181118
1119   Rom[WORD_XOR_LE(0x9EE4/2)]=0x907C;   //PUSH R6-R5-R4-R3-R2
1120   Rom[WORD_XOR_LE(0x9EE6/2)]=0x9001;   //PUSH R0
1119   Rom[WORD_XOR_LE(0x9EE4/2)]=0x907C;  //PUSH R6-R5-R4-R3-R2
1120   Rom[WORD_XOR_LE(0x9EE6/2)]=0x9001;  //PUSH R0
11211121
1122   Rom[WORD_XOR_LE(0x4B2E0/2)]=0x9004;   //PUSH R2
1123   Rom[WORD_XOR_LE(0x4B2E2/2)]=0x9001;   //PUSH R0
1122   Rom[WORD_XOR_LE(0x4B2E0/2)]=0x9004; //PUSH R2
1123   Rom[WORD_XOR_LE(0x4B2E2/2)]=0x9001; //PUSH R0
11241124
1125   Rom[WORD_XOR_LE(0xDACE/2)]=0x901c;   //PUSH R4-R3-R2
1126   Rom[WORD_XOR_LE(0xDAD0/2)]=0x9001;   //PUSH R0
1125   Rom[WORD_XOR_LE(0xDACE/2)]=0x901c;  //PUSH R4-R3-R2
1126   Rom[WORD_XOR_LE(0xDAD0/2)]=0x9001;  //PUSH R0
11271127}
11281128
11291129DRIVER_INIT_MEMBER(crystal_state, donghaer)
11301130{
11311131   UINT16 *Rom = (UINT16*)memregion("user1")->base();
11321132
1133   Rom[WORD_XOR_LE(0x037A2 / 2)] = 0x9004;   // PUSH   %R2
1134   Rom[WORD_XOR_LE(0x037A4 / 2)] = 0x8202;   // LD   (%SP,0x8),%R2
1133   Rom[WORD_XOR_LE(0x037A2 / 2)] = 0x9004; // PUSH %R2
1134   Rom[WORD_XOR_LE(0x037A4 / 2)] = 0x8202; // LD   (%SP,0x8),%R2
11351135
1136   Rom[WORD_XOR_LE(0x03834 / 2)] = 0x9001;   // PUSH   %R0
1137   Rom[WORD_XOR_LE(0x03836 / 2)] = 0x9200;   // PUSH %SR
1136   Rom[WORD_XOR_LE(0x03834 / 2)] = 0x9001; // PUSH %R0
1137   Rom[WORD_XOR_LE(0x03836 / 2)] = 0x9200; // PUSH %SR
11381138
1139   Rom[WORD_XOR_LE(0x0AC9E / 2)] = 0x9004;   // PUSH   %R2
1140   Rom[WORD_XOR_LE(0x0ACA0 / 2)] = 0x4081;   // LERI   0x81
1139   Rom[WORD_XOR_LE(0x0AC9E / 2)] = 0x9004; // PUSH %R2
1140   Rom[WORD_XOR_LE(0x0ACA0 / 2)] = 0x4081; // LERI 0x81
11411141
1142   Rom[WORD_XOR_LE(0x19C70 / 2)] = 0x900C;   // PUSH   %R2-%R3
1143   Rom[WORD_XOR_LE(0x19C72 / 2)] = 0x9001;   // PUSH %R0
1142   Rom[WORD_XOR_LE(0x19C70 / 2)] = 0x900C; // PUSH %R2-%R3
1143   Rom[WORD_XOR_LE(0x19C72 / 2)] = 0x9001; // PUSH %R0
11441144}
11451145
11461146
trunk/src/mame/drivers/meadwttl.c
r29404r29405
11/***************************************************************************
2
2
33 Meadows Discrete Game List
4 
4
55 Bombs Away (1976)
66 Ckidzo (1976)
77 Cobra Gunship (1976)
88 Drop Zone 4 (1975)
99 Flim Flam (1974)
1010 4 in 1 Meadows (197?)
11
11
1212***************************************************************************/
1313
1414
r29404r29405
4848public:
4949   meadwttl_state(const machine_config &mconfig, device_type type, const char *tag)
5050   : driver_device(mconfig, type, tag),
51     m_maincpu(*this, "maincpu"),
52     m_video(*this, "fixfreq")
51      m_maincpu(*this, "maincpu"),
52      m_video(*this, "fixfreq")
5353   {
5454   }
55   
55
5656   // devices
5757   required_device<netlist_mame_device_t> m_maincpu;
5858   required_device<fixedfreq_device> m_video;
59   
59
6060protected:
61   
61
6262   // driver_device overrides
6363   virtual void machine_start();
6464   virtual void machine_reset();
65   
65
6666   virtual void video_start();
67   
67
6868private:
69   
69
7070};
7171
7272
7373static NETLIST_START(meadows)
7474   SOLVER(Solver, 48000)
75//   PARAM(Solver.FREQ, 48000)
75//  PARAM(Solver.FREQ, 48000)
7676   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
7777
7878   // schematics
7979   //...
8080
81//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
82//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
81//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
82//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8383NETLIST_END()
8484
8585
r29404r29405
109109
110110
111111/***************************************************************************
112
112
113113 Game driver(s)
114
114
115115 ***************************************************************************/
116116
117117
trunk/src/mame/drivers/ramtek.c
r29404r29405
11/***************************************************************************
2
2
33 Ramtek Discrete Games List
4
4
55 Game Name                  DATA      Board #
66 --------------------------------------------
77 (Deluxe) Baseball (1974)   YES
r29404r29405
1414 Trivia (1976)              YES
1515 Volly/Volley (1973)        YES
1616 Wipe Out (1974)            YES
17
17
1818 ***************************************************************************/
1919
2020
r29404r29405
5454public:
5555   ramtek_state(const machine_config &mconfig, device_type type, const char *tag)
5656   : driver_device(mconfig, type, tag),
57     m_maincpu(*this, "maincpu"),
58     m_video(*this, "fixfreq")
57      m_maincpu(*this, "maincpu"),
58      m_video(*this, "fixfreq")
5959   {
6060   }
61   
61
6262   // devices
6363   required_device<netlist_mame_device_t> m_maincpu;
6464   required_device<fixedfreq_device> m_video;
65   
65
6666protected:
67   
67
6868   // driver_device overrides
6969   virtual void machine_start();
7070   virtual void machine_reset();
71   
71
7272   virtual void video_start();
73   
73
7474private:
75   
75
7676};
7777
7878
7979static NETLIST_START(ramtek)
8080   SOLVER(Solver, 48000)
81//   PARAM(Solver.FREQ, 48000)
81//  PARAM(Solver.FREQ, 48000)
8282   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
8383
8484   // schematics
8585   //...
8686
87//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
88//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
87//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
88//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8989NETLIST_END()
9090
9191
r29404r29405
115115
116116
117117/***************************************************************************
118
118
119119 Game driver(s)
120
120
121121 ***************************************************************************/
122122
123123
r29404r29405
138138ROM_END
139139
140140
141// The board number for Clean Sweep is 501082, and the letter to the right would be the revision letter (A, B, C, D).
142// Ramtek had revisions A, B, C, D, noted with a sticker that shows the letter for each specific revision.
141// The board number for Clean Sweep is 501082, and the letter to the right would be the revision letter (A, B, C, D).
142// Ramtek had revisions A, B, C, D, noted with a sticker that shows the letter for each specific revision.
143143// Revisions A,B,C have been dumped and rom content is the same (only diff is the location of some chips on the rev B pcb)
144144ROM_START( cleanswp )
145145   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
146146
147147   ROM_REGION( 0x0020, "roms", ROMREGION_ERASE00 )
148   ROM_LOAD( "501075.c6",     0x0000, 0x0020, CRC(be02b5f5) SHA1(f1c616a73c6c2915ea3d0252543b0806704ab2e9) )   // shape of paddle
149   ROM_LOAD( "501076.d7",     0x0000, 0x0020, CRC(be40b153) SHA1(07fb64ea8caee601e3e3bd6c69beea619dd0489d) )   // ball control memory
150   ROM_LOAD( "501074.k3",     0x0000, 0x0020, CRC(515a34ba) SHA1(471ca9d99851591ff11a87d18b88871edd7fd268) )   // number character generation
148   ROM_LOAD( "501075.c6",     0x0000, 0x0020, CRC(be02b5f5) SHA1(f1c616a73c6c2915ea3d0252543b0806704ab2e9) )   // shape of paddle
149   ROM_LOAD( "501076.d7",     0x0000, 0x0020, CRC(be40b153) SHA1(07fb64ea8caee601e3e3bd6c69beea619dd0489d) )   // ball control memory
150   ROM_LOAD( "501074.k3",     0x0000, 0x0020, CRC(515a34ba) SHA1(471ca9d99851591ff11a87d18b88871edd7fd268) )   // number character generation
151151ROM_END
152152
153153
154ROM_START( ramtek3 )   // maybe Hockey?
154ROM_START( ramtek3 )    // maybe Hockey?
155155   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
156156
157157   ROM_REGION( 0x0020, "roms", ROMREGION_ERASE00 )
trunk/src/mame/drivers/aerofgt.c
r29404r29405
14891489   MCFG_VSYSTEM_SPR2_SET_GFXREGION(2)
14901490   MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
14911491   MCFG_VSYSTEM_SPR2_PALETTE("palette")
1492   
1492
14931493   MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)
14941494   MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback )
14951495   MCFG_VSYSTEM_SPR2_SET_GFXREGION(3)
r29404r29405
15421542   MCFG_VSYSTEM_SPR2_SET_GFXREGION(2)
15431543   MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
15441544   MCFG_VSYSTEM_SPR2_PALETTE("palette")
1545   
1545
15461546   MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)
15471547   MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback ) // rom lookup
15481548   MCFG_VSYSTEM_SPR2_SET_PRITYPE(1)
r29404r29405
15961596   MCFG_VSYSTEM_SPR2_SET_GFXREGION(2)
15971597   MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
15981598   MCFG_VSYSTEM_SPR2_PALETTE("palette")
1599   
1599
16001600   MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)
16011601   MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback )
16021602   MCFG_VSYSTEM_SPR2_SET_GFXREGION(3)
r29404r29405
16501650   MCFG_VSYSTEM_SPR2_SET_GFXREGION(2)
16511651   MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
16521652   MCFG_VSYSTEM_SPR2_PALETTE("palette")
1653   
1654   MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)   
1653
1654   MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)
16551655   MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback )
16561656   MCFG_VSYSTEM_SPR2_SET_GFXREGION(3)
16571657   MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
r29404r29405
18061806   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
18071807   MCFG_SCREEN_SIZE(64*8, 64*8)
18081808   MCFG_SCREEN_VISIBLE_AREA(0*8+14, 44*8-1+4, 0*8, 30*8-1)
1809   MCFG_SCREEN_UPDATE_DRIVER(aerofgt_state, screen_update_wbbc97)   
1809   MCFG_SCREEN_UPDATE_DRIVER(aerofgt_state, screen_update_wbbc97)
18101810
18111811   MCFG_GFXDECODE_ADD("gfxdecode", "palette", wbbc97)
18121812   MCFG_PALETTE_ADD("palette", 2048)
trunk/src/mame/drivers/coinmstr.c
r29404r29405
1818
1919  Technical notes....
2020
21 
21
2222  There are at least 2 different boards.
23 
23
2424  A) Unknown, with 2x 6264 RAM, mapped $C000-$DFFF and $E000-$FFFF.
2525  B) 'PCB-001-POK', with 3x 6116 RAM, mapped $E000-$E7FF, $E800-$EFFF, and $F000-$F7FF.
2626
r29404r29405
4040
4141  AY-3-8912
4242  ---------
43 
43
4444  - IO pins connected to DIP switches bank.
4545  - Data pin connected to CPU data pin.
4646  - BC1 goes to PAL IC12 pin 12
r29404r29405
5050
5151  PIAs
5252  ----
53 
53
5454  PIA0 (IC24) Port A --> Input.
5555  PIA0 (IC24) Port B --> Output.
5656
r29404r29405
5858  PB0 to PB6 go to ULN2003 (IC19) then on PCB connector.
5959  PB7 goes to ULM2003 (IC40) pin 1 then on PCB connector.
6060
61 
61
6262  PIA1 (IC39) Port A --> Output.
6363  PIA1 (IC39) Port B --> Output.
6464
6565  PA0-PA7 go to 22 KOhm resistor, then a "pull up" capacitor, and then into the base of a transistor.
66        Collector connected to +5V, emitter is the output (1 KOhm pulldown), it goes into an ULN2803
67        and then to PCB connector. 3 of that transistors outputs (input of the ULN) are connected
68        together and connected to another circuit that generate 2 more outputs on PCB connector.
69       (them seem unused no solder on the pcb connector)
66          Collector connected to +5V, emitter is the output (1 KOhm pulldown), it goes into an ULN2803
67          and then to PCB connector. 3 of that transistors outputs (input of the ULN) are connected
68          together and connected to another circuit that generate 2 more outputs on PCB connector.
69         (them seem unused no solder on the pcb connector)
7070
7171  PB0 to PB6 goes to ULN2003 (IC34) then on PCB connector.
7272  PB7 goes to ULM2003 (IC40) pin 2 then on PCB connector.
r29404r29405
7878  PB0 to PB6 go to ULN2003 (IC31) then on PCB connector.
7979  PB7 goes to ULM2003 (IC40) pin 3 then on PCB connector.
8080
81 
81
8282====================================================================================
8383
8484  Notes by game....
r29404r29405
9191
9292  DIP switch #1 changes the minimal hand between "Jacks or Better" and
9393  "Pair of Aces".
94
94
9595  There are two bookkeeping modes. I think these are for different levels
9696  like operator and manager/supervisor. With the DIP switch #4 you can
9797  switch between them. Is possible that this input would be meant to be
r29404r29405
114114
115115  Pressing DEAL/START, you can get the winning hands, occurence of
116116  spades, diamonds, clubs and hearts. also number of jokers dealt.
117
117
118118  With DIP switch #8 ON, you can enter a sort of test mode, where you
119119  can set the cards using the HOLD buttons, and test the winning hands.
120120
r29404r29405
335335/* 2x 6462 hardware C000-DFFF & E000-FFFF */
336336static ADDRESS_MAP_START( jpcoin_map, AS_PROGRAM, 8, coinmstr_state )
337337   AM_RANGE(0x0000, 0xbfff) AM_ROM
338   AM_RANGE(0xc000, 0xdfff) AM_RAM      /* 2x 6462 hardware */
338   AM_RANGE(0xc000, 0xdfff) AM_RAM     /* 2x 6462 hardware */
339339   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(quizmstr_bg_w) AM_SHARE("videoram")
340340   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(quizmstr_attr1_w) AM_SHARE("attr_ram1")
341341   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(quizmstr_attr2_w) AM_SHARE("attr_ram2")
r29404r29405
345345/* 3x 6116 hardware E000-E800, E800-EFFF & F000-F7FF */
346346static ADDRESS_MAP_START( jpcoin2_map, AS_PROGRAM, 8, coinmstr_state )
347347   AM_RANGE(0x0000, 0xbfff) AM_ROM
348   AM_RANGE(0xc000, 0xdfff) AM_RAM      /* only for the 2x 6462 hardware */
348   AM_RANGE(0xc000, 0xdfff) AM_RAM     /* only for the 2x 6462 hardware */
349349   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(quizmstr_bg_w) AM_SHARE("videoram")
350350   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(quizmstr_attr1_w) AM_SHARE("attr_ram1")
351351   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(quizmstr_attr2_w) AM_SHARE("attr_ram2")
r29404r29405
486486   AM_RANGE(0xc8, 0xcb) AM_DEVREADWRITE("pia0", pia6821_device, read, write)    /* confirmed */
487487   AM_RANGE(0xd0, 0xd3) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
488488   AM_RANGE(0xd8, 0xdb) AM_DEVREADWRITE("pia2", pia6821_device, read, write)    /* confirmed */
489//   AM_RANGE(0xc0, 0xc1) AM_READ(ff_r)  /* needed to boot */
489//  AM_RANGE(0xc0, 0xc1) AM_READ(ff_r)  /* needed to boot */
490490   AM_RANGE(0xc4, 0xc4) AM_READ(ff_r)  /* needed to boot */
491491ADDRESS_MAP_END
492492
r29404r29405
820820   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
821821INPUT_PORTS_END
822822
823static INPUT_PORTS_START( supnudg2 )   /* need to find the button 'B' to be playable */
823static INPUT_PORTS_START( supnudg2 )    /* need to find the button 'B' to be playable */
824824   PORT_START("PIA0.A")
825   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_NAME("1 Pound (5 credits)")   // coin x 5
826   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_NAME("50 Pence (2.5 credits)")   // coin x 2.5
827   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_NAME("20 Pence (1 credit)")   // coin x 1
828   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_NAME("10 Pence (0.5 credit)")   // coin x 0.5
825   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )  PORT_NAME("1 Pound (5 credits)")    // coin x 5
826   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )  PORT_NAME("50 Pence (2.5 credits)") // coin x 2.5
827   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )  PORT_NAME("20 Pence (1 credit)")    // coin x 1
828   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )  PORT_NAME("10 Pence (0.5 credit)")  // coin x 0.5
829829   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER )  PORT_CODE(KEYCODE_A)  PORT_NAME("PIA0.A_0x10")
830830   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER )  PORT_CODE(KEYCODE_S)  PORT_NAME("PIA0.A_0x20")
831831   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )  PORT_CODE(KEYCODE_D)  PORT_NAME("PIA0.A_0x40")
r29404r29405
992992   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
993993   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
994994   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
995/*   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
996   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
997   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
998   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
999   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1000   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1001   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1002   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
995/*  PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
996    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
997    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
998    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
999    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1000    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1001    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1002    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
10031003*/
10041004   PORT_START("PIA2.B")
10051005   PORT_DIPNAME( 0x01, 0x01, "PIA2.B" )
r29404r29405
15251525   MCFG_CPU_MODIFY("maincpu")
15261526   MCFG_CPU_PROGRAM_MAP(jpcoin_map)
15271527   MCFG_CPU_IO_MAP(jpcoin_io_map)
1528//   MCFG_NVRAM_ADD_0FILL("attr_ram3")
1528//  MCFG_NVRAM_ADD_0FILL("attr_ram3")
15291529MACHINE_CONFIG_END
15301530
15311531static MACHINE_CONFIG_DERIVED( jpcoin2, coinmstr )
15321532   MCFG_CPU_MODIFY("maincpu")
15331533   MCFG_CPU_PROGRAM_MAP(jpcoin2_map)
15341534   MCFG_CPU_IO_MAP(jpcoin2_io_map)
1535//   MCFG_NVRAM_ADD_0FILL("attr_ram3")
1535//  MCFG_NVRAM_ADD_0FILL("attr_ram3")
15361536MACHINE_CONFIG_END
15371537
15381538/*
r29404r29405
16911691
16921692/*
16931693 Looks like the 2x 6264, since checks C000-DFFF
1694
1694
16951695 BP 1D0 (PIAS init)
16961696 BP 1102 (calls)
1697
1697
16981698 Output C0
16991699 Input C1
1700
1700
17011701 Input C8
17021702 Output C9 (masked)
17031703 Output CA
1704
1704
17051705 Input D0
17061706 Output D1
17071707 Output D2
17081708 Input D3
17091709 Output DA
1710
1710
17111711 Output E0  CRTC
17121712 Output E1  CRTC
17131713
r29404r29405
17531753   ROM_LOAD( "jp88-1.ic9", 0x0000, 0x4000, CRC(60d31daf) SHA1(204537887388f1a174d1a09331186182be31e8ee) )
17541754
17551755   ROM_REGION( 0x4000, "gfx1", 0 )
1756   ROM_LOAD( "jp88-3.ic45", 0x0000, 0x2000, CRC(f2f92a7e) SHA1(ce6f6fd5af0049269357527650b51a1016caf636) )
1757   ROM_LOAD( "jp88-2.ic41", 0x2000, 0x2000, CRC(57db61b2) SHA1(a3bc2056866cbb9fdca52e62f2ff4a952d1d7484) )
1756   ROM_LOAD( "jp88-3.ic45", 0x0000, 0x2000, CRC(f2f92a7e) SHA1(ce6f6fd5af0049269357527650b51a1016caf636) )
1757   ROM_LOAD( "jp88-2.ic41", 0x2000, 0x2000, CRC(57db61b2) SHA1(a3bc2056866cbb9fdca52e62f2ff4a952d1d7484) )
17581758ROM_END
17591759
17601760
trunk/src/mame/drivers/docastle.c
r29404r29405
626626
627627   /* video hardware */
628628   MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_9_828MHz / 16, crtc_intf)
629   
629
630630   MCFG_SCREEN_ADD("screen", RASTER)
631631   MCFG_SCREEN_RAW_PARAMS(XTAL_9_828MHz/2, 0x138, 8, 0x100-8, 0x108, 0, 0xc0) // from crtc
632632   MCFG_SCREEN_UPDATE_DRIVER(docastle_state, screen_update_docastle)
trunk/src/mame/drivers/bzone.c
r29404r29405
560560   MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 400)
561561   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
562562
563   MCFG_DEVICE_ADD("avg", AVG_BZONE, 0)   
563   MCFG_DEVICE_ADD("avg", AVG_BZONE, 0)
564564   MCFG_AVGDVG_VECTOR("vector")
565565
566566   /* Drivers */
trunk/src/mame/drivers/cntsteer.c
r29404r29405
7373   required_device<cpu_device> m_subcpu;
7474   required_device<gfxdecode_device> m_gfxdecode;
7575   required_device<palette_device> m_palette;
76   
76
7777   DECLARE_WRITE8_MEMBER(zerotrgt_vregs_w);
7878   DECLARE_WRITE8_MEMBER(cntsteer_vregs_w);
7979   DECLARE_WRITE8_MEMBER(cntsteer_foreground_vram_w);
trunk/src/mame/drivers/dblewing.c
r29404r29405
394394   MCFG_DECO16IC_ADD("tilegen1", dblewing_deco16ic_tilegen1_intf)
395395   MCFG_DECO16IC_GFXDECODE("gfxdecode")
396396   MCFG_DECO16IC_PALETTE("palette")
397   
397
398398   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
399399   decospr_device::set_gfx_region(*device, 2);
400400   decospr_device::set_pri_callback(*device, dblwings_pri_callback);
trunk/src/mame/drivers/hornet.c
r29404r29405
10021002   MCFG_PALETTE_ADD("palette", 65536)
10031003
10041004   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1005   
1005
10061006   MCFG_K037122_ADD("k037122_1", "screen", 0)
10071007   MCFG_K037122_GFXDECODE("gfxdecode")
10081008   MCFG_K037122_PALETTE("palette")
r29404r29405
10771077   MCFG_K037122_ADD("k037122_1", "lscreen", 0)
10781078   MCFG_K037122_GFXDECODE("gfxdecode")
10791079   MCFG_K037122_PALETTE("palette")
1080   
1080
10811081   MCFG_K037122_ADD("k037122_2", "rscreen", 1)
10821082   MCFG_K037122_GFXDECODE("gfxdecode")
10831083   MCFG_K037122_PALETTE("palette")
trunk/src/mame/drivers/ddragon3.c
r29404r29405
802802{
803803   m_paletteram.resize(m_palette->entries());
804804   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
805   
805
806806   save_item(NAME(m_vreg));
807807   save_item(NAME(m_bg_scrollx));
808808   save_item(NAME(m_bg_scrolly));
r29404r29405
879879
880880   MCFG_PALETTE_MODIFY("palette")
881881   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
882   
882
883883   MCFG_SCREEN_MODIFY("screen")
884884   MCFG_SCREEN_UPDATE_DRIVER(ddragon3_state, screen_update_ctribe)
885885
trunk/src/mame/drivers/discoboy.c
r29404r29405
487487static MACHINE_CONFIG_START( discoboy, discoboy_state )
488488
489489   /* basic machine hardware */
490   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)   /* 6 MHz? */
490   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)  /* 6 MHz? */
491491   MCFG_CPU_PROGRAM_MAP(discoboy_map)
492492   MCFG_CPU_IO_MAP(io_map)
493493   MCFG_CPU_VBLANK_INT_DRIVER("screen", discoboy_state,  irq0_line_hold)
494494
495   MCFG_CPU_ADD("audiocpu", Z80, XTAL_10MHz/2)   /* 5 MHz? */
495   MCFG_CPU_ADD("audiocpu", Z80, XTAL_10MHz/2) /* 5 MHz? */
496496   MCFG_CPU_PROGRAM_MAP(sound_map)
497497   MCFG_CPU_PERIODIC_INT_DRIVER(discoboy_state, nmi_line_pulse, 32*60)
498498
r29404r29405
513513   /* sound hardware */
514514   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
515515
516   MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_10MHz/4)   /* 2.5 MHz? */
516   MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_10MHz/4)   /* 2.5 MHz? */
517517   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.6)
518518   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.6)
519519
trunk/src/mame/drivers/gaplus.c
r29404r29405
549549   MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
550550   MCFG_NAMCO56XX_OUT_0_CB(WRITE8(gaplus_state, out_lamps0))
551551   MCFG_NAMCO56XX_OUT_1_CB(WRITE8(gaplus_state, out_lamps1))
552   
552
553553   MCFG_DEVICE_ADD("namcoio_2", NAMCO58XX, 0)
554554   MCFG_NAMCO58XX_IN_0_CB(IOPORT("DSWA_HIGH"))
555555   MCFG_NAMCO58XX_IN_1_CB(IOPORT("DSWB_LOW"))
556556   MCFG_NAMCO58XX_IN_2_CB(IOPORT("DSWB_HIGH"))
557557   MCFG_NAMCO58XX_IN_3_CB(IOPORT("DSWA_LOW"))
558   
558
559559   MCFG_NAMCO_62XX_ADD("62xx", 24576000/6/2)  /* totally made up - TODO: fix */
560560   //MCFG_NAMCO_62XX_INPUT_0_CB(IOPORT("IN0L"))
561561   //MCFG_NAMCO_62XX_INPUT_1_CB(IOPORT("IN0H"))
r29404r29405
563563   //MCFG_NAMCO_62XX_INPUT_3_CB(IOPORT("IN1H"))
564564   //MCFG_NAMCO_62XX_OUTPUT_0_CB(WRITE8(gaplus_state,out_0))
565565   //MCFG_NAMCO_62XX_OUTPUT_1_CB(WRITE8(gaplus_state,out_1))
566   
566
567567   /* video hardware */
568568   MCFG_SCREEN_ADD("screen", RASTER)
569569   MCFG_SCREEN_REFRESH_RATE(60.606060)
r29404r29405
597597   MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
598598   MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
599599   MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
600   
600
601601   MCFG_DEVICE_REPLACE("namcoio_2", NAMCO56XX, 0)
602602   MCFG_NAMCO56XX_IN_0_CB(IOPORT("DSWA_HIGH"))
603603   MCFG_NAMCO56XX_IN_1_CB(IOPORT("DSWB_LOW"))
r29404r29405
616616   MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1"))
617617   MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
618618   MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
619   
619
620620   MCFG_DEVICE_REPLACE("namcoio_2", NAMCO58XX, 0)
621621   MCFG_NAMCO58XX_IN_0_CB(IOPORT("DSWA_HIGH"))
622622   MCFG_NAMCO58XX_IN_1_CB(IOPORT("DSWB_LOW"))
trunk/src/mame/drivers/5clown.c
r29404r29405
462462      m_audiocpu(*this, "audiocpu"),
463463      m_ay8910(*this, "ay8910"),
464464      m_gfxdecode(*this, "gfxdecode"),
465      m_palette(*this, "palette")
465      m_palette(*this, "palette")
466466   {
467467   }
468468
trunk/src/mame/drivers/exedexes.c
r29404r29405
236236   MCFG_SCREEN_PALETTE("palette")
237237
238238   MCFG_GFXDECODE_ADD("gfxdecode", "palette", exedexes)
239   
239
240240   MCFG_PALETTE_ADD("palette", 64*4+64*4+16*16+16*16)
241241   MCFG_PALETTE_INDIRECT_ENTRIES(256)
242242   MCFG_PALETTE_INIT_OWNER(exedexes_state, exedexes)
trunk/src/mame/drivers/witch.c
r29404r29405
221221#define MAIN_CLOCK        XTAL_12MHz
222222#define CPU_CLOCK         MAIN_CLOCK / 4
223223#define YM2203_CLOCK      MAIN_CLOCK / 4
224#define ES8712_CLOCK      8000            // 8Khz, it's the only clock for sure (pin13) it come from pin14 of M5205.
224#define ES8712_CLOCK      8000              // 8Khz, it's the only clock for sure (pin13) it come from pin14 of M5205.
225225
226226
227227#include "emu.h"
r29404r29405
249249   tilemap_t *m_gfx0a_tilemap;
250250   tilemap_t *m_gfx0b_tilemap;
251251   tilemap_t *m_gfx1_tilemap;
252   
252
253253   required_device<cpu_device> m_maincpu;
254254   required_device<cpu_device> m_subcpu;
255255   required_device<gfxdecode_device> m_gfxdecode;
256   
256
257257   required_shared_ptr<UINT8> m_gfx0_vram;
258258   required_shared_ptr<UINT8> m_gfx0_cram;
259259   required_shared_ptr<UINT8> m_gfx1_vram;
260260   required_shared_ptr<UINT8> m_gfx1_cram;
261261   required_shared_ptr<UINT8> m_sprite_ram;
262262   required_device<palette_device> m_palette;
263   
263
264264   int m_scrollx;
265265   int m_scrolly;
266266   UINT8 m_reg_a002;
r29404r29405
305305   }
306306
307307   SET_TILE_INFO_MEMBER(1,
308         code,   //tiles beyond 0x7ff only for sprites?
308         code,   //tiles beyond 0x7ff only for sprites?
309309         color & 0x0f,
310310         0);
311311}
r29404r29405
833833   MCFG_CPU_ADD("sub", Z80, CPU_CLOCK)    /* 3 MHz */
834834   MCFG_CPU_PROGRAM_MAP(map_sub)
835835   MCFG_CPU_VBLANK_INT_DRIVER("screen", witch_state,  irq0_line_assert)
836   
836
837837   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
838838
839839   MCFG_NVRAM_ADD_0FILL("nvram")
r29404r29405
854854   /* sound hardware */
855855   MCFG_SPEAKER_STANDARD_MONO("mono")
856856
857   MCFG_ES8712_ADD("essnd", ES8712_CLOCK)          /* 8Khz, it's the only clock for sure (pin13) it comes from pin14 of M5205 */
857   MCFG_ES8712_ADD("essnd", ES8712_CLOCK)          /* 8Khz, it's the only clock for sure (pin13) it comes from pin14 of M5205 */
858858   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
859859
860   MCFG_SOUND_ADD("ym1", YM2203, YM2203_CLOCK)      /* 3 MHz */
860   MCFG_SOUND_ADD("ym1", YM2203, YM2203_CLOCK)     /* 3 MHz */
861861   MCFG_YM2203_AY8910_INTF(&ay8910_config_1)
862862   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
863863
864   MCFG_SOUND_ADD("ym2", YM2203, YM2203_CLOCK)      /* 3 MHz */
864   MCFG_SOUND_ADD("ym2", YM2203, YM2203_CLOCK)     /* 3 MHz */
865865   MCFG_YM2203_AY8910_INTF(&ay8910_config_2)
866866   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
867867
trunk/src/mame/drivers/multfish_boot.c
r29404r29405
1111  Sets below are bootleg / hacked sets, descriptions of what has been modified are provided where known
1212 -- use of these sets may present a risk to the operator, you should always ensure you're using original Igrosoft program roms on your PCB!
1313
14 --------------------------------
14 --------------------------------
1515
1616  The sets which differs from the originals by 5-6 bytes are bootlegs that simply change
1717     the banking address. Usually to convert a Crazy Monkey PCB which use the address "F9".
trunk/src/mame/drivers/volfied.c
r29404r29405
274274   MCFG_PC090OJ_ADD("pc090oj", volfied_pc090oj_intf)
275275   MCFG_PC090OJ_GFXDECODE("gfxdecode")
276276   MCFG_PC090OJ_PALETTE("palette")
277   
277
278278   /* sound hardware */
279279   MCFG_SPEAKER_STANDARD_MONO("mono")
280280
trunk/src/mame/drivers/deco32.c
r29404r29405
17591759   MCFG_DECO16IC_ADD("tilegen1", captaven_deco16ic_tilegen1_intf)
17601760   MCFG_DECO16IC_GFXDECODE("gfxdecode")
17611761   MCFG_DECO16IC_PALETTE("palette")
1762   
1762
17631763   MCFG_DECO16IC_ADD("tilegen2", captaven_deco16ic_tilegen2_intf)
17641764   MCFG_DECO16IC_GFXDECODE("gfxdecode")
17651765   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
18341834   MCFG_DECO16IC_ADD("tilegen1", fghthist_deco16ic_tilegen1_intf)
18351835   MCFG_DECO16IC_GFXDECODE("gfxdecode")
18361836   MCFG_DECO16IC_PALETTE("palette")
1837   
1837
18381838   MCFG_DECO16IC_ADD("tilegen2", fghthist_deco16ic_tilegen2_intf)
18391839   MCFG_DECO16IC_GFXDECODE("gfxdecode")
18401840   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
18961896   MCFG_DECO16IC_ADD("tilegen1", fghthist_deco16ic_tilegen1_intf)
18971897   MCFG_DECO16IC_GFXDECODE("gfxdecode")
18981898   MCFG_DECO16IC_PALETTE("palette")
1899   
1899
19001900   MCFG_DECO16IC_ADD("tilegen2", fghthist_deco16ic_tilegen2_intf)
19011901   MCFG_DECO16IC_GFXDECODE("gfxdecode")
19021902   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
20212021   MCFG_DECO16IC_ADD("tilegen1", dragngun_deco16ic_tilegen1_intf)
20222022   MCFG_DECO16IC_GFXDECODE("gfxdecode")
20232023   MCFG_DECO16IC_PALETTE("palette")
2024   
2024
20252025   MCFG_DECO16IC_ADD("tilegen2", dragngun_deco16ic_tilegen2_intf)
20262026   MCFG_DECO16IC_GFXDECODE("gfxdecode")
20272027   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
21082108   MCFG_DECO16IC_ADD("tilegen1", lockload_deco16ic_tilegen1_intf)
21092109   MCFG_DECO16IC_GFXDECODE("gfxdecode")
21102110   MCFG_DECO16IC_PALETTE("palette")
2111   
2111
21122112   MCFG_DECO16IC_ADD("tilegen2", lockload_deco16ic_tilegen2_intf)
21132113   MCFG_DECO16IC_GFXDECODE("gfxdecode")
21142114   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
21972197   MCFG_DECO16IC_ADD("tilegen1", tattass_deco16ic_tilegen1_intf)
21982198   MCFG_DECO16IC_GFXDECODE("gfxdecode")
21992199   MCFG_DECO16IC_PALETTE("palette")
2200   
2200
22012201   MCFG_DECO16IC_ADD("tilegen2", tattass_deco16ic_tilegen2_intf)
22022202   MCFG_DECO16IC_GFXDECODE("gfxdecode")
22032203   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
22452245   MCFG_SCREEN_REFRESH_RATE(60)
22462246   MCFG_SCREEN_SIZE(42*8, 32*8)
22472247   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
2248   MCFG_SCREEN_UPDATE_DRIVER(deco32_state, screen_update_nslasher)   
2248   MCFG_SCREEN_UPDATE_DRIVER(deco32_state, screen_update_nslasher)
22492249
22502250   MCFG_DECO16IC_ADD("tilegen1", tattass_deco16ic_tilegen1_intf)
22512251   MCFG_DECO16IC_GFXDECODE("gfxdecode")
22522252   MCFG_DECO16IC_PALETTE("palette")
2253   
2253
22542254   MCFG_DECO16IC_ADD("tilegen2", tattass_deco16ic_tilegen2_intf)
22552255   MCFG_DECO16IC_GFXDECODE("gfxdecode")
22562256   MCFG_DECO16IC_PALETTE("palette")
trunk/src/mame/drivers/zaxxon.c
r29404r29405
10111011   MCFG_PALETTE_MODIFY("palette")
10121012   MCFG_PALETTE_ENTRIES(512)
10131013   MCFG_PALETTE_INIT_OWNER(zaxxon_state, zaxxon)
1014   
1014
10151015   MCFG_VIDEO_START_OVERRIDE(zaxxon_state,congo)
10161016   MCFG_SCREEN_MODIFY("screen")
10171017   MCFG_SCREEN_UPDATE_DRIVER(zaxxon_state, screen_update_congo)
trunk/src/mame/drivers/fungames.c
r29404r29405
11/***************************************************************************
2
2
33 Fun Games discrete hardware games
4
4
55 Biplane (1975)
66 Biplane 4 (1976)
77 King
r29404r29405
99 Take 5 (1975)
1010 Take 7 (1975)
1111 Tankers (1975)
12
12
1313***************************************************************************/
1414
1515
r29404r29405
4949public:
5050   fungames_state(const machine_config &mconfig, device_type type, const char *tag)
5151   : driver_device(mconfig, type, tag),
52     m_maincpu(*this, "maincpu"),
53     m_video(*this, "fixfreq")
52      m_maincpu(*this, "maincpu"),
53      m_video(*this, "fixfreq")
5454   {
5555   }
56   
56
5757   // devices
5858   required_device<netlist_mame_device_t> m_maincpu;
5959   required_device<fixedfreq_device> m_video;
60   
60
6161protected:
62   
62
6363   // driver_device overrides
6464   virtual void machine_start();
6565   virtual void machine_reset();
66   
66
6767   virtual void video_start();
68   
68
6969private:
70   
70
7171};
7272
7373
7474static NETLIST_START(fungames)
7575   SOLVER(Solver, 48000)
76//   PARAM(Solver.FREQ, 48000)
76//  PARAM(Solver.FREQ, 48000)
7777   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
7878
7979   // schematics
8080   //...
8181
82//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
83//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
82//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
83//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8484NETLIST_END()
8585
8686
r29404r29405
110110
111111
112112/***************************************************************************
113
113
114114 Game driver(s)
115
115
116116 ***************************************************************************/
117117
118118
trunk/src/mame/drivers/enigma2.c
r29404r29405
8282   /* devices */
8383   required_device<cpu_device> m_maincpu;
8484   required_device<cpu_device> m_audiocpu;
85   required_device<screen_device> m_screen;   
85   required_device<screen_device> m_screen;
8686   DECLARE_READ8_MEMBER(dip_switch_r);
8787   DECLARE_WRITE8_MEMBER(sound_data_w);
8888   DECLARE_WRITE8_MEMBER(enigma2_flip_screen_w);
trunk/src/mame/drivers/mil4000.c
r29404r29405
314314{
315315/*  Damn thing!
316316    708010-708011 communicate with the MCU.
317   The returned value is critical to the reels.
318   
319   Writes to MCU:
320   
321   0x11 --> seems quiet or null.
322   0x1A --> command for reels state/gfx. Two bytes (command + parameter).
317    The returned value is critical to the reels.
318
319    Writes to MCU:
320
321    0x11 --> seems quiet or null.
322    0x1A --> command for reels state/gfx. Two bytes (command + parameter).
323323             The second value will be the parameter to feed.
324324             The MCU will respond with one value (see table below).
325325
326   bits:
327   7654-3210
328   ---- ----  = cherries.
329   ---- ---x  = single bar.
326    bits:
327    7654-3210
328    ---- ----  = cherries.
329    ---- ---x  = single bar.
330330    ---- --x-  = double bars.
331331    ---- --xx  = triple bars.
332   ---- -x--  = unknown (combinations produce reset).
333   ---- x---  = sevens.
334   ---- x--x  = double plums.
335   ---- x-x-  = plums.
336   ---- x-xx  = bells.
337   ---x ----  = blanks.
338   -xx- ----  = some kind of gfx retrace.
339   x--- ----  = reset the game
332    ---- -x--  = unknown (combinations produce reset).
333    ---- x---  = sevens.
334    ---- x--x  = double plums.
335    ---- x-x-  = plums.
336    ---- x-xx  = bells.
337    ---x ----  = blanks.
338    -xx- ----  = some kind of gfx retrace.
339    x--- ----  = reset the game
340340
341341   There are other commands, like:
342342   0x1B (+4 parameters)
r29404r29405
344344   0x1D (+2 parameters)
345345   0x1E (+1 parameter)
346346
347   You can find a 1E-18 at start.   
348   
347   You can find a 1E-18 at start.
348
349349*/
350   switch( mcucomm )   /* MCU command */
350   switch( mcucomm )   /* MCU command */
351351   {
352      case 0x11:   /* Idle - Null */
352      case 0x11:  /* Idle - Null */
353353      {
354354         logerror("Writes idle command 0x11 to MCU");
355         return (machine().rand() & 0x0b);   // otherwise got corrupt gfx...
355         return (machine().rand() & 0x0b);   // otherwise got corrupt gfx...
356356      }
357357
358      case 0x1a:   /* Reels state - Control */
358      case 0x1a:  /* Reels state - Control */
359359      {
360360         logerror("MCU feedback to command 0x1a with data: %02x\n", mcudata);
361361         return (machine().rand() & 0x0b);
362362      }
363363
364      case 0x1b:   /* Unknown */
364      case 0x1b:  /* Unknown */
365365      {
366366         logerror("MCU feedback to command 0x1b with data: %02x\n", mcudata);
367367         return 0x00;
368368      }
369369
370      case 0x1c:   /* Unknown. Always 00's? */
370      case 0x1c:  /* Unknown. Always 00's? */
371371      {
372372         logerror("MCU feedback to command 0x1c with data: %02x\n", mcudata);
373373         return 0x00;
374374      }
375375
376      case 0x1d:   /* Unknown */
376      case 0x1d:  /* Unknown */
377377      {
378378         logerror("MCU feedback to command 0x1d with data: %02x\n", mcudata);
379379         return 0x00;
380380      }
381381
382      case 0x1e:   /* Unknown, only one at boot (1e 18) */
382      case 0x1e:  /* Unknown, only one at boot (1e 18) */
383383      {
384384         logerror("MCU feedback to command 0x1e with data: %02x\n", mcudata);
385385         return 0x00;
r29404r29405
387387   }
388388
389389   logerror("MCU feedback to unknown command: %02x\n", mcucomm);
390   return (machine().rand() & 0x0b);   // otherwise got corrupt gfx...
390   return (machine().rand() & 0x0b);   // otherwise got corrupt gfx...
391391}
392392
393393WRITE16_MEMBER(mil4000_state::chewheel_mcu_w)
r29404r29405
407407
408408READ16_MEMBER(mil4000_state::unk_r)
409409{
410//   reads:  51000C-0E. touch screen?
410//  reads:  51000C-0E. touch screen?
411411   return 0xff;
412412}
413413
414414WRITE16_MEMBER(mil4000_state::unk_w)
415415{
416//   writes: 510000-02-04-06-08-0A-0C-0E
417//   logerror("unknown writes from address %04x\n", offset);
416//  writes: 510000-02-04-06-08-0A-0C-0E
417//  logerror("unknown writes from address %04x\n", offset);
418418}
419419
420420
r29404r29405
444444   AM_RANGE(0x508000, 0x50bfff) AM_RAM_WRITE(sc2_vram_w) AM_SHARE("sc2_vram")  // V62C518256L-35P (U8).
445445   AM_RANGE(0x50c000, 0x50ffff) AM_RAM_WRITE(sc3_vram_w) AM_SHARE("sc3_vram")  // V62C518256L-35P (U8).
446446
447   AM_RANGE(0x51000c, 0x51000f) AM_READ(unk_r)      // no idea what's mapped here.
448   AM_RANGE(0x510000, 0x51000f) AM_WRITE(unk_w)   // no idea what's mapped here.
447   AM_RANGE(0x51000c, 0x51000f) AM_READ(unk_r)     // no idea what's mapped here.
448   AM_RANGE(0x510000, 0x51000f) AM_WRITE(unk_w)    // no idea what's mapped here.
449449
450450   AM_RANGE(0x708000, 0x708001) AM_READ_PORT("IN0")
451451   AM_RANGE(0x708002, 0x708003) AM_READ_PORT("IN1")
r29404r29405
456456   AM_RANGE(0x70801e, 0x70801f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
457457
458458   AM_RANGE(0x780000, 0x780fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
459   AM_RANGE(0xff0000, 0xff3fff) AM_RAM AM_SHARE("nvram")   // V62C51864L-70P (U77).
460   AM_RANGE(0xffc000, 0xffffff) AM_RAM                  // V62C51864L-70P (U78).
459   AM_RANGE(0xff0000, 0xff3fff) AM_RAM AM_SHARE("nvram")   // V62C51864L-70P (U77).
460   AM_RANGE(0xffc000, 0xffffff) AM_RAM                     // V62C51864L-70P (U78).
461461
462462ADDRESS_MAP_END
463463
r29404r29405
702702Similar hardware to TOP XXI
703703
704704But...
7052x V62C518256L-35P.  32K x 8 Static RAM. (U7-U8)
7052x V62C518256L-35P.  32K x 8 Static RAM. (U7-U8)
7067062x V62C51864L-70P.    8K x 8 Static RAM. (U77-U78)
707707
708708Only U77 is tied to the battery.
trunk/src/mame/drivers/gticlub.c
r29404r29405
260260   required_device<adsp21062_device> m_dsp;
261261   optional_device<cpu_device> m_dsp2;
262262   required_device<k056800_device> m_k056800;
263   required_device<adc1038_device> m_adc1038;   
263   required_device<adc1038_device> m_adc1038;
264264   required_device<eeprom_serial_93cxx_device> m_eeprom;
265265   required_device<palette_device> m_palette;
266266
r29404r29405
11081108   MCFG_SCREEN_UPDATE_DRIVER(gticlub_state, screen_update_hangplt)
11091109
11101110   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1111   
1111
11121112   MCFG_K001604_ADD("k001604_1", hangplt_k001604_intf_l)
11131113   MCFG_K001604_GFXDECODE("gfxdecode")
11141114   MCFG_K001604_PALETTE("palette")
1115   
1115
11161116   MCFG_K001604_ADD("k001604_2", hangplt_k001604_intf_r)
11171117   MCFG_K001604_GFXDECODE("gfxdecode")
11181118   MCFG_K001604_PALETTE("palette")
trunk/src/mame/drivers/dkong.c
r29404r29405
752752}
753753
754754WRITE8_MEMBER(dkong_state::dkong_z80dma_rdy_w)
755{   
755{
756756   m_z80dma->rdy_w(data & 0x01);
757757}
758758
r29404r29405
17311731   MCFG_SCREEN_UPDATE_DRIVER(dkong_state, screen_update_dkong)
17321732   MCFG_SCREEN_PALETTE("palette")
17331733
1734   MCFG_GFXDECODE_ADD("gfxdecode", "palette", dkong)   
1734   MCFG_GFXDECODE_ADD("gfxdecode", "palette", dkong)
17351735   MCFG_PALETTE_ADD("palette", DK3_PALETTE_LENGTH)
17361736
17371737   MCFG_PALETTE_INIT_OWNER(dkong_state,dkong3)
r29404r29405
17631763
17641764static MACHINE_CONFIG_DERIVED( dkong3b, dkongjr )
17651765
1766   /* basic machine hardware */   
1766   /* basic machine hardware */
17671767   MCFG_PALETTE_MODIFY("palette")
17681768   MCFG_PALETTE_INIT_OWNER(dkong_state,dkong3)
17691769MACHINE_CONFIG_END
trunk/src/mame/drivers/ddenlovr.c
r29404r29405
97859785
97869786   /* devices */
97879787//  MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz)
9788//   MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(ddenlovr_state, hanakanz_rtc_irq))
9788//  MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(ddenlovr_state, hanakanz_rtc_irq))
97899789MACHINE_CONFIG_END
97909790
97919791static MACHINE_CONFIG_DERIVED( kotbinsp, kotbinyo )
trunk/src/mame/drivers/kaneko16.c
r29404r29405
16661666
16671667   /* video hardware */
16681668   MCFG_SCREEN_ADD("screen", RASTER)
1669//   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)    // mangled sprites otherwise
1669//  MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)    // mangled sprites otherwise
16701670   MCFG_SCREEN_REFRESH_RATE(60)
16711671   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
16721672   MCFG_SCREEN_SIZE(256, 256)
16731673   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 240-1)
16741674   MCFG_SCREEN_UPDATE_DRIVER(kaneko16_berlwall_state, screen_update_berlwall)
1675//   MCFG_SCREEN_PALETTE("palette")
1675//  MCFG_SCREEN_PALETTE("palette")
16761676
16771677   MCFG_GFXDECODE_ADD("gfxdecode", "palette", 1x4bit_1x4bit)
1678   MCFG_PALETTE_ADD("palette", 2048 )   
1678   MCFG_PALETTE_ADD("palette", 2048 )
16791679   MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
16801680
16811681   MCFG_PALETTE_ADD("bgpalette", 32768) /* 32768 static colors for the bg */
r29404r29405
16881688   MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
16891689
16901690   MCFG_DEVICE_ADD_VU002_SPRITES
1691//   kaneko16_sprite_device::set_altspacing(*device, 1);
1691//  kaneko16_sprite_device::set_altspacing(*device, 1);
16921692   MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
16931693
16941694   MCFG_VIDEO_START_OVERRIDE(kaneko16_berlwall_state,berlwall)
r29404r29405
17411741   kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
17421742   kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240);
17431743   MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
1744   
1744
17451745   MCFG_DEVICE_ADD("view2_1", KANEKO_TMAP, 0)
17461746   kaneko_view2_tilemap_device::set_gfx_region(*device, 2);
17471747   kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240);
r29404r29405
18091809   MCFG_GFXDECODE_ADD("gfxdecode", "palette", 1x4bit_1x4bit)
18101810   MCFG_PALETTE_ADD("palette", 2048)
18111811   MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
1812   
1812
18131813   MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
18141814   kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
18151815   kaneko_view2_tilemap_device::set_offset(*device, 0x33, 0x8, 320, 240);
trunk/src/mame/drivers/mpu4.c
r29404r29405
3434ROM_END
3535
3636ROM_START( m4rltst )
37   ROM_REGION( 0x10000, "maincpu", 0 )
37   ROM_REGION( 0x10000, "maincpu", 0 )
3838   ROM_LOAD( "rtv.p1", 0x08000, 0x08000, CRC(7b78f3f2) SHA1(07ef8e6a08fd70ee48e4463672a1230ecc669532) )
3939ROM_END
4040
r29404r29405
27292729
27302730
27312731
2732GAME(198?, m4funh      , 0         , mod4oki    ,mpu4           , mpu4_state, m4default         , 0,       "<unknown>",      "Fun House (unknown) (MPU4)", GAME_FLAGS ) // TUNE ALARM  (was in the SC1 Fun House set)
2732GAME(198?, m4funh      , 0         , mod4oki    ,mpu4           , mpu4_state, m4default         , 0,       "<unknown>",      "Fun House (unknown) (MPU4)", GAME_FLAGS ) // TUNE ALARM  (was in the SC1 Fun House set)
27332733
27342734
27352735GAME(199?, m4sunseta    ,m4sunset   ,mod4oki    ,mpu4               , mpu4_state,m4default          ,ROT0,   "Barcrest","Sunset Boulevard (Barcrest) (MPU4) (B25 1.2, set 1)",GAME_FLAGS )
trunk/src/mame/drivers/skylncr.c
r29404r29405
2929****************************************************************************************************
3030
3131  Settings:
32 
32
3333  Pressing F2, you can enter the DIP switches settings.
3434  Here the translated items:
3535
r29404r29405
4747  |                                       |
4848  '---------------------------------------'
4949
50  'Special Bonus' and 'Super Star' appearance, are per 1000.
50  'Special Bonus' and 'Super Star' appearance, are per 1000.
5151  You also can find the MAME DIP switches menu already translated.
5252  The <unknown> items still need translation.
5353
5454  Press START (key 1) to exit the mode.
5555
56 
56
5757  Bookkeeping:
5858
5959  Pressing BOOKKEEPING (key 0), you enter the Record Mode.
r29404r29405
199199{
200200   UINT8 bank = 1;
201201   UINT16 code = m_reeltiles_1_ram[ tile_index ] + (m_reeltileshigh_1_ram[ tile_index ] << 8);
202//   if (code > 0x200)
203//      bank = 2;   
202//  if (code > 0x200)
203//      bank = 2;
204204   SET_TILE_INFO_MEMBER(bank, code, 0, TILE_FLIPYX( 0 ));
205205}
206206
r29404r29405
516516   8*8*4
517517};
518518
519static const gfx_layout layout8x8x8_alt =   /* for sstar97 */
519static const gfx_layout layout8x8x8_alt =   /* for sstar97 */
520520{
521521   8,8,
522522   RGN_FRAC(1,2),
r29404r29405
572572   8*32*8/2
573573};
574574
575static const gfx_layout layout8x32x8_alt =   /* for sstar97 */
575static const gfx_layout layout8x32x8_alt =  /* for sstar97 */
576576{
577577   8,32,
578578   RGN_FRAC(1,2),
r29404r29405
11461146ROM_START( sstar97 )
11471147   ROM_REGION( 0x80000, "maincpu", 0 )
11481148   ROM_LOAD( "27256.u15",    0x0000, 0x8000, CRC(a5da4f92) SHA1(82ac70bd379649f130db017aa226d0247db0f3cd) )
1149   ROM_LOAD( "unknown.u48",  0x8000, 0x8000, BAD_DUMP CRC(9f4c02e3) SHA1(05975184130ea7dd3bb5d32eff77b585bd53e6b5) )   // palette borrowed from other game
1149   ROM_LOAD( "unknown.u48",  0x8000, 0x8000, BAD_DUMP CRC(9f4c02e3) SHA1(05975184130ea7dd3bb5d32eff77b585bd53e6b5) )   // palette borrowed from other game
11501150
1151   ROM_REGION( 0x40000, "gfx1", 0 )   // All ROMs are 28-pins mask ROMs dumped as 27512. Should be dumped as Fujitsu MB831000 or TC531000 (mask ROM).
1151   ROM_REGION( 0x40000, "gfx1", 0 )    // All ROMs are 28-pins mask ROMs dumped as 27512. Should be dumped as Fujitsu MB831000 or TC531000 (mask ROM).
11521152   ROM_LOAD16_BYTE( "bor_dun_4.u23", 0x00000, 0x10000, BAD_DUMP CRC(82c9db19) SHA1(3611fb59bb7c962c7fabe7a29fa72b632fa69bed) )
11531153   ROM_LOAD16_BYTE( "bor_dun_2.u25", 0x00001, 0x10000, BAD_DUMP CRC(42ee9b7a) SHA1(b39f677f58072ea7dcd7f49208be1a7b70bdc5e5) )
11541154   ROM_LOAD16_BYTE( "bor_dun_3.u24", 0x20000, 0x10000, BAD_DUMP CRC(6d70879b) SHA1(83cbe67cda95e5f3d95065015f6b1b2044b88989) )
11551155   ROM_LOAD16_BYTE( "bor_dun_1.u26", 0x20001, 0x10000, BAD_DUMP CRC(1b8b84ac) SHA1(b914bad0b1fb58cf581d1227e8127c6afb906fb7) )
11561156
1157   ROM_REGION( 0x40000, "gfx2", 0 )   // All ROMs are 28-pins mask ROMs dumped as 27512. Should be dumped as Fujitsu MB831000 or TC531000 (mask ROM).
1157   ROM_REGION( 0x40000, "gfx2", 0 )    // All ROMs are 28-pins mask ROMs dumped as 27512. Should be dumped as Fujitsu MB831000 or TC531000 (mask ROM).
11581158   ROM_LOAD16_BYTE( "bor_dun_8.u19", 0x00000, 0x10000, BAD_DUMP CRC(daf651a7) SHA1(d4e472aa90aa2b52c997b2f2272007b139e3cbc2) )
11591159   ROM_LOAD16_BYTE( "bor_dun_6.u21", 0x00001, 0x10000, BAD_DUMP CRC(1d88bc70) SHA1(49246d96a4ce2b8e9b10e928d7dd13973feac883) )
11601160   ROM_LOAD16_BYTE( "bor_dun_7.u20", 0x20000, 0x10000, BAD_DUMP CRC(7e28ba2f) SHA1(ac8d4e95efce87456f569a71650bd7afcb59095e) )
trunk/src/mame/drivers/4enlinea.c
r29404r29405
188188#define SEC_CLOCK            XTAL_8MHz
189189#define HCGA_CLOCK           XTAL_14_31818MHz
190190
191#define PRG_CPU_CLOCK        MAIN_CLOCK /2      /* 8 MHz. (measured) */
191#define PRG_CPU_CLOCK        MAIN_CLOCK /2      /* 8 MHz. (measured) */
192192#define SND_CPU_CLOCK        SEC_CLOCK /2       /* 4 MHz. (measured) */
193193#define SND_AY_CLOCK         SEC_CLOCK /4       /* 2 MHz. (measured) */
194194#define CRTC_CLOCK           SEC_CLOCK /2       /* 8 MHz. (measured) */
r29404r29405
321321      }
322322   }
323323
324//   astring tempstring;
325//   m_chr_gen_base = memregion(subtag(tempstring, "gfx1"))->base();
326//   m_chr_gen = m_chr_gen_base + m_chr_gen_offset[1];
324//  astring tempstring;
325//  m_chr_gen_base = memregion(subtag(tempstring, "gfx1"))->base();
326//  m_chr_gen = m_chr_gen_base + m_chr_gen_offset[1];
327327}
328328
329329
r29404r29405
346346
347347static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, _4enlinea_state )
348348   AM_RANGE(0x0000, 0x7fff) AM_ROM
349//   AM_RANGE(0x8000, 0xbfff) AM_RAM // CGA VRAM
349//  AM_RANGE(0x8000, 0xbfff) AM_RAM // CGA VRAM
350350   AM_RANGE(0xc000, 0xdfff) AM_RAM
351351
352352   AM_RANGE(0xe000, 0xe001) AM_READ(serial_r)
r29404r29405
355355static ADDRESS_MAP_START( main_portmap, AS_IO, 8, _4enlinea_state )
356356   ADDRESS_MAP_GLOBAL_MASK(0x3ff)
357357
358//   AM_RANGE(0x3d4, 0x3df) CGA regs
358//  AM_RANGE(0x3d4, 0x3df) CGA regs
359359   AM_RANGE(0x3bf, 0x3bf) AM_WRITENOP // CGA mode control, TODO
360360ADDRESS_MAP_END
361361
r29404r29405
455455
456456void _4enlinea_state::machine_start()
457457{
458
459458}
460459
461460void _4enlinea_state::machine_reset()
462461{
463
464462}
465463
466464
r29404r29405
535533   MCFG_CPU_PROGRAM_MAP(main_map)
536534   MCFG_CPU_IO_MAP(main_portmap)
537535   MCFG_CPU_PERIODIC_INT_DRIVER(_4enlinea_state, _4enlinea_irq, 60) //TODO
538//   MCFG_CPU_PERIODIC_INT_DRIVER(_4enlinea_state, irq0_line_hold, 4*35)
536//  MCFG_CPU_PERIODIC_INT_DRIVER(_4enlinea_state, irq0_line_hold, 4*35)
539537
540538   MCFG_CPU_ADD("audiocpu", Z80, SND_CPU_CLOCK)
541539   MCFG_CPU_PROGRAM_MAP(audio_map)
r29404r29405
550548    CRTC_CLOCK is 8MHz, entering for pin 1 of UM487F. This clock is used
551549    only for UM6845R embedded mode. The frequency divisor is unknown.
552550
553   CRTC_CLOCK / 4.0 = 66.961296 Hz.
554   CRTC_CLOCK / 4.5 = 59.521093 Hz.
551    CRTC_CLOCK / 4.0 = 66.961296 Hz.
552    CRTC_CLOCK / 4.5 = 59.521093 Hz.
555553    CRTC_CLOCK / 5.0 = 53.569037 Hz.
556554*/
557555
trunk/src/mame/drivers/mcr3.c
r29404r29405
16361636ROM_END
16371637
16381638
1639/* Spy Hunter labels look like this
1639/* Spy Hunter labels look like this
16401640   SPY-HUNTER
16411641     C.P.U.
16421642      PG3
1643    2/9/84
1643    2/9/84
16441644*/
16451645
16461646ROM_START( spyhunt )
trunk/src/mame/drivers/polepos.c
r29404r29405
856856   MCFG_NAMCO_51XX_INPUT_2_CB(IOPORT("DSWB"))
857857   MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("DSWB_HI"))
858858   MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(polepos_state,out_0))
859   MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(polepos_state,out_1))   
859   MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(polepos_state,out_1))
860860
861861   MCFG_NAMCO_52XX_ADD("52xx", MASTER_CLOCK/8/2)      /* 1.536 MHz */
862862   MCFG_NAMCO_52XX_DISCRETE("discrete")
863863   MCFG_NAMCO_52XX_BASENODE(NODE_04)
864864   MCFG_NAMCO_52XX_ROMREAD_CB(READ8(polepos_state,namco_52xx_rom_r))
865865   MCFG_NAMCO_52XX_SI_CB(READ8(polepos_state,namco_52xx_si_r))
866   
866
867867   MCFG_NAMCO_53XX_ADD("53xx", MASTER_CLOCK/8/2)      /* 1.536 MHz */
868868   MCFG_NAMCO_53XX_K_CB(READ8(polepos_state,namco_53xx_k_r))
869869   MCFG_NAMCO_53XX_INPUT_0_CB(READ8(polepos_state,steering_changed_r))
870870   MCFG_NAMCO_53XX_INPUT_1_CB(READ8(polepos_state,steering_delta_r))
871871   MCFG_NAMCO_53XX_INPUT_2_CB(IOPORT("DSWA"))
872872   MCFG_NAMCO_53XX_INPUT_3_CB(IOPORT("DSWA_HI"))
873   
873
874874   MCFG_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/8/2)  /* 1.536 MHz */
875875   MCFG_NAMCO_54XX_DISCRETE("discrete")
876876   MCFG_NAMCO_54XX_BASENODE(NODE_01)
r29404r29405
946946      they probably simulate some of the logic */
947947   MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2)       /* 1.536 MHz */
948948   MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0H"))
949   
949
950950   MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/8/64)
951951   MCFG_NAMCO_06XX_MAINCPU("maincpu")
952952   MCFG_NAMCO_06XX_READ_0_CB(DEVREAD8("51xx", namco_51xx_device, read))
trunk/src/mame/drivers/pinkiri8.c
r29404r29405
169169            attr = m_janshi_back_vram[count + 2] ^ 0xf0;
170170            col = (attr >> 4) | 0x10;
171171
172            gfx->transpen(bitmap,cliprect, tile, col, 0, 0, x * 16, y * 8, 0);
172               gfx->transpen(bitmap,cliprect, tile, col, 0, 0, x * 16, y * 8, 0);
173173
174174            count += 4;
175175         }
trunk/src/mame/drivers/vaportra.c
r29404r29405
256256   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
257257   MCFG_SCREEN_UPDATE_DRIVER(vaportra_state, screen_update_vaportra)
258258   MCFG_SCREEN_PALETTE("palette")
259   
259
260260   MCFG_GFXDECODE_ADD("gfxdecode", "palette", vaportra)
261261   MCFG_PALETTE_ADD("palette", 1280)
262262
trunk/src/mame/drivers/chanbara.c
r29404r29405
8484   required_device<cpu_device> m_maincpu;
8585   required_device<gfxdecode_device> m_gfxdecode;
8686   required_device<palette_device> m_palette;
87   
87
8888   DECLARE_WRITE8_MEMBER(chanbara_videoram_w);
8989   DECLARE_WRITE8_MEMBER(chanbara_colorram_w);
9090   DECLARE_WRITE8_MEMBER(chanbara_videoram2_w);
trunk/src/mame/drivers/qdrmfgp.c
r29404r29405
625625   MCFG_K056832_ADD("k056832", qdrmfgp_k056832_intf)
626626   MCFG_K056832_GFXDECODE("gfxdecode")
627627   MCFG_K056832_PALETTE("palette")
628   
628
629629   MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
630630   MCFG_K053252_OFFSETS(40, 16)
631631
r29404r29405
669669   MCFG_K056832_ADD("k056832", qdrmfgp2_k056832_intf)
670670   MCFG_K056832_GFXDECODE("gfxdecode")
671671   MCFG_K056832_PALETTE("palette")
672   
672
673673   MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
674674   MCFG_K053252_OFFSETS(40, 16)
675675
trunk/src/mame/drivers/wiz.c
r29404r29405
335335ADDRESS_MAP_END
336336
337337static ADDRESS_MAP_START( stinger_main_map, AS_PROGRAM, 8, wiz_state )
338//   AM_RANGE(0xf008, 0xf00f) AM_WRITENOP // ?
338//  AM_RANGE(0xf008, 0xf00f) AM_WRITENOP // ?
339339   AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r)
340340   AM_RANGE(0xf808, 0xf808) AM_WRITE(stinger_explosion_w)
341341   AM_RANGE(0xf80a, 0xf80a) AM_WRITE(stinger_shot_w)
r29404r29405
751751   save_item(NAME(m_sound_nmi_mask));
752752   save_item(NAME(m_dsc0));
753753   save_item(NAME(m_dsc1));
754   
754
755755   save_item(NAME(m_sprite_bank));
756756   save_item(NAME(m_charbank));
757757   save_item(NAME(m_palbank));
trunk/src/mame/drivers/gaelco3d.c
r29404r29405
991991   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
992992
993993   MCFG_TIMER_DRIVER_ADD("adsp_timer", gaelco3d_state, adsp_autobuffer_irq)
994   
994
995995   MCFG_DEVICE_ADD("serial", GAELCO_SERIAL, 0)
996996   MCFG_GAELCO_SERIAL_IRQ_HANDLER(WRITELINE(gaelco3d_state, ser_irq))
997997
trunk/src/mame/drivers/highvdeo.c
r29404r29405
16261626   ROM_LOAD( "sound-magic-bomb-hmb-vers1-memory-4m.ic16", 0x00000, 0x80000, CRC(45b2b53a) SHA1(983bcc5869d84938ba278f26339dd72c17ed1d00) )
16271627ROM_END
16281628
1629ROM_START( record )   // do checks and expect something... pc=e8044
1629ROM_START( record ) // do checks and expect something... pc=e8044
16301630   ROM_REGION( 0x100000, "user1", 0 ) /* V30 Code */
16311631   ROM_LOAD16_BYTE( "record-vrc-i17-vers1-video-map.ic7", 0x00000, 0x80000, CRC(d0e59a64) SHA1(5f51448a4cdefd335e19affa4b47df7b428b0e7c) )
16321632   ROM_LOAD16_BYTE( "record-vrc-i17-vers1-video-map.ic8", 0x00001, 0x80000, CRC(823d1c25) SHA1(3104567b2b05708d1b5218f9f0e64bfa3d0df46b) )
r29404r29405
16441644   switch(offset*2)
16451645   {
16461646      case 0:
1647      resetpulse^=0x15;      // and 0x07, cmp with 0x05
1647      resetpulse^=0x15;       // and 0x07, cmp with 0x05
16481648      return 0 | resetpulse;
1649      case 2: return 0x15;   // unknown
1649      case 2: return 0x15;    // unknown
16501650   }
16511651
16521652   return 0;
trunk/src/mame/drivers/fcrash.c
r29404r29405
13011301   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(A):7")
13021302   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
13031303   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1304   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(A):8" )    //sort of debug mode...
1304   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(A):8" ) //sort of debug mode...
13051305                                       //depnding (???) of other DSW setting get different
13061306                                       //"game" mode, autoplay, bonus round, ecc...
13071307   PORT_START("DSWB")
r29404r29405
24822482   MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_fcrash)
24832483   MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1)
24842484   MCFG_SCREEN_PALETTE("palette")
2485   
2485
24862486   MCFG_GFXDECODE_ADD("gfxdecode", "palette", cps1)
24872487   MCFG_PALETTE_ADD("palette", 0xc00)
24882488   MCFG_VIDEO_START_OVERRIDE(cps_state,cps1)
trunk/src/mame/drivers/atetris.c
r29404r29405
335335
336336   MCFG_PALETTE_ADD("palette", 256)
337337   MCFG_PALETTE_FORMAT(RRRGGGBB)
338   
338
339339   MCFG_SCREEN_ADD("screen", RASTER)
340340   /* note: these parameters are from published specs, not derived */
341341   /* the board uses an SOS-2 chip to generate video signals */
trunk/src/mame/drivers/model2.c
r29404r29405
19551955   MCFG_TIMER_PTR((FPTR)3)
19561956
19571957   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1958   
1958
19591959   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
19601960   MCFG_S24TILE_DEVICE_GFXDECODE("gfxdecode")
19611961   MCFG_S24TILE_DEVICE_PALETTE("palette")
trunk/src/mame/drivers/bmcbowl.c
r29404r29405
326326   AM_RANGE(0x000000, 0x01ffff) AM_ROM
327327
328328   AM_RANGE(0x090000, 0x090001) AM_WRITE(bmc_RAMDAC_offset_w) AM_SHARE("colorram")
329   AM_RANGE(0x090002, 0x090003) AM_WRITE(bmc_RAMDAC_color_w)
329   AM_RANGE(0x090002, 0x090003) AM_WRITE(bmc_RAMDAC_color_w)
330330   AM_RANGE(0x090004, 0x090005) AM_WRITENOP//RAMDAC
331331
332332   AM_RANGE(0x090800, 0x090803) AM_WRITENOP
r29404r29405
489489   MCFG_NVRAM_ADD_1FILL("nvram")
490490
491491   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
492   
492
493493   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz )  // guessed chip type, clock not verified
494494   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
495495   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
trunk/src/mame/drivers/popeye.c
r29404r29405
2929 */
3030
3131static NETLIST_START(nl_popeye_imp_changer)
32    RES(R62, 510000)
33    RES(R63, 100)
34    RES(R64, 510000)
35    RES(R65, 2100)
36    RES(R66, 330)
37    RES(R67, 51)
32   RES(R62, 510000)
33   RES(R63, 100)
34   RES(R64, 510000)
35   RES(R65, 2100)
36   RES(R66, 330)
37   RES(R67, 51)
3838
39    QBJT_EB(Q8, "2SC1815")
40    QBJT_EB(Q9, "2SA1015")
39   QBJT_EB(Q8, "2SC1815")
40   QBJT_EB(Q9, "2SA1015")
4141
42    NET_C(V5, R62.1, Q8.C, R66.1)
43    NET_C(R62.2, R64.1, R63.1, C7.2)
44    NET_C(R63.2, Q8.B)
45    NET_C(Q8.E, R65.1, Q9.B)
46    NET_C(R66.2, Q9.E, R67.1)
42   NET_C(V5, R62.1, Q8.C, R66.1)
43   NET_C(R62.2, R64.1, R63.1, C7.2)
44   NET_C(R63.2, Q8.B)
45   NET_C(Q8.E, R65.1, Q9.B)
46   NET_C(R66.2, Q9.E, R67.1)
4747
48    NET_C(GND, Q9.C, R65.2, R64.2)
48   NET_C(GND, Q9.C, R65.2, R64.2)
4949NETLIST_END()
5050
5151static NETLIST_START(nl_popeye)
5252
53    /* Standard stuff */
53   /* Standard stuff */
5454
55    SOLVER(Solver, 48000)
56    PARAM(Solver.ACCURACY, 1e-5)
57    ANALOG_INPUT(V5, 5)
55   SOLVER(Solver, 48000)
56   PARAM(Solver.ACCURACY, 1e-5)
57   ANALOG_INPUT(V5, 5)
5858
59    /* AY 8910 internal resistors */
59   /* AY 8910 internal resistors */
6060
61    RES(R_AY1_1, 1000);
62    RES(R_AY1_2, 1000);
63    RES(R_AY1_3, 1000);
61   RES(R_AY1_1, 1000);
62   RES(R_AY1_2, 1000);
63   RES(R_AY1_3, 1000);
6464
65    RES(R52, 2000)
66    RES(R55, 2000)
67    RES(R58, 2000)
68    RES(R53, 2000)
69    RES(R56, 2000)
70    RES(R59, 2000)
71    RES(R51, 20000)
72    RES(R57, 30000)
73    RES(R60, 30000)
65   RES(R52, 2000)
66   RES(R55, 2000)
67   RES(R58, 2000)
68   RES(R53, 2000)
69   RES(R56, 2000)
70   RES(R59, 2000)
71   RES(R51, 20000)
72   RES(R57, 30000)
73   RES(R60, 30000)
7474
75    RES(R61, 120000)
75   RES(R61, 120000)
7676
77    RES(ROUT, 5000)
77   RES(ROUT, 5000)
7878
79    CAP(C4, 0.047e-6)
80    CAP(C5, 330e-12)
81    CAP(C6, 330e-12)
82    CAP(C7, 3.3e-6)
83    CAP(C40, 680e-12)
79   CAP(C4, 0.047e-6)
80   CAP(C5, 330e-12)
81   CAP(C6, 330e-12)
82   CAP(C7, 3.3e-6)
83   CAP(C40, 680e-12)
8484
85    NET_C(V5, R_AY1_1.1, R_AY1_2.1, R_AY1_3.1)
85   NET_C(V5, R_AY1_1.1, R_AY1_2.1, R_AY1_3.1)
8686
87    NET_C(R_AY1_1.2, R52.1, R53.1)
88    NET_C(R_AY1_2.2, R55.1, R56.1)
89    NET_C(R_AY1_3.2, R58.1, R59.1)
87   NET_C(R_AY1_1.2, R52.1, R53.1)
88   NET_C(R_AY1_2.2, R55.1, R56.1)
89   NET_C(R_AY1_3.2, R58.1, R59.1)
9090
91    NET_C(R53.2, R51.1, C4.1)
92    NET_C(R56.2, R57.1, C5.1)
93    NET_C(R59.2, R60.1, C6.1)
91   NET_C(R53.2, R51.1, C4.1)
92   NET_C(R56.2, R57.1, C5.1)
93   NET_C(R59.2, R60.1, C6.1)
9494
95    NET_C(R51.2, R57.2, R60.2, R61.1, C40.1, C7.1)
95   NET_C(R51.2, R57.2, R60.2, R61.1, C40.1, C7.1)
9696
97    NET_C(GND, R52.2, R55.2, R58.2, C4.2, C5.2, C6.2, R61.2, C40.2)
97   NET_C(GND, R52.2, R55.2, R58.2, C4.2, C5.2, C6.2, R61.2, C40.2)
9898
99    INCLUDE(nl_popeye_imp_changer)
99   INCLUDE(nl_popeye_imp_changer)
100100
101    /* output resistor (actually located in TV */
101   /* output resistor (actually located in TV */
102102
103    NET_C(R67.2, ROUT.1)
103   NET_C(R67.2, ROUT.1)
104104
105    NET_C(GND, ROUT.2)
105   NET_C(GND, ROUT.2)
106106
107107NETLIST_END()
108108
r29404r29405
112112{
113113   m_field ^= 1;
114114   /* NMIs are enabled by the I register?? How can that be? */
115   if (device.state().state_int(Z80_I) & 1)   /* skyskipr: 0/1, popeye: 2/3 but also 0/1 */
115   if (device.state().state_int(Z80_I) & 1)    /* skyskipr: 0/1, popeye: 2/3 but also 0/1 */
116116      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
117117}
118118
r29404r29405
458458/* Does Sky Skipper have the same filtering? */
459459static const ay8910_interface ay8910_nl_config =
460460{
461    AY8910_RESISTOR_OUTPUT,
462    AY8910_DEFAULT_LOADS,
463    DEVCB_INPUT_PORT("DSW0"),
464    DEVCB_NULL,
465    DEVCB_NULL,
466    DEVCB_DRIVER_MEMBER(popeye_state,popeye_portB_w)
461   AY8910_RESISTOR_OUTPUT,
462   AY8910_DEFAULT_LOADS,
463   DEVCB_INPUT_PORT("DSW0"),
464   DEVCB_NULL,
465   DEVCB_NULL,
466   DEVCB_DRIVER_MEMBER(popeye_state,popeye_portB_w)
467467};
468468
469469static MACHINE_CONFIG_START( skyskipr, popeye_state )
r29404r29405
501501
502502   MCFG_SOUND_MODIFY("aysnd")
503503   MCFG_SOUND_ROUTES_RESET()
504    MCFG_SOUND_CONFIG(ay8910_nl_config)
505    MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
506    MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
507    MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2)
504   MCFG_SOUND_CONFIG(ay8910_nl_config)
505   MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
506   MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
507   MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2)
508508
509    /* NETLIST configuration using internal AY8910 resistor values */
509   /* NETLIST configuration using internal AY8910 resistor values */
510510
511    MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
512    MCFG_NETLIST_SETUP(nl_popeye)
513    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
511   MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
512   MCFG_NETLIST_SETUP(nl_popeye)
513   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
514514
515    MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY1_1.R")
516    MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY1_2.R")
517    MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY1_3.R")
515   MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY1_1.R")
516   MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY1_2.R")
517   MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY1_3.R")
518518
519    MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1")
520    MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0, -65000.0)
519   MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1")
520   MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0, -65000.0)
521521
522522   MCFG_VIDEO_START_OVERRIDE(popeye_state,popeye)
523523MACHINE_CONFIG_END
trunk/src/mame/drivers/igs017.c
r29404r29405
7979   optional_device<igs022_device> m_igs022; // Mj Shuang Long Qiang Zhu 2
8080   required_device<gfxdecode_device> m_gfxdecode;
8181   required_device<screen_device> m_screen;
82   required_device<palette_device> m_palette;   
82   required_device<palette_device> m_palette;
8383   void igs025_to_igs022_callback( void );
8484
8585   int m_toggle;
trunk/src/mame/drivers/hyperspt.c
r29404r29405
345345   MCFG_CPU_PROGRAM_MAP(roadf_map)
346346   MCFG_GFXDECODE_MODIFY("gfxdecode", roadf)
347347   MCFG_VIDEO_START_OVERRIDE(hyperspt_state,roadf)
348   
348
349349   MCFG_CPU_MODIFY("audiocpu")
350350   MCFG_CPU_PROGRAM_MAP(roadf_sound_map)
351351   MCFG_DEVICE_REMOVE("vlm")
trunk/src/mame/drivers/namcos12.c
r29404r29405
15801580   MCFG_LINE_DISPATCH_ADD("clk_dispatch", 2)
15811581   MCFG_LINE_DISPATCH_FWD_CB(0, 2, DEVWRITELINE(":rtc", rtc4543_device, clk_w)) MCFG_DEVCB_INVERT
15821582   MCFG_LINE_DISPATCH_FWD_CB(1, 2, DEVWRITELINE(":namco_settings", namco_settings_device, clk_w))
1583   
1583
15841584   MCFG_DEVICE_MODIFY("sub:sci1")
15851585   MCFG_H8_SCI_TX_CALLBACK(DEVWRITELINE(":namco_settings", namco_settings_device, data_w))
15861586   MCFG_H8_SCI_CLK_CALLBACK(DEVWRITELINE(":clk_dispatch", devcb2_line_dispatch_device<2>, in_w))
1587   
1587
15881588   MCFG_AT28C16_ADD("at28c16", NULL)
15891589
15901590   /* video hardware */
r29404r29405
19641964
19651965   ROM_REGION32_LE( 0x00800000, "user2", 0 ) /* main data */
19661966   ROM_LOAD16_BYTE( "kdt1rom0l.ic12", 0x000000, 0x400000, BAD_DUMP CRC(8e2d5d9e) SHA1(6f703e27a19740af4094004b783b3cc2974c3de0) ) // These probably should be 64MBIT
1967   ROM_LOAD16_BYTE( "kdt1rom0u.ic11", 0x000001, 0x400000, BAD_DUMP CRC(49ec5dbd) SHA1(336db6d3e361938850a9234b6b64070dbdc36d45) ) //
1967   ROM_LOAD16_BYTE( "kdt1rom0u.ic11", 0x000001, 0x400000, BAD_DUMP CRC(49ec5dbd) SHA1(336db6d3e361938850a9234b6b64070dbdc36d45) ) //
19681968
19691969   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
19701970   ROM_LOAD16_WORD_SWAP( "ktd1vera.11s", 0x000000, 0x080000, CRC(c2ff1971) SHA1(32ee2afe08e92049d8139c9324a0ea1a3b7ee5a1) )
trunk/src/mame/drivers/raiden2.c
r29404r29405
797797#define ZEROTEAM_MASK_Y (0x1ff)
798798
799799
800           
800
801801                  gfx->transpen(
802802                  bitmap,
803803                  cliprect,
r29404r29405
806806                  yflip,xflip,
807807                  (sx+xstep*xtiles)&ZEROTEAM_MASK_X,(sy+ystep*ytiles)&ZEROTEAM_MASK_Y,15);
808808
809           
809
810810                  gfx->transpen(
811811                  bitmap,
812812                  cliprect,
r29404r29405
815815                  yflip,xflip,
816816                  ((sx+xstep*xtiles)&ZEROTEAM_MASK_X)-0x200,(sy+ystep*ytiles)&ZEROTEAM_MASK_Y,15);
817817
818           
818
819819                  gfx->transpen(
820820                  bitmap,
821821                  cliprect,
r29404r29405
824824                  yflip,xflip,
825825                  (sx+xstep*xtiles)&ZEROTEAM_MASK_X,((sy+ystep*ytiles)&ZEROTEAM_MASK_Y)-0x200,15);
826826
827           
827
828828                  gfx->transpen(
829829                  bitmap,
830830                  cliprect,
r29404r29405
18581858   GFXDECODE_ENTRY( "gfx3", 0x00000, raiden2_spritelayout, 0x000, 128 )
18591859GFXDECODE_END
18601860
1861   
1861
18621862/* MACHINE DRIVERS */
18631863
18641864static MACHINE_CONFIG_START( raiden2, raiden2_state )
r29404r29405
18811881   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0, 30*8-1)
18821882   MCFG_SCREEN_UPDATE_DRIVER(raiden2_state, screen_update_raiden2)
18831883   MCFG_SCREEN_PALETTE("palette")
1884   
1884
18851885   MCFG_GFXDECODE_ADD("gfxdecode", "palette", raiden2)
18861886   MCFG_PALETTE_ADD("palette", 2048)
18871887   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
r29404r29405
19391939   MCFG_SCREEN_RAW_PARAMS(XTAL_32MHz/4,546,0,40*8,264,0,32*8) /* hand-tuned to match ~55.47 */
19401940   MCFG_SCREEN_UPDATE_DRIVER(raiden2_state, screen_update_raiden2)
19411941   MCFG_SCREEN_PALETTE("palette")
1942   
1942
19431943   MCFG_GFXDECODE_ADD("gfxdecode", "palette", raiden2)
19441944   MCFG_PALETTE_ADD("palette", 2048)
19451945   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
trunk/src/mame/drivers/scramble.c
r29404r29405
21422142
21432143ROM_START( hunchbks2 )
21442144   ROM_REGION( 0x8000, "maincpu", 0 )
2145   ROM_LOAD( "hb01.bin",       0x0000, 0x0800, CRC(fec3466a) SHA1(d8ec3b432f7037e99bf1ac1ba7911a34eff6869d) )
2145   ROM_LOAD( "hb01.bin",    0x0000, 0x0800, CRC(fec3466a) SHA1(d8ec3b432f7037e99bf1ac1ba7911a34eff6869d) )
21462146   ROM_LOAD( "2e_hb02.bin",  0x0800, 0x0800, CRC(07de4229) SHA1(9f333509ae3d6c579f6d96caa172a0abe9eefb30) )
21472147   ROM_LOAD( "2f_hb03.bin",  0x2000, 0x0800, CRC(b75a0dfc) SHA1(c60c833f28c6de027d46f5a2a54ad5646ec58453) )
21482148   ROM_LOAD( "hb04.bin",     0x2800, 0x0800, CRC(731e349b) SHA1(cfa1ac322cdfe1d4d112b0a4dd85d3552a6e33d0) )
trunk/src/mame/drivers/taitojc.c
r29404r29405
12691269   MCFG_TC0640FIO_READ_2_CB(IOPORT("START"))
12701270   MCFG_TC0640FIO_READ_3_CB(IOPORT("UNUSED"))
12711271   MCFG_TC0640FIO_READ_7_CB(IOPORT("BUTTONS"))
1272   
1272
12731273   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1274   
1274
12751275   /* video hardware */
12761276   MCFG_SCREEN_ADD("screen", RASTER)
12771277   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
trunk/src/mame/drivers/ddealer.c
r29404r29405
225225            UINT16 tile = (src[count] & 0x0fff);
226226            UINT16 colr = (src[count] & 0xf000) >> 12;
227227            count++;
228            gfx->transpen(bitmap,cliprect, tile, colr, 0, flipy, (x * 16) - sx, (y * 16) - sy, 15);
228               gfx->transpen(bitmap,cliprect, tile, colr, 0, flipy, (x * 16) - sx, (y * 16) - sy, 15);
229229         }
230230      }
231231      count = 0;
r29404r29405
238238            UINT16 tile = (src[count] & 0x0fff);
239239            UINT16 colr = (src[count] & 0xf000) >> 12;
240240            count++;
241            gfx->transpen(bitmap,cliprect, tile, colr, 0, flipy, (x * 16) - sx, (y * 16) - sy, 15);
241               gfx->transpen(bitmap,cliprect, tile, colr, 0, flipy, (x * 16) - sx, (y * 16) - sy, 15);
242242         }
243243      }
244244   }
r29404r29405
257257            UINT16 tile = (src[count] & 0x0fff);
258258            UINT16 colr = (src[count] & 0xf000) >> 12;
259259            count++;
260            gfx->transpen(bitmap,cliprect, tile, colr, flipy, flipy, (x * 16) + sx, (y * 16) + sy, 15);
260               gfx->transpen(bitmap,cliprect, tile, colr, flipy, flipy, (x * 16) + sx, (y * 16) + sy, 15);
261261         }
262262      }
263263      count = 0;
r29404r29405
270270            UINT16 tile = (src[count] & 0x0fff);
271271            UINT16 colr = (src[count] & 0xf000) >> 12;
272272            count++;
273            gfx->transpen(bitmap,cliprect, tile, colr, flipy, flipy, (x * 16) + sx, (y * 16) + sy, 15);
273               gfx->transpen(bitmap,cliprect, tile, colr, flipy, flipy, (x * 16) + sx, (y * 16) + sy, 15);
274274         }
275275      }
276276   }
trunk/src/mame/drivers/photon.c
r29404r29405
216216   MCFG_SCREEN_VISIBLE_AREA(0, 256+32-1, 0, 192+32-1)
217217   MCFG_SCREEN_UPDATE_DRIVER(photon_state, screen_update_photon)
218218   MCFG_SCREEN_PALETTE("palette")
219   
219
220220   MCFG_PALETTE_ADD("palette", 16)
221221   MCFG_PALETTE_INIT_OWNER(pk8000_base_state, pk8000)
222222
trunk/src/mame/drivers/spy.c
r29404r29405
488488
489489   m_paletteram.resize(0x800);
490490   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
491   
491
492492   memset(m_pmcram, 0, sizeof(m_pmcram));
493493
494494   save_item(NAME(m_paletteram));
trunk/src/mame/drivers/itgamble.c
r29404r29405
6565   itgamble_state(const machine_config &mconfig, device_type type, const char *tag)
6666      : driver_device(mconfig, type, tag),
6767         m_maincpu(*this, "maincpu"),
68         m_palette(*this, "palette")
68         m_palette(*this, "palette")
6969   { }
7070
7171   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/drivers/pengadvb.c
r29404r29405
3939   { }
4040
4141   required_device<cpu_device> m_maincpu;
42   
42
4343   address_map_bank_device *m_page[4];
4444   memory_bank *m_bank[4];
4545   UINT8 m_primary_slot_reg;
r29404r29405
4848   DECLARE_READ8_MEMBER(mem_r);
4949   DECLARE_WRITE8_MEMBER(mem_w);
5050   DECLARE_WRITE8_MEMBER(megarom_bank_w);
51   
51
5252   DECLARE_WRITE8_MEMBER(pengadvb_psg_port_b_w);
5353   DECLARE_READ8_MEMBER(pengadvb_ppi_port_a_r);
5454   DECLARE_WRITE8_MEMBER(pengadvb_ppi_port_a_w);
r29404r29405
9191static ADDRESS_MAP_START( bank_mem, AS_PROGRAM, 8, pengadvb_state )
9292   // slot 0, MSX BIOS
9393   AM_RANGE(0x00000, 0x07fff) AM_ROM AM_REGION("maincpu", 0)
94   
94
9595   // slot 1, MegaROM
9696   AM_RANGE(0x14000, 0x15fff) AM_ROMBANK("bank0")
9797   AM_RANGE(0x16000, 0x17fff) AM_ROMBANK("bank1")
r29404r29405
184184   {
185185      case 0x0:
186186         return ioport("IN1")->read();
187     
187
188188      default:
189189         break;
190   }         
190   }
191191
192192   return 0xff;
193193}
r29404r29405
327327{
328328   pengadvb_decrypt("maincpu");
329329   pengadvb_decrypt("game");
330   
330
331331   // init banks
332332   static const char * const pagenames[] = { "page0", "page1", "page2", "page3" };
333333   static const char * const banknames[] = { "bank0", "bank1", "bank2", "bank3" };
trunk/src/mame/drivers/ikki.c
r29404r29405
254254   MCFG_SCREEN_REFRESH_RATE(60)
255255   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
256256   MCFG_SCREEN_SIZE(32*8, 32*8+3*8)
257   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)   
257   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
258258   MCFG_SCREEN_UPDATE_DRIVER(ikki_state, screen_update_ikki)
259259   MCFG_SCREEN_PALETTE("palette")
260260
trunk/src/mame/drivers/megaphx.c
r29404r29405
1/*
1/*
22   Dinamic / Inder arcade hardware
33
44   Mega Phoenix
5
5
66 also known to exist on this hardware:
77   Hammer Boy
88   Nonamed 2 (ever finished? only code seen has 1991 date and is vastly incomplete) (versions exist for Amstrad CPC, MSX and Spectrum)
r29404r29405
2222 I/O:
2323  - port_c_r / port_c_w should go through the 8255 but I don't see how to hook them up that way? various bits of the writes are lost?
2424
25 
25
2626  --
2727
2828
r29404r29405
3333  TS68000CP8
3434  TMS34010FNL-40
3535  TMP82C55AP-2
36
36
3737  Bt478KPJ35  Palette / RAMDAC
3838
3939  Actel A1010A-PL68C  (custom blitter maybe?)
r29404r29405
4545  ST Z8430AB1
4646
4747  custom INDER badged chip 40 pin?  (probably just a z80 - it's in the sound section)
48   MODELO: MEGA PHOENIX
49   KIT NO. 1.034
50   FECHA FABRICACION 08.10.91
51   LA MANIPULCION DE LA ETIQUETA O DE LA PLACA ANULA SU SARANTIA
52   (this sticker is also present on the other PCB)
48    MODELO: MEGA PHOENIX
49    KIT NO. 1.034
50    FECHA FABRICACION 08.10.91
51    LA MANIPULCION DE LA ETIQUETA O DE LA PLACA ANULA SU SARANTIA
52    (this sticker is also present on the other PCB)
5353
5454
5555*/
r29404r29405
7777      m_indersb(*this, "inder_sb"),
7878      m_indervid(*this, "inder_vid")
7979
80   {
81
80   {
8281   }
8382
8483   required_device<cpu_device> m_maincpu;
r29404r29405
126125   AM_RANGE(0x060004, 0x060005) AM_READ8( port_c_r, 0x00ff )
127126   AM_RANGE(0x060006, 0x060007) AM_WRITE8( port_c_w, 0x00ff )
128127   AM_RANGE(0x060000, 0x060003) AM_DEVREADWRITE8("ppi8255_0", i8255_device, read, write, 0x00ff)
129   
128
130129   AM_RANGE(0x800000, 0x83ffff) AM_ROM  AM_REGION("roms01", 0x00000) // code + bg gfx are in here
131130   AM_RANGE(0x840000, 0x87ffff) AM_ROM  AM_REGION("roms23", 0x00000) // bg gfx are in here
132131   AM_RANGE(0x880000, 0x8bffff) AM_ROM  AM_REGION("roms45", 0x00000) // bg gfx + title screen in here
r29404r29405
210209   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
211210   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
212211   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
213   PORT_SERVICE( 0x0002, IP_ACTIVE_HIGH )
212   PORT_SERVICE( 0x0002, IP_ACTIVE_HIGH )
214213   PORT_DIPNAME( 0x001c, 0x0010, "Difficulty?"  ) // in hammer boy at least..
215214   PORT_DIPSETTING(      0x0000, "0" )
216215   PORT_DIPSETTING(      0x0004, "1" )
r29404r29405
240239
241240READ8_MEMBER(megaphx_state::port_c_r)
242241{
243   
244242   //printf("read port c - write value was %02x\n", port_c_value);
245243
246//   int pc = machine().device("maincpu")->safe_pc();
244//  int pc = machine().device("maincpu")->safe_pc();
247245   UINT8 ret = 0;
248246
249//   printf("(%06x) port_c_r (thru 8255)\n", pc);
250   
247//  printf("(%06x) port_c_r (thru 8255)\n", pc);
248
251249   if (m_pic_clock == 1) ret |= 0x08;
252250   if (m_pic_readbit == 1) ret |= 0x02;
253//   return ioport("SYS")->read();
251//  return ioport("SYS")->read();
254252   return ret;
255253}
256254
257255
258256WRITE8_MEMBER(megaphx_state::port_c_w)
259257{
260   
261
262
263//   int pc = machine().device("maincpu")->safe_pc();
258//  int pc = machine().device("maincpu")->safe_pc();
264259   port_c_value = (data & 0x0f);
265260
266261   if (port_c_value == 0x9)
267262   {
268   //   printf("Assert PIC reset line\n");
263   //  printf("Assert PIC reset line\n");
269264      m_pic_is_reset = 1;
270265   }
271266   else if (port_c_value == 0x8)
272267   {
273   //   printf("Clear PIC reset line\n");
268   //  printf("Clear PIC reset line\n");
274269      m_pic_is_reset = 0;
275   
270
276271      m_pic_shift_pos = 0;
277272      m_pic_data = 0;
278273      m_pic_data_bit = 0;
r29404r29405
282277   }
283278   else if (port_c_value == 0xd)
284279   {
285   //   printf("Set PIC data line\n");
280   //  printf("Set PIC data line\n");
286281      m_pic_data_bit = 1;
287282   }
288283   else if (port_c_value == 0xc)
289284   {
290   //   printf("Clear PIC data line\n");
285   //  printf("Clear PIC data line\n");
291286      m_pic_data_bit = 0;
292287   }
293288   else if (port_c_value == 0xf)
294289   {
295290      if (m_pic_clock == 0)
296291      {
297      //   printf("Set PIC clock line | pos %d | bit %d\n", m_pic_shift_pos, m_pic_data_bit);
298         
292      //  printf("Set PIC clock line | pos %d | bit %d\n", m_pic_shift_pos, m_pic_data_bit);
299293
300294
301295
302296
297
303298         m_pic_clock = 1;
304     
299
305300      }
306301   }
307302   else if (port_c_value == 0xe)
308303   {
309
310304      if (m_pic_clock == 1)
311305      {
312306         m_pic_data |= m_pic_data_bit << m_pic_shift_pos;
r29404r29405
339333         m_pic_shift_pos++;
340334
341335
342         //   printf("Clear PIC clock line\n");
336         //  printf("Clear PIC clock line\n");
343337         m_pic_clock = 0;
344338      }
345339   }
346340   else
347341   {
348   //   printf("Unknown write to PIC %02x (PC %06x)\n", port_c_value, pc);
342   //  printf("Unknown write to PIC %02x (PC %06x)\n", port_c_value, pc);
349343   }
350344
351345
trunk/src/mame/drivers/mpoker.c
r29404r29405
205205   UINT32 screen_update_mpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
206206   required_device<cpu_device> m_maincpu;
207207   required_device<gfxdecode_device> m_gfxdecode;
208   required_device<palette_device> m_palette;   
208   required_device<palette_device> m_palette;
209209};
210210
211211
trunk/src/mame/drivers/beathead.c
r29404r29405
377377   MCFG_SCREEN_SIZE(42*8, 262)
378378   MCFG_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 0*8, 30*8-1)
379379   MCFG_SCREEN_PALETTE("palette")
380   
380
381381   MCFG_PALETTE_ADD("palette", 32768)
382382
383383   /* sound hardware */
trunk/src/mame/drivers/lastbank.c
r29404r29405
480480
481481   MCFG_GFXDECODE_ADD("gfxdecode", "palette", lastbank )
482482   MCFG_PALETTE_ADD("palette", 0x100)
483   
483
484484   MCFG_DEVICE_ADD("tc0091lvc", TC0091LVC, 0)
485485   MCFG_TC0091LVC_GFXDECODE("gfxdecode")
486486   MCFG_TC0091LVC_PALETTE("palette")
trunk/src/mame/drivers/pcxt.c
r29404r29405
137137public:
138138   // construction/destruction
139139   isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
140   
140
141141   virtual const rom_entry *device_rom_region() const;
142142};
143143
r29404r29405
149149
150150isa8_cga_filetto_device::isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
151151      isa8_cga_device( mconfig, ISA8_CGA_FILETTO, "ISA8_CGA_FILETTO", tag, owner, clock, "filetto_cga", __FILE__)
152{   
152{
153153}
154154
155155ROM_START( filetto_cga )
r29404r29405
169169public:
170170   // construction/destruction
171171   isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
172   
172
173173   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
174174   virtual void device_start();
175175   virtual const rom_entry *device_rom_region() const;
176   
176
177177   DECLARE_READ8_MEMBER(bg_bank_r);
178178   DECLARE_WRITE8_MEMBER(bg_bank_w);
179179private:
r29404r29405
190190
191191isa8_cga_tetriskr_device::isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
192192      isa8_cga_superimpose_device( mconfig, ISA8_CGA_TETRISKR, "ISA8_CGA_TETRISKR", tag, owner, clock, "tetriskr_cga", __FILE__)
193{   
193{
194194}
195195
196196
r29404r29405
788788
789789static MACHINE_CONFIG_START( tetriskr, pcxt_state )
790790   MCFG_FRAGMENT_ADD( pcxt )
791   
791
792792   MCFG_CPU_MODIFY("maincpu")
793793   MCFG_CPU_IO_MAP(tetriskr_io)
794794
trunk/src/mame/drivers/toaplan2.c
r29404r29405
32753275   MCFG_DEVICE_ADD_VDP0
32763276   MCFG_GP9001_VDP_GFXDECODE("gfxdecode")
32773277   MCFG_GP9001_VDP_PALETTE("palette")
3278   
3278
32793279   MCFG_DEVICE_ADD_VDP1
32803280   MCFG_GP9001_VDP_GFXDECODE("gfxdecode")
32813281   MCFG_GP9001_VDP_PALETTE("palette")
r29404r29405
37133713   MCFG_DEVICE_ADD_VDP0
37143714   MCFG_GP9001_VDP_GFXDECODE("gfxdecode")
37153715   MCFG_GP9001_VDP_PALETTE("palette")
3716   
3716
37173717   MCFG_DEVICE_ADD_VDP1
37183718   MCFG_GP9001_VDP_GFXDECODE("gfxdecode")
37193719   MCFG_GP9001_VDP_PALETTE("palette")
r29404r29405
45984598
45994599   ROM_REGION( 0x1000, "plds", 0 )         /* Logic for mixing output of both GP9001 GFX controllers */
46004600   ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) )
4601//   ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) )
4601//  ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) )
46024602ROM_END
46034603
46044604
trunk/src/mame/drivers/subsino.c
r29404r29405
38533853DRIVER_INIT_MEMBER(subsino_state,tesorone230)
38543854{
38553855#if 1
3856   UINT8 *rom = memregion( "maincpu" )->base();         //check this patch!!!!
3856   UINT8 *rom = memregion( "maincpu" )->base();            //check this patch!!!!
38573857   rom[0x10a8] = 0x18; //patch protection check ("ERROR 08073"):
38583858   rom[0x10a9] = 0x11;
38593859   rom[0x8ba] = 0x18; //patch "winning protection" check
trunk/src/mame/drivers/wecleman.c
r29404r29405
11571157   MCFG_K051316_ADD("k051316_1", hotchase_k051316_intf_0)
11581158   MCFG_K051316_GFXDECODE("gfxdecode")
11591159   MCFG_K051316_PALETTE("palette")
1160   
1160
11611161   MCFG_K051316_ADD("k051316_2", hotchase_k051316_intf_1)
11621162   MCFG_K051316_GFXDECODE("gfxdecode")
11631163   MCFG_K051316_PALETTE("palette")
trunk/src/mame/drivers/cmmb.c
r29404r29405
338338   MCFG_SCREEN_PALETTE("palette")
339339
340340   MCFG_GFXDECODE_ADD("gfxdecode", "palette", cmmb)
341   
341
342342   MCFG_PALETTE_ADD("palette", 512)
343343   MCFG_PALETTE_FORMAT(RRRGGGBB)
344344
trunk/src/mame/drivers/flyball.c
r29404r29405
5757   required_device<gfxdecode_device> m_gfxdecode;
5858   required_device<screen_device> m_screen;
5959   required_device<palette_device> m_palette;
60     
60
6161   DECLARE_READ8_MEMBER(flyball_input_r);
6262   DECLARE_READ8_MEMBER(flyball_scanline_r);
6363   DECLARE_READ8_MEMBER(flyball_potsense_r);
trunk/src/mame/drivers/xybots.c
r29404r29405
190190
191191   /* video hardware */
192192   MCFG_GFXDECODE_ADD("gfxdecode", "palette", xybots)
193   
193
194194   MCFG_PALETTE_ADD("palette", 1024)
195195   MCFG_PALETTE_FORMAT(IIIIRRRRGGGGBBBB)
196196
trunk/src/mame/drivers/centiped.c
r29404r29405
20522052ROM_END
20532053
20542054
2055ROM_START( magworma )
2055ROM_START( magworma )
20562056   ROM_REGION( 0x10000, "maincpu", 0 )
20572057   ROM_LOAD( "h41.1d",  0x2000, 0x0800, CRC(773a3da6) SHA1(577ae0578231df83a768d6a50b86dcaf715a32d7) )
20582058   ROM_LOAD( "h42.1e",  0x2800, 0x0800, CRC(482c7808) SHA1(6d274a988e603d33131cb6ffbfe2cdd22fabf25b) )
trunk/src/mame/drivers/welltris.c
r29404r29405
742742   MCFG_SCREEN_VISIBLE_AREA(15, 335-1, 0, 224-1)
743743
744744   MCFG_DEVICE_MODIFY("vsystem_spr_old")
745   MCFG_VSYSTEM_SPR2_SET_OFFSETS(6, 1)   
745   MCFG_VSYSTEM_SPR2_SET_OFFSETS(6, 1)
746746MACHINE_CONFIG_END
747747
748748
trunk/src/mame/drivers/taitoair.c
r29404r29405
716716   MCFG_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 3*16, 28*16-1)
717717   MCFG_SCREEN_UPDATE_DRIVER(taitoair_state, screen_update_taitoair)
718718   MCFG_SCREEN_PALETTE("palette")
719   
719
720720   MCFG_GFXDECODE_ADD("gfxdecode", "palette", airsys)
721721
722722   MCFG_PALETTE_ADD_INIT_BLACK("palette", 512*16+512*16)
trunk/src/mame/drivers/nightgal.c
r29404r29405
129129   required_ioport m_io_dswb;
130130   required_ioport m_io_dswc;
131131   required_device<palette_device> m_palette;
132   
132
133133   UINT8 nightgal_gfx_nibble( int niboffset );
134134   void plot_nightgal_gfx_pixel( UINT8 pix, int x, int y );
135135};
trunk/src/mame/drivers/neptunp2.c
r29404r29405
104104   MCFG_SCREEN_SIZE(32*8, 32*8)
105105   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
106106   MCFG_SCREEN_PALETTE("palette")
107   
107
108108   MCFG_GFXDECODE_ADD("gfxdecode", "palette", neptunp2)
109109   MCFG_PALETTE_ADD("palette", 512)
110110
trunk/src/mame/drivers/littlerb.c
r29404r29405
155155
156156static INPUT_PORTS_START( littlerb )
157157   PORT_START("DSW")   /* 16bit */
158   PORT_DIPNAME( 0x0003, 0x0001, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:8,7")
158   PORT_DIPNAME( 0x0003, 0x0001, DEF_STR( Lives ) )    PORT_DIPLOCATION("SW1:8,7")
159159   PORT_DIPSETTING(      0x0003, "2" )
160160   PORT_DIPSETTING(      0x0001, "3" )
161161   PORT_DIPSETTING(      0x0002, "4" )
162162   PORT_DIPSETTING(      0x0000, "5" )
163   PORT_DIPNAME( 0x001c, 0x0004, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6,5,4")
163   PORT_DIPNAME( 0x001c, 0x0004, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6,5,4")
164164   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
165165   PORT_DIPSETTING(      0x0010, DEF_STR( 4C_1C ) )
166166   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
r29404r29405
169169   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_2C ) )
170170   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_3C ) )
171171   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_4C ) )
172   PORT_DIPNAME( 0x00e0, 0x0020, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:3,2,1")
172   PORT_DIPNAME( 0x00e0, 0x0020, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:3,2,1")
173173   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
174174   PORT_DIPSETTING(      0x0080, DEF_STR( 4C_1C ) )
175175   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_1C ) )
r29404r29405
178178   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_2C ) )
179179   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_3C ) )
180180   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_4C ) )
181   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW2:8")
181   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )  PORT_DIPLOCATION("SW2:8")
182182   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
183183   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
184   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:7,6")
184   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:7,6")
185185   PORT_DIPSETTING(      0x0600, "Every 150,000" )
186186   PORT_DIPSETTING(      0x0200, "Every 200,000" )
187187   PORT_DIPSETTING(      0x0400, "Every 300,000" )
188188   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
189   PORT_DIPNAME( 0x3800, 0x2800, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:5,4,3")
189   PORT_DIPNAME( 0x3800, 0x2800, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:5,4,3")
190190   PORT_DIPSETTING(      0x3800, DEF_STR( Easy ) )
191191   PORT_DIPSETTING(      0x1800, DEF_STR( Medium_Easy ) )
192192   PORT_DIPSETTING(      0x2800, DEF_STR( Normal ) )
r29404r29405
196196   PORT_DIPSETTING(      0x2000, DEF_STR( Very_Hard ) )
197197   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
198198   PORT_SERVICE_DIPLOC(  0x4000, IP_ACTIVE_LOW, "SW2:2" )
199   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:1")
199   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW2:1")
200200   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
201201   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
202202
trunk/src/mame/drivers/mpu4misc.c
r29404r29405
373373GAME_CUSTOM( 199?, m4shkwav__a,    m4shkwav,   "swave_v210_11376_0bb3_nlv.bin",    0x0000, 0x040000, CRC(3fcaf973) SHA1(28258c8c60e6b542e1789cd8a4cfd530d1ed6084), "Qps","Shockwave (Qps) (MPU4) (set 2)" )
374374GAME_CUSTOM( 199?, m4shkwav__b,    m4shkwav,   "swsplv.bin",                       0x0000, 0x040000, CRC(1e33e93f) SHA1(3e87f8ed35da776e1968c9574c140cc3984ea8de), "Qps","Shockwave (Qps) (MPU4) (set 3)" )
375375//This rom is possibly bad, data content isn't multiple of 0x800, padding with low bits rather than high
376   ROM_START( m4shkwav__c )
377      ROM_REGION( 0x080000, "maincpu", 0 )
378      ROM_LOAD( "sho1_0lv.bin", 0x0000, 0x080000, BAD_DUMP CRC(a76d8544) SHA1(8277a2ce311840b8405a087d3dc0bbf97054ad87) )
379      M4SHKWAV_EXTRA_ROMS
380   ROM_END
376   ROM_START( m4shkwav__c )
377      ROM_REGION( 0x080000, "maincpu", 0 )
378      ROM_LOAD( "sho1_0lv.bin", 0x0000, 0x080000, BAD_DUMP CRC(a76d8544) SHA1(8277a2ce311840b8405a087d3dc0bbf97054ad87) )
379      M4SHKWAV_EXTRA_ROMS
380   ROM_END
381381GAME(199?, m4shkwav__c, m4shkwav ,mod4oki ,mpu4 , mpu4_state,m4default_big ,ROT0,"Qps","Shockwave (Qps) (MPU4) (set 4)",GAME_FLAGS )
382382GAME_CUSTOM( 199?, m4shkwav__d,    m4shkwav,   "swave_v300_1552_13ed_nlv.bin",     0x0000, 0x040000, CRC(b0e03f04) SHA1(fdd113af30fd9e87b171ecdf3be7e720366476b3), "Qps","Shockwave (Qps) (MPU4) (set 5)" )
383383GAME_CUSTOM( 199?, m4shkwav__e,    m4shkwav,   "swave_v300_1555_119d_lv.bin",      0x0000, 0x040000, CRC(45b786d4) SHA1(24fd4fdea684103334385ca329f384796b496e2c), "Qps","Shockwave (Qps) (MPU4) (set 6)" )
trunk/src/mame/drivers/warpwarp.c
r29404r29405
772772   MCFG_SCREEN_PALETTE("palette")
773773
774774   MCFG_GFXDECODE_ADD("gfxdecode", "palette", color)
775   
775
776776   MCFG_PALETTE_ADD("palette", 2*256+1)
777777   MCFG_PALETTE_INIT_OWNER(warpwarp_state,warpwarp)
778778   MCFG_VIDEO_START_OVERRIDE(warpwarp_state,warpwarp)
trunk/src/mame/drivers/taitottl.c
r29404r29405
11/***************************************************************************
2
2
33 Taito Discrete Hardware Games
4 
5 
4
5
66 Game Name(s)                                Part #'s    Data      PROM/ROM Chip Numbers
77 ------------------------------------------+-----------+---------+---------------------------------------
8 Acrobat (1978)                                          UNKNOWN             
8 Acrobat (1978)                                          UNKNOWN
99 Astro Race (1973)                                       UNKNOWN
1010 Avenger (1976) - Vertical                   EG-1020     UNKNOWN
1111 Attack (1976)                                           UNKNOWN
r29404r29405
3737 Wall Block (1978)                                       UNKNOWN
3838 Western Gun (1975)                                      UNKNOWN
3939 Zun Zun Block (1979)                                    YES        3 - (2 x 512bytes, 1 x 32bytes)
40
40
4141***************************************************************************/
4242
4343
r29404r29405
7777public:
7878   taitottl_state(const machine_config &mconfig, device_type type, const char *tag)
7979   : driver_device(mconfig, type, tag),
80     m_maincpu(*this, "maincpu"),
81     m_video(*this, "fixfreq")
80      m_maincpu(*this, "maincpu"),
81      m_video(*this, "fixfreq")
8282   {
8383   }
84   
84
8585   // devices
8686   required_device<netlist_mame_device_t> m_maincpu;
8787   required_device<fixedfreq_device> m_video;
88   
88
8989protected:
90   
90
9191   // driver_device overrides
9292   virtual void machine_start();
9393   virtual void machine_reset();
94   
94
9595   virtual void video_start();
96   
96
9797private:
98   
98
9999};
100100
101101
102102static NETLIST_START(taitottl)
103103   SOLVER(Solver, 48000)
104//   PARAM(Solver.FREQ, 48000)
104//  PARAM(Solver.FREQ, 48000)
105105   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
106106
107107   // schematics
108108   //...
109109
110   //   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
111   //   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
110   //  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
111   //  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
112112NETLIST_END()
113113
114114
r29404r29405
138138
139139
140140/***************************************************************************
141
141
142142 Game driver(s)
143
143
144144 ***************************************************************************/
145145
146146/*
147 
148 label   loc. Part #
147
148 label  loc. Part #
149149 ==========================================================
150 CR11   N5   74s287      yes, it says CRxx not GNxx
151 GN10   H5   5623
152 GN09   N6   soldered in
153 GN08   J7   IM5200CJG
154 GN07   L9   soldered in
155 GN06   H6   7621   
156 GN05   G9   74s287     
157 GN04   F9   7643
158 GN03   D9   7621
159 GN02   C9   74s287     
160 GN01   B9   7643
161 
150 CR11   N5  74s287      yes, it says CRxx not GNxx
151 GN10   H5  5623
152 GN09   N6  soldered in
153 GN08   J7  IM5200CJG
154 GN07   L9  soldered in
155 GN06   H6  7621
156 GN05   G9  74s287
157 GN04   F9  7643
158 GN03   D9  7621
159 GN02   C9  74s287
160 GN01   B9  7643
161
162162*/
163163
164164ROM_START( gunman )
r29404r29405
180180   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
181181
182182   ROM_REGION( 0x0800, "roms", ROMREGION_ERASE00 )
183   ROM_LOAD( "tl01.4a",     0x0000, 0x0800, CRC(65b730f7) SHA1(f82931c9a128021c97d1d41b5eac05df55dd5994) )   // MMI 6353
183   ROM_LOAD( "tl01.4a",     0x0000, 0x0800, CRC(65b730f7) SHA1(f82931c9a128021c97d1d41b5eac05df55dd5994) ) // MMI 6353
184184ROM_END
185185
186186
trunk/src/mame/drivers/cbuster.c
r29404r29405
322322   MCFG_DECO16IC_ADD("tilegen1", twocrude_deco16ic_tilegen1_intf)
323323   MCFG_DECO16IC_GFXDECODE("gfxdecode")
324324   MCFG_DECO16IC_PALETTE("palette")
325   
325
326326   MCFG_DECO16IC_ADD("tilegen2", twocrude_deco16ic_tilegen2_intf)
327327   MCFG_DECO16IC_GFXDECODE("gfxdecode")
328328   MCFG_DECO16IC_PALETTE("palette")
trunk/src/mame/drivers/ghosteo.c
r29404r29405
273273      case 0xFF :
274274      {
275275         nand.mode = NAND_M_INIT;
276          m_s3c2410->frnb_w(1);
276            m_s3c2410->frnb_w(1);
277277      }
278278      break;
279279      case 0x00 :
trunk/src/mame/drivers/onetwo.c
r29404r29405
7272   required_device<cpu_device> m_audiocpu;
7373   required_device<gfxdecode_device> m_gfxdecode;
7474   required_device<palette_device> m_palette;
75   
75
7676   DECLARE_WRITE8_MEMBER(onetwo_fgram_w);
7777   DECLARE_WRITE8_MEMBER(onetwo_cpubank_w);
7878   DECLARE_WRITE8_MEMBER(onetwo_coin_counters_w);
trunk/src/mame/drivers/nbmj8891.c
r29404r29405
1313   two don't run on the same hardware. mjcamera is in nbmj8688.c.
1414
1515- In mjfocus(Medal Type), sometimes CPU's hands are forced out from the screen.
16  This is correct behaviour.   
17 
16  This is correct behaviour.
17
1818TODO:
1919
2020- Telmajan cannot set to JAMMA type. I don't know why.
trunk/src/mame/drivers/gunsmoke.c
r29404r29405
313313   MCFG_SCREEN_PALETTE("palette")
314314
315315   MCFG_GFXDECODE_ADD("gfxdecode", "palette", gunsmoke)
316   
316
317317   MCFG_PALETTE_ADD("palette", 32*4+16*16+16*16)
318318   MCFG_PALETTE_INDIRECT_ENTRIES(256)
319319   MCFG_PALETTE_INIT_OWNER(gunsmoke_state, gunsmoke)
trunk/src/mame/drivers/deco_ld.c
r29404r29405
141141   required_device<gfxdecode_device> m_gfxdecode;
142142   required_device<screen_device> m_screen;
143143   required_device<palette_device> m_palette;
144   
144
145145   UINT8 m_laserdisc_data;
146146   int m_nmimask;
147147   DECLARE_WRITE8_MEMBER(rblaster_sound_w);
r29404r29405
266266/* same as Burger Time HW */
267267WRITE8_MEMBER(deco_ld_state::decold_palette_w)
268268{
269   m_palette->write(space, offset, UINT8(~data));
269   m_palette->write(space, offset, UINT8(~data));
270270}
271271
272272/* unknown, but certainly related to audiocpu somehow */
trunk/src/mame/drivers/seta.c
r29404r29405
22082208   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1")                 // P1
22092209   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2")                 // P2
22102210   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS")              // Coins
2211//   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w)   // Sound - not on this bootleg
2211//  AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w)   // Sound - not on this bootleg
22122212   AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram")  // Palette
22132213   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritecode_r16, spritecode_w16) // Sprites Code + X + Attr
22142214/**/AM_RANGE(0xd00000, 0xd00001) AM_RAM // ? 0x4000
r29404r29405
80368036static ADDRESS_MAP_START( blockcarb_sound_portmap, AS_IO, 8, seta_state )
80378037   ADDRESS_MAP_UNMAP_HIGH
80388038   ADDRESS_MAP_GLOBAL_MASK(0xff)
8039//   AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
8040//   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_READ(wiggie_soundlatch_r)
8039//  AM_RANGE(0x00, 0x01) AM_MIRROR(0x3e) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
8040//  AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3f) AM_READ(wiggie_soundlatch_r)
80418041ADDRESS_MAP_END
80428042
80438043static MACHINE_CONFIG_DERIVED( blockcarb, blockcar )
r29404r29405
1010110101   ROM_LOAD16_BYTE( "tl5.bin",  0x080001, 0x040000, CRC(9369e8dc) SHA1(645ae72a8b49ec43c26cdee5b6cb8cca5f46e542) )
1010210102
1010310103   ROM_REGION( 0x100000, "oki", 0 )  /* 6295 samples */
10104   ROM_LOAD( "tl7.bin",  0x000000, 0x040000, CRC(41e899dc) SHA1(36c8161dcb68cdc312c7d1177dbcfb9b62b18f05) )   // == so2_09.12b  mercs      Mercs (World 900302)
10104   ROM_LOAD( "tl7.bin",  0x000000, 0x040000, CRC(41e899dc) SHA1(36c8161dcb68cdc312c7d1177dbcfb9b62b18f05) )    // == so2_09.12b  mercs      Mercs (World 900302)
1010510105
1010610106   ROM_REGION( 0x10000, "audiocpu", 0 )
10107   ROM_LOAD( "tl8.bin",  0x000000, 0x010000, CRC(d09d7c7a) SHA1(8e8532be08818c855d9c3ce45716eb07cfab5767) )   //cpu prg
10107   ROM_LOAD( "tl8.bin",  0x000000, 0x010000, CRC(d09d7c7a) SHA1(8e8532be08818c855d9c3ce45716eb07cfab5767) )    //cpu prg
1010810108ROM_END
1010910109
1011010110
trunk/src/mame/drivers/rohga.c
r29404r29405
840840   MCFG_DECO16IC_ADD("tilegen1", rohga_deco16ic_tilegen1_intf)
841841   MCFG_DECO16IC_GFXDECODE("gfxdecode")
842842   MCFG_DECO16IC_PALETTE("palette")
843   
843
844844   MCFG_DECO16IC_ADD("tilegen2", rohga_deco16ic_tilegen2_intf)
845845   MCFG_DECO16IC_GFXDECODE("gfxdecode")
846846   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
889889   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
890890   MCFG_SCREEN_SIZE(40*8, 32*8)
891891   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
892   MCFG_SCREEN_UPDATE_DRIVER(rohga_state, screen_update_wizdfire)   
892   MCFG_SCREEN_UPDATE_DRIVER(rohga_state, screen_update_wizdfire)
893893
894894   MCFG_GFXDECODE_ADD("gfxdecode", "palette", wizdfire)
895895   MCFG_PALETTE_ADD("palette", 2048)
r29404r29405
900900   MCFG_DECO16IC_ADD("tilegen1", rohga_deco16ic_tilegen1_intf)
901901   MCFG_DECO16IC_GFXDECODE("gfxdecode")
902902   MCFG_DECO16IC_PALETTE("palette")
903   
903
904904   MCFG_DECO16IC_ADD("tilegen2", rohga_deco16ic_tilegen2_intf)
905905   MCFG_DECO16IC_GFXDECODE("gfxdecode")
906906   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
968968   MCFG_DECO16IC_ADD("tilegen1", nitrobal_deco16ic_tilegen1_intf)
969969   MCFG_DECO16IC_GFXDECODE("gfxdecode")
970970   MCFG_DECO16IC_PALETTE("palette")
971   
971
972972   MCFG_DECO16IC_ADD("tilegen2", nitrobal_deco16ic_tilegen2_intf)
973973   MCFG_DECO16IC_GFXDECODE("gfxdecode")
974974   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
10401040   MCFG_DECO16IC_ADD("tilegen1", rohga_deco16ic_tilegen1_intf)
10411041   MCFG_DECO16IC_GFXDECODE("gfxdecode")
10421042   MCFG_DECO16IC_PALETTE("palette")
1043   
1043
10441044   MCFG_DECO16IC_ADD("tilegen2", rohga_deco16ic_tilegen2_intf)
10451045   MCFG_DECO16IC_GFXDECODE("gfxdecode")
10461046   MCFG_DECO16IC_PALETTE("palette")
trunk/src/mame/drivers/asteroid.c
r29404r29405
645645
646646   MCFG_DEVICE_ADD("dvg", DVG, 0)
647647   MCFG_AVGDVG_VECTOR("vector")
648   
648
649649   /* sound hardware */
650650   MCFG_SPEAKER_STANDARD_MONO("mono")
651651
trunk/src/mame/drivers/megatech.c
r29404r29405
8888      TIMER_Z80_RUN_STATE,
8989      TIMER_Z80_STOP_STATE
9090   };
91   
91
9292   mtech_state(const machine_config &mconfig, device_type type, const char *tag)
9393   : md_base_state(mconfig, type, tag),
9494   m_vdp1(*this, "vdp1"),
9595   m_bioscpu(*this, "mtbios")
9696   { }
97   
97
9898   DECLARE_WRITE_LINE_MEMBER( snd_int_callback );
9999   DECLARE_WRITE_LINE_MEMBER( bios_int_callback );
100100   DECLARE_READ8_MEMBER(cart_select_r);
r29404r29405
113113   DECLARE_READ8_MEMBER(sms_count_r);
114114   DECLARE_READ8_MEMBER(sms_ioport_dc_r);
115115   DECLARE_READ8_MEMBER(sms_ioport_dd_r);
116   DECLARE_WRITE8_MEMBER(mt_sms_standard_rom_bank_w);   
117   
116   DECLARE_WRITE8_MEMBER(mt_sms_standard_rom_bank_w);
117
118118   DECLARE_DRIVER_INIT(mt_crt);
119119   DECLARE_DRIVER_INIT(mt_slot);
120120   DECLARE_MACHINE_RESET(megatech);
r29404r29405
122122   UINT32 screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
123123   UINT32 screen_update_menu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
124124   void screen_eof_main(screen_device &screen, bool state);
125   
125
126126protected:
127127   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
128   
129private:   
128
129private:
130130   UINT8 m_mt_cart_select_reg;
131131   UINT32 m_bios_port_ctrl;
132132   int m_current_game_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
133133   UINT32 m_bios_ctrl_inputs;
134134   UINT8 m_bios_ctrl[6];
135135   int m_mt_bank_addr;
136   
136
137137   int m_cart_is_genesis[8];
138   
138
139139   void set_genz80_as_md();
140140   void set_genz80_as_sms();
141   
141
142142   TIMER_CALLBACK_MEMBER(z80_run_state);
143143   TIMER_CALLBACK_MEMBER(z80_stop_state);
144   
144
145145   UINT8* m_banked_ram;
146146   UINT8* sms_mainram;
147147   UINT8* sms_rom;
148   
148
149149   required_device<sega315_5124_device> m_vdp1;
150   required_device<cpu_device>          m_bioscpu;   
150   required_device<cpu_device>          m_bioscpu;
151151};
152152
153153
r29404r29405
328328{
329329   int bank = data & 0x1f;
330330   //logerror("bank w %02x %02x\n", offset, data);
331   
331
332332   sms_mainram[0x1ffc + offset] = data;
333333   switch (offset)
334334   {
r29404r29405
347347      case 3:
348348         memcpy(sms_rom+0x8000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
349349         break;
350         
350
351351   }
352352}
353353
r29404r29405
356356   address_space &prg = machine().device("genesis_snd_z80")->memory().space(AS_PROGRAM);
357357   address_space &io = machine().device("genesis_snd_z80")->memory().space(AS_IO);
358358   sn76496_base_device *sn = machine().device<sn76496_base_device>("snsnd");
359   
359
360360   // main ram area
361361   sms_mainram = (UINT8 *)prg.install_ram(0xc000, 0xdfff, 0, 0x2000);
362362   memset(sms_mainram,0x00,0x2000);
363   
363
364364   // fixed rom bank area
365365   sms_rom = (UINT8 *)prg.install_rom(0x0000, 0xbfff, NULL);
366   
366
367367   memcpy(sms_rom, machine().root_device().memregion("maincpu")->base(), 0xc000);
368   
368
369369   prg.install_write_handler(0xfffc, 0xffff, write8_delegate(FUNC(mtech_state::mt_sms_standard_rom_bank_w),this));
370   
370
371371   // ports
372372   io.install_read_handler      (0x40, 0x41, 0xff, 0x3e, read8_delegate(FUNC(mtech_state::sms_count_r),this));
373373   io.install_write_handler     (0x40, 0x41, 0xff, 0x3e, write8_delegate(FUNC(sn76496_device::write),sn));
374374   io.install_readwrite_handler (0x80, 0x80, 0xff, 0x3e, read8_delegate(FUNC(sega315_5124_device::vram_read),(sega315_5124_device *)m_vdp), write8_delegate(FUNC(sega315_5124_device::vram_write),(sega315_5124_device *)m_vdp));
375375   io.install_readwrite_handler (0x81, 0x81, 0xff, 0x3e, read8_delegate(FUNC(sega315_5124_device::register_read),(sega315_5124_device *)m_vdp), write8_delegate(FUNC(sega315_5124_device::register_write),(sega315_5124_device *)m_vdp));
376   
376
377377   io.install_read_handler      (0x10, 0x10, read8_delegate(FUNC(mtech_state::sms_ioport_dd_r),this)); // super tetris
378   
378
379379   io.install_read_handler      (0xdc, 0xdc, read8_delegate(FUNC(mtech_state::sms_ioport_dc_r),this));
380380   io.install_read_handler      (0xdd, 0xdd, read8_delegate(FUNC(mtech_state::sms_ioport_dd_r),this));
381381   io.install_read_handler      (0xde, 0xde, read8_delegate(FUNC(mtech_state::sms_ioport_dd_r),this));
r29404r29405
391391
392392   prg.install_readwrite_bank(0x0000, 0x1fff, "bank1");
393393   machine().root_device().membank("bank1")->set_base(m_genz80.z80_prgram);
394   
394
395395   prg.install_ram(0x0000, 0x1fff, m_genz80.z80_prgram);
396396
397397   prg.install_readwrite_handler(0x4000, 0x4003, read8_delegate(FUNC(ym2612_device::read),ym2612), write8_delegate(FUNC(ym2612_device::write),ym2612));
r29404r29405
558558READ8_MEMBER(mtech_state::bios_joypad_r )
559559{
560560   UINT8 retdata = 0;
561   
561
562562   if (m_bios_port_ctrl == 0x55)
563563   {
564564      /* A keys */
r29404r29405
570570         retdata = (m_io_pad_3b[0]->read() & 0x3f) | ((m_io_pad_3b[1]->read() & 0x03) << 6);
571571      else
572572         retdata = ((m_io_pad_3b[1]->read() & 0x3c) >> 2) | 0xf0;
573     
573
574574   }
575575   return retdata;
576576}
r29404r29405
637637      {
638638         UINT32* lineptr = &bitmap.pix32(y);
639639         UINT32* srcptr =  &m_vdp->get_bitmap().pix32(y + SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT);
640         
640
641641         for (int x = 0; x < SEGA315_5124_WIDTH; x++)
642642            lineptr[x] = srcptr[x];
643      }   
643      }
644644#endif
645645   }
646646   return 0;
trunk/src/mame/drivers/vamphalf.c
r29404r29405
9090   optional_shared_ptr<UINT16> m_wram;
9191   optional_shared_ptr<UINT32> m_tiles32;
9292   optional_shared_ptr<UINT32> m_wram32;
93   
93
9494   required_device<cpu_device> m_maincpu;
9595   optional_device<qs1000_device> m_qs1000;
9696   optional_device<okim6295_device> m_oki;
r29404r29405
9898   required_device<eeprom_serial_93cxx_device> m_eeprom;
9999   required_device<gfxdecode_device> m_gfxdecode;
100100   required_device<palette_device> m_palette;
101   
101
102102   int m_flip_bit;
103103   int m_flipscreen;
104104   int m_palshift;
trunk/src/mame/drivers/1942.c
r29404r29405
7272#include "includes/1942.h"
7373
7474#define NLFILT(RA, R1, C1, R2) \
75    NET_C(RA.1, V5)             \
76    NET_C(RA.2, R1.1)           \
77    NET_C(R1.2, GND)            \
78    NET_C(R1.1, C1.1)           \
79    NET_C(C1.2, R2.1)
75   NET_C(RA.1, V5)             \
76   NET_C(RA.2, R1.1)           \
77   NET_C(R1.2, GND)            \
78   NET_C(R1.1, C1.1)           \
79   NET_C(C1.2, R2.1)
8080
8181static NETLIST_START(nl_1942)
8282
83    /* Standard stuff */
83   /* Standard stuff */
8484
85    SOLVER(Solver, 48000)
86    ANALOG_INPUT(V5, 5)
85   SOLVER(Solver, 48000)
86   ANALOG_INPUT(V5, 5)
8787
88    /* AY 8910 internal resistors */
88   /* AY 8910 internal resistors */
8989
90    RES(R_AY1_1, 1000);
91    RES(R_AY1_2, 1000);
92    RES(R_AY1_3, 1000);
93    RES(R_AY2_1, 1000);
94    RES(R_AY2_2, 1000);
95    RES(R_AY2_3, 1000);
90   RES(R_AY1_1, 1000);
91   RES(R_AY1_2, 1000);
92   RES(R_AY1_3, 1000);
93   RES(R_AY2_1, 1000);
94   RES(R_AY2_2, 1000);
95   RES(R_AY2_3, 1000);
9696
97    RES(R2, 220000)
98    RES(R3, 220000)
99    RES(R4, 220000)
100    RES(R5, 220000)
101    RES(R6, 220000)
102    RES(R7, 220000)
97   RES(R2, 220000)
98   RES(R3, 220000)
99   RES(R4, 220000)
100   RES(R5, 220000)
101   RES(R6, 220000)
102   RES(R7, 220000)
103103
104    RES(R11, 10000)
105    RES(R12, 10000)
106    RES(R13, 10000)
107    RES(R14, 10000)
108    RES(R15, 10000)
109    RES(R16, 10000)
104   RES(R11, 10000)
105   RES(R12, 10000)
106   RES(R13, 10000)
107   RES(R14, 10000)
108   RES(R15, 10000)
109   RES(R16, 10000)
110110
111    CAP(CC7, 10e-6)
112    CAP(CC8, 10e-6)
113    CAP(CC9, 10e-6)
114    CAP(CC10, 10e-6)
115    CAP(CC11, 10e-6)
116    CAP(CC12, 10e-6)
111   CAP(CC7, 10e-6)
112   CAP(CC8, 10e-6)
113   CAP(CC9, 10e-6)
114   CAP(CC10, 10e-6)
115   CAP(CC11, 10e-6)
116   CAP(CC12, 10e-6)
117117
118    NLFILT(R_AY2_3, R13, CC7, R2)
119    NLFILT(R_AY2_2, R15, CC8, R3)
120    NLFILT(R_AY2_1, R11, CC9, R4)
118   NLFILT(R_AY2_3, R13, CC7, R2)
119   NLFILT(R_AY2_2, R15, CC8, R3)
120   NLFILT(R_AY2_1, R11, CC9, R4)
121121
122    NLFILT(R_AY1_3, R12, CC10, R5)
123    NLFILT(R_AY1_2, R14, CC11, R6)
124    NLFILT(R_AY1_1, R16, CC12, R7)
122   NLFILT(R_AY1_3, R12, CC10, R5)
123   NLFILT(R_AY1_2, R14, CC11, R6)
124   NLFILT(R_AY1_1, R16, CC12, R7)
125125
126    POT(VR, 2000)
127    NET_C(VR.3, GND)
126   POT(VR, 2000)
127   NET_C(VR.3, GND)
128128
129    NET_C(R2.2, VR.1)
130    NET_C(R3.2, VR.1)
131    NET_C(R4.2, VR.1)
132    NET_C(R5.2, VR.1)
133    NET_C(R6.2, VR.1)
134    NET_C(R7.2, VR.1)
129   NET_C(R2.2, VR.1)
130   NET_C(R3.2, VR.1)
131   NET_C(R4.2, VR.1)
132   NET_C(R5.2, VR.1)
133   NET_C(R6.2, VR.1)
134   NET_C(R7.2, VR.1)
135135
136    CAP(CC6, 10e-6)
137    RES(R1, 100000)
136   CAP(CC6, 10e-6)
137   RES(R1, 100000)
138138
139    NET_C(CC6.1, VR.2)
140    NET_C(CC6.2, R1.1)
141    NET_C(R1.2, GND)
139   NET_C(CC6.1, VR.2)
140   NET_C(CC6.2, R1.1)
141   NET_C(R1.2, GND)
142142
143143NETLIST_END()
144144
r29404r29405
519519
520520static const ay8910_interface ay8910_config =
521521{
522    AY8910_RESISTOR_OUTPUT,
523    AY8910_DEFAULT_LOADS,
524    DEVCB_NULL,
525    DEVCB_NULL,
526    DEVCB_NULL,
527    DEVCB_NULL
522   AY8910_RESISTOR_OUTPUT,
523   AY8910_DEFAULT_LOADS,
524   DEVCB_NULL,
525   DEVCB_NULL,
526   DEVCB_NULL,
527   DEVCB_NULL
528528};
529529
530530static MACHINE_CONFIG_START( 1942, _1942_state )
r29404r29405
541541
542542   /* video hardware */
543543   MCFG_GFXDECODE_ADD("gfxdecode", "palette", 1942)
544   
544
545545   MCFG_PALETTE_ADD("palette", 64*4+4*32*8+16*16)
546546   MCFG_PALETTE_INDIRECT_ENTRIES(256)
547547   MCFG_PALETTE_INIT_OWNER(_1942_state, 1942)
r29404r29405
557557   /* sound hardware */
558558   MCFG_SPEAKER_STANDARD_MONO("mono")
559559
560    MCFG_SOUND_ADD("ay1", AY8910, AUDIO_CLOCK)  /* 1.5 MHz */
561    MCFG_SOUND_CONFIG(ay8910_config)
562    MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
563    MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
564    MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2)
565    MCFG_SOUND_ADD("ay2", AY8910, AUDIO_CLOCK)  /* 1.5 MHz */
566    MCFG_SOUND_CONFIG(ay8910_config)
567    MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 3)
568    MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 4)
569    MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 5)
560   MCFG_SOUND_ADD("ay1", AY8910, AUDIO_CLOCK)  /* 1.5 MHz */
561   MCFG_SOUND_CONFIG(ay8910_config)
562   MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
563   MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
564   MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2)
565   MCFG_SOUND_ADD("ay2", AY8910, AUDIO_CLOCK)  /* 1.5 MHz */
566   MCFG_SOUND_CONFIG(ay8910_config)
567   MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 3)
568   MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 4)
569   MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 5)
570570
571    /* NETLIST configuration using internal AY8910 resistor values */
571   /* NETLIST configuration using internal AY8910 resistor values */
572572
573    MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
574    MCFG_NETLIST_SETUP(nl_1942)
575    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0)
573   MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
574   MCFG_NETLIST_SETUP(nl_1942)
575   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0)
576576
577    MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY1_1.R")
578    MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY1_2.R")
579    MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY1_3.R")
580    MCFG_NETLIST_STREAM_INPUT("snd_nl", 3, "R_AY2_1.R")
581    MCFG_NETLIST_STREAM_INPUT("snd_nl", 4, "R_AY2_2.R")
582    MCFG_NETLIST_STREAM_INPUT("snd_nl", 5, "R_AY2_3.R")
577   MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY1_1.R")
578   MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY1_2.R")
579   MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY1_3.R")
580   MCFG_NETLIST_STREAM_INPUT("snd_nl", 3, "R_AY2_1.R")
581   MCFG_NETLIST_STREAM_INPUT("snd_nl", 4, "R_AY2_2.R")
582   MCFG_NETLIST_STREAM_INPUT("snd_nl", 5, "R_AY2_3.R")
583583
584    MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "R1.1")
585    MCFG_NETLIST_ANALOG_MULT_OFFSET(100000.0, 0.0)
584   MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "R1.1")
585   MCFG_NETLIST_ANALOG_MULT_OFFSET(100000.0, 0.0)
586586
587587MACHINE_CONFIG_END
588588
trunk/src/mame/drivers/bloodbro.c
r29404r29405
472472   MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
473473   MCFG_SEIBU_CRTC_LAYER_EN_CB(WRITE16(bloodbro_state, layer_en_w))
474474   MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(WRITE16(bloodbro_state, layer_scroll_w))
475   
476475
476
477477   MCFG_GFXDECODE_ADD("gfxdecode", "palette", bloodbro)
478478   MCFG_PALETTE_ADD("palette", 2048)
479479   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
trunk/src/mame/drivers/blockhl.c
r29404r29405
187187
188188   m_paletteram.resize(m_palette->entries() * 2);
189189   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
190   
190
191191   save_item(NAME(m_paletteram));
192192   save_item(NAME(m_palette_selected));
193193   save_item(NAME(m_rombank));
trunk/src/mame/drivers/dai3wksi.c
r29404r29405
6767   optional_device<sn76477_device> m_ic79;
6868   optional_device<sn76477_device> m_ic80;
6969   optional_device<sn76477_device> m_ic81;
70   
70
7171   /* video */
7272   required_shared_ptr<UINT8> m_dai3wksi_videoram;
7373   int         m_dai3wksi_flipscreen;
r29404r29405
8383   DECLARE_WRITE8_MEMBER(dai3wksi_audio_1_w);
8484   DECLARE_WRITE8_MEMBER(dai3wksi_audio_2_w);
8585   DECLARE_WRITE8_MEMBER(dai3wksi_audio_3_w);
86   
86
8787   /* i/o ports */
8888   required_ioport m_in2;
89   
89
9090   virtual void machine_start();
9191   virtual void machine_reset();
9292};
trunk/src/mame/drivers/aleisttl.c
r29404r29405
11/***************************************************************************
2
2
33 Allied Leisure discrete hardware games
4
4
55 Hesitation (1974)                AL-6500?
66 Paddle Battle (1973)
77 Robot (1975)                     AL-7500
r29404r29405
1010 Super Soccer (1973)
1111 Tennis Tourney (1973)
1212 Zap (1974)                       AL-6500
13
13
1414***************************************************************************/
1515
1616
r29404r29405
5050public:
5151   sburners_state(const machine_config &mconfig, device_type type, const char *tag)
5252   : driver_device(mconfig, type, tag),
53     m_maincpu(*this, "maincpu"),
54     m_video(*this, "fixfreq")
53      m_maincpu(*this, "maincpu"),
54      m_video(*this, "fixfreq")
5555   {
5656   }
57   
57
5858   // devices
5959   required_device<netlist_mame_device_t> m_maincpu;
6060   required_device<fixedfreq_device> m_video;
61   
61
6262protected:
63   
63
6464   // driver_device overrides
6565   virtual void machine_start();
6666   virtual void machine_reset();
67   
67
6868   virtual void video_start();
69   
69
7070private:
71   
71
7272};
7373
7474
7575static NETLIST_START(sburners)
7676   SOLVER(Solver, 48000)
77//   PARAM(Solver.FREQ, 48000)
77//  PARAM(Solver.FREQ, 48000)
7878   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
7979
8080   // schematics
8181   //...
8282
83//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
84//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
83//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
84//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8585NETLIST_END()
8686
8787
r29404r29405
111111
112112
113113/***************************************************************************
114
114
115115 Game driver(s)
116
116
117117 ***************************************************************************/
118118
119119
trunk/src/mame/drivers/m62.c
r29404r29405
10451045
10461046   /* video hardware */
10471047   MCFG_GFXDECODE_MODIFY("gfxdecode", lotlot)
1048   
1048
10491049   MCFG_PALETTE_MODIFY("palette")
10501050   MCFG_PALETTE_ENTRIES(768)
10511051
trunk/src/mame/drivers/exidyttl.c
r29404r29405
1313 Super Death Chase (1977)
1414 Table Football (1975)
1515 Tv Pinball (1974)
16
16
1717***************************************************************************/
1818
1919
r29404r29405
5353public:
5454   exidyttl_state(const machine_config &mconfig, device_type type, const char *tag)
5555   : driver_device(mconfig, type, tag),
56     m_maincpu(*this, "maincpu"),
57     m_video(*this, "fixfreq")
56      m_maincpu(*this, "maincpu"),
57      m_video(*this, "fixfreq")
5858   {
5959   }
6060
6161   // devices
6262   required_device<netlist_mame_device_t> m_maincpu;
6363   required_device<fixedfreq_device> m_video;
64   
64
6565protected:
6666
6767   // driver_device overrides
r29404r29405
7777
7878static NETLIST_START(attack)
7979   SOLVER(Solver, 48000)
80//   PARAM(Solver.FREQ, 48000)
80//  PARAM(Solver.FREQ, 48000)
8181   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
8282
8383   // schematics
8484   //...
8585
86//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
87//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
86//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, exidyttl_state, sound_cb, "")
87//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
8888NETLIST_END()
8989
9090
r29404r29405
105105static MACHINE_CONFIG_START( attack, exidyttl_state )
106106
107107   /* basic machine hardware */
108    MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
108   MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
109109   MCFG_NETLIST_SETUP(attack)
110110
111111   /* video hardware */
r29404r29405
147147/***********
148148
149149 Exidy Death Race 1976
150
150
151151 Drawing Name
152152 ------------
153 6331-36.E7   32x8   Right Gremlin
154 6301-91.J10   256x4
155 
156 6331-36.R7   32x8   Left Gremlin
157 6301-91.V10   256x4
158 
159 6301-92.V5      P1 (left car)
153 6331-36.E7 32x8    Right Gremlin
154 6301-91.J10    256x4
155
156 6331-36.R7 32x8    Left Gremlin
157 6301-91.V10    256x4
158
159 6301-92.V5     P1 (left car)
160160 6331-35.T7
161 
162 6301-92.J5      P2 (right car)
161
162 6301-92.J5     P2 (right car)
163163 6331-35.G7
164 
165 6301-97.M11      Image Generation
164
165 6301-97.M11        Image Generation
166166 6301-98.L11
167167 6301-99.K11
168168 6301-100.J11
169 
170 6331-33.P14      Score & Timer
171 
172 6331-31.A11      Timing / Sync
169
170 6331-33.P14        Score & Timer
171
172 6331-31.A11        Timing / Sync
173173 6331-32.C12
174 
175***********/
176174
175***********/
177176
177
178178ROM_START( deathrac )
179179   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
180180
trunk/src/mame/drivers/dwarfd.c
r29404r29405
307307      : driver_device(mconfig, type, tag),
308308      m_maincpu(*this,"maincpu"),
309309      m_gfxdecode(*this, "gfxdecode"),
310      m_palette(*this, "palette")
310      m_palette(*this, "palette")
311311      { }
312312
313313   /* video-related */
r29404r29405
337337   required_device<cpu_device> m_maincpu;
338338   required_device<gfxdecode_device> m_gfxdecode;
339339   required_device<palette_device> m_palette;
340   
340
341341   DECLARE_WRITE8_MEMBER(i8275_preg_w);
342342   DECLARE_READ8_MEMBER(i8275_preg_r);
343343   DECLARE_WRITE8_MEMBER(i8275_creg_w);
trunk/src/mame/drivers/slapshot.c
r29404r29405
533533   MCFG_TC0640FIO_READ_2_CB(IOPORT("BUTTONS"))
534534   MCFG_TC0640FIO_READ_3_CB(IOPORT("SYSTEM"))
535535   MCFG_TC0640FIO_READ_7_CB(IOPORT("JOY"))
536   
536
537537   /* video hardware */
538538   MCFG_SCREEN_ADD("screen", RASTER)
539539   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mame/drivers/koftball.c
r29404r29405
179179   AM_RANGE(0x2da000, 0x2da003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)
180180
181181   AM_RANGE(0x2db000, 0x2db001) AM_WRITE(bmc_RAMDAC_offset_w) AM_SHARE("colorram")
182   AM_RANGE(0x2db002, 0x2db003) AM_READWRITE(bmc_RAMDAC_color_r, bmc_RAMDAC_color_w)
182   AM_RANGE(0x2db002, 0x2db003) AM_READWRITE(bmc_RAMDAC_color_r, bmc_RAMDAC_color_w)
183183   AM_RANGE(0x2db004, 0x2db005) AM_WRITENOP
184184   AM_RANGE(0x2dc000, 0x2dc001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00)
185185   AM_RANGE(0x2f0000, 0x2f0003) AM_READ_PORT("INPUTS")
r29404r29405
254254   MCFG_SCREEN_SIZE(64*8, 32*8)
255255   MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 30*8-1)
256256   MCFG_SCREEN_PALETTE("palette")
257   
257
258258   MCFG_PALETTE_ADD("palette", 256)
259259
260260   MCFG_GFXDECODE_ADD("gfxdecode", "palette", koftball)
261261
262262   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
263   
263
264264   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz)  // guessed chip type, clock not verified
265265   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
266266   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
trunk/src/mame/drivers/cninja.c
r29404r29405
960960   MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf)
961961   MCFG_DECO16IC_GFXDECODE("gfxdecode")
962962   MCFG_DECO16IC_PALETTE("palette")
963   
963
964964   MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf)
965965   MCFG_DECO16IC_GFXDECODE("gfxdecode")
966966   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
10281028   MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf)
10291029   MCFG_DECO16IC_GFXDECODE("gfxdecode")
10301030   MCFG_DECO16IC_PALETTE("palette")
1031   
1031
10321032   MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf)
10331033   MCFG_DECO16IC_GFXDECODE("gfxdecode")
10341034   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
10911091   MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf)
10921092   MCFG_DECO16IC_GFXDECODE("gfxdecode")
10931093   MCFG_DECO16IC_PALETTE("palette")
1094   
1094
10951095   MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf)
10961096   MCFG_DECO16IC_GFXDECODE("gfxdecode")
10971097   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
11411141   MCFG_DECO16IC_ADD("tilegen1", edrandy_deco16ic_tilegen1_intf)
11421142   MCFG_DECO16IC_GFXDECODE("gfxdecode")
11431143   MCFG_DECO16IC_PALETTE("palette")
1144   
1144
11451145   MCFG_DECO16IC_ADD("tilegen2", edrandy_deco16ic_tilegen2_intf)
11461146   MCFG_DECO16IC_GFXDECODE("gfxdecode")
11471147   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
12061206   MCFG_DECO16IC_ADD("tilegen1", robocop2_deco16ic_tilegen1_intf)
12071207   MCFG_DECO16IC_GFXDECODE("gfxdecode")
12081208   MCFG_DECO16IC_PALETTE("palette")
1209   
1209
12101210   MCFG_DECO16IC_ADD("tilegen2", robocop2_deco16ic_tilegen2_intf)
12111211   MCFG_DECO16IC_GFXDECODE("gfxdecode")
12121212   MCFG_DECO16IC_PALETTE("palette")
r29404r29405
12761276   MCFG_DECO16IC_ADD("tilegen1", mutantf_deco16ic_tilegen1_intf)
12771277   MCFG_DECO16IC_GFXDECODE("gfxdecode")
12781278   MCFG_DECO16IC_PALETTE("palette")
1279   
1279
12801280   MCFG_DECO16IC_ADD("tilegen2", mutantf_deco16ic_tilegen2_intf)
12811281   MCFG_DECO16IC_GFXDECODE("gfxdecode")
12821282   MCFG_DECO16IC_PALETTE("palette")
trunk/src/mame/drivers/nss.c
r29404r29405
311311   required_device<rp5h01_device> m_rp5h01;
312312   required_device<screen_device> m_screen;
313313   optional_device<palette_device> m_palette;
314   
314
315315   UINT8 m_wram_wp_flag;
316316   UINT8 *m_wram;
317317   UINT8 m_nmi_enable;
trunk/src/mame/drivers/go2000.c
r29404r29405
6262   required_device<cpu_device> m_maincpu;
6363   required_device<gfxdecode_device> m_gfxdecode;
6464   required_device<screen_device> m_screen;
65   required_device<palette_device> m_palette;   
65   required_device<palette_device> m_palette;
6666};
6767
6868
trunk/src/mame/drivers/tumblep.c
r29404r29405
312312   MCFG_DECO16IC_ADD("tilegen1", tumblep_deco16ic_tilegen1_intf)
313313   MCFG_DECO16IC_GFXDECODE("gfxdecode")
314314   MCFG_DECO16IC_PALETTE("palette")
315   
315
316316   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
317317   decospr_device::set_gfx_region(*device, 2);
318318   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
trunk/src/mame/drivers/deshoros.c
r29404r29405
275275   MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 16*8-1)
276276   MCFG_SCREEN_UPDATE_DRIVER(destiny_state, screen_update_destiny)
277277   MCFG_SCREEN_PALETTE("palette")
278   
278
279279   MCFG_PALETTE_ADD("palette", 16)
280280
281281
trunk/src/mame/drivers/igs_m027.c
r29404r29405
203203
204204void igs_m027_state::video_start_fearless()
205205{
206
207206}
208207
209208UINT32 igs_m027_state::screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
trunk/src/mame/drivers/smsmcorp.c
r29404r29405
249249   DECLARE_MACHINE_START(sureshot);
250250   UINT32 screen_update_sms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
251251   required_device<cpu_device> m_maincpu;
252   required_device<screen_device> m_screen;   
252   required_device<screen_device> m_screen;
253253};
254254
255255
trunk/src/mame/drivers/subsino2.c
r29404r29405
591591      layer_t *l = &m_layers[i];
592592
593593      l->tmap = &machine().tilemap().create(m_gfxdecode, i ?
594                                   tilemap_get_info_delegate(FUNC(subsino2_state::ss9601_get_tile_info_1),this) :
595                                   tilemap_get_info_delegate(FUNC(subsino2_state::ss9601_get_tile_info_0),this),
596                                   TILEMAP_SCAN_ROWS, 8,8, 0x80,0x40);
594                                    tilemap_get_info_delegate(FUNC(subsino2_state::ss9601_get_tile_info_1),this) :
595                                    tilemap_get_info_delegate(FUNC(subsino2_state::ss9601_get_tile_info_0),this),
596                                    TILEMAP_SCAN_ROWS, 8,8, 0x80,0x40);
597597
598598      l->tmap->set_transparent_pen(0);
599599
trunk/src/mame/drivers/pgm2.c
r29404r29405
11/* PGM 2 hardware.
22
3   Motherboard is bare bones stuff, and does not contain any ROMs.
4   The IGS036 used by the games is an ARM based CPU, like IGS027A used on PGM1 it has internal ROM.
5   Decryption should be correct in most cases, but the ARM mode code at the start of the external
6   ROMs is a bit weird, with many BNV instructions rather than jumps.  Maybe the ARM is customized,
7   the code has been 'NOPPED' out this way (BNV is Branch Never) or it's a different type of ARM?
8   
9    - Some of the THUMB code looks like THUMB2 code
10     eg
11       f004 BL (HI) 00004000
12      e51f B #fffffa3e
13      0434 LSL R4, R6, 16
14      0000 LSL R0, R0, 0
3    Motherboard is bare bones stuff, and does not contain any ROMs.
4    The IGS036 used by the games is an ARM based CPU, like IGS027A used on PGM1 it has internal ROM.
5    Decryption should be correct in most cases, but the ARM mode code at the start of the external
6    ROMs is a bit weird, with many BNV instructions rather than jumps.  Maybe the ARM is customized,
7    the code has been 'NOPPED' out this way (BNV is Branch Never) or it's a different type of ARM?
158
16      should be a 32-bit branch instruction with the 2nd dword used as data.
9     - Some of the THUMB code looks like THUMB2 code
10      eg
11        f004 BL (HI) 00004000
12        e51f B #fffffa3e
13        0434 LSL R4, R6, 16
14        0000 LSL R0, R0, 0
1715
16        should be a 32-bit branch instruction with the 2nd dword used as data.
1817
19   We need to determine where VRAM etc. map in order to attempt tests on the PCBs.
2018
19    We need to determine where VRAM etc. map in order to attempt tests on the PCBs.
2120
22   PGM2 Motherboard Components:
2321
24    IS61LV25616AL(SRAM)
25    IGS037(GFX PROCESSOR)
26    YMZ774-S(SOUND)
27    R5F21256SN(extra MCU for protection and ICcard communication)
28     - Appears to be refered to by the games as MPU
22    PGM2 Motherboard Components:
2923
30   Cartridges
31    IGS036 (MAIN CPU) (differs per game, internal code)
32    ROMs
33    Custom program ROM module (KOV3 only)
34     - on some games ROM socket contains Flash ROM + SRAM
24     IS61LV25616AL(SRAM)
25     IGS037(GFX PROCESSOR)
26     YMZ774-S(SOUND)
27     R5F21256SN(extra MCU for protection and ICcard communication)
28      - Appears to be refered to by the games as MPU
3529
36    QFP100 chip (Xlinx CPLD)
30    Cartridges
31     IGS036 (MAIN CPU) (differs per game, internal code)
32     ROMs
33     Custom program ROM module (KOV3 only)
34      - on some games ROM socket contains Flash ROM + SRAM
3735
38    Single PCB versions of some of the titles were also available
36     QFP100 chip (Xlinx CPLD)
3937
40   Only 5 Games were released for this platform, 3 of which are just updates / re-releases of older titles!
41   The platform has since been superseded by PGM3 (HD system uses flash cards etc.)
38     Single PCB versions of some of the titles were also available
4239
43   Oriental Legend 2
44   The King of Fighters '98 - Ultimate Match - Hero  (NOT DUMPED)
45   Knights of Valour 2 New Legend
46   Dodonpachi Daioujou Tamashii
47   Knights of Valour 3
40    Only 5 Games were released for this platform, 3 of which are just updates / re-releases of older titles!
41    The platform has since been superseded by PGM3 (HD system uses flash cards etc.)
4842
49   These were only released as single board PGM2 based hardware, seen for sale in Japan for around $250-$300
43    Oriental Legend 2
44    The King of Fighters '98 - Ultimate Match - Hero  (NOT DUMPED)
45    Knights of Valour 2 New Legend
46    Dodonpachi Daioujou Tamashii
47    Knights of Valour 3
5048
51   Jigsaw World Arena
52   Puzzle of Ocha / Ochainu No Pazuru
49    These were only released as single board PGM2 based hardware, seen for sale in Japan for around $250-$300
5350
51    Jigsaw World Arena
52    Puzzle of Ocha / Ochainu No Pazuru
53
5454*/
5555
5656#include "emu.h"
r29404r29405
511511// The King of Fighters '98 - Ultimate Match - Hero
512512// Jigsaw World Arena
513513//Puzzle of Ocha / Ochainu No Pazuru
514
trunk/src/mame/drivers/dassault.c
r29404r29405
516516   MCFG_DECO16IC_ADD("tilegen1", dassault_deco16ic_tilegen1_intf)
517517   MCFG_DECO16IC_GFXDECODE("gfxdecode")
518518   MCFG_DECO16IC_PALETTE("palette")
519   
519
520520   MCFG_DECO16IC_ADD("tilegen2", dassault_deco16ic_tilegen2_intf)
521521   MCFG_DECO16IC_GFXDECODE("gfxdecode")
522522   MCFG_DECO16IC_PALETTE("palette")
trunk/src/mame/drivers/supbtime.c
r29404r29405
348348   MCFG_DECO16IC_ADD("tilegen1", supbtime_deco16ic_tilegen1_intf)
349349   MCFG_DECO16IC_GFXDECODE("gfxdecode")
350350   MCFG_DECO16IC_PALETTE("palette")
351   
351
352352   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
353353   decospr_device::set_gfx_region(*device, 2);
354354   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
r29404r29405
395395   MCFG_DECO16IC_ADD("tilegen1", supbtime_deco16ic_tilegen1_intf)
396396   MCFG_DECO16IC_GFXDECODE("gfxdecode")
397397   MCFG_DECO16IC_PALETTE("palette")
398   
398
399399   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
400400   decospr_device::set_gfx_region(*device, 2);
401401   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
trunk/src/mame/drivers/ggconnie.c
r29404r29405
3131{
3232public:
3333   ggconnie_state(const machine_config &mconfig, device_type type, const char *tag)
34      : pce_common_state(mconfig, type, tag),     
34      : pce_common_state(mconfig, type, tag),
3535      m_rtc(*this, "rtc"),
3636      m_oki(*this, "oki")
3737      { }
trunk/src/mame/drivers/blmbycar.c
r29404r29405
363363   MCFG_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0x100-1)
364364   MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update_blmbycar)
365365   MCFG_SCREEN_PALETTE("palette")
366   
366
367367   MCFG_GFXDECODE_ADD("gfxdecode", "palette", blmbycar)
368368   MCFG_PALETTE_ADD("palette", 0x300)
369369
trunk/src/mame/drivers/gbusters.c
r29404r29405
257257
258258   membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000);
259259   membank("bank1")->set_entry(0);
260   
260
261261   m_paletteram.resize(0x800);
262262   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
263   
263
264264   save_item(NAME(m_paletteram));
265265   save_item(NAME(m_palette_selected));
266266   save_item(NAME(m_priority));
r29404r29405
298298   MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
299299   MCFG_SCREEN_UPDATE_DRIVER(gbusters_state, screen_update_gbusters)
300300   MCFG_SCREEN_PALETTE("palette")
301   
301
302302   MCFG_PALETTE_ADD("palette", 1024)
303303   MCFG_PALETTE_ENABLE_SHADOWS()
304304   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
trunk/src/mame/drivers/megaplay.c
r29404r29405
7070   m_vdp1(*this, "vdp1"),
7171   m_bioscpu(*this, "mtbios")
7272   { }
73   
73
7474   DECLARE_READ16_MEMBER(extra_ram_r);
7575   DECLARE_WRITE16_MEMBER(extra_ram_w);
7676   DECLARE_READ8_MEMBER(bios_banksel_r);
r29404r29405
9292   DECLARE_WRITE8_MEMBER(game_w);
9393   DECLARE_READ8_MEMBER(vdp_count_r);
9494   DECLARE_WRITE_LINE_MEMBER(bios_int_callback);
95   
95
9696   DECLARE_DRIVER_INIT(megaplay);
9797   DECLARE_VIDEO_START(megplay);
9898   DECLARE_MACHINE_RESET(megaplay);
9999   UINT32 screen_update_megplay(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
100   
100
101101private:
102   
102
103103   UINT32 m_bios_mode;  // determines whether ROM banks or Game data is to read from 0x8000-0xffff
104   
104
105105   UINT32 m_bios_bank; // ROM bank selection
106106   UINT16 m_game_banksel;  // Game bank selection
107107   UINT32 m_readpos;  // serial bank selection position (9-bit)
108108   UINT32 m_bios_bank_addr;
109   
109
110110   UINT32 m_bios_width;  // determines the way the game info ROM is read
111111   UINT8 m_bios_ctrl[6];
112112   UINT8 m_bios_6600;
113113   UINT8 m_bios_6403;
114114   UINT8 m_bios_6404;
115   
115
116116   UINT16 *m_ic36_ram;
117117   UINT8* m_ic37_ram;
118   
118
119119   required_shared_ptr<UINT8>           m_ic3_ram;
120120   optional_device<sega315_5124_device> m_vdp1;
121121   required_device<cpu_device>          m_bioscpu;
r29404r29405
616616{
617617   //printf("megplay vu\n");
618618   screen_update_megadriv(screen, bitmap, cliprect);
619//   m_vdp->screen_update(screen, bitmap, cliprect);
619//  m_vdp->screen_update(screen, bitmap, cliprect);
620620
621621   // overlay, only drawn for pixels != 0
622622   for (int y = 0; y < 224; y++)
623623   {
624624      UINT32* lineptr = &bitmap.pix32(y);
625625      UINT32* srcptr =  &m_vdp->get_bitmap().pix32(y + SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT);
626     
626
627627      for (int x = 0; x < SEGA315_5124_WIDTH; x++)
628628      {
629629         UINT32 src = srcptr[x] & 0xffffff;
630         
630
631631         if (src)
632632            lineptr[x] = src;
633633      }
634   }   
634   }
635635   return 0;
636636}
637637
r29404r29405
855855
856856DRIVER_INIT_MEMBER(mplay_state,megaplay)
857857{
858   // copy game instruction rom to main map. maybe this should just be accessed
858   // copy game instruction rom to main map. maybe this should just be accessed
859859   // through a handler instead?
860860   UINT8 *instruction_rom = memregion("user1")->base();
861861   UINT8 *game_rom = memregion("maincpu")->base();
862   
862
863863   for (int offs = 0; offs < 0x8000; offs++)
864864   {
865865      UINT8 dat = instruction_rom[offs];
866     
866
867867      game_rom[0x300000 + offs * 2] = dat;
868868      game_rom[0x300001 + offs * 2] = dat;
869869   }
r29404r29405
875875   DRIVER_INIT_CALL(megadrij);
876876   m_megadrive_io_read_data_port_ptr = read8_delegate(FUNC(md_base_state::megadrive_io_read_data_port_3button),this);
877877   m_megadrive_io_write_data_port_ptr = write16_delegate(FUNC(md_base_state::megadrive_io_write_data_port_3button),this);
878   
878
879879   // for now ...
880880   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa10000, 0xa1001f, read16_delegate(FUNC(mplay_state::mp_io_read),this), write16_delegate(FUNC(mplay_state::mp_io_write),this));
881881
trunk/src/mame/drivers/ohmygod.c
r29404r29405
332332   MCFG_SCREEN_PALETTE("palette")
333333
334334   MCFG_GFXDECODE_ADD("gfxdecode", "palette", ohmygod)
335   
335
336336   MCFG_PALETTE_ADD("palette", 1024)
337337   MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
338338
trunk/src/mame/drivers/jclub2.c
r29404r29405
293293***************************************************************************/
294294
295295
296WRITE32_MEMBER(darkhors_state::jclub2o_eeprom_w)      //seiko s-2929 is used on old style pcb
296WRITE32_MEMBER(darkhors_state::jclub2o_eeprom_w)        //seiko s-2929 is used on old style pcb
297297{
298298   if (data & ~0xff000000)
299299      logerror("%s: Unknown EEPROM bit written %08X\n",machine().describe_context(),data);
300   
300
301301   if ( ACCESSING_BITS_24_31 )
302302   {
303     
304303      // latch the bit
305304      m_eeprom->di_write((data & 0x01000000) >> 24);
306305
r29404r29405
355354
356355READ32_MEMBER(darkhors_state::darkhors_input_sel_r)
357356{
358
359357   // from bit mask to bit number
360358   int bit_p1 = mask_to_bit((m_input_sel & 0x00ff0000) >> 16);
361359   int bit_p2 = mask_to_bit((m_input_sel & 0xff000000) >> 24);
r29404r29405
371369{
372370UINT32 ret = ioport("580004")->read()& 0x00ffffff;
373371switch (m_input_sel_jc_2p){
374
375372   case 0x01: return  ret | (ioport("580004-01")->read()<<24);
376373   case 0x02: return  ret | (ioport("580004-02")->read()<<24);
377374   case 0x04: return  ret | (ioport("580004-04")->read()<<24);
r29404r29405
381378   case 0x40: return  ret | (ioport("580004-40")->read()<<24);
382379   case 0x80: return  ret | (ioport("580004-80")->read()<<24);
383380   }
384   
381
385382   return  ret;
386383}
387384
r29404r29405
390387{
391388UINT32 ret = ioport("4E0000")->read()& 0x00ffffff;
392389switch (m_input_sel_jc_2p){
393
394390   case 0x01: return  ret | (ioport("4E0000-01")->read()<<24);
395391   case 0x02: return  ret | (ioport("4E0000-02")->read()<<24);
396392   case 0x04: return  ret | (ioport("4E0000-04")->read()<<24);
r29404r29405
456452
457453static ADDRESS_MAP_START( jclub2_map, AS_PROGRAM, 32, darkhors_state )
458454   AM_RANGE(0x000000, 0x1fffff) AM_ROM
459   AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_SHARE("nvram")   //all 68k ram is battery backup
455   AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_SHARE("nvram")   //all 68k ram is battery backup
460456   //AM_RANGE(0x400000, 0x41ffff) AM_RAM
461457
462458   AM_RANGE(0x490000, 0x490003) AM_WRITE(darkhors_eeprom_w)
463   AM_RANGE(0x4E0000, 0x4E0003) AM_READ(p_4e0000)      //input 2p
459   AM_RANGE(0x4E0000, 0x4E0003) AM_READ(p_4e0000)      //input 2p
464460   AM_RANGE(0x4E0000, 0x4E0003) AM_WRITE(jclub2_input_sel_w_p1)
465   AM_RANGE(0x580000, 0x580003) AM_READ_PORT("580000")      //eeprom related?
466   AM_RANGE(0x580004, 0x580007) AM_READ(p_580004)      //system + some 1p input here
467   AM_RANGE(0x580008, 0x58000b) AM_READ_PORT("580008")      //input 1p + coins
461   AM_RANGE(0x580000, 0x580003) AM_READ_PORT("580000")     //eeprom related?
462   AM_RANGE(0x580004, 0x580007) AM_READ(p_580004)      //system + some 1p input here
463   AM_RANGE(0x580008, 0x58000b) AM_READ_PORT("580008")     //input 1p + coins
468464   AM_RANGE(0x58000c, 0x58000f) AM_WRITE(jclub2_input_sel_w_p2)
469   AM_RANGE(0x580200, 0x580203) AM_READNOP   //????
465   AM_RANGE(0x580200, 0x580203) AM_READNOP //????
470466
471467   AM_RANGE(0x800000, 0x87ffff) AM_DEVREADWRITE16( "st0020_spr", st0020_device, st0020_sprram_r, st0020_sprram_w, 0xffffffff );
472468
473469   AM_RANGE(0x880000, 0x89ffff) AM_RAM AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
474470   AM_RANGE(0x8a0000, 0x8bffff) AM_RAM   // this should still be palette ram!
475471
476//   AM_RANGE(0x8C0000, 0x8C00ff) AM_DEVREADWRITE16( "st0020_spr", st0020_device, st0020_blitram_r, st0020_blitram_w, 0xffffffff );
472//  AM_RANGE(0x8C0000, 0x8C00ff) AM_DEVREADWRITE16( "st0020_spr", st0020_device, st0020_blitram_r, st0020_blitram_w, 0xffffffff );
477473   AM_RANGE(0x8E0000, 0x8E01ff) AM_RAM
478474
479475   AM_RANGE(0x900000, 0x9fffff) AM_DEVREADWRITE16( "st0020_spr", st0020_device, st0020_gfxram_r, st0020_gfxram_w, 0xffffffff );
r29404r29405
483479
484480
485481static ADDRESS_MAP_START( jclub2o_map, AS_PROGRAM, 32, darkhors_state )
486   
482
487483   AM_RANGE(0x000000, 0x1fffff) AM_ROM
488   AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_SHARE("nvram")   //all 68k ram is battery backup
484   AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_SHARE("nvram")   //all 68k ram is battery backup
489485   //AM_RANGE(0x400000, 0x41ffff) AM_RAM
490   
491   AM_RANGE(0x490000, 0x490003) AM_WRITE(jclub2o_eeprom_w)   //eeprom s2929 not 93c46
492   AM_RANGE(0x4E0000, 0x4E0003) AM_READ(p_4e0000)         //input 2p
486
487   AM_RANGE(0x490000, 0x490003) AM_WRITE(jclub2o_eeprom_w) //eeprom s2929 not 93c46
488   AM_RANGE(0x4E0000, 0x4E0003) AM_READ(p_4e0000)          //input 2p
493489   AM_RANGE(0x4E0000, 0x4E0003) AM_WRITE(jclub2_input_sel_w_p1)
494   AM_RANGE(0x580000, 0x580003) AM_READ_PORT("580000")      //eeprom read
495   AM_RANGE(0x580004, 0x580007) AM_READ(p_580004)         //system + some 1p keyboard input here
496   AM_RANGE(0x580008, 0x58000b) AM_READ_PORT("580008")      //input 1p + coins
490   AM_RANGE(0x580000, 0x580003) AM_READ_PORT("580000")     //eeprom read
491   AM_RANGE(0x580004, 0x580007) AM_READ(p_580004)          //system + some 1p keyboard input here
492   AM_RANGE(0x580008, 0x58000b) AM_READ_PORT("580008")     //input 1p + coins
497493   AM_RANGE(0x58000c, 0x58000f) AM_WRITE(jclub2_input_sel_w_p2)
498   
499   AM_RANGE(0x580200, 0x580203) AM_READNOP   //????
500494
495   AM_RANGE(0x580200, 0x580203) AM_READNOP //????
496
501497   AM_RANGE(0x600000, 0x67ffff) AM_DEVREADWRITE16( "st0020_spr", st0020_device, st0020_sprram_r, st0020_sprram_w, 0xffffffff );
502498   AM_RANGE(0x680000, 0x69ffff) AM_RAM AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
503499   AM_RANGE(0x6a0000, 0x6bffff) AM_RAM
r29404r29405
722718
723719static INPUT_PORTS_START( jclub2 )
724720
725   
721
726722   PORT_START("580000")
727723   PORT_BIT( 0x7fffffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
728724   PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL  ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
729725
730726   PORT_START("580008")
731727   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
732   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 Payout") PORT_CODE(KEYCODE_LCONTROL)   // payout 1p
728   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 Payout") PORT_CODE(KEYCODE_LCONTROL)    // payout 1p
733729   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
734730   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
735   PORT_BIT( 0x00080000, IP_ACTIVE_LOW,  IPT_START1   )                                        // start 1p
731   PORT_BIT( 0x00080000, IP_ACTIVE_LOW,  IPT_START1   )                                                    // start 1p
736732   PORT_BIT( 0x00100000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
737733   PORT_BIT( 0x00200000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
738   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 coin out") PORT_CODE(KEYCODE_RSHIFT)            //coin out 2p
739   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 coin out") PORT_CODE(KEYCODE_LSHIFT)            //coin out 1p
734   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 coin out") PORT_CODE(KEYCODE_RSHIFT)                //coin out 2p
735   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 coin out") PORT_CODE(KEYCODE_LSHIFT)                //coin out 1p
740736   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
741737   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
742   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_COIN1 )                                          //1p coin drop
743   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_COIN3 )                                           //2p coin drop
744   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_COIN1 )                                           //1p coin in s1
745   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_COIN2 )                                           //1p coin in s2
746   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_COIN3 )                                           //2p coin in s1
747   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_COIN4 )                                           //2p coin in s2
738   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_COIN1 )                                                       //1p coin drop
739   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_COIN3 )                                                       //2p coin drop
740   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_COIN1 )                                                       //1p coin in s1
741   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_COIN2 )                                                       //1p coin in s2
742   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_COIN3 )                                                       //2p coin in s1
743   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_COIN4 )                                                       //2p coin in s2
748744
749745   PORT_START("580004")
750746   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
751   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_SERVICE2 )                                        //reset
752   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_SERVICE3 )                                        //meter
753   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_SERVICE4 )                                        //last game
747   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_SERVICE2 )                                                    //reset
748   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_SERVICE3 )                                                    //meter
749   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_SERVICE4 )                                                    //last game
754750   PORT_BIT( 0x00080000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 Cancel") PORT_CODE(KEYCODE_LALT)        // cancel 1p
755   PORT_BIT( 0x00100000, IP_ACTIVE_LOW,  IPT_SERVICE  ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)   //test
751   PORT_BIT( 0x00100000, IP_ACTIVE_LOW,  IPT_SERVICE  ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)   //test
756752   PORT_BIT( 0x00200000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
757   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 hopper full") PORT_CODE(KEYCODE_CLOSEBRACE)               //hopper full 2p
758   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 hopper full") PORT_CODE(KEYCODE_OPENBRACE)               //hopper full 1p
759   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )    //keyboard input 1p
760   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
761   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )      //keyboard input 1p
762   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )    //keyboard input 1p
763   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
764   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )    //keyboard input 1p
765   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )    //keyboard input 1p
766   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )    //keyboard input 1p
767   
768   PORT_START("580004-01")   //1P
753   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 hopper full") PORT_CODE(KEYCODE_CLOSEBRACE)                 //hopper full 2p
754   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P1 hopper full") PORT_CODE(KEYCODE_OPENBRACE)                  //hopper full 1p
755   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
756   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
757   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
758   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
759   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
760   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
761   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
762   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )     //keyboard input 1p
763
764   PORT_START("580004-01") //1P
769765   PORT_BIT( 0x00, IP_ACTIVE_LOW, IPT_UNKNOWN )
770766   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1") PORT_CODE(KEYCODE_1_PAD)
771767   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2") PORT_CODE(KEYCODE_2_PAD)
r29404r29405
776772   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 7") PORT_CODE(KEYCODE_7_PAD)
777773   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 8") PORT_CODE(KEYCODE_8_PAD)
778774
779   PORT_START("580004-02")   //1P
775   PORT_START("580004-02") //1P
780776   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
781777   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-2") PORT_CODE(KEYCODE_Q)
782778   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-3") PORT_CODE(KEYCODE_W)
r29404r29405
785781   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-6") PORT_CODE(KEYCODE_T)
786782   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-7") PORT_CODE(KEYCODE_Y)
787783   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-8") PORT_CODE(KEYCODE_U)
788   
789784
790   PORT_START("580004-04")   //1P
785
786   PORT_START("580004-04") //1P
791787   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
792788   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-3") PORT_CODE(KEYCODE_I)
793789   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-4") PORT_CODE(KEYCODE_O)
r29404r29405
795791   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-6") PORT_CODE(KEYCODE_S)
796792   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-7") PORT_CODE(KEYCODE_D)
797793   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-8") PORT_CODE(KEYCODE_F)
798   
799   PORT_START("580004-08")   //1P
794
795   PORT_START("580004-08") //1P
800796   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
801797   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-4") PORT_CODE(KEYCODE_G)
802798   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-5") PORT_CODE(KEYCODE_H)
r29404r29405
804800   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-7") PORT_CODE(KEYCODE_K)
805801   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-8") PORT_CODE(KEYCODE_L)
806802
807   PORT_START("580004-10")   //1P
803   PORT_START("580004-10") //1P
808804   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
809805   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-5") PORT_CODE(KEYCODE_Z)
810806   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-6") PORT_CODE(KEYCODE_X)
811807   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-7") PORT_CODE(KEYCODE_C)
812808   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-8") PORT_CODE(KEYCODE_V)
813809
814   
815   PORT_START("580004-20")   //1P
810
811   PORT_START("580004-20") //1P
816812   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
817813   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-6") PORT_CODE(KEYCODE_B)
818814   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-7") PORT_CODE(KEYCODE_N)
819815   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-8") PORT_CODE(KEYCODE_M)
820816
821   
822   PORT_START("580004-40")   //1P
823   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )   
817
818   PORT_START("580004-40") //1P
819   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
824820   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 6-7") PORT_CODE(KEYCODE_COMMA)
825821   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 6-8") PORT_CODE(KEYCODE_STOP)
826822
827   
828   PORT_START("580004-80")   //1P
823
824   PORT_START("580004-80") //1P
829825   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
830826   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 7-8") PORT_CODE(KEYCODE_SLASH)
831827
832828
833829   PORT_START("4E0000")   // 4E0000
834830   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
835   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 Payout") PORT_CODE(KEYCODE_RCONTROL)   // payout 2p
831   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 Payout") PORT_CODE(KEYCODE_RCONTROL)    // payout 2p
836832   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
837833   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
838   PORT_BIT( 0x00080000, IP_ACTIVE_LOW,  IPT_START2   )                                        // start 2p
834   PORT_BIT( 0x00080000, IP_ACTIVE_LOW,  IPT_START2   )                                                    // start 2p
839835   PORT_BIT( 0x00100000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
840836   PORT_BIT( 0x00200000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
841   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 Cancel") PORT_CODE(KEYCODE_RALT)       // cancel 2p
837   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_OTHER ) PORT_NAME("P2 Cancel") PORT_CODE(KEYCODE_RALT)        // cancel 2p
842838   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_UNKNOWN ) //unused???
843   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                 //keyboard input 2p
844   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                //keyboard input 2p
845   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                //keyboard input 2p
846   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                //keyboard input 2p
847   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                 //keyboard input 2p
848   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                //keyboard input 2p
849   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                //keyboard input 2p
850   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                //keyboard input 2p   
851   
852   PORT_START("4E0000-01")   //2P
839   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
840   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
841   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
842   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
843   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
844   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
845   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
846   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )                     //keyboard input 2p
847
848   PORT_START("4E0000-01") //2P
853849   PORT_BIT( 0x00, IP_ACTIVE_LOW, IPT_UNKNOWN )
854850   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1") PORT_CODE(KEYCODE_1_PAD)
855851   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2") PORT_CODE(KEYCODE_2_PAD)
r29404r29405
860856   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 7") PORT_CODE(KEYCODE_7_PAD)
861857   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 8") PORT_CODE(KEYCODE_8_PAD)
862858
863   PORT_START("4E0000-02")   //2P
859   PORT_START("4E0000-02") //2P
864860   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
865861   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-2") PORT_CODE(KEYCODE_Q)
866862   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-3") PORT_CODE(KEYCODE_W)
r29404r29405
869865   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-6") PORT_CODE(KEYCODE_T)
870866   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-7") PORT_CODE(KEYCODE_Y)
871867   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-8") PORT_CODE(KEYCODE_U)
872   
873868
874   PORT_START("4E0000-04")   //2P
869
870   PORT_START("4E0000-04") //2P
875871   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
876872   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-3") PORT_CODE(KEYCODE_I)
877873   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-4") PORT_CODE(KEYCODE_O)
r29404r29405
879875   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-6") PORT_CODE(KEYCODE_S)
880876   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-7") PORT_CODE(KEYCODE_D)
881877   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-8") PORT_CODE(KEYCODE_F)
882   
883   PORT_START("4E0000-08")   //2P
878
879   PORT_START("4E0000-08") //2P
884880   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
885881   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-4") PORT_CODE(KEYCODE_G)
886882   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-5") PORT_CODE(KEYCODE_H)
r29404r29405
888884   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-7") PORT_CODE(KEYCODE_K)
889885   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-8") PORT_CODE(KEYCODE_L)
890886
891   PORT_START("4E0000-10")   //2P
887   PORT_START("4E0000-10") //2P
892888   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
893889   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-5") PORT_CODE(KEYCODE_Z)
894890   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-6") PORT_CODE(KEYCODE_X)
895891   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-7") PORT_CODE(KEYCODE_C)
896892   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-8") PORT_CODE(KEYCODE_V)
897893
898   
899   PORT_START("4E0000-20")   //2P
894
895   PORT_START("4E0000-20") //2P
900896   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
901897   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-6") PORT_CODE(KEYCODE_B)
902898   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-7") PORT_CODE(KEYCODE_N)
903899   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-8") PORT_CODE(KEYCODE_M)
904   
905   PORT_START("4E0000-40")   //2P
900
901   PORT_START("4E0000-40") //2P
906902   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
907903   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 6-7") PORT_CODE(KEYCODE_COMMA)
908904   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 6-8") PORT_CODE(KEYCODE_STOP)
909   
910   PORT_START("4E0000-80")   //2P
905
906   PORT_START("4E0000-80") //2P
911907   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
912908   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 7-8") PORT_CODE(KEYCODE_SLASH)
913909INPUT_PORTS_END
r29404r29405
10231019   MCFG_SCREEN_PALETTE("palette")
10241020
10251021   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1026   
1022
10271023   // NOT an ST0020 but instead ST0032, ram format isn't compatible at least
10281024   MCFG_DEVICE_ADD("st0020_spr", ST0020_SPRITES, 0)
10291025   st0020_device::set_is_st0032(*device, 1);
r29404r29405
10851081   MCFG_CPU_VBLANK_INT_DRIVER("screen", darkhors_state,  irq0_line_hold)
10861082
10871083   MCFG_NVRAM_ADD_0FILL("nvram")
1088   MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")      //not correct
1089   
1084   MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")      //not correct
1085
10901086   /* video hardware */
10911087   MCFG_SCREEN_ADD("screen", RASTER)
10921088   MCFG_SCREEN_REFRESH_RATE(60)
r29404r29405
10981094
10991095   MCFG_PALETTE_ADD("palette", 0x10000)
11001096   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
1101   
1097
11021098   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1103   
1099
11041100   MCFG_DEVICE_ADD("st0020_spr", ST0020_SPRITES, 0)
11051101   st0020_device::set_is_jclub2o(*device, 1);
11061102   MCFG_ST0020_SPRITES_GFXDECODE("gfxdecode")
r29404r29405
12201216   ROM_REGION( 0x80000, "misc", ROMREGION_ERASEFF )
12211217   ROM_LOAD( "gal16v8b-m88-03.bin", 0x000, 0x117, CRC(6d9c882e) SHA1(84cb95ab540290c2f8b740668360e9c643a67dcf) )
12221218   ROM_LOAD( "gal16v8b-m88-04.bin", 0x000, 0x117, CRC(5e79f292) SHA1(5e44c234e2b15d486a1af71fee986892aa245b4d) )
1223   
1219
12241220   ROM_REGION( 0x80, "eeprom", 0 ) // EEPROM
12251221   ROM_LOAD( "eeprom-jclub2.bin", 0x0000, 0x0080, CRC(1513cdc8) SHA1(22ff752f3e0f8f611c234a1dc4327aa360b4d6eb) )
12261222ROM_END
r29404r29405
12711267
12721268   ROM_REGION( 0x80000, "st0016", 0 ) // z80 core (used for sound?)
12731269   ROM_LOAD( "sx006-04.u87", 0x00000, 0x80000, CRC(a87adedd) SHA1(1cd5af2d03738fff2230b46241659179467c828c) )
1274   
1270
12751271   ROM_REGION( 0x100, "eeprom", 0 ) // eeprom 16 bit one!!!
1276   ROM_LOAD( "eeprom-jclub2o.bin", 0x0000, 0x100, CRC(dd1c88ec) SHA1(acb67e41e832f203361e0f93afcd4eaf963fd13e) )   //jclub2ob ones
1272   ROM_LOAD( "eeprom-jclub2o.bin", 0x0000, 0x100, CRC(dd1c88ec) SHA1(acb67e41e832f203361e0f93afcd4eaf963fd13e) )   //jclub2ob ones
12771273ROM_END
12781274
12791275/*
12801276  Jockey Club II (26-mar-1997)
12811277  8 Horses, old style PCB.
12821278  Maybe upgraded to a release candidate software revision.
1283*/ 
1279*/
12841280ROM_START( jclub2ob )
12851281   ROM_REGION( 0x200000, "maincpu", 0 )    // 68EC020 code + compressed gfx
12861282   ROM_LOAD16_WORD_SWAP( "sx006a-01.u26",0x00000, 0x200000, CRC(55e249bc) SHA1(ed0f066ed17f047760b712cbbfba1a62d4b452ba) )
r29404r29405
12921288
12931289   ROM_REGION( 0x80000, "st0016", 0 ) // z80 core (used for sound?)
12941290   ROM_LOAD( "sx006-04.u87", 0x00000, 0x80000, CRC(a87adedd) SHA1(1cd5af2d03738fff2230b46241659179467c828c) )
1295   
1291
12961292   ROM_REGION( 0x100, "eeprom", 0 ) // eeprom 16 bit one!!!
12971293   ROM_LOAD( "eeprom-jclub2o.bin", 0x0000, 0x100, CRC(dd1c88ec) SHA1(acb67e41e832f203361e0f93afcd4eaf963fd13e) )
12981294ROM_END
r29404r29405
13251321         temp[i] = eeprom[BITSWAP8(i,7,5,4,3,2,1,0,6)];
13261322
13271323      memcpy(eeprom, temp, len);
1328     
1324
13291325   }
13301326}
13311327
r29404r29405
13361332GAME( 2001, darkhors, jclub2, darkhors,darkhors,darkhors_state, darkhors,ROT0, "bootleg", "Dark Horse (bootleg of Jockey Club II)", GAME_IMPERFECT_GRAPHICS )
13371333
13381334
1339//test boot = test mode
1335//test boot = test mode
13401336//reset +start 1p at boot, when msg on screen press test without release other key = setup
13411337//reset +cancel 1p  = backup all clear
13421338//reset, test, meter and last game are keys so once you turn them they stay "active"
r29404r29405
13471343- 0 + left alt (reset + p1 cancel) to clear data
13481344- 0 + 1 + f1 (IIRC) to write ID
13491345*/
1350
trunk/src/mame/drivers/zr107.c
r29404r29405
776776   MCFG_VIDEO_START_OVERRIDE(zr107_state,zr107)
777777
778778   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
779   
779
780780   MCFG_K056832_ADD("k056832", zr107_k056832_intf)
781781   MCFG_K056832_GFXDECODE("gfxdecode")
782782   MCFG_K056832_PALETTE("palette")
r29404r29405
840840   MCFG_VIDEO_START_OVERRIDE(zr107_state,jetwave)
841841
842842   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
843   
843
844844   MCFG_K001604_ADD("k001604", jetwave_k001604_intf)
845845   MCFG_K001604_GFXDECODE("gfxdecode")
846846   MCFG_K001604_PALETTE("palette")
r29404r29405
11071107GAME( 1996, jetwave,  0,        jetwave, jetwave,  zr107_state, jetwave, ROT0, "Konami", "Jet Wave (EAB, Euro v1.04)", GAME_IMPERFECT_GRAPHICS )
11081108GAME( 1996, waveshrk, jetwave,  jetwave, jetwave,  zr107_state, jetwave, ROT0, "Konami", "Wave Shark (UAB, USA v1.04)", GAME_IMPERFECT_GRAPHICS )
11091109GAME( 1996, jetwavej, jetwave,  jetwave, jetwave,  zr107_state, jetwave, ROT0, "Konami", "Jet Wave (JAB, Japan v1.04)", GAME_IMPERFECT_GRAPHICS )
1110
trunk/src/mame/drivers/dominob.c
r29404r29405
139139   {
140140      for (x = 0; x < 256 / 32; x++)
141141      {
142         
143142               m_gfxdecode->gfx(1)->opaque(bitmap,
144143               cliprect,
145144               m_bgram[index] + 256 * (m_bgram[index + 1] & 0xf),
r29404r29405
154153   {
155154      for (x = 0; x < 32; x++)
156155      {
157         
158156               m_gfxdecode->gfx(0)->transpen(bitmap,
159157               cliprect,
160158               m_videoram[(y * 32 + x) * 2 + 1] + (m_videoram[(y * 32 + x) * 2] & 7) * 256,
trunk/src/mame/drivers/fantland.c
r29404r29405
996996   MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_0))   /* IRQ handler */
997997   MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)      /* 8 kHz, 4 Bits  */
998998   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
999   
999
10001000   MCFG_SOUND_ADD("msm2", MSM5205, 384000)
10011001   MCFG_MSM5205_VCLK_CB(WRITELINE(fantland_state, borntofi_adpcm_int_1))   /* IRQ handler */
10021002   MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)      /* 8 kHz, 4 Bits  */
trunk/src/mame/drivers/albazc.c
r29404r29405
288288   MCFG_SCREEN_PALETTE("palette")
289289
290290   MCFG_GFXDECODE_ADD("gfxdecode", "palette", hanaroku)
291   
291
292292   MCFG_PALETTE_ADD("palette", 0x200)
293293   MCFG_PALETTE_INIT_OWNER(albazc_state, albazc)
294294
trunk/src/mame/drivers/aristmk4.c
r29404r29405
1717    * Press PB4, PB5 and PB6 keys simultaneously (Z+X+C keys by default)
1818    * A value (displayed below) will appear next to RF/AMT on the right of the screen
1919    * Key out both the Jackpot and Audit Keys
20   
2120
21
2222    This method works with the following games:
2323    3bagflnz 200
2424    3bagflvt 200
r29404r29405
6868    eforest
6969    fhunter
7070    fhuntera
71   
71
7272    Technical Notes:
7373
7474    68B09EP Motorola Processor
r29404r29405
303303   required_device<ay8910_device> m_ay1;
304304   required_device<ay8910_device> m_ay2;
305305   required_device<samples_device> m_samples;
306   
306
307307   required_shared_ptr<UINT8> m_mkiv_vram;
308308   required_device<gfxdecode_device> m_gfxdecode;
309309   required_device<palette_device> m_palette;
310   
310
311311   int m_rtc_address_strobe;
312312   int m_rtc_data_strobe;
313313   UINT8 *m_shapeRomPtr;
r29404r29405
23812381ROM_START( gunnrose ) // MK2.5
23822382   ROM_REGION(0x10000, "maincpu", 0 )
23832383      /* VIDEO AND SOUND EPROM */
2384   ROM_LOAD("gnr.u7", 0x06000, 0x2000, CRC(fe7d0ea4) SHA1(3F3F4809534065C33ECA2CFFF0D1D2A3E3992406))   // 1VL/SH136 RED AND BLACK
2384   ROM_LOAD("gnr.u7", 0x06000, 0x2000, CRC(fe7d0ea4) SHA1(3F3F4809534065C33ECA2CFFF0D1D2A3E3992406))   // 1VL/SH136 RED AND BLACK
23852385
23862386      /* GAME EPROMS */
2387   ROM_LOAD("gnr.u9", 0x08000, 0x8000, CRC(4fb5f757) SHA1(A4129BCA7E573FAAC0D11DE41A9BF8EA144091EE))   // E/C606191SMP
2387   ROM_LOAD("gnr.u9", 0x08000, 0x8000, CRC(4fb5f757) SHA1(A4129BCA7E573FAAC0D11DE41A9BF8EA144091EE))   // E/C606191SMP
23882388
23892389      /* SHAPE EPROMS */
23902390   ROM_REGION(0xc000, "tile_gfx", 0 )
2391   ROM_LOAD("gnr.u8",  0x00000, 0x2000, CRC(dec9e695) SHA1(A596C4243D6D39E0611FF714E19E14188C90B6F1))   // 1VL/SH136 RED AND BLACK
2392   ROM_LOAD("gnr.u10", 0x02000, 0x2000, CRC(e83b8e79) SHA1(595F41A5F59F938581A57B445370AA716C6B1409))   // 1VL/SH136 RED AND BLACK
2393   ROM_LOAD("gnr.u12", 0x04000, 0x2000, CRC(9134d029) SHA1(D698FB91D8F5FA78FFD056149421008D3F12C456))   // 1VL/SH136 RED AND BLACK
2394   ROM_LOAD("gnr.u9t", 0x06000, 0x2000, CRC(73a0c2cd) SHA1(662056D570EAA069483D378B77EFCFB42EFF6D0D))   // E/C606191SMP
2395   ROM_LOAD("gnr.u11", 0x08000, 0x2000, CRC(c50adffe) SHA1(A7C4A3CDD4D5D31A1420E47859408CAA75CE2636))   // 1VL/SH136 RED AND BLACK
2396   ROM_LOAD("gnr.u13", 0x0a000, 0x2000, CRC(e0a6bfc5) SHA1(07E4C8191503F0EA2DE4F7CE18FE6290D20EF80E))   // 1VL/SH136 RED AND BLACK
2391   ROM_LOAD("gnr.u8",  0x00000, 0x2000, CRC(dec9e695) SHA1(A596C4243D6D39E0611FF714E19E14188C90B6F1))  // 1VL/SH136 RED AND BLACK
2392   ROM_LOAD("gnr.u10", 0x02000, 0x2000, CRC(e83b8e79) SHA1(595F41A5F59F938581A57B445370AA716C6B1409))  // 1VL/SH136 RED AND BLACK
2393   ROM_LOAD("gnr.u12", 0x04000, 0x2000, CRC(9134d029) SHA1(D698FB91D8F5FA78FFD056149421008D3F12C456))  // 1VL/SH136 RED AND BLACK
2394   ROM_LOAD("gnr.u9t", 0x06000, 0x2000, CRC(73a0c2cd) SHA1(662056D570EAA069483D378B77EFCFB42EFF6D0D))  // E/C606191SMP
2395   ROM_LOAD("gnr.u11", 0x08000, 0x2000, CRC(c50adffe) SHA1(A7C4A3CDD4D5D31A1420E47859408CAA75CE2636))  // 1VL/SH136 RED AND BLACK
2396   ROM_LOAD("gnr.u13", 0x0a000, 0x2000, CRC(e0a6bfc5) SHA1(07E4C8191503F0EA2DE4F7CE18FE6290D20EF80E))  // 1VL/SH136 RED AND BLACK
23972397
23982398      /* COLOR PROM */
23992399   ROM_REGION(0x200, "proms", 0 ) /* are either of these correct?  They are taken from different games */
24002400   //ROM_LOAD("2cm07.u71", 0x0000, 0x0200, CRC(1e3f402a) SHA1(f38da1ad6607df38add10c69febf7f5f8cd21744)) // Using 2CM07 until a correct PROM is confirmed
24012401   ROM_LOAD("1cm48.u71", 0x0000, 0x0200, BAD_DUMP CRC(81daeeb0) SHA1(7dfe198c6def5c4ae4ecac488d65c2911fb3a890))
2402   
2402
24032403ROM_END
24042404
24052405GAMEL( 1985, 86lions,  0,        86lions,  aristmk4, aristmk4_state, aristmk4, ROT0, "Aristocrat", "86 Lions", GAME_NOT_WORKING, layout_topgear )
trunk/src/mame/drivers/mcr68.c
r29404r29405
773773   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
774774   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
775775   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
776   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
776   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
777777   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
778778   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
779779   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r29404r29405
15111511
15121512ROM_START( archrivlb ) /* Reports as rev 2.0 5/03/89 */
15131513   ROM_REGION( 0x40000, "maincpu", 0 )
1514   ROM_LOAD16_BYTE( "4.bin",  0x00000, 0x10000, CRC(1d99cce6) SHA1(738d651de0bf1b4a1524a1d8835a060bfc4649a8) )
1514   ROM_LOAD16_BYTE( "4.bin",  0x00000, 0x10000, CRC(1d99cce6) SHA1(738d651de0bf1b4a1524a1d8835a060bfc4649a8) )
15151515   ROM_LOAD16_BYTE( "2.bin",  0x00001, 0x10000, CRC(5d58a77b) SHA1(9a42bb89acd4e6b603215b14b4d411d14615f412) )
15161516   ROM_LOAD16_BYTE( "3.bin",  0x20000, 0x10000, CRC(d6d08ff7) SHA1(bbbd4b5c3218c9bb461b17e536191d40ab39f67c) )
15171517   ROM_LOAD16_BYTE( "1.bin",  0x20001, 0x10000, CRC(92f3a43d) SHA1(45fdcbacd65f5898d54cc2ac95639b7ee2c097e6) )
15181518
15191519   ROM_REGION( 0x90000, "cvsd:cpu", 0 )  /* Audio System board */
1520   ROM_LOAD( "13.bin",   0x10000, 0x08000, CRC(96b3c652) SHA1(1bb576d0bf6b6b8df24e7b9352a33e97dd8ebdcb) )
1520   ROM_LOAD( "13.bin",   0x10000, 0x08000, CRC(96b3c652) SHA1(1bb576d0bf6b6b8df24e7b9352a33e97dd8ebdcb) )
15211521   ROM_RELOAD(                           0x18000, 0x08000 )
15221522   ROM_RELOAD(                           0x20000, 0x08000 )
15231523   ROM_RELOAD(                           0x28000, 0x08000 )
r29404r29405
15311531   ROM_RELOAD(                           0x68000, 0x08000 )
15321532
15331533   ROM_REGION( 0x20000, "gfx1", ROMREGION_INVERT )
1534   ROM_LOAD( "5.bin", 0x00000, 0x10000, CRC(7eb3d7c6) SHA1(8544d04929cdb36fa7f0dcb67e0b7fd8c7b0fc2b) )
1534   ROM_LOAD( "5.bin", 0x00000, 0x10000, CRC(7eb3d7c6) SHA1(8544d04929cdb36fa7f0dcb67e0b7fd8c7b0fc2b) )
15351535   ROM_LOAD( "6.bin", 0x10000, 0x10000, CRC(31e68050) SHA1(e25871beb08a8706af70d277fa7305a1f4d7d3e2) )
15361536
15371537   ROM_REGION( 0x80000, "gfx2", 0 )
trunk/src/mame/drivers/thunderx.c
r29404r29405
597597{
598598   m_paletteram.resize(0x800);
599599   m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
600   
600
601601   save_item(NAME(m_paletteram));
602602   save_item(NAME(m_priority));
603603   save_item(NAME(m_1f98_data));
trunk/src/mame/drivers/galaxi.c
r29404r29405
103103   required_device<cpu_device> m_maincpu;
104104   required_device<gfxdecode_device> m_gfxdecode;
105105   required_device<screen_device> m_screen;
106   required_device<palette_device> m_palette;   
106   required_device<palette_device> m_palette;
107107};
108108
109109
trunk/src/mame/drivers/tecmo16.c
r29404r29405
382382   MCFG_SCREEN_UPDATE_DRIVER(tecmo16_state, screen_update_tecmo16)
383383
384384   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tecmo16)
385   MCFG_PALETTE_ADD_INIT_BLACK("palette", 4096)   
385   MCFG_PALETTE_ADD_INIT_BLACK("palette", 4096)
386386   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
387387
388388
trunk/src/mame/drivers/murogmbl.c
r29404r29405
114114      for (x = 0; x < 32; x++)
115115      {
116116         int tile = m_video[count];
117          gfx->opaque(bitmap,cliprect, tile, 0, 0, 0, x * 8, y * 8);
117            gfx->opaque(bitmap,cliprect, tile, 0, 0, 0, x * 8, y * 8);
118118
119119         count++;
120120      }
trunk/src/mame/drivers/amusco.c
r29404r29405
2424  1x MOS 6845 (U27)       CRT Controller.
2525  2x P8255                Programmable Peripheral Interface (I/O).
2626
27  2x SRM2264      8k X 8 CMOS Static RAM.
27  2x SRM2264        8k X 8 CMOS Static RAM.
2828
29  1x 27128 (U35) ROM.   Handwritten sticker:  Char A U35.
30  1x 27128 (U36) ROM.   Handwritten sticker:  Char B U36.
31  1x 27128 (U37) ROM.   Handwritten sticker:  Char C U37.
32  1x 27256 (U42) ROM.   Handwritten sticker:  PK V1.4 U42.
29  1x 27128 (U35) ROM.   Handwritten sticker:  Char A U35.
30  1x 27128 (U36) ROM.   Handwritten sticker:  Char B U36.
31  1x 27128 (U37) ROM.   Handwritten sticker:  Char C U37.
32  1x 27256 (U42) ROM.   Handwritten sticker:  PK V1.4 U42.
3333
34  1x TI SN76489      Digital Complex Sound Generator (DCSG).
34  1x TI SN76489     Digital Complex Sound Generator (DCSG).
3535
3636  3x MMI PAL16L8ACN (U47, U48, U50)
3737  1x MMI PAL16R4 (U49)    <-- couldn't get a consistent read
r29404r29405
6262*******************************************************************************/
6363
6464
65#define MASTER_CLOCK      XTAL_22_1184MHz      /* confirmed */
66#define SECOND_CLOCK      XTAL_15MHz         /* confirmed */
65#define MASTER_CLOCK        XTAL_22_1184MHz     /* confirmed */
66#define SECOND_CLOCK        XTAL_15MHz          /* confirmed */
6767
68#define CPU_CLOCK         MASTER_CLOCK / 4   /* guess */
69#define CRTC_CLOCK         SECOND_CLOCK / 8   /* guess */
70#define SND_CLOCK         SECOND_CLOCK / 8   /* guess */
68#define CPU_CLOCK           MASTER_CLOCK / 4    /* guess */
69#define CRTC_CLOCK          SECOND_CLOCK / 8    /* guess */
70#define SND_CLOCK           SECOND_CLOCK / 8    /* guess */
7171
7272
7373#include "emu.h"
r29404r29405
120120
121121WRITE16_MEMBER(amusco_state::amusco_videoram_w)
122122{
123
124123}
125124
126125PALETTE_INIT_MEMBER(amusco_state, amusco_palette_init)
r29404r29405
180179
181180static ADDRESS_MAP_START( amusco_mem_map, AS_PROGRAM, 16, amusco_state )
182181   AM_RANGE(0x00000, 0x0ffff) AM_RAM
183   AM_RANGE(0xec000, 0xecfff) AM_RAM AM_SHARE("videoram")   // placeholder
182   AM_RANGE(0xec000, 0xecfff) AM_RAM AM_SHARE("videoram")  // placeholder
184183   AM_RANGE(0xf8000, 0xfffff) AM_ROM
185184ADDRESS_MAP_END
186185
r29404r29405
213212{
214213   m_videoram[m_video_update_address] = data;
215214   m_bg_tilemap->mark_tile_dirty(m_video_update_address);
216//   printf("%04x %04x\n",m_video_update_address,data);
215//  printf("%04x %04x\n",m_video_update_address,data);
217216}
218217
219218static ADDRESS_MAP_START( amusco_io_map, AS_IO, 16, amusco_state )
220219   AM_RANGE(0x0000, 0x0001) AM_READWRITE8(mc6845_r, mc6845_w, 0xffff)
221//   AM_RANGE(0x0000, 0x0001) AM_DEVREADWRITE8("crtc", mc6845_device, status_r,   address_w,  0x00ff)
222//   AM_RANGE(0x0000, 0x0001) AM_DEVREADWRITE8("crtc", mc6845_device, register_r, register_w, 0xff00)
220//  AM_RANGE(0x0000, 0x0001) AM_DEVREADWRITE8("crtc", mc6845_device, status_r,   address_w,  0x00ff)
221//  AM_RANGE(0x0000, 0x0001) AM_DEVREADWRITE8("crtc", mc6845_device, register_r, register_w, 0xff00)
223222   AM_RANGE(0x0010, 0x0011) AM_DEVREADWRITE8("pic8259", pic8259_device, read, write, 0xffff ) //PPI 8255
224223
225   AM_RANGE(0x0060, 0x0061) AM_DEVWRITE8("sn", sn76489_device, write, 0x00ff)                        /* sound */
224   AM_RANGE(0x0060, 0x0061) AM_DEVWRITE8("sn", sn76489_device, write, 0x00ff)                              /* sound */
226225   AM_RANGE(0x0070, 0x0071) AM_WRITE(vram_w)
227//   AM_RANGE(0x0010, 0x0011) AM_READ_PORT("IN1")
228//   AM_RANGE(0x0012, 0x0013) AM_READ_PORT("IN3")
226//  AM_RANGE(0x0010, 0x0011) AM_READ_PORT("IN1")
227//  AM_RANGE(0x0012, 0x0013) AM_READ_PORT("IN3")
229228   AM_RANGE(0x0030, 0x0031) AM_READ_PORT("DSW1") AM_WRITENOP // lamps?
230229   AM_RANGE(0x0040, 0x0041) AM_READ_PORT("DSW2")
231230ADDRESS_MAP_END
r29404r29405
485484
486485MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
487486{
488//   amusco_state *state = device->machine().driver_data<amusco_state>();
489//   state->m_video_update_address = address;
487//  amusco_state *state = device->machine().driver_data<amusco_state>();
488//  state->m_video_update_address = address;
490489}
491490
492491static MC6845_INTERFACE( mc6845_intf )
r29404r29405
537536   MCFG_SCREEN_ADD("screen", RASTER)
538537   MCFG_SCREEN_REFRESH_RATE(60)
539538   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
540   MCFG_SCREEN_SIZE(88*8, 27*10)                     // screen size: 88*8 27*10
541   MCFG_SCREEN_VISIBLE_AREA(0*8, 74*8-1, 0*10, 24*10-1)   // visible scr: 74*8 24*10
539   MCFG_SCREEN_SIZE(88*8, 27*10)                           // screen size: 88*8 27*10
540   MCFG_SCREEN_VISIBLE_AREA(0*8, 74*8-1, 0*10, 24*10-1)    // visible scr: 74*8 24*10
542541   MCFG_SCREEN_UPDATE_DRIVER(amusco_state, screen_update_amusco)
543542
544543   MCFG_SCREEN_PALETTE("palette")
r29404r29405
568567   ROM_LOAD( "char_a_u35.u35",  0x0000, 0x4000, CRC(ded67ef6) SHA1(da7326c190211e956e5a5f763d5045615bb8ffb3) )
569568   ROM_LOAD( "char_b_u36.u36",  0x4000, 0x4000, CRC(55523513) SHA1(97fd221c298698628d4f6564389d96eb89e55927) )
570569   ROM_LOAD( "char_c_u37.u37",  0x8000, 0x4000, CRC(d26f3b94) SHA1(e58af4f6f1a9091c23827997d03b91f02bb07856) )
571//   ROM_LOAD( "char_a_u35.u35",  0x8000, 0x4000, CRC(ded67ef6) SHA1(da7326c190211e956e5a5f763d5045615bb8ffb3) )
572//   ROM_LOAD( "char_b_u36.u36",  0x4000, 0x4000, CRC(55523513) SHA1(97fd221c298698628d4f6564389d96eb89e55927) )
573//   ROM_LOAD( "char_c_u37.u37",  0x0000, 0x4000, CRC(d26f3b94) SHA1(e58af4f6f1a9091c23827997d03b91f02bb07856) )
570//  ROM_LOAD( "char_a_u35.u35",  0x8000, 0x4000, CRC(ded67ef6) SHA1(da7326c190211e956e5a5f763d5045615bb8ffb3) )
571//  ROM_LOAD( "char_b_u36.u36",  0x4000, 0x4000, CRC(55523513) SHA1(97fd221c298698628d4f6564389d96eb89e55927) )
572//  ROM_LOAD( "char_c_u37.u37",  0x0000, 0x4000, CRC(d26f3b94) SHA1(e58af4f6f1a9091c23827997d03b91f02bb07856) )
574573
575574   ROM_REGION( 0x0800, "plds", 0 )
576575   ROM_LOAD( "pal16l8a.u47", 0x0000, 0x0104, CRC(554b4286) SHA1(26bc991f2cc58644cd2d9ce5c1867a94455b95a8) )
trunk/src/mame/drivers/toypop.c
r29404r29405
532532   MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1_RIGHT"))
533533   MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2_RIGHT"))
534534   MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
535     
535
536536   MCFG_DEVICE_ADD("56xx_1", NAMCO56XX, 0)
537537   MCFG_NAMCO56XX_IN_0_CB(READ8(toypop_state, dipA_h))
538538   MCFG_NAMCO56XX_IN_1_CB(READ8(toypop_state, dipB_l))
539539   MCFG_NAMCO56XX_IN_2_CB(READ8(toypop_state, dipB_h))
540540   MCFG_NAMCO56XX_IN_3_CB(READ8(toypop_state, dipA_l))
541541   MCFG_NAMCO56XX_OUT_0_CB(WRITE8(toypop_state, flip))
542   
542
543543   MCFG_DEVICE_ADD("56xx_2", NAMCO56XX, 0)
544544   MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1_LEFT"))
545545   MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2_LEFT"))
546546   MCFG_NAMCO56XX_IN_3_CB(IOPORT("SERVICE"))
547   
547
548548   /* video hardware */
549549   MCFG_SCREEN_ADD("screen", RASTER)
550550   MCFG_SCREEN_REFRESH_RATE(60.606060)
trunk/src/mame/drivers/cd32.c
r29404r29405
864864   Harem Challenge      |      | 1995
865865   Laser Quiz           |      | 1995
866866   Laser Quiz 2 "Italy" |  1.0 | 1995
867   Laser Strixx         |      | 1995
867   Laser Strixx         |      | 1995
868868   Laser Strixx 2       |      | 1995
869869   Magic Premium        |  1.1 | 1996
870870   Laser Quiz France    |  1.0 | 1995
trunk/src/mame/drivers/olibochu.c
r29404r29405
200200         flipy = !flipy;
201201      }
202202
203     
203
204204         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
205205         code, color,
206206         flipx, flipy,
r29404r29405
226226         flipy = !flipy;
227227      }
228228
229     
229
230230         m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
231231         code, color,
232232         flipx, flipy,
trunk/src/mame/drivers/taitogn.c
r29404r29405
8181      CAT702         - Protection chip labelled 'TT10' (DIP20)
8282      *              - Unpopulated position for additional KM416V1204BT-L5 RAMs
8383      NEC_78081G503  - NEC uPD78081 MCU, 5MHz
84     
84
8585      Video syncs are 59.8260Hz and 15.4333kHz
8686
8787
r29404r29405
420420{
421421   // 20 = watchdog
422422   m_mb3773->write_line_ck((data & 0x20) >> 5);
423   
423
424424   // 10 = sound hw reset, but make sure it's only booted on games that use it
425425   if (m_has_zoom)
426426   {
r29404r29405
429429      if (~data & m_control & 0x10)
430430      {
431431         logerror("control_w Zoom reset\n");
432         
432
433433         m_zoom->reset();
434434
435435         // assume that this also readys the sound flash chips
r29404r29405
489489         m_v = m_v ^ 8;
490490         // Probably something to do with MCU
491491         return m_v;
492     
492
493493      default:
494494         break;
495495   }
r29404r29405
550550      case 0x08: return ioport("KEY1")->read();
551551      case 0x40: return ioport("KEY2")->read();
552552      case 0x80: return ioport("KEY3")->read();
553     
553
554554      default:
555555         break;
556556   }
r29404r29405
587587{
588588   // halt sound CPU since it has no valid program at start
589589   m_mn10200->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
590   
590
591591   m_control = 0x10;
592592}
593593
r29404r29405
661661   MCFG_DEVICE_ADD("maincpu:sio0:znsec1", ZNSEC, 0)
662662   MCFG_DEVICE_ADD("maincpu:sio0:zndip", ZNDIP, 0)
663663   MCFG_ZNDIP_DATA_HANDLER(IOPORT(":DSW"))
664   
664
665665   MCFG_AT28C16_ADD( "at28c16", 0 )
666666   MCFG_DEVICE_ADD("rf5c296", RF5C296, 0)
667667   MCFG_RF5C296_SLOT(":pccard")
trunk/src/mame/drivers/r2dx_v33.c
r29404r29405
743743   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0, 32*8-1)
744744   MCFG_SCREEN_UPDATE_DRIVER(r2dx_v33_state, screen_update_rdx_v33)
745745   MCFG_SCREEN_PALETTE("palette")
746   
746
747747   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rdx_v33)
748748   MCFG_PALETTE_ADD("palette", 2048)
749749   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
trunk/src/mame/drivers/vega.c
r29404r29405
582582
583583         //  if(color==0) color=0xf;
584584
585              m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, character, color, 0, 0, x*7, y*10,0);
585               m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, character, color, 0, 0, x*7, y*10,0);
586586
587587            ++idx;
588588         }
r29404r29405
603603         {
604604            //for(int x=0;x<4;++x)
605605            {
606                 m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0);
606                  m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0);
607607               ++num;
608608            }
609609         }
r29404r29405
643643
644644            for(int y=0;y<4;++y)
645645            {
646                 m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0);
646                  m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0);
647647               ++strip_num;
648648            }
649649         }
trunk/src/mame/drivers/mappy.c
r29404r29405
17231723   MCFG_NAMCO56XX_IN_1_CB(IOPORT("P1"))
17241724   MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
17251725   MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
1726   
1726
17271727   MCFG_DEVICE_ADD("namcoio_2", NAMCO56XX, 0)
17281728   MCFG_NAMCO56XX_IN_0_CB(READ8(mappy_state, dipB_mux))
17291729   MCFG_NAMCO56XX_IN_1_CB(READ8(mappy_state, dipA_l))
r29404r29405
17451745   MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
17461746   MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
17471747   MCFG_NAMCO56XX_OUT_0_CB(WRITE8(mappy_state, out_lamps))
1748   
1748
17491749   MCFG_DEVICE_ADD("namcoio_2", NAMCO59XX, 0)
17501750   MCFG_NAMCO59XX_IN_0_CB(READ8(mappy_state, dipB_mux))
17511751   MCFG_NAMCO59XX_IN_1_CB(READ8(mappy_state, dipA_l))
r29404r29405
17671767   MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
17681768   MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
17691769   MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
1770   
1770
17711771   MCFG_DEVICE_ADD("namcoio_2", NAMCO56XX, 0)
17721772   MCFG_NAMCO56XX_IN_0_CB(READ8(mappy_state, dipB_mux))
17731773   MCFG_NAMCO56XX_IN_1_CB(READ8(mappy_state, dipA_l))
r29404r29405
18071807   MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
18081808   MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
18091809   MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
1810   
1810
18111811   MCFG_DEVICE_ADD("namcoio_2", NAMCO56XX, 0)
18121812   MCFG_NAMCO56XX_IN_0_CB(READ8(mappy_state, dipB_muxi))
18131813   MCFG_NAMCO56XX_IN_1_CB(READ8(mappy_state, dipA_l))
18141814   MCFG_NAMCO56XX_IN_2_CB(READ8(mappy_state, dipA_h))
18151815   MCFG_NAMCO56XX_IN_3_CB(IOPORT("DSW0"))
18161816   MCFG_NAMCO56XX_OUT_0_CB(WRITE8(mappy_state, out_mux))
1817   
1817
18181818   /* video hardware */
18191819   MCFG_GFXDECODE_ADD("gfxdecode", "palette", phozon)
18201820   MCFG_PALETTE_ADD("palette", 64*4+64*4)
r29404r29405
18841884   MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
18851885   MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
18861886   MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
1887   
1887
18881888   MCFG_DEVICE_ADD("namcoio_2", NAMCO58XX, 0)
18891889   MCFG_NAMCO58XX_IN_0_CB(READ8(mappy_state, dipB_mux))
18901890   MCFG_NAMCO58XX_IN_1_CB(READ8(mappy_state, dipA_l))
r29404r29405
19071907   MCFG_NAMCO58XX_IN_1_CB(IOPORT("P1"))
19081908   MCFG_NAMCO58XX_IN_2_CB(IOPORT("P2"))
19091909   MCFG_NAMCO58XX_IN_3_CB(IOPORT("BUTTONS"))
1910   
1910
19111911   MCFG_DEVICE_ADD("namcoio_2", NAMCO56XX, 0)
19121912   MCFG_NAMCO56XX_IN_0_CB(READ8(mappy_state, dipB_mux))
19131913   MCFG_NAMCO56XX_IN_1_CB(READ8(mappy_state, dipA_l))
r29404r29405
19371937   MCFG_NAMCO56XX_IN_2_CB(IOPORT("P2"))
19381938   MCFG_NAMCO56XX_IN_3_CB(IOPORT("BUTTONS"))
19391939   MCFG_NAMCO56XX_OUT_0_CB(WRITE8(mappy_state, out_lamps))
1940   
1940
19411941   MCFG_DEVICE_ADD("namcoio_2", NAMCO56XX, 0)
19421942   MCFG_NAMCO56XX_IN_0_CB(READ8(mappy_state, dipB_mux))
19431943   MCFG_NAMCO56XX_IN_1_CB(READ8(mappy_state, dipA_l))
trunk/src/mame/drivers/safarir.c
r29404r29405
410410   /* video hardware */
411411   MCFG_PALETTE_ADD("palette", 2*8)
412412   MCFG_PALETTE_INIT_OWNER(safarir_state, safarir)
413   
413
414414   MCFG_GFXDECODE_ADD("gfxdecode", "palette", safarir)
415415
416416   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/uapce.c
r29404r29405
321321   MCFG_CPU_PROGRAM_MAP(z80_map)
322322
323323   MCFG_QUANTUM_TIME(attotime::from_hz(60))
324   
324
325325   /* video hardware */
326326   MCFG_SCREEN_ADD("screen", RASTER)
327327   MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK, HUC6260_WPF, 64, 64 + 1024 + 64, HUC6260_LPF, 18, 18 + 242)
trunk/src/mame/drivers/rltennis.c
r29404r29405
185185   MCFG_SCREEN_VISIBLE_AREA(0,319, 0, 239)
186186   MCFG_SCREEN_UPDATE_DRIVER(rltennis_state, screen_update_rltennis)
187187   MCFG_SCREEN_PALETTE("palette")
188   
188
189189   MCFG_PALETTE_ADD("palette", 256)
190190
191191   MCFG_NVRAM_ADD_0FILL("nvram")
trunk/src/mame/drivers/cavepc.c
r29404r29405
134134
135135Deathshmiles II (2009/10/14 MASTER VER 4.00)
136136
137CAVE's venture into PC based hardware platforms. The game did not
138sell that well and was plagued by BSODs and hardware issues. The
137CAVE's venture into PC based hardware platforms. The game did not
138sell that well and was plagued by BSODs and hardware issues. The
139139motherboard bios version that shipped out with the game is F2 on
140140a Gigabyte GA-MA78GPM-UD2H board
141141( http://www.gigabyte.com/products/product-page.aspx?pid=3016#ov )
r29404r29405
143143The following versions are known to have existed.
144144
1451451.00 - released 2009/05/14
1462.00   
1462.00
1471473.00 - sometimes scrolls the text "2ND UPDATE MASTER VER 3.00" at
148148       the bottom of the title screen
149149
150150The archive contains the following:
151151
152./images, documentaiton
152./images, documentaiton
153153./cf_card_2gb, a dd image of the 2GB CF FLASH card
154154./usb_drive, the game is updated using a USB drive and will not
155155  start if it is not present
trunk/src/mame/drivers/metalmx.c
r29404r29405
726726   MCFG_CPU_CONFIG(gsp_config)
727727   MCFG_CPU_PROGRAM_MAP(gsp_map)
728728
729   MCFG_CPU_ADD("dsp32c_1", DSP32C, 40000000)      /* Unverified */   
729   MCFG_CPU_ADD("dsp32c_1", DSP32C, 40000000)      /* Unverified */
730730   MCFG_CPU_PROGRAM_MAP(dsp32c_1_map)
731731
732732   MCFG_CPU_ADD("dsp32c_2", DSP32C, 40000000)      /* Unverified */
trunk/src/mame/drivers/slapfght.c
r29404r29405
99    Guardian / Get Star
1010    Performan
1111    Tiger Heli
12 
12
1313  TODO:
1414  - proper MCU emulation (mame/machine/slapfght.c)
1515  - alcon cocktail/flipscreen, it doesn't write to the flipscreen reg
r29404r29405
358358WRITE8_MEMBER(slapfght_state::irq_enable_w)
359359{
360360   m_main_irq_enabled = offset ? true : false;
361   
361
362362   if (!m_main_irq_enabled)
363363      m_maincpu->set_input_line(0, CLEAR_LINE);
364364}
r29404r29405
366366WRITE8_MEMBER(slapfght_state::sound_reset_w)
367367{
368368   m_audiocpu->set_input_line(INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
369   
369
370370   if (offset == 0)
371371      m_sound_nmi_enabled = false;
372372}
r29404r29405
482482/***************************************************************************
483483
484484  MCU Memory Maps
485 
485
486486  NOTE: handlers and simulation are in the src/mame/machine folder
487487
488488***************************************************************************/
r29404r29405
834834{
835835   // don't boot the mcu since we don't have a dump yet
836836   m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
837   
837
838838   machine_reset();
839839}
840840
r29404r29405
844844{
845845   UINT8 *ROM = memregion("maincpu")->base();
846846   membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
847   
847
848848   membank("bank1")->set_entry(0);
849849}
850850
r29404r29405
10871087   MCFG_CPU_MODIFY("maincpu")
10881088   MCFG_CPU_PROGRAM_MAP(tigerhb1_map)
10891089   MCFG_CPU_IO_MAP(tigerhb_io_map)
1090   
1090
10911091   MCFG_DEVICE_REMOVE("mcu")
10921092MACHINE_CONFIG_END
10931093
r29404r29405
11671167   MCFG_CPU_MODIFY("maincpu")
11681168   MCFG_CPU_PROGRAM_MAP(getstar_map)
11691169   MCFG_CPU_IO_MAP(getstar_io_map)
1170   
1170
11711171   MCFG_MACHINE_RESET_OVERRIDE(slapfght_state, getstar)
11721172MACHINE_CONFIG_END
11731173
trunk/src/mame/drivers/1945kiii.c
r29404r29405
120120      ypos = (source[0] & 0x00ff) >> 0;
121121      tileno = (source2[0] & 0x7ffe) >> 1;
122122      xpos |=  (source2[0] & 0x0001) << 8;
123       gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos, ypos, 0);
124       gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos, ypos - 0x100, 0); // wrap
125       gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos - 0x200, ypos, 0); // wrap
126       gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos - 0x200, ypos - 0x100, 0); // wrap
123         gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos, ypos, 0);
124         gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos, ypos - 0x100, 0); // wrap
125         gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos - 0x200, ypos, 0); // wrap
126         gfx->transpen(bitmap,cliprect, tileno, 1, 0, 0, xpos - 0x200, ypos - 0x100, 0); // wrap
127127
128128      source++;
129129      source2++;
trunk/src/mame/drivers/astinvad.c
r29404r29405
7474
7575   required_device<samples_device> m_samples;
7676   required_device<screen_device> m_screen;
77   
77
7878   DECLARE_WRITE8_MEMBER(color_latch_w);
7979   DECLARE_WRITE8_MEMBER(spaceint_videoram_w);
8080   DECLARE_READ8_MEMBER(kamikaze_ppi_r);
trunk/src/mame/drivers/boogwing.c
r29404r29405
364364   MCFG_DECO16IC_ADD("tilegen1", boogwing_deco16ic_tilegen1_intf)
365365   MCFG_DECO16IC_GFXDECODE("gfxdecode")
366366   MCFG_DECO16IC_PALETTE("palette")
367   
367
368368   MCFG_DECO16IC_ADD("tilegen2", boogwing_deco16ic_tilegen2_intf)
369369   MCFG_DECO16IC_GFXDECODE("gfxdecode")
370370   MCFG_DECO16IC_PALETTE("palette")
trunk/src/mame/drivers/offtwall.c
r29404r29405
376376   MCFG_ATARI_VAD_MOB(offtwall_state::s_mob_config, "gfxdecode")
377377
378378   MCFG_SCREEN_ADD("screen", RASTER)
379   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)   
379   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
380380   /* note: these parameters are from published specs, not derived */
381381   /* the board uses a VAD chip to generate video signals */
382382   MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
r29404r29405
422422   ROM_REGION( 0x800, "eeprom:eeprom", 0 )
423423   ROM_LOAD( "offtwall-eeprom.17l", 0x0000, 0x800, CRC(5eaf2d5b) SHA1(934a76a23960e6ed2cc33c359f9735caee762145) )
424424
425    ROM_REGION(0x022f, "jsa:plds", 0)
426    ROM_LOAD("136085-1038.17c.bin", 0x0000, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
427    ROM_LOAD("136085-1039.20c.bin", 0x0118, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
425   ROM_REGION(0x022f, "jsa:plds", 0)
426   ROM_LOAD("136085-1038.17c.bin", 0x0000, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
427   ROM_LOAD("136085-1039.20c.bin", 0x0118, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
428428
429    ROM_REGION(0x2591, "main:plds", 0)
430    ROM_LOAD("136090-1001.14l.bin", 0x0000, 0x201d, NO_DUMP ) /* GAL6001-35P is read protected */
431    ROM_LOAD("136090-1002.11r.bin", 0x201e, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
432    ROM_LOAD("136090-1003.15f.bin", 0x2135, 0x0117, CRC(5e723b46) SHA1(e686920d0af342e33f836fec15b6e8b5ef1b8be5)) /* GAL16V8A-25LP */
433    ROM_LOAD("136090-1005.5n.bin",  0x224c, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
434    ROM_LOAD("136090-1006.5f.bin",  0x2363, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
435    ROM_LOAD("136090-1007.3f.bin",  0x247a, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
429   ROM_REGION(0x2591, "main:plds", 0)
430   ROM_LOAD("136090-1001.14l.bin", 0x0000, 0x201d, NO_DUMP ) /* GAL6001-35P is read protected */
431   ROM_LOAD("136090-1002.11r.bin", 0x201e, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
432   ROM_LOAD("136090-1003.15f.bin", 0x2135, 0x0117, CRC(5e723b46) SHA1(e686920d0af342e33f836fec15b6e8b5ef1b8be5)) /* GAL16V8A-25LP */
433   ROM_LOAD("136090-1005.5n.bin",  0x224c, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
434   ROM_LOAD("136090-1006.5f.bin",  0x2363, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
435   ROM_LOAD("136090-1007.3f.bin",  0x247a, 0x0117, NO_DUMP ) /* GAL16V8A-25LP is read protected */
436436ROM_END
437437
438438
trunk/src/mame/drivers/firetrk.c
r29404r29405
4949TIMER_DEVICE_CALLBACK_MEMBER(firetrk_state::firetrk_scanline)
5050{
5151   int scanline = param;
52   
52
5353   // periodic IRQs are generated by inverse 16V signal
5454   if ((scanline & 0x1f) == 0)
5555      generic_pulse_irq_line(m_maincpu, 0, 1);
56   
56
5757   // vblank interrupt
5858   // NMIs are disabled during service mode
5959   if (!m_in_service_mode && scanline == 240)
trunk/src/mame/drivers/segas16a.c
r29404r29405
19791979
19801980/*
19811981static MACHINE_CONFIG_DERIVED( system16a_i8751_no7751, system16a_i8751 )
1982   MCFG_DEVICE_REMOVE("n7751")
1983   MCFG_DEVICE_REMOVE("dac")
1982    MCFG_DEVICE_REMOVE("n7751")
1983    MCFG_DEVICE_REMOVE("dac")
19841984
1985   MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
1986   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1985    MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
1986    MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
19871987MACHINE_CONFIG_END
19881988*/
19891989
r29404r29405
25142514   ROM_LOAD16_BYTE( "epr-7384.24",  0x020001, 0x8000, CRC(fd909341) SHA1(2f1e01eb7d7b330c9c0dd98e5f8ed4973f0e93fb) )
25152515
25162516   ROM_REGION( 0x18000, "gfx1", 0 ) // tiles
2517   ROM_LOAD( "epr-7388.95",  0x00000, 0x08000, CRC(8eb02f6b) SHA1(80511b944b57541669010bd5a0ca52bc98eabd62) )
2517   ROM_LOAD( "epr-7388.95",  0x00000, 0x08000, CRC(8eb02f6b) SHA1(80511b944b57541669010bd5a0ca52bc98eabd62) )
25182518   ROM_LOAD( "epr-7389.94",  0x08000, 0x08000, CRC(2f4f71b8) SHA1(ceb39e95cd43904b8e4f89c7227491e139fb3ca6) )
25192519   ROM_LOAD( "epr-7390.93",  0x10000, 0x08000, CRC(d90609c6) SHA1(4232f6ecb21f242c0c8d81e06b88bc742668609f) )
25202520
r29404r29405
25402540   ROM_LOAD16_BYTE( "epr-7387.41",         0x020000, 0x8000, CRC(0acd335d) SHA1(f39566a2069eefa7682c57c6521ea7a328738d06) ) // missing - assumed to be the same because the rom below is
25412541   ROM_LOAD16_BYTE( "ic24-prg20-2f57.bin", 0x020001, 0x8000, CRC(fd909341) SHA1(2f1e01eb7d7b330c9c0dd98e5f8ed4973f0e93fb) ) // MATCH
25422542
2543   ROM_REGION( 0x18000, "gfx1", 0 ) // tiles
2543   ROM_REGION( 0x18000, "gfx1", 0 ) // tiles
25442544   ROM_LOAD( "ic95-1413.bin",  0x00000, 0x08000, CRC(158af770) SHA1(a02c500920770a987c9d8c78e0313cb3434c1873) ) // 96.661377%
25452545   ROM_LOAD( "ic94-3e96.bin",  0x08000, 0x08000, CRC(2fea4fe7) SHA1(891dbf163378e9ef55b97b4cb8ac02dab05f206c) ) // 96.710205%
25462546   ROM_LOAD( "ic93-de1b.bin",  0x10000, 0x08000, BAD_DUMP CRC(335fe57a) SHA1(93cfcfd1d06daa03b1b000460c4e0ff54aa9f317) ) // 72.341919%
trunk/src/mame/drivers/neogeo.c
r29404r29405
210210    . NEO-MVS PROGSS3
211211    . NEO-MVS PROGTOP
212212    . NEO-MVS PROGSF1 (1998.6.17)
213   . NEO-MVS PROGSF1E (1998.6.18)
213    . NEO-MVS PROGSF1E (1998.6.18)
214214    . NEO-MVS PROGEOP (1999.2.2)
215215    . NEO-MVS PROGLBA (1999.4.12) - LBA-SUB (2000.2.24)
216216    . NEO-MVS PROGBK1 (1994)
r29404r29405
787787READ16_MEMBER(neogeo_state::memcard_r)
788788{
789789   m_maincpu->eat_cycles(2); // insert waitstate
790   
790
791791   UINT16 ret;
792792
793793   if (memcard_present(machine()) != -1)
r29404r29405
18101810   MCFG_CPU_ADD("audiocpu", Z80, NEOGEO_AUDIO_CPU_CLOCK)
18111811   MCFG_CPU_PROGRAM_MAP(audio_map)
18121812   MCFG_CPU_IO_MAP(audio_io_map)
1813   
1813
18141814   /* video hardware */
18151815   MCFG_DEFAULT_LAYOUT(layout_neogeo)
18161816
r29404r29405
1155811558/* N.C.I - LE CORTEX */
1155911559// Bang Bang Busters (c)2010 - MVS?/AES
1156011560// Treasure of the Caribbean (c)2011 - MVS?/AES
11561
trunk/src/mame/drivers/statriv2.c
r29404r29405
8888      m_videoram(*this, "videoram"),
8989      m_question_offset(*this, "question_offset"),
9090      m_gfxdecode(*this, "gfxdecode"),
91      m_palette(*this, "palette")
91      m_palette(*this, "palette")
9292         { }
9393
9494   required_device<cpu_device> m_maincpu;
trunk/src/mame/drivers/ultraman.c
r29404r29405
230230   MCFG_PALETTE_ENABLE_SHADOWS()
231231
232232   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
233   
233
234234   MCFG_K051960_ADD("k051960", ultraman_k051960_intf)
235235   MCFG_K051960_GFXDECODE("gfxdecode")
236236   MCFG_K051960_PALETTE("palette")
237   
237
238238   MCFG_K051316_ADD("k051316_1", ultraman_k051316_intf_0)
239239   MCFG_K051316_GFXDECODE("gfxdecode")
240240   MCFG_K051316_PALETTE("palette")
241   
241
242242   MCFG_K051316_ADD("k051316_2", ultraman_k051316_intf_1)
243243   MCFG_K051316_GFXDECODE("gfxdecode")
244244   MCFG_K051316_PALETTE("palette")
245   
245
246246   MCFG_K051316_ADD("k051316_3", ultraman_k051316_intf_2)
247247   MCFG_K051316_GFXDECODE("gfxdecode")
248248   MCFG_K051316_PALETTE("palette")
trunk/src/mame/drivers/atarittl.c
r29404r29405
22
33 Atari / Kee Games Driver - Discrete Games made in the 1970's
44
5
5
66 Atari / Kee Games List and Data based, in part from:
7
7
88 - Andy's collection of Bronzeage Atari Video Arcade PCB's"
99 http://www.andysarcade.net/personal/bronzeage/index.htm
10
10
1111 - "Atari's Technical Manual Log"
1212 http://www.atarigames.com/manuals.txt
13
13
1414 Suspected "same games" are grouped together.  These are usually the exact same game but different cabinet/name.
15 
16 
15
16
1717 Technical Manual #s  Game Name(s)                                         Atari Part #'s                     Data      PROM/ROM Chip Numbers
1818 -------------------+----------------------------------------------------+----------------------------------+---------+---------------------------------------
1919 TM-025               Anti-Aircraft (1975)                                 A000951                            YES       003127
2020 TM-058               Breakout/Breakout Cocktail (1976)                    A004533                            NO
21 TM-048               Crash 'N Score/Stock Car (1975)                      A004256                            YES       003186(x2), 003187(x2), 004248, 004247
21 TM-048               Crash 'N Score/Stock Car (1975)                      A004256                            YES       003186(x2), 003187(x2), 004248, 004247
2222 TM-030               Crossfire (1975)
2323 TM-003,005,011,020   Gran Trak 10/Trak 10/Formula K/Race Circuit (1974)   A000872,A000872 K3RT               YES       74186 Racetrack Prom (K5)
2424 TM-004,021           Gran Trak 20/Trak 20/Twin Racer (1974)               A001791(RT20),A001793(A20-K4DRTA)  YES       74186 Racetrack prom (K5)
r29404r29405
3333 TM-040               Outlaw (1976)                                        A003213                            YES       003323 - ROM (8205 @ J4)
3434 TM-007               Pin Pong (1974)                                      A001660                            NO
3535 TM-013               Pong/Super Pong (1972)                               A001433,A000423                    NO
36 TM-015               Pong Cocktail (1974)                                                                    NO
36 TM-015               Pong Cocktail (1974)                                                                    NO
3737 TM-014               Pong Doubles/Coupe Davis (1974)                      A000785                            NO
3838 TM-018               Pursuit (1975)                                       K8P-B 90128                        NO
3939 TM-012,022,034       Quadrapong/Elimination (1974)                        A000845                            NO
r29404r29405
4646 TM-057               Stunt Cycle (1976)                                   A004128                            YES       004275 ROM Motorcycle/Bus (1F), 004811 ROM Score Translator (D7)
4747 TM-010,036,049       Tank/Tank Cocktail/Tank II (1974/1975)               A003111 (K5T-F 90124)              YES       90-2006
4848 TM-002               Touch Me (1974)                                                                         NO
49
49
5050 - Not Known to be released or produced, but at least announced.
51
51
5252 TM-024               Qwakers (Not Produced/Released)
5353 TM-017               World Cup Football (Not Produced/Released)
54 
55 
54
55
5656***************************************************************************/
5757
5858
r29404r29405
9494public:
9595   atarikee_state(const machine_config &mconfig, device_type type, const char *tag)
9696   : driver_device(mconfig, type, tag),
97     m_maincpu(*this, "maincpu"),
98     m_video(*this, "fixfreq")
97      m_maincpu(*this, "maincpu"),
98      m_video(*this, "fixfreq")
9999   {
100100   }
101   
101
102102   // devices
103103   required_device<netlist_mame_device_t> m_maincpu;
104104   required_device<fixedfreq_device> m_video;
105105
106106protected:
107   
107
108108   // driver_device overrides
109109   virtual void machine_start();
110110   virtual void machine_reset();
111   
111
112112   virtual void video_start();
113   
113
114114private:
115   
115
116116};
117117
118118
119119
120120static NETLIST_START(atarikee)
121121   SOLVER(Solver, 48000)
122//   PARAM(Solver.FREQ, 48000)
122//  PARAM(Solver.FREQ, 48000)
123123   PARAM(Solver.ACCURACY, 1e-4) // works and is sufficient
124124
125125   // schematics
126126   //...
127127
128//   NETDEV_ANALOG_CALLBACK(sound_cb, sound, atarikee_state, sound_cb, "")
129//   NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
128//  NETDEV_ANALOG_CALLBACK(sound_cb, sound, atarikee_state, sound_cb, "")
129//  NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
130130NETLIST_END()
131131
132132
r29404r29405
147147static MACHINE_CONFIG_START( atarikee, atarikee_state )
148148
149149   /* basic machine hardware */
150    MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
150   MCFG_DEVICE_ADD("maincpu", NETLIST_CPU, NETLIST_CLOCK)
151151   MCFG_NETLIST_SETUP(atarikee)
152152
153153   /* video hardware */
r29404r29405
309309ROM_END
310310
311311
312/*   // NO DUMPED ROMS
312/*  // NO DUMPED ROMS
313313
314314// Astroturf
315315ROM_START( astrotrf )
316   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
317 
318   ROM_REGION( 0x0400, "gfx", ROMREGION_ERASE00 ) // Region Size unknown, dump size unknown
319   ROM_LOAD( "003774.c8",     0x0000, 0x0100, NO_DUMP ) // Bugle
320   ROM_LOAD( "003773-02.c4",  0x0100, 0x0100, NO_DUMP ) // Graphics (Astroturf - Rev.A)
316    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
317
318    ROM_REGION( 0x0400, "gfx", ROMREGION_ERASE00 ) // Region Size unknown, dump size unknown
319    ROM_LOAD( "003774.c8",     0x0000, 0x0100, NO_DUMP ) // Bugle
320    ROM_LOAD( "003773-02.c4",  0x0100, 0x0100, NO_DUMP ) // Graphics (Astroturf - Rev.A)
321321ROM_END
322322
323323// Crossfire
r29404r29405
327327
328328// Gran Trak 10
329329ROM_START( gtrak10 )  // Unknown size, assumed 2K Bytes
330   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
331 
332   ROM_REGION( 0x0800, "racetrack", ROMREGION_ERASE00 )
333   ROM_LOAD( "74168.k5",     0x0000, 0x0800, NO_DUMP) // Racetrack
330    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
331
332    ROM_REGION( 0x0800, "racetrack", ROMREGION_ERASE00 )
333    ROM_LOAD( "74168.k5",     0x0000, 0x0800, NO_DUMP) // Racetrack
334334ROM_END
335
335
336336// Gran Trak 20
337337ROM_START( gtrak20 )  // Unknown size, assumed 2K Bytes
338   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
339 
340   ROM_REGION( 0x0800, "racetrack", ROMREGION_ERASE00 )
341   ROM_LOAD( "74168.k5",     0x0000, 0x0800, NO_DUMP) // Racetrack
338    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
339
340    ROM_REGION( 0x0800, "racetrack", ROMREGION_ERASE00 )
341    ROM_LOAD( "74168.k5",     0x0000, 0x0800, NO_DUMP) // Racetrack
342342ROM_END
343343
344344// LeMans
345345ROM_START( lemans )
346   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
347 
348   ROM_REGION( 0x0400, "gfx", ROMREGION_ERASE00 ) // Region Size unknown, dump size unknown
349   ROM_LOAD( "005837-01.n5",  0x0000, 0x0100, NO_DUMP ) // Rom 1
350   ROM_LOAD( "005838-01.n4",  0x0100, 0x0100, NO_DUMP ) // Rom 2
351   ROM_LOAD( "005839-01.n6",  0x0200, 0x0100, NO_DUMP ) // Rom 3
346    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
347
348    ROM_REGION( 0x0400, "gfx", ROMREGION_ERASE00 ) // Region Size unknown, dump size unknown
349    ROM_LOAD( "005837-01.n5",  0x0000, 0x0100, NO_DUMP ) // Rom 1
350    ROM_LOAD( "005838-01.n4",  0x0100, 0x0100, NO_DUMP ) // Rom 2
351    ROM_LOAD( "005839-01.n6",  0x0200, 0x0100, NO_DUMP ) // Rom 3
352352ROM_END
353 
354// Qwak!
353
354// Qwak!
355355ROM_START( qwak )
356   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
357 
358   ROM_REGION( 0x0200, "gfx", ROMREGION_ERASE00 ) // Region Size unknown, dump size unknown
359   ROM_LOAD( "37-2530n.k9",  0x0000, 0x0200, NO_DUMP ) // Custom Rom (2530 N)
356    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
357
358    ROM_REGION( 0x0200, "gfx", ROMREGION_ERASE00 ) // Region Size unknown, dump size unknown
359    ROM_LOAD( "37-2530n.k9",  0x0000, 0x0200, NO_DUMP ) // Custom Rom (2530 N)
360360ROM_END
361
361
362362*/
363363
364364
365/*   // 100% TTL - NO ROMS
366 
365/*  // 100% TTL - NO ROMS
366
367367ROM_START( breakout )
368   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
368    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
369369ROM_END
370370
371371ROM_START( goal4 )
372   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
372    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
373373ROM_END
374374
375375ROM_START( gotcha )
376   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
376    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
377377ROM_END
378378
379379ROM_START( gotchac )
380   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
380    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
381381ROM_END
382382
383383ROM_START( highway )
384   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
384    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
385385ROM_END
386386
387387ROM_START( pinpong )
388   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
388    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
389389ROM_END
390390
391391ROM_START( pongdbl )
392   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
392    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
393393ROM_END
394394
395395ROM_START( pursuit )
396   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
396    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
397397ROM_END
398398
399399ROM_START( quadpong )
400   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
400    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
401401ROM_END
402402
403403ROM_START( rebound )
404   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
404    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
405405ROM_END
406406
407407ROM_START( spacrace )
408   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
408    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
409409ROM_END
410410
411411ROM_START( touchme )
412   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
412    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
413413ROM_END
414
414
415415*/
416416
417417
trunk/src/mame/drivers/quantum.c
r29404r29405
308308   MCFG_SCREEN_VISIBLE_AREA(0, 900, 0, 600)
309309   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
310310
311   MCFG_DEVICE_ADD("avg", AVG_QUANTUM, 0)   
311   MCFG_DEVICE_ADD("avg", AVG_QUANTUM, 0)
312312   MCFG_AVGDVG_VECTOR("vector")
313313
314314   /* sound hardware */
trunk/src/mame/drivers/taito_f2.c
r29404r29405
32603260
32613261   MCFG_PALETTE_MODIFY("palette")
32623262   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
3263   
3263
32643264   /* video hardware */
32653265   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_gunfront)
32663266   MCFG_SCREEN_MODIFY("screen")
r29404r29405
33883388
33893389   MCFG_PALETTE_MODIFY("palette")
33903390   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
3391   
3391
33923392   /* video hardware */
33933393   MCFG_GFXDECODE_MODIFY("gfxdecode", yuyugogo)
33943394   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_yuyugogo)
r29404r29405
35853585   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_dinorex)
35863586   MCFG_SCREEN_MODIFY("screen")
35873587   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
3588   
3588
35893589   MCFG_PALETTE_MODIFY("palette")
35903590   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
35913591
r29404r29405
36073607   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_quiz)
36083608   MCFG_SCREEN_MODIFY("screen")
36093609   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
3610   
3610
36113611   MCFG_PALETTE_MODIFY("palette")
36123612   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
36133613
r29404r29405
36293629   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_quiz)
36303630   MCFG_SCREEN_MODIFY("screen")
36313631   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
3632   
3632
36333633   MCFG_PALETTE_MODIFY("palette")
36343634   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
36353635
r29404r29405
36513651   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_quiz)
36523652   MCFG_SCREEN_MODIFY("screen")
36533653   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
3654   
3654
36553655   MCFG_PALETTE_MODIFY("palette")
36563656   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
36573657
trunk/src/mame/drivers/goldnpkr.c
r29404r29405
34103410   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
34113411
34123412   /* the following one is connected to DIP switches and is meant
3413    for switch between different programs stored in different
3414    halves of the program ROM */
3413   for switch between different programs stored in different
3414   halves of the program ROM */
34153415   PORT_START("SELDSW")
34163416   PORT_DIPNAME( 0x01, 0x00, "Game Selector" )
34173417   PORT_DIPSETTING(    0x00, "Game 1 (Italian" )
r29404r29405
40484048ROM_END
40494049
40504050ROM_START( videtron2 )
4051   ROM_REGION( 0x10000, "maincpu", 0 )   /* different from videtron */
4051   ROM_REGION( 0x10000, "maincpu", 0 ) /* different from videtron */
40524052   ROM_LOAD( "4.bin", 0x5000, 0x1000, CRC(4a7dab42) SHA1(7fcdab985b783d90879a99b2a53a6814ca4278eb) )
40534053   ROM_LOAD( "5.bin", 0x6000, 0x1000, CRC(c70e8127) SHA1(7db2d4a29cba7c336f254393955fad71f30a539a) )
40544054   ROM_LOAD( "6.bin", 0x7000, 0x1000, CRC(490c7304) SHA1(1a6c6112571fd0e35b640ed58f66582a2d99c58b) )
r29404r29405
1033510335GAME(  198?, pokerduc,  0,        goldnpkr, goldnpkr, goldnpkr_state, icp1db,   ROT0,   "<unknown>",                "unknown encrypted poker game",            GAME_NOT_WORKING )   // encrypted.
1033610336
1033710337GAMEL( 198?, bchancep,  0,        bchancep, goldnpkr, goldnpkr_state, bchancep, ROT0,   "<unknown>",                "Bonne Chance! (Golden Poker prequel HW)", GAME_NOT_WORKING, layout_goldnpkr )
10338GAME(  1987, pokermon,  0,        mondial,  mondial,  driver_device,  0,        ROT0,   "<unknown>",                "Mundial/Mondial (Italian/French)",        0 )               // banked selectable program
10339GAME(  198?, pokersis,  0,        bchancep, goldnpkr, driver_device,  0,        ROT0,   "Sisteme France",           "unknown Sisteme France Poker",            GAME_NOT_WORKING )   // fix banking (4 prgs?)...
10338GAME(  1987, pokermon,  0,        mondial,  mondial,  driver_device,  0,        ROT0,   "<unknown>",                "Mundial/Mondial (Italian/French)",        0 )                  // banked selectable program
10339GAME(  198?, pokersis,  0,        bchancep, goldnpkr, driver_device,  0,        ROT0,   "Sisteme France",           "unknown Sisteme France Poker",            GAME_NOT_WORKING )   // fix banking (4 prgs?)...
trunk/src/mame/drivers/cswat.c
r29404r29405
44  mirrors and motors to move a spotlight(s) on a large projection screen,
55  similar to Namco Shoot Away/Shoot Away II.
66  The CRT is just used for showing status and keeping scores.
7 
7
88  X1 18.432MHz
99  HD68A09EP   - Hitachi M6809 CPU
1010  2 * M58725P - Mitsubishi 2KB SRAM
r29404r29405
134134static ADDRESS_MAP_START( cswat_map, AS_PROGRAM, 8, cswat_state )
135135   AM_RANGE(0x0000, 0x0bff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
136136   AM_RANGE(0x0c00, 0x0fff) AM_RAM
137//   AM_RANGE(0x1800, 0x1800) AM_READNOP // ? reads here after writing to $4000
137//  AM_RANGE(0x1800, 0x1800) AM_READNOP // ? reads here after writing to $4000
138138   AM_RANGE(0x2000, 0x2000) AM_WRITE(irq_ack_w) // writes 1 at end of vblank irq, 0 at gamestart
139139   AM_RANGE(0x2000, 0x2001) AM_READ(dipswitch_r)
140140   AM_RANGE(0x2002, 0x2002) AM_WRITE(irq_ack_w) // writes 0 at start of vblank irq
141141   AM_RANGE(0x2002, 0x2002) AM_READ(sensors_r)
142142   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("IN0")
143//   AM_RANGE(0x4000, 0x4009) AM_NOP // ?
143//  AM_RANGE(0x4000, 0x4009) AM_NOP // ?
144144   AM_RANGE(0x8000, 0xffff) AM_ROM
145145ADDRESS_MAP_END
146146
trunk/src/mame/drivers/hng64.c
r29404r29405
650650
651651   switch (offset*4)
652652   {
653      case 0x000:   return 0x00000400;
653      case 0x000: return 0x00000400;
654654      case 0x004: return ioport("SYSTEM")->read();
655655      case 0x008: return ioport("P1_P2")->read();
656656      case 0x600: return m_no_machine_error_code;
r29404r29405
919919{
920920   //if(data & 2) // swap buffers
921921   //{
922   //   clear3d();
922   //  clear3d();
923923   //}
924924
925//   printf("%02x\n",data);
925//  printf("%02x\n",data);
926926
927//   if(data & 1) // process DMA from 3d FIFO to framebuffer
927//  if(data & 1) // process DMA from 3d FIFO to framebuffer
928928
929929//  if(data & 4) // reset buffer count
930930}
r29404r29405
984984   */
985985READ32_MEMBER(hng64_state::unk_vreg_r)
986986{
987//   m_unk_vreg_toggle^=0x8000;
987//  m_unk_vreg_toggle^=0x8000;
988988
989989   return 0;
990990
991//   return ++m_unk_vreg_toggle;
991//  return ++m_unk_vreg_toggle;
992992}
993993
994994/***** I don't think there is a soundram2, having it NOT hooked up causes xrally to copy the sound program to the expected location, see memory map note *****/
r29404r29405
18901890
18911891   switch(scanline)
18921892   {
1893      case 224*2:   m_set_irq(0x0001);  break; // lv 0 vblank irq
1894//      case 0*2:   m_set_irq(0x0002);  break; // lv 1
1895//      case 32*2:  m_set_irq(0x0008);  break; // lv 2
1896//      case 64*2:  m_set_irq(0x0008);  break; // lv 2
1897      case 128*2:   m_set_irq(0x0800);  break; // lv 11 network irq?
1893      case 224*2: m_set_irq(0x0001);  break; // lv 0 vblank irq
1894//      case 0*2:   m_set_irq(0x0002);  break; // lv 1
1895//      case 32*2:  m_set_irq(0x0008);  break; // lv 2
1896//      case 64*2:  m_set_irq(0x0008);  break; // lv 2
1897      case 128*2: m_set_irq(0x0800);  break; // lv 11 network irq?
18981898   }
18991899}
19001900
r29404r29405
19231923   m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
19241924   m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
19251925
1926//   m_comm->set_input_line(INPUT_LINE_RESET, PULSE_LINE);     // reset the CPU and let 'er rip
1926//  m_comm->set_input_line(INPUT_LINE_RESET, PULSE_LINE);     // reset the CPU and let 'er rip
19271927//  m_comm->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);     // hold on there pardner...
19281928
19291929   // "Display List" init - ugly
1930//   m_activeBuffer = 0;
1930//  m_activeBuffer = 0;
19311931
19321932   /* For simulate MCU stepping */
19331933   m_mcu_fake_time = 0;
r29404r29405
19551955   MCFG_CPU_IO_MAP(hng_comm_io_map)
19561956
19571957   MCFG_NVRAM_ADD_0FILL("nvram")
1958   
1958
19591959   MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz)
19601960
19611961   MCFG_GFXDECODE_ADD("gfxdecode", "palette", hng64)
trunk/src/mame/drivers/cabal.c
r29404r29405
473473   MCFG_SCREEN_REFRESH_RATE(59.60)   /* verified on pcb */
474474   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
475475   MCFG_SCREEN_SIZE(256, 256)
476   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)   
476   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
477477   MCFG_SCREEN_UPDATE_DRIVER(cabal_state, screen_update_cabal)
478478   MCFG_SCREEN_PALETTE("palette")
479479
trunk/src/mame/drivers/turrett.c
r29404r29405
366366   MCFG_SCREEN_RAW_PARAMS(4000000, 512, 0, 336, 259, 0, 244)
367367   MCFG_SCREEN_UPDATE_DRIVER(turrett_state, screen_update)
368368   MCFG_SCREEN_PALETTE("palette")
369   
369
370370   MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
371371
372372   /* sound hardware */
trunk/src/mame/drivers/destroyr.c
r29404r29405
5656   required_device<gfxdecode_device> m_gfxdecode;
5757   required_device<screen_device> m_screen;
5858   required_device<palette_device> m_palette;
59   
59
6060   DECLARE_WRITE8_MEMBER(destroyr_misc_w);
6161   DECLARE_WRITE8_MEMBER(destroyr_cursor_load_w);
6262   DECLARE_WRITE8_MEMBER(destroyr_interrupt_ack_w);
trunk/src/mame/drivers/feversoc.c
r29404r29405
256256   MCFG_SCREEN_REFRESH_RATE(60)
257257   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
258258   MCFG_SCREEN_SIZE(40*8, 32*8)
259   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) //dynamic resolution?   
259   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) //dynamic resolution?
260260   MCFG_SCREEN_UPDATE_DRIVER(feversoc_state, screen_update_feversoc)
261261   MCFG_SCREEN_PALETTE("palette")
262262
trunk/src/mame/drivers/multfish_ref.c
r29404r29405
624624//GAME( 2008, fcockt2_2,   fcockt2_parent,  igrosoft_gamble, igrosoft_gamble, driver_device,  0,        ROT0, "Igrosoft", "Fruit Cocktail 2 (080904 Russia)", GAME_SUPPORTS_SAVE ) /* Russia */
625625
626626#endif
627
628
trunk/src/mame/drivers/gunpey.c
r29404r29405
202202      m_maincpu(*this, "maincpu"),
203203      m_oki(*this, "oki"),
204204      m_wram(*this, "wram"),
205      m_palette(*this, "palette")
205      m_palette(*this, "palette")
206206      { }
207207
208208   required_device<cpu_device> m_maincpu;
trunk/src/mame/drivers/superwng.c
r29404r29405
3939      m_colorram_bg(*this, "colorrabg"),
4040      m_colorram_fg(*this, "colorrafg"),
4141      m_gfxdecode(*this, "gfxdecode"),
42      m_palette(*this, "palette")
42      m_palette(*this, "palette")
4343   { }
4444
4545   required_device<cpu_device> m_maincpu;
trunk/src/mame/drivers/dblcrown.c
r29404r29405
55    Double Crown (c) 1997 Cadence Technology / Dyna
66
77    Driver by Angelo Salese
8   Additional work by Roberto Fresca.
8    Additional work by Roberto Fresca.
99
1010    TODO:
1111    - Bogus "Hole" in main screen display;
r29404r29405
3535    4 * dipsw 8pos
3636    YMZ284-D (ay8910, but without i/o ports)
3737    MAXIM MAX693ACPE is a "Microprocessor Supervisory Circuit", for watchdog
38   and for nvram functions.
38    and for nvram functions.
3939
4040***************************************************************************/
4141
4242
43#define MAIN_CLOCK         XTAL_28_63636MHz
44#define CPU_CLOCK         MAIN_CLOCK / 6
45#define SND_CLOCK         MAIN_CLOCK / 12
43#define MAIN_CLOCK          XTAL_28_63636MHz
44#define CPU_CLOCK           MAIN_CLOCK / 6
45#define SND_CLOCK           MAIN_CLOCK / 12
4646
4747#include "emu.h"
4848#include "cpu/z80/z80.h"
r29404r29405
298298  x-x- --xx  unknown
299299*/
300300
301   coin_counter_w(machine(), 0, data & 0x10);   /* Coin In counter pulse */
302   coin_counter_w(machine(), 1 ,data & 0x08);   /* Payout counter pulse */
303//   popmessage("out: %02x", data);
301   coin_counter_w(machine(), 0, data & 0x10);  /* Coin In counter pulse */
302   coin_counter_w(machine(), 1 ,data & 0x08);  /* Payout counter pulse */
303//  popmessage("out: %02x", data);
304304}
305305
306306
trunk/src/mame/drivers/cball.c
r29404r29405
3636   required_device<gfxdecode_device> m_gfxdecode;
3737   required_device<screen_device> m_screen;
3838   required_device<palette_device> m_palette;
39   
39
4040   DECLARE_WRITE8_MEMBER(cball_vram_w);
4141   DECLARE_READ8_MEMBER(cball_wram_r);
4242   DECLARE_WRITE8_MEMBER(cball_wram_w);
trunk/src/mame/drivers/vlc.c
r29404r29405
327327void nevada_state::nvram_init(nvram_device &nvram, void *data, size_t size)
328328{
329329   memset(data, 0x00, size);
330   if (memregion("defaults")->base())
330   if (memregion("defaults")->base())
331331      memcpy(data, memregion("defaults")->base(), memregion("defaults")->bytes());
332332}
333333
r29404r29405
649649   MCFG_MC68681_INPORT_CALLBACK(IOPORT("DSW3"))
650650
651651   MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("duart40_68681", mc68681_device, rx_a_w) )
652   
652
653653   /* devices */
654654   MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz)
655655   MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(nevada_state, nevada_rtc_irq))
trunk/src/mame/drivers/tourtabl.c
r29404r29405
178178   MCFG_DEVICE_ADD("tia_video", TIA_NTSC_VIDEO, 0)
179179   MCFG_TIA_READ_INPUT_PORT_CB(READ16(tourtabl_state, tourtabl_read_input_port))
180180   MCFG_TIA_DATABUS_CONTENTS_CB(READ8(tourtabl_state, tourtabl_get_databus_contents))
181   
181
182182   MCFG_SCREEN_ADD("screen", RASTER)
183183   MCFG_SCREEN_RAW_PARAMS( MASTER_CLOCK, 228, 34, 34 + 160, 262, 46, 46 + 200 )
184184   MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update)
trunk/src/mame/drivers/asuka.c
r29404r29405
888888   MCFG_TC0100SCN_PALETTE("palette")
889889   MCFG_TC0110PCR_ADD("tc0110pcr")
890890   MCFG_TC0110PCR_PALETTE("palette")
891   
891
892892   /* sound hardware */
893893   MCFG_SPEAKER_STANDARD_MONO("mono")
894894
r29404r29405
920920   MCFG_TC0220IOC_READ_2_CB(IOPORT("IN0"))
921921   MCFG_TC0220IOC_READ_3_CB(IOPORT("IN1"))
922922   MCFG_TC0220IOC_READ_7_CB(IOPORT("IN2"))
923   
923
924924   /* video hardware */
925925   MCFG_SCREEN_ADD("screen", RASTER)
926926   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mame/drivers/hvyunit.c
r29404r29405
111111   required_device<kaneko_pandora_device> m_pandora;
112112   required_device<gfxdecode_device> m_gfxdecode;
113113   required_device<palette_device> m_palette;
114   
114
115115   DECLARE_WRITE8_MEMBER(trigger_nmi_on_slave_cpu);
116116   DECLARE_WRITE8_MEMBER(master_bankswitch_w);
117117   DECLARE_WRITE8_MEMBER(mermaid_data_w);
trunk/src/mame/drivers/rollerg.c
r29404r29405
282282   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
283283
284284   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
285   
285
286286   MCFG_K053244_ADD("k053244", rollerg_k05324x_intf)
287287   MCFG_K053244_GFXDECODE("gfxdecode")
288288   MCFG_K053244_PALETTE("palette")
289   
289
290290   MCFG_K051316_ADD("k051316", rollerg_k051316_intf)
291291   MCFG_K051316_GFXDECODE("gfxdecode")
292292   MCFG_K051316_PALETTE("palette")
293   
293
294294   MCFG_DEVICE_ADD("k053252", K053252, 3000000*2)
295295   MCFG_K053252_INT1_ACK_CB(WRITELINE(rollerg_state,rollerg_irq_ack_w))
296296   MCFG_K053252_OFFSETS(14*8, 2*8)
trunk/src/mame/drivers/backfire.c
r29404r29405
526526   MCFG_SCREEN_PALETTE("palette")
527527
528528
529   MCFG_DECO16IC_ADD("tilegen1", backfire_deco16ic_tilegen1_intf)   
529   MCFG_DECO16IC_ADD("tilegen1", backfire_deco16ic_tilegen1_intf)
530530   MCFG_DECO16IC_SET_SCREEN("lscreen")
531531   MCFG_DECO16IC_GFXDECODE("gfxdecode")
532532   MCFG_DECO16IC_PALETTE("palette")
533   
533
534534   MCFG_DECO16IC_ADD("tilegen2", backfire_deco16ic_tilegen2_intf)
535535   MCFG_DECO16IC_SET_SCREEN("lscreen")
536536   MCFG_DECO16IC_GFXDECODE("gfxdecode")
trunk/src/mame/drivers/ltcasino.c
r29404r29405
658658   MCFG_SCREEN_REFRESH_RATE(60)
659659   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
660660   MCFG_SCREEN_SIZE(64*8, 32*8)
661   MCFG_SCREEN_VISIBLE_AREA(6*8, 58*8-1, 0, 32*8-1)   
661   MCFG_SCREEN_VISIBLE_AREA(6*8, 58*8-1, 0, 32*8-1)
662662   MCFG_SCREEN_UPDATE_DRIVER(ltcasino_state, screen_update_ltcasino)
663663   MCFG_SCREEN_PALETTE("palette")
664664
trunk/src/mame/drivers/coolridr.c
r29404r29405
35463546
35473547WRITE8_MEMBER(coolridr_state::scsp_irq)
35483548{
3549   m_soundcpu->set_input_line(offset, data);     
3549   m_soundcpu->set_input_line(offset, data);
35503550}
35513551
35523552WRITE_LINE_MEMBER(coolridr_state::scsp1_to_sh1_irq)
trunk/src/mame/drivers/mpu4hw.c
r29404r29405
20942094      LOG_CHR(("Characteriser read data %02X \n",m_current_chr_table[m_prot_col].response));
20952095      return m_current_chr_table[m_prot_col].response;
20962096   }
2097     
2097
20982098   if (offset == 3)
20992099   {
21002100      LOG_CHR(("Characteriser read data off 3 %02X \n",m_current_chr_table[m_lamp_col+64].response));
r29404r29405
23952395   //      6  0  7  0  8  0  7  0  0  8
23962396//request 36 42 27 42 09 42 27 42 42 09
23972397//verify  00 04 04 0C 0C 1C 14 2C 5C 2C
2398   
2398
23992399DRIVER_INIT_MEMBER(mpu4_state,m_oldtmr)
24002400{
24012401   m_reel_mux=SIX_REEL_1TO8;
trunk/src/mame/drivers/intrscti.c
r29404r29405
2424      m_subcpu(*this,"subcpu"),
2525      m_vram(*this, "vram"),
2626      m_gfxdecode(*this, "gfxdecode"),
27      m_palette(*this, "palette")
27      m_palette(*this, "palette")
2828   { }
2929
3030   required_device<cpu_device> m_maincpu;
trunk/src/mame/drivers/mgolf.c
r29404r29405
4040   required_device<gfxdecode_device> m_gfxdecode;
4141   required_device<screen_device> m_screen;
4242   required_device<palette_device> m_palette;
43   
43
4444   DECLARE_WRITE8_MEMBER(mgolf_vram_w);
4545   DECLARE_READ8_MEMBER(mgolf_wram_r);
4646   DECLARE_READ8_MEMBER(mgolf_dial_r);
trunk/src/mame/drivers/rungun.c
r29404r29405
402402   MCFG_K055673_ADD("k055673", rng_k055673_intf)
403403   MCFG_K055673_GFXDECODE("gfxdecode")
404404   MCFG_K055673_PALETTE("palette")
405   
405
406406   MCFG_DEVICE_ADD("k053252", K053252, 16000000/2)
407407   MCFG_K053252_OFFSETS(9*8, 24)
408408
trunk/src/mame/mame.lst
r29404r29405
165165galaxiant       // (c) Taito
166166galaxiani       // (c) Irem
167167galaxrf         // bootleg (Recreativos Franco)
168galaxrfgg      // bootleg (Recreativos Franco)
168galaxrfgg       // bootleg (Recreativos Franco)
169169superg          // hack
170170galapx          // hack
171171moonaln         // [Nichibutsu] (Karateco license) or hack
r29404r29405
177177starfght        // hack
178178galaxbsf        // hack
179179galaxianbl      // bootleg
180galaxbsf2      // bootleg
180galaxbsf2       // bootleg
181181kamakazi3       // Video Games (UK) Ltd., hack or bootleg?
182182tst_galx        // Galaxian Test ROM
183183gmgalax         // bootleg
r29404r29405
338338hotshockb       // bootleg
339339conquer         // (c) 1982 ????
340340hunchbks        // (c) 1983 Century
341hunchbks2      // bootleg
341hunchbks2       // bootleg
342342hncholms        // (c) 1984 Century
343343cavelon         // (c) 1983 Jetsoft
344344sfx             // (c) 1983 Nichibutsu
r29404r29405
380380hustlerb        // bootleg
381381hustlerb2       // bootleg
382382hustlerb3       // bootleg
383hustlerb4      // bootleg
383hustlerb4       // bootleg
384384frogger         // GX392 (c) 1981 Konami
385385froggers1       // (c) 1981 Sega
386386froggers2       // 834-0068 (c) 1981 Sega
r29404r29405
16541654blasted         // (c) 1988
16551655archrivl        // (c) 1989
16561656archrivla       // (c) 1989
1657archrivlb      // bootleg
1657archrivlb       // bootleg
16581658trisport        // (c) 1989
16591659pigskin         // (c) 1990
16601660pigskina        // (c) 1990
r29404r29405
18661866gunforc2        // (c) 1994 Irem
18671867geostorm        // (c) 1994 Irem (Japan)
18681868// M107
1869airass         // (c) 1993 Irem (World)
1869airass          // (c) 1993 Irem (World)
18701870firebarr        // (c) 1993 Irem (Japan)
18711871dsoccr94        // (c) 1994 Irem (Data East Corporation license)
18721872kftgoal         // (c) 1994 Jaleco
r29404r29405
22462246masterw         // B72 (c) 1989 Taito Corporation Japan (World)
22472247masterwu        // B72 (c) 1989 Taito America Corporation (US)
22482248masterwj        // B72 (c) 1989 Taito Corporation (Japan)
2249yukiwo         // prototype
2249yukiwo          // prototype
22502250nastar          // B81 (c) 1988 Taito Corporation Japan (World)
22512251nastarw         // B81 (c) 1988 Taito America Corporation (US)
22522252rastsag2        // B81 (c) 1988 Taito Corporation (Japan)
r29404r29405
22862286contcircj       // B33 (c) 1987 Taito Corporation (Japan)
22872287chasehq         // B52 (c) 1988 Taito Corporation Japan (World)
22882288chasehqj        // B52 (c) 1988 Taito Corporation (Japan)
2289chasehqju      // B52 (c) 1988 Taito Corporation (Japan)
2289chasehqju       // B52 (c) 1988 Taito Corporation (Japan)
22902290chasehqu        // B52 (c) 1988 Taito America Corporation (US)
22912291enforce         // B58 (c) 1988 Taito Corporation Japan (World)
22922292enforcej        // B58 (c) 1988 Taito Corporation (Japan)
r29404r29405
25812581twincobru       // B30 / TP-011 (c) 1987 Taito America Corporation + Romstar license (US)
25822582ktiger          // B30 / TP-011 (c) 1987 Taito Corporation (Japan)
25832583gulfwar2        // (c) 1991 Comad
2584gulfwar2a      //
2584gulfwar2a       //
25852585rallybik        // B45 / TP-O12 (c) 1988 Taito
25862586truxton         // B65 / TP-O13B (c) 1988 Taito
25872587hellfire        // B90 / TP-??? (c) 1989 Toaplan + Taito license
r29404r29405
26742674batsuguna       // TP-030 (c) 1993 Toaplan
26752675batsugunsp      // TP-030 (c) 1993 Toaplan
26762676snowbro2        // TP-033 (c) 1994 Hanafram
2677snowbro2b      //
2677snowbro2b       //
26782678pwrkick         // (c) 1994 Sunwise
26792679othldrby        // (c) 1995 Sunwise
26802680sstriker        // (c) 1993 Raizing
r29404r29405
27962796crusherm        // (c) 1999 Takumi
27972797tjumpman        // (c) 1999 Namco
27982798
2799mushisam
2799mushisam
28002800mushisama
28012801mushisamb
2802espgal2
2803ibara   
2804ibarablk
2805ibarablka
2806mushitam
2802espgal2
2803ibara
2804ibarablk
2805ibarablka
2806mushitam
28072807mushitama
2808futari15
2809futari15a 
2810futari10
2811futaribl
2812pinkswts
2813pinkswtsa
2808futari15
2809futari15a
2810futari10
2811futaribl
2812pinkswts
2813pinkswtsa
28142814pinkswtsb
2815pinkswtsx
2816deathsml 
2817mmpork   
2815pinkswtsx
2816deathsml
2817mmpork
28182818mmmbanc
28192819ddpdfk
28202820ddpdfk10
r29404r29405
29432943trojana         //  4/1986 (c) 1986 (US)
29442944trojanr         //  4/1986 (c) 1986 + Romstar
29452945trojanj         //  4/1986 (c) 1986 (Japan)
2946trojanb         // bootleg
2946trojanb         // bootleg
29472947srumbler        //  9/1986 (c) 1986
29482948srumbler2       //  9/1986 (c) 1986
29492949srumbler3       //  9/1986 (c) 1986 + Tecfri
r29404r29405
31333133sf2v004         // hack
31343134sf2acc          // hack
31353135sf2acca         // hack
3136sf2ceblp         // hack
3136sf2ceblp            // hack
31373137sf2accp2        // hack
31383138sf2amf          // bootleg
3139sf2amf2         // bootleg
3139sf2amf2         // bootleg
31403140sf2dkot2        // hack
31413141sf2m1           // hack
31423142sf2m2           // hack
r29404r29405
31513151sf2dongb        // hack
31523152sf2mdt          // bootleg
31533153sf2mdta         // bootleg
3154sf2mdtb         // bootleg
3154sf2mdtb         // bootleg
31553155cworld2j        // 11/06/1992 (c) 1992 (Japan)
31563156varth           // 14/07/1992 (c) 1992 (World)
31573157varthr1         // 12/06/1992 (c) 1992 (World)
r29404r29405
33153315mshh            // 17/11/1995 (c) 1995 (Hispanic)
33163316mshb            // 17/11/1995 (c) 1995 (Brazil)
3317331719xx            // 07/12/1995 (c) 1996 (USA)
331819xxj         // 04/01/1996 (c) 1996 (Japan)
331819xxj           // 04/01/1996 (c) 1996 (Japan)
3319331919xxjr1         // 25/12/1995 (c) 1996 (Japan)
3320332019xxjr2         // 07/12/1995 (c) 1996 (Japan)
3321332119xxa           // 07/12/1995 (c) 1996 (Asia)
r29404r29405
35033503warzardr1       // 23/10/1996 (c) 1996 (Japan)
35043504sfiii           // 04/02/1997 (c) 1997 (Euro)
35053505sfiiiu          // 04/02/1997 (c) 1997 (USA)
3506sfiiia         // 04/02/1997 (c) 1997 (Asia)
3506sfiiia          // 04/02/1997 (c) 1997 (Asia)
35073507sfiiij          // 04/02/1997 (c) 1997 (Japan)
35083508sfiiih          // 04/02/1997 (c) 1997 (Hispanic)
35093509sfiii2          // 30/09/1997 (c) 1997 (USA)
r29404r29405
35213521jojoba          // 27/09/1999 (c) 1999 (Japan)
35223522jojobar1        // 13/09/1999 (c) 1999 (Japan)
35233523sfiiin          // 04/02/1997 (c) 1997 (Asia)
3524sfiiina         // 04/02/1997 (c) 1997 (Asia)
3524sfiiina         // 04/02/1997 (c) 1997 (Asia)
35253525sfiii2n         // 30/09/1997 (c) 1997 (Asia)
35263526jojon           // 28/01/1999 (c) 1998 (Asia)
35273527jojonr1         // 08/01/1999 (c) 1998 (Asia)
r29404r29405
35343534jojobaner1      // 13/09/1999 (c) 1999 (Euro)
35353535cps3boot        // bootleg
35363536cps3boota       // bootleg
3537cps3bs32      //
3538cps3bs32a      //
3537cps3bs32        //
3538cps3bs32a       //
35393539
35403540// Capcom ZN1
35413541cpzn1
r29404r29405
37743774golgo13         // 2000.03 Golgo 13 (GLG1/VER.A, Japan)
37753775sws2000         // 2000.03 Super World Stadium 2000 (SS01/VER.A, Japan)
37763776truckk          // 2000.06 Truck Kyousoukyoku (Metro)
3777kartduel      // 2000.07 Kart Duel
3777kartduel        // 2000.07 Kart Duel
37783778            // 2000.08 Teknowerk
37793779g13knd          // 2000.10 Golgo 13 Kiseki no Dandou (GLS1/VER.A, Japan)
37803780sws2001         // 2001.04 Super World Stadium 2001 (SS11/VER.A, Japan)
r29404r29405
44654465fantzone        // (c) 1986 (Unprotected Rev A)
44664466fantzone1       // (c) 1986 (Unprotected)
44674467fantzonep       // (c) 1986 (NEC 0317-5000, encrypted)
4468fantzonepr      //
4468fantzonepr      //
44694469sdi             // (c) 1987 (FD1089B, decrypted)
44704470shinobi         // (c) 1987 (Unprotected)
44714471shinobi1        // (c) 1987 (FD1094, decrypted)
r29404r29405
47414741radrj           // 1991.07 Rad Rally (Japan)
47424742spidman         // 1991.?? Spiderman (World)
47434743spidmanu        // 1991.09 Spiderman (US)
4744spidmanj   // 1991.09 Spiderman (Japan)
4744spidmanj    // 1991.09 Spiderman (Japan)
47454745f1en            // 1991.?? F-1 Exhaust Note (World)
47464746            // 1992.01 F-1 Exhaust Note (US)
47474747            // 1991.11 F-1 Exhaust Note (Japan)
r29404r29405
54195419initdv2jo       // 2002.12 Initial D Arcade Stage Ver. 2 (Japan)
54205420initdv2e        // 2002.12 Initial D Arcade Stage Ver. 2 (export)
54215421vf4evo          // 2002.12 Virtua Fighter 4 Evolution Ver.B
5422clubk2k3   // 2003.?? Club Kart: European Session 2003
5422clubk2k3    // 2003.?? Club Kart: European Session 2003
54235423clubk2kf
54245424initdexp        // 2002.?? Initial D Arcade Stage (Export)
54255425            // 2002.?? Sega Driving Simulator
r29404r29405
57065706afire           // Rene Pierre
57075707acombat         // bootleg
57085708acombato        // bootleg
5709acombat3      // bootleg
5709acombat3        // bootleg
57105710sstarbtl        // bootleg
57115711spfghmk2        // (c) [1979] Data East Corporation
57125712spfghmk22       // (c) [1979] Data East Corporation
r29404r29405
57705770pcktgal2        // (c) 1989 Data East Corporation (World?)
57715771pcktgal2j       // (c) 1989 Data East Corporation (World?)
57725772pokechmp        // Korean hack of Pocket Gal
5773billlist      //
5773billlist        //
57745774spool3          // (c) 1989 Data East Corporation (World?)
57755775spool3i         // (c) 1990 Data East Corporation + I-Vics license
57765776battlera        // (c) 1988 Data East Corporation (World)
r29404r29405
61996199rockragej       // GX620 (c) 1986 (Japan)
62006200mx5000          // GX669 (c) 1987
62016201flkatck         // GX669 (c) 1987 (Japan)
6202flkatcka      // GX669 (c) 1987 (Japan)
6202flkatcka        // GX669 (c) 1987 (Japan)
62036203fastlane        // GX752 (c) 1987
62046204tricktrp        // GX771 (c) 1987
62056205labyrunr        // GX771 (c) 1987 (Japan)
r29404r29405
66626662mtrap           // (c) 1981
66636663mtrap3          // (c) 1981
66646664mtrap4          // (c) 1981
6665mtrapb         // bootleg
6665mtrapb          // bootleg
66666666pepper2         // (c) 1982
66676667pepper27        // (c) 1982
66686668hardhat         // (c) 1982
r29404r29405
82558255raiden2e        // (c) 1993 Seibu Kaihatsu
82568256raiden2f        // (c) 1993 Seibu Kaihatsu + Fabtek license
82578257raiden2g        // (c) 1993 Seibu Kaihatsu
8258raiden2nl      // (c) 1993 Seibu Kaihatsu
8258raiden2nl       // (c) 1993 Seibu Kaihatsu
82598259raidendx        // (c) 1994 Seibu Kaihatsu
82608260raidendxj       // (c) 1994 Seibu Kaihatsu
82618261raidendxu       // (c) 1994 Seibu Kaihatsu + Fabtek license
82628262raidendxa1      // (c) 1994 Seibu Kaihatsu + Metrotainment license
82638263raidendxa2      // (c) 1994 Seibu Kaihatsu + Metrotainment license
82648264raidendxg       // (c) 1994 Seibu Kaihatsu + Tuning license
8265raidendxnl      // (c) 1994 Seibu Kaihatsu
8265raidendxnl      // (c) 1994 Seibu Kaihatsu
82668266zeroteam        // (c) 1993 Seibu Kaihatsu + Fabtek license
82678267zeroteama       // (c) 1993 Seibu Kaihatsu
82688268zeroteamb       // (c) 1993 Seibu Kaihatsu
r29404r29405
82878287batlballu       // (c) 1995 Seibu Kaihatsu (Fabtek license)
82888288
82898289viprp1          // (c) 1995 Seibu Kaihatsu
8290viprp1k         // (c) 1995 Seibu Kaihatsu (Dream Island license)
8290viprp1k         // (c) 1995 Seibu Kaihatsu (Dream Island license)
82918291viprp1u         // (c) 1995 Seibu Kaihatsu (Fabtek license)
82928292viprp1ua        // (c) 1995 Seibu Kaihatsu (Fabtek license)
82938293viprp1j         // (c) 1995 Seibu Kaihatsu
r29404r29405
87248724galsnewk        // (c) 1990 Kaneko
87258725galpani2        // (c) 1993 Kaneko
87268726galpani2e       // (c) 1993 Kaneko
8727galpani2e2      // (c) 1993 Kaneko
8727galpani2e2      // (c) 1993 Kaneko
87288728galpani2g       // (c) 1993 Kaneko
87298729galpani2t       // (c) 1993 Kaneko
87308730galpani2i       // (c) 1993 Kaneko
8731galpani2gs      // (c) 1993 Kaneko
8731galpani2gs      // (c) 1993 Kaneko
87328732galpani2j       // (c) 1993 Kaneko
87338733gp2quiz         // (c) 1993 Kaneko
87348734gp2se           // (c) 1994 Kaneko
r29404r29405
87378737galpani3        // (c) 1995 Kaneko (World)
87388738galpani3j       // (c) 1995 Kaneko (Japan)
87398739galpani3k       // (c) 1995 Kaneko (Korea)
8740galpani3hk      // (c) 1995 Kaneko (Hong Kong)
8740galpani3hk      // (c) 1995 Kaneko (Hong Kong)
87418741
87428742// Kaneko "AX System" games
87438743berlwall        // (c) 1991 Kaneko
r29404r29405
88388838blandia         // (c) 1992 Allumer
88398839blandiap        // (c) 1992 Allumer
88408840blockcar        // (c) 1992 Visco
8841blockcarb      // bootleg
8841blockcarb       // bootleg
88428842qzkklogy        // (c) 1992 Tecmo
88438843neobattl        // (c) 1992 Banpresto / Sotsu Agency. Sunrise
88448844umanclub        // (c) 1992 Tsuburaya Prod. / Banpresto
r29404r29405
90669066lastdaya        // (c) 1990 Dooyong
90679067gulfstrm        // (c) 1991 Dooyong
90689068gulfstrma       // (c) 1991 Dooyong
9069gulfstrmb      // (c) 1991 Dooyong
9069gulfstrmb       // (c) 1991 Dooyong
90709070gulfstrmm       // (c) 1991 Dooyong + distributed by Media Shoji
90719071pollux          // (c) 1991 Dooyong
90729072polluxa         // (c) 1991 Dooyong
90739073polluxa2        // (c) 1991 Dooyong
90749074flytiger        // (c) 1992 Dooyong
9075flytigera      // (c) 1992 Dooyong
9075flytigera       // (c) 1992 Dooyong
90769076bluehawk        // (c) 1993 Dooyong
90779077bluehawkn       // (c) 1993 NTC
90789078sadari          // (c) 1993 NTC
r29404r29405
91179117fantsia2        // (c) 1997 Comad
91189118fantsia2a       // (c) 1997 Comad
91199119wownfant        // (c) 2002 Comad
9120pgalvip         // (c) 1996 ACE International (Afega stickers on ROMs)
9121pgalvipa      //
9120pgalvip         // (c) 1996 ACE International (Afega stickers on ROMs)
9121pgalvipa        //
91229122galhustl        // (c) 1997 ACE International
91239123
91249124// Playmark games
r29404r29405
92459245bombkick        // (c) 1998 Yun Sung
92469246bombkicka       // (c) 1998 Yun Sung
92479247nmg5            // (c) 1998 Yun Sung
9248nmg5a         // (c) 1998 Yun Sung
9248nmg5a           // (c) 1998 Yun Sung
92499249nmg5e           // (c) 1998 Yun Sung
92509250searchey        // (c) 1999 Yun Sung
92519251searchp2        // (c) 1999 Yun Sung
r29404r29405
96729672oldsplus        // (c) 2004 Oriental Legend Super Plus
96739673killbldp        // (c) 2004 Killing Blade Plus
96749674happy6          // (c) 2004 Happy 6
9675happy6101      //
9675happy6101       //
96769676svg             // (c) 2003 Spectral vs Generation
96779677svgpcb          //
96789678ket             // (c) 2002 Ketsui
r29404r29405
96909690orleg2o         //
96919691kov2nl          // (c) 2008
96929692kov2nlo         //
9693ddpdojh         //
9694kov3         //
9693ddpdojh         //
9694kov3            //
96959695
96969696// IGS PC based HW
96979697speeddrv        // (c) 2004
r29404r29405
1010510105nostk           // (c) 1993 Face
10106101064enraya         // (c) 1990 IDSA
10107101074enrayaa        //
101084enlinea      // (c) 1991 System Compumatic
101084enlinea        // (c) 1991 System Compumatic
1010910109unkpacg         // (c) 19?? ???
1011010110oneshot         // no copyright notice
1011110111maddonna        // (c) 1995 Tuning
r29404r29405
10123101239ballsht2       // (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games"
10124101249ballsht3       // (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games"
10125101259ballshtc       // (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games"
10126megaphx         // (c) 1991 Dinamic / Inder
10126megaphx         // (c) 1991 Dinamic / Inder
1012710127gumbo           // (c) 1994 Min Corp.
1012810128mspuzzleg       // (c) 1994 Min Corp.
1012910129mspuzzle        // (c) 1994 Min Corp.
r29404r29405
1108111081livequiz        // (c) 1999 Andamiro
1108211082hammer          // (c) 2000 Andamiro
1108311083discoboy        // (c) 1993 Soft Art Co.
11084discoboyp      // (c) 1993 Soft Art Co. (Promat license?)
11084discoboyp       // (c) 1993 Soft Art Co. (Promat license?)
1108511085pangofun        // (c) 1995 InfoCube
1108611086koikoi          // (c) 1983 Kiwako
1108711087good            // (c) 1998
r29404r29405
1108911089quizo           // (c) 1985 Seoul Coin Corp.
1109011090quizoa          // (c) 1985 Seoul Coin Corp.
1109111091gstream         // (c) 2002, Oriental Soft Japan
11092x2222         // (c) 2000, Oriental Soft
11093x2222o         // (c) 2000, Oriental Soft
11092x2222           // (c) 2000, Oriental Soft
11093x2222o          // (c) 2000, Oriental Soft
1109411094miniboy7        // (c) 1983, Bonanza Enterprises
1109511095miniboy7a       // (c) 1983, Bonanza Enterprises
1109611096miniboy7b       // (c) 1983, Bonanza Enterprises
r29404r29405
1125211252grandprx        // (c) 200? 4fun
1125311253supjolly        // (c) 200? unknown
1125411254x5jokers        // (c) 200? Electronic Projects
11255queenotg      //
11256ejollyx9      //
11255queenotg        //
11256ejollyx9        //
1125711257
1125811258// Astro Corp.
1125911259showhand        // (c) 2000  Astro Corp.
r29404r29405
2947729477ec_casmb    // Casino Multi Bar (Concept - Electrocoin)
2947829478ec_supmb    // Super Multi Bar (Concept - Electrocoin)
2947929479ec_stkex    // Stake X (Concept - Electrocoin)
29480ec_bar7      // Bar 7 (Concept)
29480ec_bar7     // Bar 7 (Concept)
2948129481ec_fltr     // Flutter (Concept)
2948229482ec_gold7    // Golden 7 (Concept)
2948329483ec_mgbel    // Megabell (Concept)
r29404r29405
3125831258number1    // 1996 San Remo Games
3125931259gluck2     // 1992 Yung Yu / CYE
3126031260
31261amusco     // 1987, Amusco.
No newline at end of file
31261amusco     // 1987, Amusco.
trunk/src/mame/audio/cclimber.c
r29404r29405
4141   MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.50)
4242
4343   MCFG_SAMPLES_ADD("samples", cclimber_samples_interface)
44   MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.5)   
45MACHINE_CONFIG_END   
44   MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.5)
45MACHINE_CONFIG_END
4646
4747//**************************************************************************
4848//  DEVICE DEFINITIONS
r29404r29405
136136
137137   m_samples->start_raw(0,samplebuf,2 * len,freq);
138138}
139
trunk/src/mame/audio/cclimber.h
r29404r29405
2828#define MCFG_CCLIMBER_AUDIO_ADD(_tag) \
2929   MCFG_DEVICE_ADD(_tag, CCLIMBER_AUDIO, 0)
3030
31   
31
3232// ======================> cclimber_audio_device
3333
3434class cclimber_audio_device : public device_t
r29404r29405
4141   DECLARE_WRITE8_MEMBER( sample_rate_w );
4242   DECLARE_WRITE8_MEMBER( sample_volume_w );
4343   DECLARE_WRITE8_MEMBER( sample_select_w );
44     
44
4545protected:
46   // device level overrides   
47   virtual void device_start();   
46   // device level overrides
47   virtual void device_start();
4848   virtual machine_config_constructor device_mconfig_additions() const;
4949
5050   void play_sample(int start,int freq,int volume);
51private:   
51private:
5252   int m_sample_num;
5353   int m_sample_freq;
5454   int m_sample_volume;
trunk/src/mame/audio/namco52.c
r29404r29405
166166   m_basenode(0),
167167   m_extclock(0),
168168   m_romread(*this),
169   m_si(*this)   
169   m_si(*this)
170170{
171171}
172172
trunk/src/mame/audio/namco52.h
r29404r29405
2323
2424#define MCFG_NAMCO_52XX_SI_CB(_devcb) \
2525   devcb = &namco_52xx_device::set_si_callback(*device, DEVCB2_##_devcb);
26   
2726
27
2828class namco_52xx_device : public device_t
2929{
3030public:
r29404r29405
3535   static void set_extclock(device_t &device, attoseconds_t clk) { downcast<namco_52xx_device &>(device).m_extclock = clk; }
3636   template<class _Object> static devcb2_base &set_romread_callback(device_t &device, _Object object) { return downcast<namco_52xx_device &>(device).m_romread.set_callback(object); }
3737   template<class _Object> static devcb2_base &set_si_callback(device_t &device, _Object object) { return downcast<namco_52xx_device &>(device).m_si.set_callback(object); }
38   
38
3939   DECLARE_WRITE8_MEMBER(write);
4040
4141   DECLARE_READ8_MEMBER( K_r );
r29404r29405
5252   virtual void device_start();
5353   virtual const rom_entry *device_rom_region() const;
5454   virtual machine_config_constructor device_mconfig_additions() const;
55   
55
5656   TIMER_CALLBACK_MEMBER( latch_callback );
5757   TIMER_CALLBACK_MEMBER( irq_clear );
5858   TIMER_CALLBACK_MEMBER( external_clock_pulse );
r29404r29405
6060   // internal state
6161   required_device<mb88_cpu_device> m_cpu;
6262   required_device<discrete_device> m_discrete;
63   
63
6464   int m_basenode;
6565   attoseconds_t m_extclock;
6666   devcb2_read8 m_romread;
6767   devcb2_read8 m_si;
68   
68
6969   UINT8 m_latched_cmd;
7070   UINT32 m_address;
7171};
trunk/src/mame/audio/taito_zm.c
r29404r29405
5555void taito_zoom_device::device_start()
5656{
5757   m_snd_shared_ram = auto_alloc_array_clear(machine(), UINT8, 0x100);
58   
58
5959   // register for savestates
6060   save_item(NAME(m_reg_address));
6161   save_item(NAME(m_tms_ctrl));
r29404r29405
6969void taito_zoom_device::device_reset()
7070{
7171   m_reg_address = 0;
72   
72
7373   m_zsg2->reset();
7474}
7575
r29404r29405
150150            popmessage("ZOOM gain L %04X, contact MAMEdev", data);
151151         m_zsg2->set_output_gain(0, (data & 0x3f) / 63.0);
152152         break;
153     
153
154154      case 0x05:
155155         // zsg2+dsp global volume right
156156         if (data & 0xc0c0)
trunk/src/mame/audio/taito_zm.h
r29404r29405
2727   virtual void device_reset();
2828
2929private:
30   
30
3131   // devices/pointers
3232   required_device<mn10200_device> m_soundcpu;
3333   required_device<zsg2_device> m_zsg2;
34   
34
3535   // internal state
3636   UINT16 m_reg_address;
3737   UINT8 m_tms_ctrl;
trunk/src/mame/audio/cps3.c
r29404r29405
7373            -------- --------  xxxxxxxx xxxxxxxx  end address high
7474         7  xxxxxxxx xxxxxxxx  -------- --------  volume right (signed?)
7575            -------- --------  xxxxxxxx xxxxxxxx  volume left (signed?)
76         
76
7777         (*) reg 5 and 6 are always the same. One of them probably means loop-end address,
7878             but we won't know which until we do tests on real hw.
7979         */
r29404r29405
8787
8888         INT16 vol_l = (vptr->regs[7] & 0xffff);
8989         INT16 vol_r = (vptr->regs[7] >> 16 & 0xffff);
90         
90
9191         UINT32 pos = vptr->pos;
9292         UINT32 frac = vptr->frac;
93         
93
9494         /* TODO */
9595         start -= 0x400000;
9696         end -= 0x400000;
r29404r29405
144144   else if (offset == 0x80)
145145   {
146146      assert((mem_mask & 0xffff0000) == 0xffff0000); // doesn't happen
147     
147
148148      UINT16 key = data >> 16;
149149
150150      for (int i = 0; i < CPS3_VOICES; i++)
trunk/src/mame/audio/namco54.c
r29404r29405
5858}
5959
6060READ8_MEMBER( namco_54xx_device::K_r )
61{   
61{
6262   return m_latched_cmd >> 4;
6363}
6464
trunk/src/mame/audio/taito_en.h
r29404r29405
1919   DECLARE_WRITE16_MEMBER( es5510_dsp_w );
2020
2121   DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
22   
22
2323   DECLARE_WRITE8_MEMBER(mb87078_gain_changed);
2424
2525protected:
trunk/src/mame/audio/namco54.h
r29404r29405
2424
2525   static void set_discrete(device_t &device, const char *tag) { downcast<namco_54xx_device &>(device).m_discrete.set_tag(tag); }
2626   static void set_basenote(device_t &device, int node) { downcast<namco_54xx_device &>(device).m_basenode = node; }
27   
27
2828   DECLARE_READ8_MEMBER( K_r );
2929   DECLARE_READ8_MEMBER( R0_r );
3030   DECLARE_WRITE8_MEMBER( O_w );
3131   DECLARE_WRITE8_MEMBER( R1_w );
32   
32
3333   DECLARE_WRITE8_MEMBER( write );
3434protected:
3535   // device-level overrides
r29404r29405
4343   // internal state
4444   required_device<mb88_cpu_device> m_cpu;
4545   required_device<discrete_device> m_discrete;
46   
46
4747   int m_basenode;
4848   UINT8 m_latched_cmd;
4949};
trunk/src/mame/machine/igs036crypt.c
r29404r29405
88non-trivial obfuscation layered upon a simple address-based XOR encryption
99(similar to the ones found in previous IGS circuits).
1010
11The scheme works on 16-bits words and is probably designed to depend on 24 bits of
12(word-) address; in what follows, we will refer to the 8 lowest ones simply as the
11The scheme works on 16-bits words and is probably designed to depend on 24 bits of
12(word-) address; in what follows, we will refer to the 8 lowest ones simply as the
1313lowest bits of the address, and the other 16 as the highest bits the address.
1414
1515The address-based XOR is thought to be comprised of 16 one-bit XOR controlled
1616by a certain combination of one or two of the highest address bits (but only
1715 of them are observed, probably due to the fact that no game uses more than
1715 of them are observed, probably due to the fact that no game uses more than
18182^22 of the 2^24 address space). Every one of the one-bit XORs affects a different bit
19of the word. The game key acts by masking on/off those XORs for every combination
20of the lowest address bits. Thus, a complete key can be described by 256 16-bits values.
19of the word. The game key acts by masking on/off those XORs for every combination
20of the lowest address bits. Thus, a complete key can be described by 256 16-bits values.
2121This use of the key is pretty similar to the one found in previous instantiations of
2222IGS circuits.
2323
r29404r29405
4848that region appears to be hiding 20-bytes values (SHA-1 hashes?) located at
4949positions which vary per set. See the table below.
5050
51driver      20-bytes value position in the ROM
51driver      20-bytes value position in the ROM
5252---------   ----------------------------------
5353orleg2o     $763984-$763997
5454orleg2      $76C77C-$76C78F
r29404r29405
7777{
7878   // key-independent manipulation
7979   int aux = deobfuscate(cipherword, word_address);
80   
80
8181   // key-dependent manipulation
8282   for (int i=0; i<16; ++i)
8383   {
r29404r29405
8787            aux ^= (1<<i);
8888      }
8989   }
90     
90
9191   return aux^0x1a3a;
9292}
9393
r29404r29405
107107   const int group14[] = {14, 9, 3, 2};  // 14 is a guess
108108   const int group13[] = {13,10, 6, 1};
109109   const int group12[] = {12, 8, 4, 0};
110   
110
111111   // rotation depending on all the address bits
112112   int enabled0 = rot_enabled(address, group15);
113113   int rot = enabled0 * rot_group(address, group15) * 9;
114   
114
115115   int enabled1 = enabled0 ^ rot_enabled(address, group14);
116116   rot += enabled1 * rot_group(address, group14) * 1;
117   
117
118118   int enabled2 = enabled0 ^ rot_enabled(address, group13);
119119   rot += enabled2 * rot_group(address, group13) * 2;
120   
120
121121   int enabled3 = enabled0 ^ rot_enabled(address, group12);
122122   rot += enabled3 * rot_group(address, group12) * 4;
123123
r29404r29405
143143         break;
144144      }
145145   }
146   
146
147147   return enabled;
148148}
149149
r29404r29405
157157{
158158   UINT16 r = num<<shift;
159159   UINT16 l = num>>(16-shift);
160   
160
161161   return r|l;
162162}
163163
r29404r29405
175175// of function on the 8 lowest word-address bits. Some comments:
176176// * Bits #5 & #6 are unused so, in fact, they only depend on 6 address bits
177177// * The functions are clearly low-complexity boolean functions on those 6 bits
178//    rather than, say, random lookup tables
179// * There are quite a number of functionally equivalent ways to implement
180//    those boolean functions, so the given implementation (by multiplexing
181//   over some simple functions) shouldn't be taken too seriously: while it's
178//   rather than, say, random lookup tables
179// * There are quite a number of functionally equivalent ways to implement
180//   those boolean functions, so the given implementation (by multiplexing
181//   over some simple functions) shouldn't be taken too seriously: while it's
182182//   functionally correct, it doesn't neccesarily represent the way the hardware
183183//   is calculating them.
184184
r29404r29405
233233// if any. The only exception is DDPDOJ (see below).
234234
235235const UINT16 orleg2_key[0x100] = {
236   0x8100, 0x9202, 0x3000, 0x1200, 0x0100, 0x0800, 0x2100, 0xab05,
237   0x130a, 0xba0a, 0x0308, 0x9200, 0x8306, 0xab0f, 0x200c, 0x0301,
238   0x9010, 0x1b13, 0x1310, 0x1b11, 0x8104, 0x0212, 0x8204, 0x8214,
239   0x8302, 0x1111, 0x8300, 0x1b19, 0x0110, 0x8202, 0x0310, 0x0301,
240   0x8322, 0xb202, 0xb200, 0x9121, 0x8222, 0x0a26, 0x2000, 0x0321,
241   0xb000, 0x0020, 0x9328, 0x3909, 0x230a, 0x8929, 0x8224, 0x2204,
242   0x0322, 0x9b33, 0x0300, 0x9311, 0x8120, 0x8810, 0x0330, 0x0004,
243   0x832a, 0x8a0a, 0x0100, 0x1131, 0x0138, 0x093d, 0x8128, 0x081c,
244   0xe342, 0x8101, 0xf140, 0x0000, 0x6144, 0x2004, 0x8204, 0x4044,
245   0xa302, 0xdb4b, 0x1000, 0xa200, 0xc044, 0xe044, 0x010c, 0x0204,
246   0x1212, 0xdb53, 0xd050, 0xcb41, 0x4150, 0xc347, 0x4340, 0x0101,
247   0x5252, 0xd959, 0x1310, 0xc040, 0xc252, 0xc959, 0x4340, 0x8919,
248   0x2202, 0x3800, 0xe340, 0x2101, 0x0326, 0x2307, 0x4360, 0x8321,
249   0x3000, 0xbb0b, 0x5068, 0xf848, 0x436a, 0xab0b, 0xa10c, 0xe240,
250   0xc140, 0xc363, 0x8300, 0x4961, 0x0004, 0xc860, 0x0324, 0x0000,
251   0xd070, 0x8101, 0xd070, 0x1331, 0x0104, 0x4a6e, 0x4348, 0x4a78,
252   0xa282, 0xb282, 0x0200, 0x2200, 0x8180, 0x8080, 0x8080, 0x0800,
253   0x1302, 0x9989, 0x2008, 0x2000, 0xa386, 0x0b0f, 0x828c, 0xa280,
254   0x9392, 0x9292, 0x1010, 0x8080, 0x0206, 0x8383, 0x8294, 0x0911,
255   0x8382, 0x0a0a, 0x9190, 0x1010, 0x0008, 0x0b0b, 0x8098, 0x8b9d,
256   0x1120, 0x0820, 0x2200, 0xa080, 0x81a4, 0xa286, 0xa380, 0xaa80,
257   0x0120, 0x1020, 0xb088, 0x1020, 0x2000, 0x0b2b, 0x2100, 0x2a0c,
258   0x9292, 0x98b0, 0x1330, 0x8880, 0x8396, 0x0b17, 0x8080, 0x0325,
259   0x0000, 0x99b9, 0x92b0, 0x82a0, 0x8184, 0x0020, 0x0330, 0x0818,
260   0xe1c0, 0xa981, 0xd1c0, 0xd0c0, 0x6140, 0x4242, 0xc2c4, 0x6345,
261   0xb088, 0x7141, 0x4040, 0xa181, 0x220e, 0xe0c4, 0x4144, 0x6a4c,
262   0xd0d0, 0x9a92, 0x1310, 0xd9d1, 0x8392, 0xc0c4, 0x8284, 0x8890,
263   0xc0c0, 0x8282, 0x8280, 0x9090, 0x4342, 0x0a0a, 0x4240, 0xc1d5,
264   0xb080, 0xb282, 0xc1e0, 0x90a0, 0xa084, 0x4b63, 0x81a0, 0xeac0,
265   0x7242, 0x5363, 0x7348, 0x0321, 0x022a, 0x6949, 0x4360, 0x8aa8,
266   0x8282, 0x0303, 0x8180, 0x1331, 0x83a2, 0x4b53, 0x4364, 0x83b1,
267   0x121a, 0x80a0, 0x1238, 0x0000, 0x82ba, 0x0030, 0xc0c0, 0x4264,
236   0x8100, 0x9202, 0x3000, 0x1200, 0x0100, 0x0800, 0x2100, 0xab05,
237   0x130a, 0xba0a, 0x0308, 0x9200, 0x8306, 0xab0f, 0x200c, 0x0301,
238   0x9010, 0x1b13, 0x1310, 0x1b11, 0x8104, 0x0212, 0x8204, 0x8214,
239   0x8302, 0x1111, 0x8300, 0x1b19, 0x0110, 0x8202, 0x0310, 0x0301,
240   0x8322, 0xb202, 0xb200, 0x9121, 0x8222, 0x0a26, 0x2000, 0x0321,
241   0xb000, 0x0020, 0x9328, 0x3909, 0x230a, 0x8929, 0x8224, 0x2204,
242   0x0322, 0x9b33, 0x0300, 0x9311, 0x8120, 0x8810, 0x0330, 0x0004,
243   0x832a, 0x8a0a, 0x0100, 0x1131, 0x0138, 0x093d, 0x8128, 0x081c,
244   0xe342, 0x8101, 0xf140, 0x0000, 0x6144, 0x2004, 0x8204, 0x4044,
245   0xa302, 0xdb4b, 0x1000, 0xa200, 0xc044, 0xe044, 0x010c, 0x0204,
246   0x1212, 0xdb53, 0xd050, 0xcb41, 0x4150, 0xc347, 0x4340, 0x0101,
247   0x5252, 0xd959, 0x1310, 0xc040, 0xc252, 0xc959, 0x4340, 0x8919,
248   0x2202, 0x3800, 0xe340, 0x2101, 0x0326, 0x2307, 0x4360, 0x8321,
249   0x3000, 0xbb0b, 0x5068, 0xf848, 0x436a, 0xab0b, 0xa10c, 0xe240,
250   0xc140, 0xc363, 0x8300, 0x4961, 0x0004, 0xc860, 0x0324, 0x0000,
251   0xd070, 0x8101, 0xd070, 0x1331, 0x0104, 0x4a6e, 0x4348, 0x4a78,
252   0xa282, 0xb282, 0x0200, 0x2200, 0x8180, 0x8080, 0x8080, 0x0800,
253   0x1302, 0x9989, 0x2008, 0x2000, 0xa386, 0x0b0f, 0x828c, 0xa280,
254   0x9392, 0x9292, 0x1010, 0x8080, 0x0206, 0x8383, 0x8294, 0x0911,
255   0x8382, 0x0a0a, 0x9190, 0x1010, 0x0008, 0x0b0b, 0x8098, 0x8b9d,
256   0x1120, 0x0820, 0x2200, 0xa080, 0x81a4, 0xa286, 0xa380, 0xaa80,
257   0x0120, 0x1020, 0xb088, 0x1020, 0x2000, 0x0b2b, 0x2100, 0x2a0c,
258   0x9292, 0x98b0, 0x1330, 0x8880, 0x8396, 0x0b17, 0x8080, 0x0325,
259   0x0000, 0x99b9, 0x92b0, 0x82a0, 0x8184, 0x0020, 0x0330, 0x0818,
260   0xe1c0, 0xa981, 0xd1c0, 0xd0c0, 0x6140, 0x4242, 0xc2c4, 0x6345,
261   0xb088, 0x7141, 0x4040, 0xa181, 0x220e, 0xe0c4, 0x4144, 0x6a4c,
262   0xd0d0, 0x9a92, 0x1310, 0xd9d1, 0x8392, 0xc0c4, 0x8284, 0x8890,
263   0xc0c0, 0x8282, 0x8280, 0x9090, 0x4342, 0x0a0a, 0x4240, 0xc1d5,
264   0xb080, 0xb282, 0xc1e0, 0x90a0, 0xa084, 0x4b63, 0x81a0, 0xeac0,
265   0x7242, 0x5363, 0x7348, 0x0321, 0x022a, 0x6949, 0x4360, 0x8aa8,
266   0x8282, 0x0303, 0x8180, 0x1331, 0x83a2, 0x4b53, 0x4364, 0x83b1,
267   0x121a, 0x80a0, 0x1238, 0x0000, 0x82ba, 0x0030, 0xc0c0, 0x4264,
268268};
269269
270270const UINT16 m312cn_key[0x100] = {
trunk/src/mame/machine/igs036crypt.h
r29404r29405
1010   void decrypter_rom(memory_region* region);
1111   UINT16 decrypt(UINT16 cipherword, int word_address)const;
1212   UINT16 deobfuscate(UINT16 cipherword, int word_address)const;
13   
13
1414private:
1515   const UINT16* key;
16   
16
1717   static int (*rot_enabling[16][4])(int);
1818   static int (*rot_direction[4][8])(int);
1919   static const UINT16 triggers[16][2];
trunk/src/mame/machine/namco50.c
r29404r29405
176176}
177177
178178void namco_50xx_device::irq_set()
179{   
179{
180180   m_cpu->set_input_line(0, ASSERT_LINE);
181181
182182   // The execution time of one instruction is ~4us, so we must make sure to
trunk/src/mame/machine/inder_vid.c
r29404r29405
1313
1414inder_vid_device::inder_vid_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1515   : device_t(mconfig, INDER_VIDEO, "Inder / Dinamic TMS Video", tag, owner, clock, "indervd", __FILE__),
16/*   device_video_interface(mconfig, *this, false), */
16/*  device_video_interface(mconfig, *this, false), */
1717      m_vram(*this, "vram"),
1818      m_palette(*this, "palette"),
1919      m_tms(*this, "tms")
r29404r29405
7171
7272static void megaphx_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
7373{
74//   printf("write from shift regs address %08x (%08x)\n", address, TOWORD(address) * 2);
74//  printf("write from shift regs address %08x (%08x)\n", address, TOWORD(address) * 2);
7575
7676   inder_vid_device *state = (inder_vid_device*)space.machine().device("inder_vid");
7777
r29404r29405
125125
126126
127127   MCFG_PALETTE_ADD("palette", 256)
128   
128
129129   MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map, "palette")
130130
131131
r29404r29405
138138
139139void inder_vid_device::device_start()
140140{
141
142141}
143142
144143void inder_vid_device::device_reset()
trunk/src/mame/machine/namco50.h
r29404r29405
1414{
1515public:
1616   namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   
17
1818   WRITE8_MEMBER( write );
1919   WRITE_LINE_MEMBER(read_request);
2020   READ8_MEMBER( read );
21   
21
2222   READ8_MEMBER( K_r );
2323   READ8_MEMBER( R0_r );
2424   READ8_MEMBER( R2_r );
r29404r29405
2929   virtual void device_start();
3030   virtual const rom_entry *device_rom_region() const;
3131   virtual machine_config_constructor device_mconfig_additions() const;
32   
32
3333   TIMER_CALLBACK_MEMBER( latch_callback );
3434   TIMER_CALLBACK_MEMBER( readrequest_callback );
3535   TIMER_CALLBACK_MEMBER( irq_clear );
36   void irq_set();   
36   void irq_set();
3737private:
3838   // internal state
3939   required_device<mb88_cpu_device> m_cpu;
trunk/src/mame/machine/inder_vid.h
r29404r29405
2020
2121
2222class inder_vid_device :  public device_t
23/*   public device_video_interface */
23/*  public device_video_interface */
2424{
2525public:
2626   // construction/destruction
r29404r29405
2929   required_shared_ptr<UINT16> m_vram;
3030   required_device<palette_device> m_palette;
3131   required_device<tms34010_device> m_tms;
32   
32
3333   int m_shiftfull; // this might be a driver specific hack for a TMS bug.
3434
3535protected:
r29404r29405
4444
4545};
4646
47#endif
No newline at end of file
47#endif
trunk/src/mame/machine/asteroid.c
r29404r29405
140140MACHINE_RESET_MEMBER(asteroid_state, llander)
141141{
142142   m_dvg->reset_w(m_maincpu->space(AS_PROGRAM), 0, 0);
143}
No newline at end of file
143}
trunk/src/mame/machine/namco51.h
r29404r29405
77
88
99#define MCFG_NAMCO_51XX_ADD(_tag, _clock) \
10   MCFG_DEVICE_ADD(_tag, NAMCO_51XX, _clock)
10   MCFG_DEVICE_ADD(_tag, NAMCO_51XX, _clock)
1111
1212#define MCFG_NAMCO_51XX_INPUT_0_CB(_devcb) \
1313   devcb = &namco_51xx_device::set_input_0_callback(*device, DEVCB2_##_devcb);
r29404r29405
3636   template<class _Object> static devcb2_base &set_input_1_callback(device_t &device, _Object object) { return downcast<namco_51xx_device &>(device).m_in_1.set_callback(object); }
3737   template<class _Object> static devcb2_base &set_input_2_callback(device_t &device, _Object object) { return downcast<namco_51xx_device &>(device).m_in_2.set_callback(object); }
3838   template<class _Object> static devcb2_base &set_input_3_callback(device_t &device, _Object object) { return downcast<namco_51xx_device &>(device).m_in_3.set_callback(object); }
39   
39
4040   template<class _Object> static devcb2_base &set_output_0_callback(device_t &device, _Object object) { return downcast<namco_51xx_device &>(device).m_out_0.set_callback(object); }
4141   template<class _Object> static devcb2_base &set_output_1_callback(device_t &device, _Object object) { return downcast<namco_51xx_device &>(device).m_out_1.set_callback(object); }
42   
42
4343   DECLARE_WRITE8_MEMBER( write );
4444   DECLARE_READ8_MEMBER( read );
45   
45
4646protected:
4747   // device-level overrides
4848   virtual void device_start();
trunk/src/mame/machine/megadriv.c
r29404r29405
10481048   m_vdp->set_vdp_pal(FALSE);
10491049   m_vdp->set_framerate(60);
10501050   m_vdp->set_total_scanlines(262);
1051   
1052   m_version_hi_nibble = 0x20;   // JPN NTSC no-SCD
1051
1052   m_version_hi_nibble = 0x20; // JPN NTSC no-SCD
10531053}
10541054
10551055
r29404r29405
10641064   m_vdp->set_framerate(60);
10651065   m_vdp->set_total_scanlines(262);
10661066
1067   m_version_hi_nibble = 0xa0;   // Export NTSC no-SCD
1067   m_version_hi_nibble = 0xa0; // Export NTSC no-SCD
10681068}
10691069
10701070DRIVER_INIT_MEMBER(md_base_state, megadrij)
r29404r29405
10761076   m_vdp->set_vdp_pal(FALSE);
10771077   m_vdp->set_framerate(60);
10781078   m_vdp->set_total_scanlines(262);
1079   
1080   m_version_hi_nibble = 0x20;   // JPN NTSC no-SCD
1079
1080   m_version_hi_nibble = 0x20; // JPN NTSC no-SCD
10811081}
10821082
10831083DRIVER_INIT_MEMBER(md_base_state, megadrie)
r29404r29405
10901090   m_vdp->set_framerate(50);
10911091   m_vdp->set_total_scanlines(313);
10921092
1093   m_version_hi_nibble = 0xe0;   // Export PAL no-SCD
1093   m_version_hi_nibble = 0xe0; // Export PAL no-SCD
10941094}
10951095
10961096void md_base_state::screen_eof_megadriv(screen_device &screen, bool state)
trunk/src/mame/machine/namco53.c
r29404r29405
6969READ8_MEMBER( namco_53xx_device::Rx_r )
7070{
7171   switch(offset) {
72      case 0 : return m_in_0(0);
73      case 1 : return m_in_1(0);
74      case 2 : return m_in_2(0);
75      case 3 : return m_in_3(0);
72      case 0 : return m_in_0(0);
73      case 1 : return m_in_1(0);
74      case 2 : return m_in_2(0);
75      case 3 : return m_in_3(0);
7676      default : return 0xff;
7777   }
78   
78
7979}
8080
8181WRITE8_MEMBER( namco_53xx_device::O_w )
trunk/src/mame/machine/namco53.h
r29404r29405
2626#define MCFG_NAMCO_53XX_P_CB(_devcb) \
2727   devcb = &namco_53xx_device::set_p_port_callback(*device, DEVCB2_##_devcb);
2828
29   
29
3030class namco_53xx_device : public device_t
3131{
3232public:
r29404r29405
3636   template<class _Object> static devcb2_base &set_input_1_callback(device_t &device, _Object object) { return downcast<namco_53xx_device &>(device).m_in_1.set_callback(object); }
3737   template<class _Object> static devcb2_base &set_input_2_callback(device_t &device, _Object object) { return downcast<namco_53xx_device &>(device).m_in_2.set_callback(object); }
3838   template<class _Object> static devcb2_base &set_input_3_callback(device_t &device, _Object object) { return downcast<namco_53xx_device &>(device).m_in_3.set_callback(object); }
39   
39
4040   template<class _Object> static devcb2_base &set_k_port_callback(device_t &device, _Object object) { return downcast<namco_53xx_device &>(device).m_k.set_callback(object); }
4141   template<class _Object> static devcb2_base &set_p_port_callback(device_t &device, _Object object) { return downcast<namco_53xx_device &>(device).m_p.set_callback(object); }
4242
r29404r29405
4444   DECLARE_READ8_MEMBER( Rx_r );
4545   DECLARE_WRITE8_MEMBER( O_w );
4646   DECLARE_WRITE8_MEMBER( P_w );
47   
47
4848   DECLARE_WRITE_LINE_MEMBER(read_request);
4949   DECLARE_READ8_MEMBER( read );
5050
r29404r29405
5353   virtual void device_start();
5454   virtual const rom_entry *device_rom_region() const;
5555   virtual machine_config_constructor device_mconfig_additions() const;
56   
56
5757   TIMER_CALLBACK_MEMBER( irq_clear );
5858private:
5959   // internal state
6060   required_device<mb88_cpu_device> m_cpu;
6161   UINT8           m_portO;
6262   devcb2_read8    m_k;
63   devcb2_read8    m_in_0;
64   devcb2_read8    m_in_1;
65   devcb2_read8    m_in_2;
66   devcb2_read8    m_in_3;
63   devcb2_read8    m_in_0;
64   devcb2_read8    m_in_1;
65   devcb2_read8    m_in_2;
66   devcb2_read8    m_in_3;
6767   devcb2_write8   m_p;
6868
6969};
trunk/src/mame/machine/cdi070.h
r29404r29405
154154
155155   DECLARE_READ16_MEMBER(periphs_r);
156156   DECLARE_WRITE16_MEMBER(periphs_w);
157   
157
158158   DECLARE_READ16_MEMBER(uart_loopback_enable);
159159
160160   TIMER_CALLBACK_MEMBER( timer0_callback );
trunk/src/mame/machine/namco62.h
r29404r29405
3434   template<class _Object> static devcb2_base &set_input_1_callback(device_t &device, _Object object) { return downcast<namco_62xx_device &>(device).m_in_1.set_callback(object); }
3535   template<class _Object> static devcb2_base &set_input_2_callback(device_t &device, _Object object) { return downcast<namco_62xx_device &>(device).m_in_2.set_callback(object); }
3636   template<class _Object> static devcb2_base &set_input_3_callback(device_t &device, _Object object) { return downcast<namco_62xx_device &>(device).m_in_3.set_callback(object); }
37   
37
3838   template<class _Object> static devcb2_base &set_output_0_callback(device_t &device, _Object object) { return downcast<namco_62xx_device &>(device).m_out_0.set_callback(object); }
3939   template<class _Object> static devcb2_base &set_output_1_callback(device_t &device, _Object object) { return downcast<namco_62xx_device &>(device).m_out_1.set_callback(object); }
40   
40
4141   DECLARE_READ8_MEMBER( read );
4242   DECLARE_WRITE8_MEMBER( write );
4343
trunk/src/mame/machine/gaelco3d.h
r29404r29405
6464public:
6565   gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6666   ~gaelco_serial_device() {}
67   
67
6868   template<class _Object> static devcb2_base &set_irq_handler(device_t &device, _Object object) { return downcast<gaelco_serial_device &>(device).m_irq_handler.set_callback(object); }
6969
7070   DECLARE_READ8_MEMBER( status_r);
trunk/src/mame/machine/naomim4.c
r29404r29405
139139      if (rombdid_tag && memregion(rombdid_tag) != NULL)
140140      {
141141         fpr_num = *memregion(rombdid_tag)->base() & 0x7f;
142     
142
143143      }
144144
145145      if (((rom_cur_address >> 26) & 0x07) < fpr_num) {
r29404r29405
210210   if (rombdid_tag && memregion(rombdid_tag) != NULL)
211211   {
212212      epr_flag = *memregion(rombdid_tag)->base() & 0x80;
213     
213
214214   }
215215
216216   return 0x5500 | epr_flag;
r29404r29405
222222      cfi_mode = true;
223223   if (((offset&0xffff) == 0x0000) && (data == 0x00f0))
224224      cfi_mode = false;
225}
No newline at end of file
225}
trunk/src/mame/machine/slapfght.c
r29404r29405
4141      res |= 0x02;
4242   if (!m_mcu_sent)
4343      res |= 0x04;
44   
44
4545   return res;
4646}
4747
trunk/src/mame/machine/inder_sb.c
r29404r29405
2424
2525
2626// hacks for test purposes, these are installed over the program rom so we know when irqs are actually taken
27READ8_MEMBER(inder_sb_device::megaphx_02cc_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x02cc\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[0] & 7;   membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02cc]; };
28READ8_MEMBER(inder_sb_device::megaphx_02e6_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x02e6\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[1] & 7;   membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02e6]; };
29READ8_MEMBER(inder_sb_device::megaphx_0309_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x0309\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[2] & 7;   membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0309]; };
30READ8_MEMBER(inder_sb_device::megaphx_0323_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x0323\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[3] & 7;   membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0323]; };
27READ8_MEMBER(inder_sb_device::megaphx_02cc_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x02cc\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[0] & 7;  membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02cc]; };
28READ8_MEMBER(inder_sb_device::megaphx_02e6_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x02e6\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[1] & 7;  membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02e6]; };
29READ8_MEMBER(inder_sb_device::megaphx_0309_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x0309\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[2] & 7;  membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0309]; };
30READ8_MEMBER(inder_sb_device::megaphx_0323_hack_r)  { /*logerror("%04x audicpu IRQ hack 0x0323\n", machine().device("audiocpu")->safe_pc());*/  int bank = m_soundbank[3] & 7;  membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0323]; };
3131
3232
3333
3434READ16_MEMBER(inder_sb_device::megaphx_0x050002_r)
3535{
3636   space.machine().scheduler().synchronize();
37//   int pc = machine().device("maincpu")->safe_pc();
37//  int pc = machine().device("maincpu")->safe_pc();
3838   int ret = m_soundback;
3939   m_soundback = 0;
4040   //logerror("(%06x) megaphx_0x050002_r (from z80?) %04x\n", pc, mem_mask);
41   return ret;
41   return ret;
4242}
4343
4444WRITE16_MEMBER(inder_sb_device::megaphx_0x050000_w)
4545{
46//   int pc = machine().device("maincpu")->safe_pc();
46//  int pc = machine().device("maincpu")->safe_pc();
4747   space.machine().scheduler().synchronize();
4848
4949   //logerror("(%06x) megaphx_0x050000_w (to z80?) %04x %04x\n", pc, data, mem_mask);
r29404r29405
6969
7070WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch0)
7171{
72//   int bank = m_soundbank[0] & 7;   membank("snddata")->set_entry(bank);
73//   m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
72//  int bank = m_soundbank[0] & 7;  membank("snddata")->set_entry(bank);
73//  m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
7474   if (state) m_soundirq |= 0x1;
7575   else m_soundirq &= ~0x1;
7676
r29404r29405
8080
8181WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch1)
8282{
83//   int bank = m_soundbank[1] & 7;   membank("snddata")->set_entry(bank);
84//   m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
83//  int bank = m_soundbank[1] & 7;  membank("snddata")->set_entry(bank);
84//  m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
8585   if (state) m_soundirq |= 0x2;
8686   else m_soundirq &= ~0x2;
8787
r29404r29405
9191
9292WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch2)
9393{
94//   int bank = m_soundbank[2] & 7;   membank("snddata")->set_entry(bank);
95//   m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
94//  int bank = m_soundbank[2] & 7;  membank("snddata")->set_entry(bank);
95//  m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
9696   if (state) m_soundirq |= 0x4;
9797   else m_soundirq &= ~0x4;
9898
r29404r29405
104104
105105WRITE_LINE_MEMBER(inder_sb_device::z80ctc_ch3)
106106{
107//   int bank = m_soundbank[3] & 7;   membank("snddata")->set_entry(bank);
108//   m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
107//  int bank = m_soundbank[3] & 7;  membank("snddata")->set_entry(bank);
108//  m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
109109   if (state) m_soundirq |= 0x8;
110110   else m_soundirq &= ~0x8;
111111
112112   update_sound_irqs();
113113}
114114
115   
116115
117116
117
118118static Z80CTC_INTERFACE( z80ctc_intf ) // runs in IM2 , vector set to 0x20 , values there are 0xCC, 0x02, 0xE6, 0x02, 0x09, 0x03, 0x23, 0x03  (so 02cc, 02e6, 0309, 0323, all of which are valid irq handlers)
119119{
120120   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, inder_sb_device, z80ctc_ch0),    // for channel 0
r29404r29405
152152
153153WRITE8_MEMBER(inder_sb_device::megaphx_sound_to_68k_w)
154154{
155//   int pc = machine().device("audiocpu")->safe_pc();
155//  int pc = machine().device("audiocpu")->safe_pc();
156156   space.machine().scheduler().synchronize();
157157   //logerror("(%04x) megaphx_sound_to_68k_w (to 68k?) %02x\n", pc, data);
158158
r29404r29405
161161
162162WRITE8_MEMBER(inder_sb_device::dac0_value_write)
163163{
164//   printf("dac0_data_write %02x\n", data);
164//  printf("dac0_data_write %02x\n", data);
165165   m_dac0->write_unsigned8(data);
166166}
167167
168168WRITE8_MEMBER(inder_sb_device::dac0_gain_write)
169169{
170//   printf("dac0_gain_write %02x\n", data);
170//  printf("dac0_gain_write %02x\n", data);
171171   dac_gain[0] = data;
172172}
173173
174174WRITE8_MEMBER(inder_sb_device::dac1_value_write)
175175{
176//   printf("dac1_data_write %02x\n", data);
176//  printf("dac1_data_write %02x\n", data);
177177   m_dac1->write_unsigned8(data);
178178}
179179
180180WRITE8_MEMBER(inder_sb_device::dac1_gain_write)
181181{
182//   printf("dac1_gain_write %02x\n", data);
182//  printf("dac1_gain_write %02x\n", data);
183183   dac_gain[1] = data;
184184}
185185
186186WRITE8_MEMBER(inder_sb_device::dac2_value_write)
187187{
188//   printf("dac2_data_write %02x\n", data);
188//  printf("dac2_data_write %02x\n", data);
189189   m_dac2->write_unsigned8(data);
190190}
191191
192192WRITE8_MEMBER(inder_sb_device::dac2_gain_write)
193193{
194//   printf("dac2_gain_write %02x\n", data);
194//  printf("dac2_gain_write %02x\n", data);
195195   dac_gain[2] = data;
196196}
197197
198198WRITE8_MEMBER(inder_sb_device::dac3_value_write)
199199{
200//   printf("dac3_data_write %02x\n", data);
200//  printf("dac3_data_write %02x\n", data);
201201   m_dac3->write_unsigned8(data);
202202}
203203
204204WRITE8_MEMBER(inder_sb_device::dac3_gain_write)
205205{
206//   printf("dac3_gain_write %02x\n", data);
206//  printf("dac3_gain_write %02x\n", data);
207207   dac_gain[3] = data;
208208}
209209
r29404r29405
211211{
212212   m_soundbank[0] = data;
213213
214//   printf("dac0_rombank_write %02x", data);
214//  printf("dac0_rombank_write %02x", data);
215215}
216216
217217WRITE8_MEMBER(inder_sb_device::dac1_rombank_write)
218218{
219219   m_soundbank[1] = data;
220//   printf("dac1_rombank_write %02x", data);
220//  printf("dac1_rombank_write %02x", data);
221221
222222}
223223
224224WRITE8_MEMBER(inder_sb_device::dac2_rombank_write)
225225{
226226   m_soundbank[2] = data;
227//   printf("dac2_rombank_write %02x", data);
227//  printf("dac2_rombank_write %02x", data);
228228}
229229
230230WRITE8_MEMBER(inder_sb_device::dac3_rombank_write)
231231{
232232   m_soundbank[3] = data;
233//   printf("dac3_rombank_write %02x", data);
233//  printf("dac3_rombank_write %02x", data);
234234
235235}
236236
r29404r29405
253253   AM_RANGE(0x13, 0x13) AM_WRITE(dac3_rombank_write)
254254
255255
256   
257256
257
258258   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
259   
259
260260   AM_RANGE(0x30, 0x30) AM_READWRITE(megaphx_sound_cmd_r, megaphx_sound_to_68k_w)
261261   AM_RANGE(0x31, 0x31) AM_READ(megaphx_sound_sent_r)
262262ADDRESS_MAP_END
r29404r29405
271271
272272   MCFG_Z80CTC_ADD( "ctc", 4000000, z80ctc_intf ) // unk freq
273273
274   MCFG_SPEAKER_STANDARD_MONO("mono")   
274   MCFG_SPEAKER_STANDARD_MONO("mono")
275275   MCFG_DAC_ADD("dac0")
276276   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
277277   MCFG_DAC_ADD("dac1")
trunk/src/mame/machine/inder_sb.h
r29404r29405
8989
9090};
9191
92#endif
No newline at end of file
92#endif
trunk/src/mame/machine/tait8741.c
r29404r29405
9797
9898void taito8741_4pack_device::device_reset()
9999{
100   for (int i=0;i<4;i++)
100   for (int i=0;i<4;i++)
101101   {
102102      I8741 *st = &m_taito8741[i];
103103      st->number = i;
r29404r29405
305305
306306UINT8 taito8741_4pack_device::port_read(int num, int offset)
307307{
308   switch(num)
308   switch(num)
309309   {
310310      case 0 : return m_port_handler_0_r(offset);
311311      case 1 : return m_port_handler_1_r(offset);
r29404r29405
473473
474474UINT8 josvolly8741_4pack_device::port_read(int num)
475475{
476   switch(num)
476   switch(num)
477477   {
478478      case 0 : return m_port_handler_0_r(0);
479479      case 1 : return m_port_handler_1_r(0);
r29404r29405
482482      default : return 0;
483483   }
484484}
485
trunk/src/mame/machine/tait8741.h
r29404r29405
1717#define MCFG_TAITO8741_PORT_HANDLERS(_devcb0, _devcb1, _devcb2, _devcb3) \
1818   devcb = &taito8741_4pack_device::set_port_handler_0_callback(*device, DEVCB2_##_devcb0); \
1919   devcb = &taito8741_4pack_device::set_port_handler_1_callback(*device, DEVCB2_##_devcb1); \
20    devcb = &taito8741_4pack_device::set_port_handler_2_callback(*device, DEVCB2_##_devcb2); \
20   devcb = &taito8741_4pack_device::set_port_handler_2_callback(*device, DEVCB2_##_devcb2); \
2121   devcb = &taito8741_4pack_device::set_port_handler_3_callback(*device, DEVCB2_##_devcb3);
2222
2323#define MCFG_TAITO8741_MODES(_mode0, _mode1, _mode2, _mode3) \
24   taito8741_4pack_device::static_set_mode(*device, 0, _mode0);   \
25   taito8741_4pack_device::static_set_mode(*device, 1, _mode1);   \
26   taito8741_4pack_device::static_set_mode(*device, 2, _mode2);   \
24   taito8741_4pack_device::static_set_mode(*device, 0, _mode0);    \
25   taito8741_4pack_device::static_set_mode(*device, 1, _mode1);    \
26   taito8741_4pack_device::static_set_mode(*device, 2, _mode2);    \
2727   taito8741_4pack_device::static_set_mode(*device, 3, _mode3);
2828
2929
3030#define MCFG_TAITO8741_CONNECT(_con0, _con1, _con2, _con3) \
31   taito8741_4pack_device::static_set_connect(*device, 0, _con0);   \
32   taito8741_4pack_device::static_set_connect(*device, 1, _con1);   \
33   taito8741_4pack_device::static_set_connect(*device, 2, _con2);   \
31   taito8741_4pack_device::static_set_connect(*device, 0, _con0);  \
32   taito8741_4pack_device::static_set_connect(*device, 1, _con1);  \
33   taito8741_4pack_device::static_set_connect(*device, 2, _con2);  \
3434   taito8741_4pack_device::static_set_connect(*device, 3, _con3);
3535
36   
36
3737class taito8741_4pack_device : public device_t
3838{
3939   struct I8741 {
40      int number;
40      int number;
4141      UINT8 toData;    /* to host data      */
4242      UINT8 fromData;  /* from host data    */
4343      UINT8 fromCmd;   /* from host command */
r29404r29405
6262   template<class _Object> static devcb2_base &set_port_handler_1_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_1_r.set_callback(object); }
6363   template<class _Object> static devcb2_base &set_port_handler_2_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_2_r.set_callback(object); }
6464   template<class _Object> static devcb2_base &set_port_handler_3_callback(device_t &device, _Object object) { return downcast<taito8741_4pack_device &>(device).m_port_handler_3_r.set_callback(object); }
65     
66   static void static_set_mode(device_t &device, int num, UINT8 mode) { downcast<taito8741_4pack_device &>(device).m_taito8741[num].mode = mode; }
67   static void static_set_connect(device_t &device, int num, int conn) { downcast<taito8741_4pack_device &>(device).m_taito8741[num].connect = conn; }
68   
65
66   static void static_set_mode(device_t &device, int num, UINT8 mode) { downcast<taito8741_4pack_device &>(device).m_taito8741[num].mode = mode; }
67   static void static_set_connect(device_t &device, int num, int conn) { downcast<taito8741_4pack_device &>(device).m_taito8741[num].connect = conn; }
68
6969   DECLARE_READ8_MEMBER( read_0 ) { if(offset&1) return status_r(0); else return data_r(0); }
7070   DECLARE_WRITE8_MEMBER( write_0 ) { if(offset&1) command_w(0,data); else data_w(0,data); }
7171   DECLARE_READ8_MEMBER( read_1 ) { if(offset&1) return status_r(1); else return data_r(1); }
r29404r29405
8181   int data_r(int num);
8282   void data_w(int num, int data);
8383   void command_w(int num, int data);
84   
84
8585   UINT8 port_read(int num, int offset);
8686
8787protected:
r29404r29405
9696   void serial_rx(I8741 *st,UINT8 *data);
9797
9898   // internal state
99   I8741       m_taito8741[4];
99   I8741       m_taito8741[4];
100100
101101   devcb2_read8 m_port_handler_0_r;
102102   devcb2_read8 m_port_handler_1_r;
r29404r29405
118118#define MCFG_JOSVOLLY8741_PORT_HANDLERS(_devcb0, _devcb1, _devcb2, _devcb3) \
119119   devcb = &josvolly8741_4pack_device::set_port_handler_0_callback(*device, DEVCB2_##_devcb0); \
120120   devcb = &josvolly8741_4pack_device::set_port_handler_1_callback(*device, DEVCB2_##_devcb1); \
121    devcb = &josvolly8741_4pack_device::set_port_handler_2_callback(*device, DEVCB2_##_devcb2); \
121   devcb = &josvolly8741_4pack_device::set_port_handler_2_callback(*device, DEVCB2_##_devcb2); \
122122   devcb = &josvolly8741_4pack_device::set_port_handler_3_callback(*device, DEVCB2_##_devcb3);
123123
124124#define MCFG_JOSVOLLY8741_CONNECT(_con0, _con1, _con2, _con3) \
125   josvolly8741_4pack_device::static_set_connect(*device, 0, _con0);   \
126   josvolly8741_4pack_device::static_set_connect(*device, 1, _con1);   \
127   josvolly8741_4pack_device::static_set_connect(*device, 2, _con2);   \
125   josvolly8741_4pack_device::static_set_connect(*device, 0, _con0);   \
126   josvolly8741_4pack_device::static_set_connect(*device, 1, _con1);   \
127   josvolly8741_4pack_device::static_set_connect(*device, 2, _con2);   \
128128   josvolly8741_4pack_device::static_set_connect(*device, 3, _con3);
129129
130   
130
131131class josvolly8741_4pack_device : public device_t
132132{
133133   struct JV8741  {
r29404r29405
148148   template<class _Object> static devcb2_base &set_port_handler_1_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_1_r.set_callback(object); }
149149   template<class _Object> static devcb2_base &set_port_handler_2_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_2_r.set_callback(object); }
150150   template<class _Object> static devcb2_base &set_port_handler_3_callback(device_t &device, _Object object) { return downcast<josvolly8741_4pack_device &>(device).m_port_handler_3_r.set_callback(object); }
151     
152   static void static_set_connect(device_t &device, int num, int conn) { downcast<josvolly8741_4pack_device &>(device).m_i8741[num].connect = conn; }
153     
151
152   static void static_set_connect(device_t &device, int num, int conn) { downcast<josvolly8741_4pack_device &>(device).m_i8741[num].connect = conn; }
153
154154   DECLARE_READ8_MEMBER( read_0 ) { return read(0,offset); }
155155   DECLARE_WRITE8_MEMBER( write_0 ) { write(0,offset,data); }
156156   DECLARE_READ8_MEMBER( read_1 ) { return read(1,offset); }
157157   DECLARE_WRITE8_MEMBER( write_1 ) { write(1,offset,data); }
158   
159   DECLARE_WRITE8_HANDLER( nmi_enable_w ) { m_nmi_enable = 1; }
160158
159   DECLARE_WRITE8_HANDLER( nmi_enable_w ) { m_nmi_enable = 1; }
160
161161   TIMER_CALLBACK_MEMBER( tx );
162162protected:
163163   // device-level overrides
r29404r29405
173173   // internal state
174174   JV8741 m_i8741[4];
175175   int m_nmi_enable;
176   
176
177177   devcb2_read8 m_port_handler_0_r;
178178   devcb2_read8 m_port_handler_1_r;
179179   devcb2_read8 m_port_handler_2_r;
trunk/src/mame/machine/pcecommn.c
r29404r29405
6767{
6868   m_maincpu->set_input_line(0, state);
6969}
70
trunk/src/mame/machine/pcecommn.h
r29404r29405
3131   virtual UINT8 joy_read();
3232   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3333   required_device<huc6260_device> m_huc6260;
34   DECLARE_WRITE_LINE_MEMBER(pce_irq_changed);   
34   DECLARE_WRITE_LINE_MEMBER(pce_irq_changed);
3535private:
3636   UINT8 m_io_port_options;    /*driver-specific options for the PCE*/
3737   int m_joystick_port_select; /* internal index of joystick ports */
trunk/src/mame/machine/taitoio.h
r29404r29405
2121   template<class _Object> static devcb2_base &set_read_2_callback(device_t &device, _Object object) { return downcast<tc0220ioc_device &>(device).m_read_2_cb.set_callback(object); }
2222   template<class _Object> static devcb2_base &set_read_3_callback(device_t &device, _Object object) { return downcast<tc0220ioc_device &>(device).m_read_3_cb.set_callback(object); }
2323   template<class _Object> static devcb2_base &set_read_7_callback(device_t &device, _Object object) { return downcast<tc0220ioc_device &>(device).m_read_7_cb.set_callback(object); }
24     
24
2525   DECLARE_READ8_MEMBER( read );
2626   DECLARE_WRITE8_MEMBER( write );
2727   DECLARE_READ8_MEMBER( port_r );
r29404r29405
5959   template<class _Object> static devcb2_base &set_read_2_callback(device_t &device, _Object object) { return downcast<tc0510nio_device &>(device).m_read_2_cb.set_callback(object); }
6060   template<class _Object> static devcb2_base &set_read_3_callback(device_t &device, _Object object) { return downcast<tc0510nio_device &>(device).m_read_3_cb.set_callback(object); }
6161   template<class _Object> static devcb2_base &set_read_7_callback(device_t &device, _Object object) { return downcast<tc0510nio_device &>(device).m_read_7_cb.set_callback(object); }
62     
62
6363   DECLARE_READ8_MEMBER( read );
6464   DECLARE_WRITE8_MEMBER( write );
6565   DECLARE_READ16_MEMBER( halfword_r );
r29404r29405
9696   template<class _Object> static devcb2_base &set_read_2_callback(device_t &device, _Object object) { return downcast<tc0640fio_device &>(device).m_read_2_cb.set_callback(object); }
9797   template<class _Object> static devcb2_base &set_read_3_callback(device_t &device, _Object object) { return downcast<tc0640fio_device &>(device).m_read_3_cb.set_callback(object); }
9898   template<class _Object> static devcb2_base &set_read_7_callback(device_t &device, _Object object) { return downcast<tc0640fio_device &>(device).m_read_7_cb.set_callback(object); }
99   
100     
99
100
101101   DECLARE_READ8_MEMBER( read );
102102   DECLARE_WRITE8_MEMBER( write );
103103   DECLARE_READ16_MEMBER( halfword_r );
r29404r29405
133133
134134#define MCFG_TC0220IOC_READ_1_CB(_devcb) \
135135   devcb = &tc0220ioc_device::set_read_1_callback(*device, DEVCB2_##_devcb);
136   
136
137137#define MCFG_TC0220IOC_READ_2_CB(_devcb) \
138138   devcb = &tc0220ioc_device::set_read_2_callback(*device, DEVCB2_##_devcb);
139   
139
140140#define MCFG_TC0220IOC_READ_3_CB(_devcb) \
141141   devcb = &tc0220ioc_device::set_read_3_callback(*device, DEVCB2_##_devcb);
142   
142
143143#define MCFG_TC0220IOC_READ_7_CB(_devcb) \
144144   devcb = &tc0220ioc_device::set_read_7_callback(*device, DEVCB2_##_devcb);
145   
146145
146
147147#define MCFG_TC0510NIO_READ_0_CB(_devcb) \
148148   devcb = &tc0510nio_device::set_read_0_callback(*device, DEVCB2_##_devcb);
149149
150150#define MCFG_TC0510NIO_READ_1_CB(_devcb) \
151151   devcb = &tc0510nio_device::set_read_1_callback(*device, DEVCB2_##_devcb);
152   
152
153153#define MCFG_TC0510NIO_READ_2_CB(_devcb) \
154154   devcb = &tc0510nio_device::set_read_2_callback(*device, DEVCB2_##_devcb);
155   
155
156156#define MCFG_TC0510NIO_READ_3_CB(_devcb) \
157157   devcb = &tc0510nio_device::set_read_3_callback(*device, DEVCB2_##_devcb);
158   
158
159159#define MCFG_TC0510NIO_READ_7_CB(_devcb) \
160160   devcb = &tc0510nio_device::set_read_7_callback(*device, DEVCB2_##_devcb);
161161
r29404r29405
165165
166166#define MCFG_TC0640FIO_READ_1_CB(_devcb) \
167167   devcb = &tc0640fio_device::set_read_1_callback(*device, DEVCB2_##_devcb);
168   
168
169169#define MCFG_TC0640FIO_READ_2_CB(_devcb) \
170170   devcb = &tc0640fio_device::set_read_2_callback(*device, DEVCB2_##_devcb);
171   
171
172172#define MCFG_TC0640FIO_READ_3_CB(_devcb) \
173173   devcb = &tc0640fio_device::set_read_3_callback(*device, DEVCB2_##_devcb);
174   
174
175175#define MCFG_TC0640FIO_READ_7_CB(_devcb) \
176   devcb = &tc0640fio_device::set_read_7_callback(*device, DEVCB2_##_devcb);   
176   devcb = &tc0640fio_device::set_read_7_callback(*device, DEVCB2_##_devcb);
177177
178   
178
179179#endif  /* __TAITOIO_H__ */
trunk/src/mame/machine/atarigen.h
r29404r29405
7979   { astring fulltag(device->tag(), ":mob"); device_t *device; \
8080   MCFG_ATARI_MOTION_OBJECTS_ADD(fulltag, "^^screen", _config) \
8181   MCFG_ATARI_MOTION_OBJECTS_GFXDECODE("^" _gfxtag) }
82   
8382
8483
84
8585#define MCFG_ATARI_EEPROM_2804_ADD(_tag) \
8686   MCFG_DEVICE_ADD(_tag, ATARI_EEPROM_2804, 0)
8787
trunk/src/mame/machine/atari.c
r29404r29405
278278   machine().save().save_pointer(NAME((UINT8 *) &antic.r), sizeof(antic.r));
279279   machine().save().save_pointer(NAME((UINT8 *) &antic.w), sizeof(antic.w));
280280}
281
trunk/src/mame/machine/namco06.c
r29404r29405
101101
102102
103103READ8_MEMBER( namco_06xx_device::data_r )
104{   
104{
105105   UINT8 result = 0xff;
106106
107107   LOG(("%s: 06XX '%s' read offset %d\n",machine().describe_context(),tag(),offset));
r29404r29405
122122
123123
124124WRITE8_MEMBER( namco_06xx_device::data_w )
125{   
125{
126126   LOG(("%s: 06XX '%s' write offset %d = %02x\n",machine().describe_context(),tag(),offset,data));
127127
128128   if (m_control & 0x10)
r29404r29405
138138
139139
140140READ8_MEMBER( namco_06xx_device::ctrl_r )
141{   
141{
142142   LOG(("%s: 06XX '%s' ctrl_r\n",machine().describe_context(),tag()));
143143   return m_control;
144144}
145145
146146WRITE8_MEMBER( namco_06xx_device::ctrl_w )
147{   
147{
148148   LOG(("%s: 06XX '%s' control %02x\n",space.machine().describe_context(),tag(),data));
149149
150150   m_control = data;
r29404r29405
183183   m_read_0(*this),
184184   m_read_1(*this),
185185   m_read_2(*this),
186   m_read_3(*this),   
186   m_read_3(*this),
187187   m_readreq_0(*this),
188188   m_readreq_1(*this),
189189   m_readreq_2(*this),
190   m_readreq_3(*this),   
190   m_readreq_3(*this),
191191   m_write_0(*this),
192192   m_write_1(*this),
193193   m_write_2(*this),
r29404r29405
212212   m_write_0.resolve();
213213   m_write_1.resolve();
214214   m_write_2.resolve();
215   m_write_3.resolve();   
215   m_write_3.resolve();
216216   /* allocate a timer */
217217   m_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namco_06xx_device::nmi_generate),this));
218218
trunk/src/mame/machine/namco06.h
r29404r29405
1616
1717#define MCFG_NAMCO_06XX_ADD(_tag, _clock) \
1818   MCFG_DEVICE_ADD(_tag, NAMCO_06XX, _clock)
19   
19
2020#define MCFG_NAMCO_06XX_MAINCPU(_tag) \
2121   namco_06xx_device::set_maincpu(*device, "^" _tag);
2222
r29404r29405
4444
4545#define MCFG_NAMCO_06XX_READ_REQUEST_3_CB(_devcb) \
4646   devcb = &namco_06xx_device::set_read_request_3_callback(*device, DEVCB2_##_devcb);
47   
4847
48
4949#define MCFG_NAMCO_06XX_WRITE_0_CB(_devcb) \
5050   devcb = &namco_06xx_device::set_write_0_callback(*device, DEVCB2_##_devcb);
5151
5252#define MCFG_NAMCO_06XX_WRITE_1_CB(_devcb) \
5353   devcb = &namco_06xx_device::set_write_1_callback(*device, DEVCB2_##_devcb);
54   
54
5555#define MCFG_NAMCO_06XX_WRITE_2_CB(_devcb) \
5656   devcb = &namco_06xx_device::set_write_2_callback(*device, DEVCB2_##_devcb);
5757
5858#define MCFG_NAMCO_06XX_WRITE_3_CB(_devcb) \
5959   devcb = &namco_06xx_device::set_write_3_callback(*device, DEVCB2_##_devcb);
60   
6160
61
6262/* device get info callback */
6363class namco_06xx_device : public device_t
6464{
r29404r29405
6666   namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6767
6868   static void set_maincpu(device_t &device, const char *tag) { downcast<namco_06xx_device &>(device).m_nmicpu.set_tag(tag); }
69   
69
7070   template<class _Object> static devcb2_base &set_read_0_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_read_0.set_callback(object); }
7171   template<class _Object> static devcb2_base &set_read_1_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_read_1.set_callback(object); }
7272   template<class _Object> static devcb2_base &set_read_2_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_read_2.set_callback(object); }
7373   template<class _Object> static devcb2_base &set_read_3_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_read_3.set_callback(object); }
74   
74
7575   template<class _Object> static devcb2_base &set_read_request_0_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_readreq_0.set_callback(object); }
7676   template<class _Object> static devcb2_base &set_read_request_1_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_readreq_1.set_callback(object); }
7777   template<class _Object> static devcb2_base &set_read_request_2_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_readreq_2.set_callback(object); }
7878   template<class _Object> static devcb2_base &set_read_request_3_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_readreq_3.set_callback(object); }
79   
8079
80
8181   template<class _Object> static devcb2_base &set_write_0_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_write_0.set_callback(object); }
8282   template<class _Object> static devcb2_base &set_write_1_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_write_1.set_callback(object); }
8383   template<class _Object> static devcb2_base &set_write_2_callback(device_t &device, _Object object) { return downcast<namco_06xx_device &>(device).m_write_2.set_callback(object); }
r29404r29405
9595private:
9696
9797   TIMER_CALLBACK_MEMBER( nmi_generate );
98   
99   // internal state   
98
99   // internal state
100100   UINT8 m_control;
101101   emu_timer *m_nmi_timer;
102102
r29404r29405
106106   devcb2_read8 m_read_1;
107107   devcb2_read8 m_read_2;
108108   devcb2_read8 m_read_3;
109   
109
110110   devcb2_write_line m_readreq_0;
111111   devcb2_write_line m_readreq_1;
112112   devcb2_write_line m_readreq_2;
113113   devcb2_write_line m_readreq_3;
114     
114
115115   devcb2_write8 m_write_0;
116116   devcb2_write8 m_write_1;
117117   devcb2_write8 m_write_2;
118   devcb2_write8 m_write_3;   
118   devcb2_write8 m_write_3;
119119};
120120
121121extern const device_type NAMCO_06XX;
trunk/src/mame/machine/namcoio.h
r29404r29405
1717   template<class _Object> static devcb2_base &set_in_3_callback(device_t &device, _Object object) { return downcast<namcoio_device &>(device).m_in_3_cb.set_callback(object); }
1818   template<class _Object> static devcb2_base &set_out_0_callback(device_t &device, _Object object) { return downcast<namcoio_device &>(device).m_out_0_cb.set_callback(object); }
1919   template<class _Object> static devcb2_base &set_out_1_callback(device_t &device, _Object object) { return downcast<namcoio_device &>(device).m_out_1_cb.set_callback(object); }
20   
21   
20
21
2222   DECLARE_READ8_MEMBER( read );
2323   DECLARE_WRITE8_MEMBER( write );
2424
r29404r29405
104104
105105#define MCFG_NAMCO56XX_IN_2_CB(_devcb) \
106106   devcb = &namco56xx_device::set_in_2_callback(*device, DEVCB2_##_devcb);
107   
107
108108#define MCFG_NAMCO56XX_IN_3_CB(_devcb) \
109109   devcb = &namco56xx_device::set_in_3_callback(*device, DEVCB2_##_devcb);
110110
r29404r29405
113113
114114#define MCFG_NAMCO56XX_OUT_1_CB(_devcb) \
115115   devcb = &namco56xx_device::set_out_1_callback(*device, DEVCB2_##_devcb);
116   
117116
117
118118#define MCFG_NAMCO58XX_IN_0_CB(_devcb) \
119119   devcb = &namco58xx_device::set_in_0_callback(*device, DEVCB2_##_devcb);
120120
r29404r29405
123123
124124#define MCFG_NAMCO58XX_IN_2_CB(_devcb) \
125125   devcb = &namco58xx_device::set_in_2_callback(*device, DEVCB2_##_devcb);
126   
126
127127#define MCFG_NAMCO58XX_IN_3_CB(_devcb) \
128128   devcb = &namco58xx_device::set_in_3_callback(*device, DEVCB2_##_devcb);
129129
r29404r29405
132132
133133#define MCFG_NAMCO58XX_OUT_1_CB(_devcb) \
134134   devcb = &namco58xx_device::set_out_1_callback(*device, DEVCB2_##_devcb);
135   
136   
135
136
137137#define MCFG_NAMCO59XX_IN_0_CB(_devcb) \
138138   devcb = &namco59xx_device::set_in_0_callback(*device, DEVCB2_##_devcb);
139139
r29404r29405
142142
143143#define MCFG_NAMCO59XX_IN_2_CB(_devcb) \
144144   devcb = &namco59xx_device::set_in_2_callback(*device, DEVCB2_##_devcb);
145   
145
146146#define MCFG_NAMCO59XX_IN_3_CB(_devcb) \
147147   devcb = &namco59xx_device::set_in_3_callback(*device, DEVCB2_##_devcb);
148148
r29404r29405
151151
152152#define MCFG_NAMCO59XX_OUT_1_CB(_devcb) \
153153   devcb = &namco59xx_device::set_out_1_callback(*device, DEVCB2_##_devcb);
154   
154
155155#endif  /* __NAMCOIO_H__ */
trunk/src/mame/machine/namcos1.c
r29404r29405
1313
1414UINT8 namcos1_state::bank_r(address_space &space, offs_t offset, int bank)
1515{
16   
1716   return m_active_bank[bank].bank_handler_r(space, offset + m_active_bank[bank].bank_offset, 0xff);
1817}
1918
r29404r29405
641640      "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8",
642641      "bank9", "bank10", "bank11", "bank12", "bank13", "bank14", "bank15", "bank16"
643642   };
644   
643
645644   static const struct { read8_delegate func; } io_bank_handler_r[16] =
646645   {
647646      { read8_delegate(FUNC(namcos1_state::bank1_r),this) }, { read8_delegate(FUNC(namcos1_state::bank2_r),this) }, { read8_delegate(FUNC(namcos1_state::bank3_r),this) }, { read8_delegate(FUNC(namcos1_state::bank4_r),this) },
r29404r29405
660659
661660
662661   static const char *const cputags[] = { "maincpu", "sub" };
663   
662
664663   address_space &space = machine().device(cputags[(banknum >> 3) & 1])->memory().space(AS_PROGRAM);
665664   int bankstart = (banknum & 7) * 0x2000;
666665
trunk/src/mame/includes/fuukifg3.h
r29404r29405
5555   required_device<gfxdecode_device> m_gfxdecode;
5656   required_device<screen_device> m_screen;
5757   required_device<palette_device> m_palette;
58   
59   
58
59
6060   DECLARE_READ32_MEMBER(snd_020_r);
6161   DECLARE_WRITE32_MEMBER(snd_020_w);
6262   DECLARE_WRITE32_MEMBER(fuuki32_vregs_w);
trunk/src/mame/includes/battlane.h
r29404r29405
3131   required_device<cpu_device> m_subcpu;
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<palette_device> m_palette;
34   
34
3535   DECLARE_WRITE8_MEMBER(battlane_cpu_command_w);
3636   DECLARE_WRITE8_MEMBER(battlane_palette_w);
3737   DECLARE_WRITE8_MEMBER(battlane_scrollx_w);
trunk/src/mame/includes/turbo.h
r29404r29405
4848   required_shared_ptr<UINT8> m_sprite_position;
4949
5050   required_device<samples_device> m_samples;
51   
51
5252   required_device<gfxdecode_device> m_gfxdecode;
5353   required_device<screen_device> m_screen;
5454
trunk/src/mame/includes/rohga.h
r29404r29405
5858
5959   optional_device<decospr_device> m_sprgen1;
6060   optional_device<decospr_device> m_sprgen2;
61   
61
6262   required_device<palette_device> m_palette;
6363
6464   DECLARE_READ16_MEMBER(rohga_irq_ack_r);
trunk/src/mame/includes/crimfght.h
r29404r29405
3434   required_device<k052109_device> m_k052109;
3535   required_device<k051960_device> m_k051960;
3636   required_device<palette_device> m_palette;
37   
37
3838   DECLARE_WRITE8_MEMBER(crimfght_coin_w);
3939   DECLARE_WRITE8_MEMBER(crimfght_sh_irqtrigger_w);
4040   DECLARE_READ8_MEMBER(k052109_051960_r);
trunk/src/mame/includes/model3.h
r29404r29405
3636   required_device<cpu_device> m_audiocpu;
3737   required_device<scsp_device> m_scsp1;
3838   required_device<eeprom_serial_93cxx_device> m_eeprom;
39   required_device<screen_device> m_screen;   
39   required_device<screen_device> m_screen;
4040
4141   required_shared_ptr<UINT64> m_work_ram;
4242   required_shared_ptr<UINT64> m_paletteram64;
trunk/src/mame/includes/darius.h
r29404r29405
9393   required_device<filter_volume_device> m_msm5205_r;
9494   required_device<gfxdecode_device> m_gfxdecode;
9595   required_device<palette_device> m_palette;
96   
96
9797   DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
9898   DECLARE_WRITE16_MEMBER(darius_watchdog_w);
9999   DECLARE_READ16_MEMBER(darius_ioc_r);
trunk/src/mame/includes/nitedrvr.h
r29404r29405
5050   required_device<discrete_device> m_discrete;
5151   required_device<gfxdecode_device> m_gfxdecode;
5252   required_device<palette_device> m_palette;
53   
53
5454   DECLARE_READ8_MEMBER(nitedrvr_steering_reset_r);
5555   DECLARE_WRITE8_MEMBER(nitedrvr_steering_reset_w);
5656   DECLARE_READ8_MEMBER(nitedrvr_in0_r);
trunk/src/mame/includes/cchasm.h
r29404r29405
3535   required_device<dac_device> m_dac2;
3636   required_device<vector_device> m_vector;
3737   required_device<screen_device> m_screen;
38   
38
3939   int m_sound_flags;
4040   int m_coin_flag;
4141   int m_channel_active[2];
trunk/src/mame/includes/nycaptor.h
r29404r29405
6363   required_device<msm5232_device> m_msm;
6464   required_device<gfxdecode_device> m_gfxdecode;
6565   required_device<palette_device> m_palette;
66   
66
6767   DECLARE_WRITE8_MEMBER(sub_cpu_halt_w);
6868   DECLARE_READ8_MEMBER(from_snd_r);
6969   DECLARE_WRITE8_MEMBER(to_main_w);
trunk/src/mame/includes/mrflea.h
r29404r29405
3737   required_device<gfxdecode_device> m_gfxdecode;
3838   required_device<screen_device> m_screen;
3939   required_device<palette_device> m_palette;
40   
40
4141   DECLARE_WRITE8_MEMBER(mrflea_main_w);
4242   DECLARE_WRITE8_MEMBER(mrflea_io_w);
4343   DECLARE_READ8_MEMBER(mrflea_main_r);
trunk/src/mame/includes/bublbobl.h
r29404r29405
7070   required_device<cpu_device> m_slave;
7171   required_device<gfxdecode_device> m_gfxdecode;
7272   required_device<palette_device> m_palette;
73   
73
7474   DECLARE_WRITE8_MEMBER(bublbobl_bankswitch_w);
7575   DECLARE_WRITE8_MEMBER(tokio_bankswitch_w);
7676   DECLARE_WRITE8_MEMBER(tokio_videoctrl_w);
trunk/src/mame/includes/docastle.h
r29404r29405
2121      m_colorram(*this, "colorram"),
2222      m_spriteram(*this, "spriteram"),
2323      m_gfxdecode(*this, "gfxdecode"),
24      m_palette(*this, "palette")
24      m_palette(*this, "palette")
2525   { }
2626
2727   /* devices */
r29404r29405
3535   required_shared_ptr<UINT8> m_videoram;
3636   required_shared_ptr<UINT8> m_colorram;
3737   required_shared_ptr<UINT8> m_spriteram;
38   
38
3939   required_device<gfxdecode_device> m_gfxdecode;
4040   required_device<palette_device> m_palette;
41   
41
4242   /* video-related */
4343   tilemap_t  *m_do_tilemap;
4444
trunk/src/mame/includes/snowbros.h
r29404r29405
2525   optional_shared_ptr<UINT16> m_bootleg_spriteram16;
2626   required_device<gfxdecode_device> m_gfxdecode;
2727   required_device<palette_device> m_palette;
28   
28
2929   int m_sb3_music_is_playing;
3030   int m_sb3_music;
3131   UINT8 m_semicom_prot_offset;
trunk/src/mame/includes/lasso.h
r29404r29405
4949   optional_device<sn76489_device> m_sn_2;
5050   required_device<gfxdecode_device> m_gfxdecode;
5151   required_device<palette_device> m_palette;
52   
52
5353   DECLARE_WRITE8_MEMBER(sound_command_w);
5454   DECLARE_READ8_MEMBER(sound_status_r);
5555   DECLARE_WRITE8_MEMBER(sound_select_w);
trunk/src/mame/includes/copsnrob.h
r29404r29405
4444   required_device<cpu_device> m_maincpu;
4545   required_device<gfxdecode_device> m_gfxdecode;
4646   required_device<screen_device> m_screen;
47   required_device<palette_device> m_palette;   
47   required_device<palette_device> m_palette;
4848};
4949
5050/*----------- defined in audio/copsnrob.c -----------*/
trunk/src/mame/includes/multfish.h
r29404r29405
113113MACHINE_CONFIG_EXTERN( igrosoft_gamble );
114114MACHINE_CONFIG_EXTERN( rollfr );
115115INPUT_PORTS_EXTERN( igrosoft_gamble );
116
117
118
119
trunk/src/mame/includes/m10.h
r29404r29405
4646      m_chargen(*this, "chargen"),
4747      m_maincpu(*this, "maincpu"),
4848      m_ic8j1(*this, "ic8j1"),
49      m_ic8j2(*this, "ic8j2"),     
49      m_ic8j2(*this, "ic8j2"),
5050      m_samples(*this, "samples"),
5151      m_gfxdecode(*this, "gfxdecode"),
5252      m_screen(*this, "screen"),
r29404r29405
8181   optional_device<gfxdecode_device> m_gfxdecode;
8282   required_device<screen_device> m_screen;
8383   required_device<palette_device> m_palette;
84   
84
8585   DECLARE_WRITE8_MEMBER(m10_ctrl_w);
8686   DECLARE_WRITE8_MEMBER(m11_ctrl_w);
8787   DECLARE_WRITE8_MEMBER(m15_ctrl_w);
trunk/src/mame/includes/labyrunr.h
r29404r29405
3333   required_shared_ptr<UINT8> m_spriteram;
3434   required_shared_ptr<UINT8> m_videoram1;
3535   required_shared_ptr<UINT8> m_videoram2;
36   
36
3737   required_device<gfxdecode_device> m_gfxdecode;
3838   required_device<screen_device> m_screen;
3939   required_device<palette_device> m_palette;
trunk/src/mame/includes/ccastles.h
r29404r29405
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<screen_device> m_screen;
3434   required_device<palette_device> m_palette;
35   
35
3636   /* video-related */
3737   const UINT8 *m_syncprom;
3838   const UINT8 *m_wpprom;
trunk/src/mame/includes/djboy.h
r29404r29405
5656   required_device<kaneko_pandora_device> m_pandora;
5757   required_device<gfxdecode_device> m_gfxdecode;
5858   required_device<palette_device> m_palette;
59   
59
6060   DECLARE_WRITE8_MEMBER(beast_data_w);
6161   DECLARE_READ8_MEMBER(beast_data_r);
6262   DECLARE_READ8_MEMBER(beast_status_r);
trunk/src/mame/includes/powerins.h
r29404r29405
2828   required_device<gfxdecode_device> m_gfxdecode;
2929   required_device<screen_device> m_screen;
3030   required_device<palette_device> m_palette;
31   
31
3232   UINT16 *m_vctrl_1;
3333   tilemap_t *m_tilemap_0;
3434   tilemap_t *m_tilemap_1;
trunk/src/mame/includes/paradise.h
r29404r29405
6767   optional_device<okim6295_device> m_oki2;
6868   required_device<gfxdecode_device> m_gfxdecode;
6969   required_device<screen_device> m_screen;
70   required_device<palette_device> m_palette;   
70   required_device<palette_device> m_palette;
7171};
trunk/src/mame/includes/balsente.h
r29404r29405
219219   required_device<cpu_device> m_audiocpu;
220220   optional_device<cpu_device> m_68k;
221221   required_device<screen_device> m_screen;
222   required_device<palette_device> m_palette;   
222   required_device<palette_device> m_palette;
223223};
224224
225225
trunk/src/mame/includes/pushman.h
r29404r29405
3737   optional_device<cpu_device> m_mcu;
3838   required_device<gfxdecode_device> m_gfxdecode;
3939   required_device<palette_device> m_palette;
40   
40
4141   DECLARE_WRITE16_MEMBER(pushman_flipscreen_w);
4242   DECLARE_WRITE16_MEMBER(pushman_control_w);
4343   DECLARE_READ16_MEMBER(pushman_68705_r);
trunk/src/mame/includes/undrfire.h
r29404r29405
4949   required_shared_ptr<UINT32> m_spriteram;
5050   required_device<gfxdecode_device> m_gfxdecode;
5151   required_device<palette_device> m_palette;
52   
52
5353   DECLARE_WRITE32_MEMBER(color_ram_w);
5454   DECLARE_READ32_MEMBER(undrfire_input_r);
5555   DECLARE_WRITE32_MEMBER(undrfire_input_w);
trunk/src/mame/includes/zodiack.h
r29404r29405
4242   required_shared_ptr<UINT8> m_attributeram;
4343   required_shared_ptr<UINT8> m_spriteram;
4444   required_shared_ptr<UINT8> m_bulletsram;
45   
45
4646   required_device<gfxdecode_device> m_gfxdecode;
4747   required_device<palette_device> m_palette;
4848
trunk/src/mame/includes/taitojc.h
r29404r29405
7070   required_shared_ptr<UINT32> m_main_ram;
7171   required_shared_ptr<UINT16> m_dsp_shared_ram;
7272   required_shared_ptr<UINT32> m_palette_ram;
73   
73
7474   required_device<gfxdecode_device> m_gfxdecode;
7575   required_device<screen_device> m_screen;
7676   required_device<palette_device> m_palette;
trunk/src/mame/includes/fastfred.h
r29404r29405
3131   optional_shared_ptr<UINT8> m_imago_fg_videoram;
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<palette_device> m_palette;
34   
34
3535   UINT16 m_charbank;
3636   UINT8 m_colorbank;
3737   tilemap_t *m_bg_tilemap;
trunk/src/mame/includes/mcr68.h
r29404r29405
127127   required_device<cpu_device> m_maincpu;
128128   required_device<gfxdecode_device> m_gfxdecode;
129129   required_device<screen_device> m_screen;
130   required_device<palette_device> m_palette;   
130   required_device<palette_device> m_palette;
131131};
trunk/src/mame/includes/citycon.h
r29404r29405
3333   required_device<cpu_device> m_maincpu;
3434   required_device<gfxdecode_device> m_gfxdecode;
3535   required_device<palette_device> m_palette;
36   
36
3737   DECLARE_READ8_MEMBER(citycon_in_r);
3838   DECLARE_READ8_MEMBER(citycon_irq_ack_r);
3939   DECLARE_WRITE8_MEMBER(citycon_videoram_w);
trunk/src/mame/includes/galpanic.h
r29404r29405
2020   required_device<gfxdecode_device> m_gfxdecode;
2121   required_device<screen_device> m_screen;
2222   required_device<palette_device> m_palette;
23   
23
2424   DECLARE_WRITE16_MEMBER(galpanic_6295_bankswitch_w);
2525   DECLARE_WRITE16_MEMBER(galpanica_6295_bankswitch_w);
2626   DECLARE_WRITE16_MEMBER(galpanica_misc_w);
trunk/src/mame/includes/m107.h
r29404r29405
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<screen_device> m_screen;
3434   required_device<palette_device> m_palette;
35   
35
3636   UINT8 m_irq_vectorbase;
3737   int m_sound_status;
3838   UINT8 m_spritesystem;
trunk/src/mame/includes/namcona1.h
r29404r29405
7878   UINT8 m_mask_data[8];
7979   UINT8 m_conv_data[9];
8080
81   
81
8282   DECLARE_READ16_MEMBER(custom_key_r);
8383   DECLARE_WRITE16_MEMBER(custom_key_w);
8484   DECLARE_READ16_MEMBER(namcona1_vreg_r);
r29404r29405
111111   DECLARE_WRITE16_MEMBER(namcona1_paletteram_w);
112112   DECLARE_READ16_MEMBER(namcona1_gfxram_r);
113113   DECLARE_WRITE16_MEMBER(namcona1_gfxram_w);
114   void pdraw_tile( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, UINT32 code,   int color,
115      int sx, int sy,   int flipx, int flipy, int priority,   int bShadow, int bOpaque, int gfx_region );
114   void pdraw_tile( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, UINT32 code, int color,
115      int sx, int sy, int flipx, int flipy, int priority, int bShadow, int bOpaque, int gfx_region );
116116   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
117117   void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int primask );
118118   DECLARE_READ16_MEMBER(snd_r);
trunk/src/mame/includes/metlclsh.h
r29404r29405
3838   required_device<cpu_device> m_subcpu;
3939   required_device<gfxdecode_device> m_gfxdecode;
4040   required_device<palette_device> m_palette;
41   
41
4242   DECLARE_WRITE8_MEMBER(metlclsh_cause_irq);
4343   DECLARE_WRITE8_MEMBER(metlclsh_ack_nmi);
4444   DECLARE_WRITE8_MEMBER(metlclsh_cause_nmi2);
trunk/src/mame/includes/cave.h
r29404r29405
240240   optional_device<eeprom_serial_93cxx_device> m_eeprom;
241241   required_device<gfxdecode_device> m_gfxdecode;
242242   required_device<screen_device> m_screen;
243   required_device<palette_device> m_palette;   
243   required_device<palette_device> m_palette;
244244   void update_irq_state();
245245   void unpack_sprites(const char *region);
246246   void ddonpach_unpack_sprites(const char *region);
trunk/src/mame/includes/kaneko16.h
r29404r29405
3232      m_view2_1(*this, "view2_1"),
3333      m_kaneko_spr(*this, "kan_spr"),
3434      m_pandora(*this, "pandora"),
35      m_palette(*this, "palette")
35      m_palette(*this, "palette")
3636      { }
3737
3838   required_device<cpu_device> m_maincpu;
r29404r29405
7474   DECLARE_VIDEO_START(kaneko16);
7575   DECLARE_MACHINE_RESET(mgcrystl);
7676   UINT32 screen_update_kaneko16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
77   
77
7878   template<class _BitmapClass>
7979   UINT32 screen_update_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect);
8080
r29404r29405
8282
8383   TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_interrupt);
8484   TIMER_DEVICE_CALLBACK_MEMBER(shogwarr_interrupt);
85   
85
8686   template<class _BitmapClass>
8787   void kaneko16_fill_bitmap(palette_device* palette, _BitmapClass &bitmap, const rectangle &cliprect);
8888
r29404r29405
123123      : kaneko16_state(mconfig, type, tag),
124124      m_bg15_reg(*this, "bg15_reg"),
125125      m_bg15_select(*this, "bg15_select"),
126      m_bgpalette(*this, "bgpalette")
126      m_bgpalette(*this, "bgpalette")
127127
128128   {
129129   }
trunk/src/mame/includes/mcatadv.h
r29404r29405
3737   required_device<cpu_device> m_soundcpu;
3838   required_device<gfxdecode_device> m_gfxdecode;
3939   required_device<palette_device> m_palette;
40   
40
4141   DECLARE_WRITE16_MEMBER(mcat_soundlatch_w);
4242   DECLARE_WRITE16_MEMBER(mcat_coin_w);
4343   DECLARE_READ16_MEMBER(mcat_wd_r);
trunk/src/mame/includes/dec8.h
r29404r29405
4444   /* memory pointers */
4545   required_shared_ptr<UINT8> m_videoram;
4646   optional_shared_ptr<UINT8> m_bg_data;
47   
47
4848   required_device<gfxdecode_device> m_gfxdecode;
4949   required_device<palette_device> m_palette;
5050
trunk/src/mame/includes/seicross.h
r29404r29405
2121   required_shared_ptr<UINT8> m_row_scroll;
2222   required_shared_ptr<UINT8> m_spriteram2;
2323   required_shared_ptr<UINT8> m_colorram;
24   
24
2525   UINT8 m_portb;
2626   tilemap_t *m_bg_tilemap;
2727   void nvram_init(nvram_device &nvram, void *data, size_t size);
trunk/src/mame/includes/system16.h
r29404r29405
119119   optional_device<msm5205_device> m_msm;
120120   optional_device<upd7759_device> m_upd7759;
121121   required_device<gfxdecode_device> m_gfxdecode;
122   
122
123123   DECLARE_WRITE16_MEMBER(sound_command_nmi_w);
124124   DECLARE_WRITE16_MEMBER(sound_command_w);
125125   DECLARE_WRITE16_MEMBER(sys16_coinctrl_w);
trunk/src/mame/includes/atari.h
r29404r29405
2121public:
2222   atari_common_state(const machine_config &mconfig, device_type type, const char *tag)
2323      : driver_device(mconfig, type, tag),
24      tv_artifacts(0)   { }
24      tv_artifacts(0) { }
2525
2626   void a600xl_mmu(UINT8 new_mmu);
2727
trunk/src/mame/includes/munchmo.h
r29404r29405
4141   required_device<cpu_device> m_audiocpu;
4242   required_device<gfxdecode_device> m_gfxdecode;
4343   required_device<palette_device> m_palette;
44   
44
4545   DECLARE_WRITE8_MEMBER(mnchmobl_nmi_enable_w);
4646   DECLARE_WRITE8_MEMBER(mnchmobl_soundlatch_w);
4747   DECLARE_WRITE8_MEMBER(sound_nmi_ack_w);
trunk/src/mame/includes/stadhero.h
r29404r29405
2121   required_shared_ptr<UINT16> m_spriteram;
2222   required_shared_ptr<UINT16> m_pf1_data;
2323   required_device<gfxdecode_device> m_gfxdecode;
24   
24
2525   tilemap_t *m_pf1_tilemap;
2626   int m_flipscreen;
2727   DECLARE_READ16_MEMBER(stadhero_control_r);
trunk/src/mame/includes/galaga.h
r29404r29405
3232   required_device<namco_device> m_namco_sound;
3333   required_device<gfxdecode_device> m_gfxdecode;
3434   required_device<screen_device> m_screen;
35   required_device<palette_device> m_palette;   
35   required_device<palette_device> m_palette;
3636   emu_timer *m_cpu3_interrupt_timer;
3737   UINT8 m_custom_mod;
3838
trunk/src/mame/includes/vaportra.h
r29404r29405
3838   required_device<deco_mxc06_device> m_spritegen;
3939   required_device<buffered_spriteram16_device> m_spriteram;
4040   required_device<palette_device> m_palette;
41   
41
4242   DECLARE_WRITE16_MEMBER(vaportra_sound_w);
4343   DECLARE_READ16_MEMBER(vaportra_control_r);
4444   DECLARE_READ8_MEMBER(vaportra_soundlatch_r);
trunk/src/mame/includes/cninja.h
r29404r29405
6565   required_device<gfxdecode_device> m_gfxdecode;
6666   required_device<screen_device> m_screen;
6767   required_device<palette_device> m_palette;
68   
68
6969   /* misc */
7070   int        m_scanline;
7171   int        m_irq_mask;
trunk/src/mame/includes/dbz.h
r29404r29405
5353   required_device<k053936_device> m_k053936_1;
5454   required_device<k053936_device> m_k053936_2;
5555   required_device<gfxdecode_device> m_gfxdecode;
56   
56
5757   DECLARE_READ16_MEMBER(dbzcontrol_r);
5858   DECLARE_WRITE16_MEMBER(dbzcontrol_w);
5959   DECLARE_WRITE16_MEMBER(dbz_sound_command_w);
trunk/src/mame/includes/tceptor.h
r29404r29405
6868   required_device<screen_device> m_2dscreen;
6969   required_device<gfxdecode_device> m_gfxdecode;
7070   required_device<palette_device> m_palette;
71   
71
7272   TILE_GET_INFO_MEMBER(get_tx_tile_info);
7373   TILE_GET_INFO_MEMBER(get_bg1_tile_info);
7474   TILE_GET_INFO_MEMBER(get_bg2_tile_info);
trunk/src/mame/includes/gaelco3d.h
r29404r29405
7979   required_device<cpu_device> m_tms;
8080   required_device<gaelco_serial_device> m_serial;
8181   required_device<screen_device> m_screen;
82   
82
8383   UINT16 m_sound_data;
8484   UINT8 m_sound_status;
8585   offs_t m_tms_offset_xor;
trunk/src/mame/includes/hyprduel.h
r29404r29405
6969   required_device<gfxdecode_device> m_gfxdecode;
7070   required_device<screen_device> m_screen;
7171   required_device<palette_device> m_palette;
72   
72
7373   DECLARE_READ16_MEMBER(hyprduel_irq_cause_r);
7474   DECLARE_WRITE16_MEMBER(hyprduel_irq_cause_w);
7575   DECLARE_WRITE16_MEMBER(hyprduel_subcpu_control_w);
trunk/src/mame/includes/calomega.h
r29404r29405
1212      m_videoram(*this, "videoram"),
1313      m_colorram(*this, "colorram"),
1414      m_gfxdecode(*this, "gfxdecode"),
15      m_palette(*this, "palette")
15      m_palette(*this, "palette")
1616   {
1717   }
1818
trunk/src/mame/includes/tubep.h
r29404r29405
106106   required_device<cpu_device> m_mcu;
107107   optional_device<msm5205_device> m_msm;
108108   required_device<screen_device> m_screen;
109   
110109
110
111111protected:
112112   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
113113};
trunk/src/mame/includes/exidy.h
r29404r29405
6666   optional_device<samples_device> m_samples;
6767   required_device<gfxdecode_device> m_gfxdecode;
6868   required_device<screen_device> m_screen;
69   required_device<palette_device> m_palette;   
69   required_device<palette_device> m_palette;
7070
7171   UINT8 m_last_dial;
7272   UINT8 m_collision_mask;
trunk/src/mame/includes/lazercmd.h
r29404r29405
3737   required_device<dac_device> m_dac;
3838   /* memory pointers */
3939   required_shared_ptr<UINT8> m_videoram;
40   
40
4141   required_device<gfxdecode_device> m_gfxdecode;
4242   required_device<palette_device> m_palette;
4343
trunk/src/mame/includes/spacefb.h
r29404r29405
6767   required_device<cpu_device> m_maincpu;
6868   required_device<cpu_device> m_audiocpu;
6969   required_device<samples_device> m_samples;
70   required_device<screen_device> m_screen;   
70   required_device<screen_device> m_screen;
7171};
7272
7373/*----------- defined in audio/spacefb.c -----------*/
trunk/src/mame/includes/wiz.h
r29404r29405
4949   UINT8 m_main_nmi_mask;
5050   UINT8 m_sound_nmi_mask;
5151   UINT8 m_sprite_bank;
52   
52
5353   int m_dsc0;
5454   int m_dsc1;
5555
trunk/src/mame/includes/scramble.h
r29404r29405
4949   DECLARE_WRITE8_MEMBER(mars_ppi8255_0_w);
5050   DECLARE_WRITE8_MEMBER(mars_ppi8255_1_w);
5151   DECLARE_WRITE8_MEMBER(ad2083_tms5110_ctrl_w);
52   
52
5353   DECLARE_WRITE8_MEMBER(harem_portA_w);
5454   DECLARE_WRITE8_MEMBER(harem_portB_w);
5555
trunk/src/mame/includes/nemesis.h
r29404r29405
8080   required_device<gfxdecode_device> m_gfxdecode;
8181   required_device<screen_device> m_screen;
8282   required_device<palette_device> m_palette;
83   
83
8484   DECLARE_WRITE16_MEMBER(gx400_irq1_enable_word_w);
8585   DECLARE_WRITE16_MEMBER(gx400_irq2_enable_word_w);
8686   DECLARE_WRITE16_MEMBER(gx400_irq4_enable_word_w);
trunk/src/mame/includes/gsword.h
r29404r29405
4848   DECLARE_READ8_MEMBER( gsword_8741_3_r );
4949   DECLARE_WRITE8_MEMBER(gsword_adpcm_data_w);
5050   DECLARE_DRIVER_INIT(gsword);
51   DECLARE_DRIVER_INIT(gsword2);   
51   DECLARE_DRIVER_INIT(gsword2);
5252   TILE_GET_INFO_MEMBER(get_bg_tile_info);
5353   virtual void video_start();
5454   DECLARE_MACHINE_RESET(gsword);
trunk/src/mame/includes/sbasketb.h
r29404r29405
3535   required_device<vlm5030_device> m_vlm;
3636   required_device<gfxdecode_device> m_gfxdecode;
3737   required_device<palette_device> m_palette;
38   
38
3939   /* video-related */
4040   tilemap_t  *m_bg_tilemap;
4141
trunk/src/mame/includes/ironhors.h
r29404r29405
3939   required_device<cpu_device> m_soundcpu;
4040   required_device<gfxdecode_device> m_gfxdecode;
4141   required_device<palette_device> m_palette;
42   
42
4343   DECLARE_WRITE8_MEMBER(ironhors_sh_irqtrigger_w);
4444   DECLARE_WRITE8_MEMBER(ironhors_videoram_w);
4545   DECLARE_WRITE8_MEMBER(ironhors_colorram_w);
trunk/src/mame/includes/bwing.h
r29404r29405
5858   required_device<cpu_device> m_audiocpu;
5959   required_device<gfxdecode_device> m_gfxdecode;
6060   required_device<palette_device> m_palette;
61   
61
6262   DECLARE_WRITE8_MEMBER(bwp12_sharedram1_w);
6363   DECLARE_WRITE8_MEMBER(bwp3_u8F_w);
6464   DECLARE_WRITE8_MEMBER(bwp3_nmimask_w);
trunk/src/mame/includes/gridlee.h
r29404r29405
3838   required_device<cpu_device> m_maincpu;
3939   required_device<screen_device> m_screen;
4040   required_device<palette_device> m_palette;
41   
41
4242   UINT8 m_last_analog_input[2];
4343   UINT8 m_last_analog_output[2];
4444   UINT8 *m_poly17;
trunk/src/mame/includes/lockon.h
r29404r29405
9292   required_device<gfxdecode_device> m_gfxdecode;
9393   required_device<screen_device> m_screen;
9494   required_device<palette_device> m_palette;
95   
95
9696   DECLARE_READ16_MEMBER(lockon_crtc_r);
9797   DECLARE_WRITE16_MEMBER(lockon_crtc_w);
9898   DECLARE_WRITE16_MEMBER(lockon_char_w);
trunk/src/mame/includes/wecleman.h
r29404r29405
2424      m_k007232_3(*this, "k007232_3"),
2525      m_gfxdecode(*this, "gfxdecode"),
2626      m_palette(*this, "palette"),
27      m_screen(*this, "screen")      { }
27      m_screen(*this, "screen")       { }
2828
2929   optional_shared_ptr<UINT16> m_videostatus;
3030   optional_shared_ptr<UINT16> m_protection_ram;
trunk/src/mame/includes/crbaloon.h
r29404r29405
3232   required_device<sn76477_device> m_sn;
3333   required_device<discrete_device> m_discrete;
3434   required_device<gfxdecode_device> m_gfxdecode;
35   
35
3636   UINT16 m_collision_address;
3737   UINT8 m_collision_address_clear;
3838   tilemap_t *m_bg_tilemap;
trunk/src/mame/includes/namcos1.h
r29404r29405
3434   required_device<dac_device> m_dac;
3535   required_device<gfxdecode_device> m_gfxdecode;
3636   required_device<palette_device> m_palette;
37   
37
3838   int m_dac0_value;
3939   int m_dac1_value;
4040   int m_dac0_gain;
trunk/src/mame/includes/portrait.h
r29404r29405
3232   UINT32 screen_update_portrait(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3333   inline void get_tile_info( tile_data &tileinfo, int tile_index, const UINT8 *source );
3434   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
35   required_device<cpu_device> m_maincpu;   
35   required_device<cpu_device> m_maincpu;
3636   required_device<gfxdecode_device> m_gfxdecode;
3737   required_device<palette_device> m_palette;
3838};
trunk/src/mame/includes/lastduel.h
r29404r29405
3030   required_shared_ptr<UINT16> m_scroll1;
3131   required_shared_ptr<UINT16> m_scroll2;
3232   required_shared_ptr<UINT16> m_paletteram;
33   
33
3434   required_device<gfxdecode_device> m_gfxdecode;
3535   required_device<palette_device> m_palette;
36   
36
3737   /* video-related */
3838   tilemap_t     *m_bg_tilemap;
3939   tilemap_t     *m_fg_tilemap;
trunk/src/mame/includes/taito_h.h
r29404r29405
3434   required_device<tc0220ioc_device> m_tc0220ioc;
3535   required_device<gfxdecode_device> m_gfxdecode;
3636   required_device<palette_device> m_palette;
37   
37
3838   DECLARE_READ8_MEMBER(syvalion_input_bypass_r);
3939   DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
4040   virtual void machine_start();
trunk/src/mame/includes/centiped.h
r29404r29405
9494   optional_device<eeprom_serial_93cxx_device> m_eeprom;
9595   required_device<gfxdecode_device> m_gfxdecode;
9696   required_device<screen_device> m_screen;
97   required_device<palette_device> m_palette;   
97   required_device<palette_device> m_palette;
9898};
trunk/src/mame/includes/atarisy1.h
r29404r29405
4848   int             m_next_timer_scanline;
4949   required_device<timer_device> m_scanline_timer;
5050   required_device<timer_device> m_int3off_timer;
51   
51
5252   /* speech */
5353   required_device<tms5220_device> m_tms;
5454
trunk/src/mame/includes/irobot.h
r29404r29405
9898   required_device<cpu_device> m_maincpu;
9999   required_device<gfxdecode_device> m_gfxdecode;
100100   required_device<screen_device> m_screen;
101   required_device<palette_device> m_palette;   
101   required_device<palette_device> m_palette;
102102};
trunk/src/mame/includes/psikyo4.h
r29404r29405
2424      m_gfxdecode(*this, "gfxdecode"),
2525      m_palette(*this, "lpalette"),
2626      m_palette2(*this, "rpalette"),
27      m_screen(*this, "screen")     
27      m_screen(*this, "screen")
2828   { }
2929
3030   /* memory pointers */
trunk/src/mame/includes/taitosj.h
r29404r29405
129129   required_device<dac_device> m_dac;
130130   required_device<gfxdecode_device> m_gfxdecode;
131131   required_device<screen_device> m_screen;
132   required_device<palette_device> m_palette;   
132   required_device<palette_device> m_palette;
133133};
trunk/src/mame/includes/ms32.h
r29404r29405
113113   required_device<cpu_device> m_audiocpu;
114114   required_device<gfxdecode_device> m_gfxdecode;
115115   optional_device<screen_device> m_screen;
116   required_device<palette_device> m_palette;   
116   required_device<palette_device> m_palette;
117117};
trunk/src/mame/includes/fgoal.h
r29404r29405
4040   required_device<gfxdecode_device> m_gfxdecode;
4141   required_device<screen_device> m_screen;
4242   required_device<palette_device> m_palette;
43   
43
4444   DECLARE_READ8_MEMBER(fgoal_analog_r);
4545   DECLARE_READ8_MEMBER(fgoal_nmi_reset_r);
4646   DECLARE_READ8_MEMBER(fgoal_irq_reset_r);
trunk/src/mame/includes/namcos2.h
r29404r29405
227227   optional_device<cpu_device> m_mcu;
228228   required_device<gfxdecode_device> m_gfxdecode;
229229   optional_device<screen_device> m_screen;
230   required_device<palette_device> m_palette;   
230   required_device<palette_device> m_palette;
231231};
232232
233233class namcos2_state : public namcos2_shared_state
trunk/src/mame/includes/aztarac.h
r29404r29405
2323   required_device<vector_device> m_vector;
2424   required_shared_ptr<UINT16> m_nvram;
2525   required_shared_ptr<UINT16> m_vectorram;
26   required_device<screen_device> m_screen;   
26   required_device<screen_device> m_screen;
2727
2828   int m_sound_status;
2929   int m_xcenter;
trunk/src/mame/includes/bigevglf.h
r29404r29405
106106   required_device<msm5232_device> m_msm;
107107   required_device<gfxdecode_device> m_gfxdecode;
108108   required_device<screen_device> m_screen;
109   required_device<palette_device> m_palette;   
109   required_device<palette_device> m_palette;
110110};
trunk/src/mame/includes/gyruss.h
r29404r29405
3838   required_device<gfxdecode_device> m_gfxdecode;
3939   required_device<screen_device> m_screen;
4040   required_device<palette_device> m_palette;
41   
41
4242   tilemap_t *m_tilemap;
4343   UINT8 m_master_nmi_mask;
4444   UINT8 m_slave_irq_mask;
trunk/src/mame/includes/wgp.h
r29404r29405
6868   required_device<tc0220ioc_device> m_tc0220ioc;
6969   required_device<gfxdecode_device> m_gfxdecode;
7070   required_device<palette_device> m_palette;
71   
71
7272   DECLARE_READ16_MEMBER(sharedram_r);
7373   DECLARE_WRITE16_MEMBER(sharedram_w);
7474   DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
trunk/src/mame/includes/meadows.h
r29404r29405
6666   optional_device<samples_device> m_samples;
6767   required_device<gfxdecode_device> m_gfxdecode;
6868   required_device<screen_device> m_screen;
69   required_device<palette_device> m_palette;   
69   required_device<palette_device> m_palette;
7070};
7171
7272
trunk/src/mame/includes/cps1.h
r29404r29405
129129   UINT16 *     m_cps2_buffered_obj;
130130   // game-specific
131131   UINT16 *     m_gigaman2_dummyqsound_ram;
132   UINT16   sf2ceblp_prot;
132   UINT16  sf2ceblp_prot;
133133
134134   /* video-related */
135135   tilemap_t      *m_bg_tilemap[3];
r29404r29405
202202   required_device<gfxdecode_device> m_gfxdecode;
203203   required_device<screen_device> m_screen;
204204   required_device<palette_device> m_palette;
205   
205
206206   DECLARE_READ16_MEMBER(cps1_hack_dsw_r);
207207   DECLARE_READ16_MEMBER(cps1_in1_r);
208208   DECLARE_READ16_MEMBER(cps1_in2_r);
trunk/src/mame/includes/ssv.h
r29404r29405
182182   optional_ioport m_io_tracky;
183183   required_device<gfxdecode_device> m_gfxdecode;
184184   required_device<screen_device> m_screen;
185   required_device<palette_device> m_palette;   
185   required_device<palette_device> m_palette;
186186};
trunk/src/mame/includes/ojankohs.h
r29404r29405
4646   optional_device<gfxdecode_device> m_gfxdecode;
4747   required_device<screen_device> m_screen;
4848   required_device<palette_device> m_palette;
49   
49
5050   DECLARE_WRITE8_MEMBER(ojankohs_rombank_w);
5151   DECLARE_WRITE8_MEMBER(ojankoy_rombank_w);
5252   DECLARE_WRITE8_MEMBER(ojankohs_msm5205_w);
trunk/src/mame/includes/thedeep.h
r29404r29405
3434   required_device<cpu_device> m_mcu;
3535   required_device<gfxdecode_device> m_gfxdecode;
3636   required_device<palette_device> m_palette;
37   
37
3838   DECLARE_WRITE8_MEMBER(thedeep_nmi_w);
3939   DECLARE_WRITE8_MEMBER(thedeep_sound_w);
4040   DECLARE_WRITE8_MEMBER(thedeep_protection_w);
trunk/src/mame/includes/orbit.h
r29404r29405
4646   required_device<gfxdecode_device> m_gfxdecode;
4747   required_device<screen_device> m_screen;
4848   required_device<palette_device> m_palette;
49   
49
5050   DECLARE_WRITE8_MEMBER(orbit_misc_w);
5151   DECLARE_WRITE8_MEMBER(orbit_playfield_w);
5252   TILE_GET_INFO_MEMBER(get_tile_info);
trunk/src/mame/includes/liberate.h
r29404r29405
3636   required_device<cpu_device> m_maincpu;
3737   required_device<cpu_device> m_audiocpu;
3838   required_device<gfxdecode_device> m_gfxdecode;
39   required_device<palette_device> m_palette;   
39   required_device<palette_device> m_palette;
4040
4141   DECLARE_READ8_MEMBER(deco16_bank_r);
4242   DECLARE_READ8_MEMBER(deco16_io_r);
trunk/src/mame/includes/laserbat.h
r29404r29405
2323      m_s2636_3(*this, "s2636_3"),
2424      m_sn(*this, "snsnd"),
2525      m_gfxdecode(*this, "gfxdecode"),
26      m_palette(*this, "palette")
26      m_palette(*this, "palette")
2727   {
2828   }
2929
trunk/src/mame/includes/bfm_sc45.h
r29404r29405
102102
103103
104104   DECLARE_WRITE_LINE_MEMBER(bfmdm01_busy);
105   
105
106106   DECLARE_READ16_MEMBER(sc4_mem_r);
107107   DECLARE_WRITE16_MEMBER(sc4_mem_w);
108108
r29404r29405
112112   DECLARE_WRITE_LINE_MEMBER(bfm_sc4_duart_txa);
113113   DECLARE_READ8_MEMBER(bfm_sc4_duart_input_r);
114114   DECLARE_WRITE8_MEMBER(bfm_sc4_duart_output_w);
115   
115
116116   DECLARE_WRITE_LINE_MEMBER(m68307_duart_irq_handler);
117117   DECLARE_WRITE_LINE_MEMBER(m68307_duart_txa);
118118   DECLARE_READ8_MEMBER(m68307_duart_input_r);
119119   DECLARE_WRITE8_MEMBER(m68307_duart_output_w);
120   
120
121121   DECLARE_DRIVER_INIT(sc4);
122122   DECLARE_DRIVER_INIT(sc4mbus);
123123   DECLARE_DRIVER_INIT(sc4cvani);
trunk/src/mame/includes/ninjaw.h
r29404r29405
6161   required_device<filter_volume_device> m_2610_2r;
6262   required_device<gfxdecode_device> m_gfxdecode;
6363   required_device<palette_device> m_palette;
64   
64
6565   DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
6666   DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
6767   DECLARE_WRITE16_MEMBER(ninjaw_sound_w);
trunk/src/mame/includes/warriorb.h
r29404r29405
5656   required_device<filter_volume_device> m_2610_2r;
5757   required_device<gfxdecode_device> m_gfxdecode;
5858   required_device<palette_device> m_palette;
59   
59
6060   DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
6161   DECLARE_WRITE16_MEMBER(warriorb_sound_w);
6262   DECLARE_READ16_MEMBER(warriorb_sound_r);
trunk/src/mame/includes/twin16.h
r29404r29405
7777   required_device<upd7759_device> m_upd7759;
7878   required_device<gfxdecode_device> m_gfxdecode;
7979   required_device<screen_device> m_screen;
80   required_device<palette_device> m_palette;   
80   required_device<palette_device> m_palette;
8181};
8282
8383class cuebrickj_state : public twin16_state
trunk/src/mame/includes/tumbleb.h
r29404r29405
4949   required_device<okim6295_device> m_oki;
5050   required_device<gfxdecode_device> m_gfxdecode;
5151   required_device<palette_device> m_palette;
52   
52
5353   UINT8 m_semicom_prot_offset;
5454   UINT16 m_protbase;
5555   DECLARE_WRITE16_MEMBER(tumblepb_oki_w);
trunk/src/mame/includes/micro3d.h
r29404r29405
136136   DECLARE_READ8_MEMBER(duart_input_r);
137137   DECLARE_WRITE8_MEMBER(duart_output_w);
138138   DECLARE_WRITE_LINE_MEMBER(duart_txb);
139   
139
140140   required_device<cpu_device> m_maincpu;
141141   required_device<i8051_device> m_audiocpu;
142142   required_device<upd7759_device> m_upd7759;
trunk/src/mame/includes/m52.h
r29404r29405
4343   required_device<cpu_device> m_maincpu;
4444   required_device<gfxdecode_device> m_gfxdecode;
4545   required_device<screen_device> m_screen;
46   required_device<palette_device> m_palette;   
46   required_device<palette_device> m_palette;
4747};
trunk/src/mame/includes/amiga.h
r29404r29405
432432
433433   required_device<screen_device> m_screen;
434434   optional_device<palette_device> m_palette;
435   
435
436436   address_space* m_maincpu_program_space;
437437
438438   const amiga_machine_interface *m_intf;
r29404r29405
499499   DECLARE_WRITE_LINE_MEMBER(amiga_cia_1_irq);
500500   DECLARE_READ8_MEMBER( amiga_cia_0_portA_r );
501501   DECLARE_WRITE8_MEMBER( amiga_cia_0_portA_w );
502   
502
503503   DECLARE_READ16_MEMBER( amiga_clock_r );
504504   DECLARE_WRITE16_MEMBER( amiga_clock_w );
505505
trunk/src/mame/includes/gcpinbal.h
r29404r29405
3232   required_shared_ptr<UINT16> m_tilemapram;
3333   required_shared_ptr<UINT16> m_spriteram;
3434   required_shared_ptr<UINT16> m_ioc_ram;
35   
35
3636   required_device<gfxdecode_device> m_gfxdecode;
3737   required_device<palette_device> m_palette;
3838//  UINT16 *    m_paletteram; // currently this uses generic palette handling
trunk/src/mame/includes/lkage.h
r29404r29405
5959   optional_device<cpu_device> m_mcu;
6060   required_device<gfxdecode_device> m_gfxdecode;
6161   required_device<palette_device> m_palette;
62   
62
6363   DECLARE_WRITE8_MEMBER(lkage_sound_command_w);
6464   DECLARE_WRITE8_MEMBER(lkage_sh_nmi_disable_w);
6565   DECLARE_WRITE8_MEMBER(lkage_sh_nmi_enable_w);
trunk/src/mame/includes/cvs.h
r29404r29405
3737         m_s2636_2(*this, "s2636_2"),
3838         m_gfxdecode(*this, "gfxdecode"),
3939         m_screen(*this, "screen"),
40         m_palette(*this, "palette")
40         m_palette(*this, "palette")
4141   {
4242   }
4343
r29404r29405
8181   required_device<gfxdecode_device> m_gfxdecode;
8282   required_device<screen_device> m_screen;
8383   required_device<palette_device> m_palette;
84   
84
8585   /* memory */
8686   UINT8      m_color_ram[0x400];
8787   UINT8      m_palette_ram[0x10];
trunk/src/mame/includes/battlera.h
r29404r29405
5454   required_device<msm5205_device> m_msm;
5555   required_device<gfxdecode_device> m_gfxdecode;
5656   required_device<screen_device> m_screen;
57   required_device<palette_device> m_palette;   
57   required_device<palette_device> m_palette;
5858};
trunk/src/mame/includes/pooyan.h
r29404r29405
2828   required_device<cpu_device> m_maincpu;
2929   required_device<gfxdecode_device> m_gfxdecode;
3030   required_device<palette_device> m_palette;
31   
31
3232   DECLARE_WRITE8_MEMBER(irq_enable_w);
3333   DECLARE_WRITE8_MEMBER(pooyan_videoram_w);
3434   DECLARE_WRITE8_MEMBER(pooyan_colorram_w);
trunk/src/mame/includes/stv.h
r29404r29405
2424         m_scudsp(*this, "scudsp"),
2525         m_eeprom(*this, "eeprom"),
2626      m_gfxdecode(*this, "gfxdecode"),
27      m_palette(*this, "palette")
27      m_palette(*this, "palette")
2828   {
2929   }
3030
r29404r29405
644644   DECLARE_WRITE_LINE_MEMBER(scudsp_end_w);
645645   DECLARE_READ16_MEMBER(scudsp_dma_r);
646646   DECLARE_WRITE16_MEMBER(scudsp_dma_w);
647   
647
648648   // FROM smpc.c
649649   TIMER_CALLBACK_MEMBER( stv_bankswitch_state );
650650   void stv_select_game(int gameno);
r29404r29405
671671   void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv);
672672   DECLARE_READ8_MEMBER( stv_SMPC_r );
673673   DECLARE_WRITE8_MEMBER( stv_SMPC_w );
674   
674
675675};
676676
677677class stv_state : public saturn_state
trunk/src/mame/includes/equites.h
r29404r29405
7474   required_device<msm5232_device> m_msm;
7575   required_device<dac_device> m_dac_1;
7676   required_device<dac_device> m_dac_2;
77   
77
7878   DECLARE_WRITE8_MEMBER(equites_c0f8_w);
7979   DECLARE_WRITE8_MEMBER(equites_cymbal_ctrl_w);
8080   DECLARE_WRITE8_MEMBER(equites_dac_latch_w);
trunk/src/mame/includes/ikki.h
r29404r29405
2424   required_shared_ptr<UINT8> m_videoram;
2525   required_shared_ptr<UINT8> m_scroll;
2626   required_shared_ptr<UINT8> m_spriteram;
27   
27
2828   required_device<gfxdecode_device> m_gfxdecode;
2929   required_device<screen_device> m_screen;
3030   required_device<palette_device> m_palette;
trunk/src/mame/includes/othunder.h
r29404r29405
7878   required_device<filter_volume_device> m_2610_2r;
7979   required_device<gfxdecode_device> m_gfxdecode;
8080   required_device<palette_device> m_palette;
81   
81
8282   DECLARE_WRITE16_MEMBER(irq_ack_w);
8383   DECLARE_WRITE16_MEMBER(othunder_tc0220ioc_w);
8484   DECLARE_READ16_MEMBER(othunder_tc0220ioc_r);
trunk/src/mame/includes/tail2nos.h
r29404r29405
3737   required_device<k051316_device> m_k051316;
3838   required_device<gfxdecode_device> m_gfxdecode;
3939   required_device<palette_device> m_palette;
40   
40
4141   DECLARE_WRITE16_MEMBER(sound_command_w);
4242   DECLARE_WRITE16_MEMBER(tail2nos_bgvideoram_w);
4343   DECLARE_READ16_MEMBER(tail2nos_zoomdata_r);
trunk/src/mame/includes/slapshot.h
r29404r29405
7373   required_device<tc0640fio_device> m_tc0640fio;
7474   required_device<gfxdecode_device> m_gfxdecode;
7575   required_device<palette_device> m_palette;
76   
76
7777   DECLARE_READ16_MEMBER(color_ram_word_r);
7878   DECLARE_WRITE16_MEMBER(color_ram_word_w);
7979   DECLARE_READ16_MEMBER(slapshot_service_input_r);
trunk/src/mame/includes/dkong.h
r29404r29405
189189   required_device<screen_device> m_screen;
190190   required_device<palette_device> m_palette;
191191   optional_device<z80dma_device> m_z80dma;
192   
192
193193   /* radarscp_scanline */
194194   int m_counter;
195195
trunk/src/mame/includes/firetrk.h
r29404r29405
6464   optional_shared_ptr<UINT8> m_drone_rot;
6565   required_device<gfxdecode_device> m_gfxdecode;
6666   required_device<screen_device> m_screen;
67   required_device<palette_device> m_palette;   
67   required_device<palette_device> m_palette;
6868
6969   UINT8 m_in_service_mode;
7070   UINT32 m_dial[2];
trunk/src/mame/includes/snes.h
r29404r29405
452452      UINT16 ver_offset;
453453      UINT8 extbg;
454454   } m_mode7;
455   
455
456456   struct OAM
457457   {
458458      UINT16 tile;
r29404r29405
577577   UINT16 *m_oam_ram;     /* Object Attribute Memory */
578578   UINT16 *m_cgram;   /* Palette RAM */
579579   UINT8  *m_vram;    /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
580   
580
581581   snes_state *m_state;
582582};
583583
trunk/src/mame/includes/rungun.h
r29404r29405
3838   /* memory pointers */
3939   required_shared_ptr<UINT16> m_sysreg;
4040   required_shared_ptr<UINT16> m_936_videoram;
41   
41
4242   required_device<gfxdecode_device> m_gfxdecode;
4343   required_device<palette_device> m_palette;
4444//  UINT16 *    m_paletteram;    // currently this uses generic palette handling
trunk/src/mame/includes/esripsys.h
r29404r29405
123123   TIMER_CALLBACK_MEMBER(hblank_start_callback);
124124   TIMER_CALLBACK_MEMBER(hblank_end_callback);
125125   required_device<dac_device> m_dac;
126   required_device<screen_device> m_screen;   
126   required_device<screen_device> m_screen;
127127   ESRIP_DRAW(esripsys_draw);
128128};
129129
trunk/src/mame/includes/skyfox.h
r29404r29405
3030   required_device<cpu_device> m_maincpu;
3131   required_device<gfxdecode_device> m_gfxdecode;
3232   required_device<screen_device> m_screen;
33   required_device<palette_device> m_palette;   
34   
33   required_device<palette_device> m_palette;
34
3535   DECLARE_READ8_MEMBER(skyfox_vregs_r);
3636   DECLARE_WRITE8_MEMBER(skyfox_vregs_w);
3737   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
trunk/src/mame/includes/ladybug.h
r29404r29405
4949   required_device<cpu_device> m_maincpu;
5050   required_device<gfxdecode_device> m_gfxdecode;
5151   required_device<palette_device> m_palette;
52   
52
5353   DECLARE_READ8_MEMBER(sraider_sound_low_r);
5454   DECLARE_READ8_MEMBER(sraider_sound_high_r);
5555   DECLARE_WRITE8_MEMBER(sraider_sound_low_w);
trunk/src/mame/includes/exidy440.h
r29404r29405
3232   required_device<exidy440_sound_device> m_custom;
3333   required_device<screen_device> m_screen;
3434   required_device<palette_device> m_palette;
35   
35
3636   UINT8 m_bank;
3737   const UINT8 *m_showdown_bank_data[2];
3838   INT8 m_showdown_bank_select;
trunk/src/mame/includes/pcktgal.h
r29404r29405
2121   required_shared_ptr<UINT8> m_spriteram;
2222   required_device<gfxdecode_device> m_gfxdecode;
2323   required_device<palette_device> m_palette;
24   
24
2525   DECLARE_WRITE8_MEMBER(pcktgal_bank_w);
2626   DECLARE_WRITE8_MEMBER(pcktgal_sound_bank_w);
2727   DECLARE_WRITE8_MEMBER(pcktgal_sound_w);
trunk/src/mame/includes/btime.h
r29404r29405
6363   required_device<gfxdecode_device> m_gfxdecode;
6464   required_device<screen_device> m_screen;
6565   required_device<palette_device> m_palette;
66   
66
6767   DECLARE_WRITE8_MEMBER(audio_nmi_enable_w);
6868   DECLARE_WRITE8_MEMBER(lnc_w);
6969   DECLARE_WRITE8_MEMBER(mmonkey_w);
trunk/src/mame/includes/harddriv.h
r29404r29405
379379   DECLARE_WRITE16_MEMBER( hdds3_sdsp_control_w );
380380   DECLARE_READ16_MEMBER( hdds3_xdsp_control_r );
381381   DECLARE_WRITE16_MEMBER( hdds3_xdsp_control_w );
382   
382
383383   void hdds3sdsp_reset_timer();
384384   void hdds3xdsp_reset_timer();
385385
trunk/src/mame/includes/cidelsa.h
r29404r29405
6565   DECLARE_WRITE_LINE_MEMBER( q_w );
6666   DECLARE_WRITE_LINE_MEMBER( prd_w );
6767   DECLARE_READ_LINE_MEMBER( cdp1869_pcb_r );
68   
68
6969   CDP1869_CHAR_RAM_READ_MEMBER(cidelsa_charram_r);
7070   CDP1869_CHAR_RAM_WRITE_MEMBER(cidelsa_charram_w);
7171   CDP1869_PCB_READ_MEMBER(cidelsa_pcb_r);
r29404r29405
104104   DECLARE_WRITE8_MEMBER( psg_w );
105105   DECLARE_WRITE8_MEMBER( out1_w );
106106   DECLARE_WRITE8_MEMBER( psg_pb_w );
107   
107
108108   CDP1869_CHAR_RAM_READ_MEMBER(draco_charram_r);
109109   CDP1869_CHAR_RAM_WRITE_MEMBER(draco_charram_w);
110110   CDP1869_PCB_READ_MEMBER(draco_pcb_r);
trunk/src/mame/includes/fcombat.h
r29404r29405
5454   required_device<cpu_device> m_maincpu;
5555   required_device<gfxdecode_device> m_gfxdecode;
5656   required_device<palette_device> m_palette;
57   
57
5858   DECLARE_READ8_MEMBER(fcombat_protection_r);
5959   DECLARE_READ8_MEMBER(fcombat_port01_r);
6060   DECLARE_WRITE8_MEMBER(e900_w);
trunk/src/mame/includes/firetrap.h
r29404r29405
5151   required_device<msm5205_device> m_msm;
5252   required_device<gfxdecode_device> m_gfxdecode;
5353   required_device<palette_device> m_palette;
54   
54
5555   DECLARE_WRITE8_MEMBER(firetrap_nmi_disable_w);
5656   DECLARE_WRITE8_MEMBER(firetrap_bankselect_w);
5757   DECLARE_READ8_MEMBER(firetrap_8751_bootleg_r);
trunk/src/mame/includes/timeplt.h
r29404r29405
3434   required_device<gfxdecode_device> m_gfxdecode;
3535   required_device<screen_device> m_screen;
3636   required_device<palette_device> m_palette;
37   
37
3838   /* video-related */
3939   tilemap_t  *m_bg_tilemap;
4040
trunk/src/mame/includes/topspeed.h
r29404r29405
5252   required_device<filter_volume_device> m_filter3;
5353   required_device<gfxdecode_device> m_gfxdecode;
5454   required_device<palette_device> m_palette;
55   
55
5656   // Misc
5757   UINT16  m_cpua_ctrl;
5858   INT32   m_ioc220_port;
trunk/src/mame/includes/bladestl.h
r29404r29405
5555   K007342_CALLBACK_MEMBER(bladestl_tile_callback);
5656   K007420_CALLBACK_MEMBER(bladestl_sprite_callback);
5757};
58
trunk/src/mame/includes/zac2650.h
r29404r29405
2121   required_device<gfxdecode_device> m_gfxdecode;
2222   required_device<screen_device> m_screen;
2323   required_device<palette_device> m_palette;
24   
24
2525   bitmap_ind16 m_bitmap;
2626   bitmap_ind16 m_spritebitmap;
2727   int m_CollisionBackground;
trunk/src/mame/includes/gaplus.h
r29404r29405
4949   required_shared_ptr<UINT8> m_spriteram;
5050   required_device<gfxdecode_device> m_gfxdecode;
5151   required_device<screen_device> m_screen;
52   required_device<palette_device> m_palette;   
52   required_device<palette_device> m_palette;
5353   namco58xx_device *m_namco58xx;
5454   namco56xx_device *m_namco56xx;
5555
trunk/src/mame/includes/thunderx.h
r29404r29405
4949   required_device<k052109_device> m_k052109;
5050   required_device<k051960_device> m_k051960;
5151   required_device<palette_device> m_palette;
52   
52
5353   DECLARE_READ8_MEMBER(scontra_bankedram_r);
5454   DECLARE_WRITE8_MEMBER(scontra_bankedram_w);
5555   DECLARE_READ8_MEMBER(thunderx_bankedram_r);
trunk/src/mame/includes/homerun.h
r29404r29405
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<screen_device> m_screen;
3434   required_device<palette_device> m_palette;
35   
35
3636   UINT8 m_control;
3737   UINT8 m_sample;
3838
trunk/src/mame/includes/exprraid.h
r29404r29405
2828   required_shared_ptr<UINT8> m_spriteram;
2929   required_shared_ptr<UINT8> m_videoram;
3030   required_shared_ptr<UINT8> m_colorram;
31   
31
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<palette_device> m_palette;
3434
trunk/src/mame/includes/naughtyb.h
r29404r29405
2525   required_device<screen_device> m_screen;
2626   required_device<palette_device> m_palette;
2727
28   
28
2929   UINT8 m_popflame_prot_seed;
3030   int m_r_index;
3131   int m_prot_count;
trunk/src/mame/includes/contra.h
r29404r29405
7676   required_device<cpu_device> m_maincpu;
7777   required_device<gfxdecode_device> m_gfxdecode;
7878   required_device<screen_device> m_screen;
79   required_device<palette_device> m_palette;   
79   required_device<palette_device> m_palette;
8080};
trunk/src/mame/includes/dcheese.h
r29404r29405
4040   /* devices */
4141   required_device<cpu_device> m_maincpu;
4242   required_device<cpu_device> m_audiocpu;
43   required_device<screen_device> m_screen;   
43   required_device<screen_device> m_screen;
4444   device_t *m_bsmt;
4545   DECLARE_WRITE16_MEMBER(eeprom_control_w);
4646   DECLARE_WRITE16_MEMBER(sound_command_w);
trunk/src/mame/includes/m72.h
r29404r29405
4040   optional_device<m72_audio_device> m_audio;
4141   required_device<gfxdecode_device> m_gfxdecode;
4242   required_device<screen_device> m_screen;
43   required_device<palette_device> m_palette;   
43   required_device<palette_device> m_palette;
4444
4545   UINT16 *m_protection_ram;
4646   emu_timer *m_scanline_timer;
trunk/src/mame/includes/mouser.h
r29404r29405
2020   /* memory pointers */
2121   required_shared_ptr<UINT8> m_videoram;
2222   required_shared_ptr<UINT8> m_colorram;
23   required_shared_ptr<UINT8> m_spriteram;   
23   required_shared_ptr<UINT8> m_spriteram;
2424
2525   /* misc */
2626   UINT8      m_sound_byte;
r29404r29405
3131   required_device<cpu_device> m_audiocpu;
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<palette_device> m_palette;
34   
34
3535   DECLARE_WRITE8_MEMBER(mouser_nmi_enable_w);
3636   DECLARE_WRITE8_MEMBER(mouser_sound_interrupt_w);
3737   DECLARE_READ8_MEMBER(mouser_sound_byte_r);
trunk/src/mame/includes/deco32.h
r29404r29405
9191
9292   required_device<deco16ic_device> m_deco_tilegen1;
9393   required_device<deco16ic_device> m_deco_tilegen2;
94   
94
9595   required_device<gfxdecode_device> m_gfxdecode;
9696   required_device<screen_device> m_screen;
9797   required_device<palette_device> m_palette;
98   
98
9999   UINT8 m_irq_source;
100100   DECLARE_WRITE_LINE_MEMBER(sound_irq_nslasher);
101101   DECLARE_READ32_MEMBER(deco32_irq_controller_r);
trunk/src/mame/includes/playch10.h
r29404r29405
3434   required_shared_ptr<UINT8> m_timedata;
3535   required_shared_ptr<UINT8> m_work_ram;
3636   required_device<gfxdecode_device> m_gfxdecode;
37   
37
3838   int m_up_8w;
3939   int m_pc10_nmi_enable;
4040   int m_pc10_dog_di;
trunk/src/mame/includes/seta.h
r29404r29405
6868   optional_shared_ptr<UINT16> m_kiwame_nvram;
6969   optional_shared_ptr<UINT16> m_inttoote_key_select;
7070   optional_shared_ptr<UINT16> m_inttoote_700000;
71   
71
7272   required_device<gfxdecode_device> m_gfxdecode;
7373   required_device<palette_device> m_palette;
7474
trunk/src/mame/includes/tp84.h
r29404r29405
3131   required_shared_ptr<UINT8> m_spriteram;
3232   required_device<gfxdecode_device> m_gfxdecode;
3333   required_device<screen_device> m_screen;
34   required_device<palette_device> m_palette;   
34   required_device<palette_device> m_palette;
3535   tilemap_t *m_bg_tilemap;
3636   tilemap_t *m_fg_tilemap;
3737
trunk/src/mame/includes/karnov.h
r29404r29405
2727   required_device<cpu_device> m_audiocpu;
2828   required_device<buffered_spriteram16_device> m_spriteram;
2929   required_device<deco_karnovsprites_device> m_spritegen;
30   
30
3131   /* memory pointers */
3232   required_shared_ptr<UINT16> m_ram;
3333   required_shared_ptr<UINT16> m_videoram;
r29404r29405
3535
3636   required_device<gfxdecode_device> m_gfxdecode;
3737   required_device<palette_device> m_palette;
38   
38
3939   /* video-related */
4040   bitmap_ind16    *m_bitmap_f;
4141   tilemap_t     *m_fix_tilemap;
r29404r29405
5151   int         m_microcontroller_id;
5252   int         m_coin_mask;
5353   int         m_latch;
54   
54
5555   DECLARE_WRITE16_MEMBER(karnov_control_w);
5656   DECLARE_READ16_MEMBER(karnov_control_r);
5757   DECLARE_WRITE16_MEMBER(karnov_videoram_w);
trunk/src/mame/includes/slapfght.h
r29404r29405
2525      m_fixvideoram(*this, "fixvideoram"),
2626      m_fixcolorram(*this, "fixcolorram")
2727   { }
28   
28
2929   // devices, memory pointers
3030   required_device<cpu_device> m_maincpu;
3131   required_device<cpu_device> m_audiocpu;
r29404r29405
137137   DECLARE_DRIVER_INIT(getstarb1);
138138   DECLARE_DRIVER_INIT(slapfigh);
139139   DECLARE_DRIVER_INIT(getstarb2);
140   
140
141141   TILE_GET_INFO_MEMBER(get_pf_tile_info);
142142   TILE_GET_INFO_MEMBER(get_pf1_tile_info);
143143   TILE_GET_INFO_MEMBER(get_fix_tile_info);
trunk/src/mame/includes/exerion.h
r29404r29405
5555   required_device<cpu_device> m_maincpu;
5656   required_device<gfxdecode_device> m_gfxdecode;
5757   required_device<screen_device> m_screen;
58   required_device<palette_device> m_palette;   
59   
58   required_device<palette_device> m_palette;
59
6060   DECLARE_READ8_MEMBER(exerion_protection_r);
6161   DECLARE_WRITE8_MEMBER(exerion_videoreg_w);
6262   DECLARE_WRITE8_MEMBER(exerion_video_latch_w);
trunk/src/mame/includes/segas18.h
r29404r29405
151151   UINT8               m_wwally_last_y[3];
152152   UINT8               m_lghost_value;
153153   UINT8               m_lghost_select;
154   
154
155155   required_device<gfxdecode_device> m_gfxdecode;
156156};
trunk/src/mame/includes/gradius3.h
r29404r29405
4343   required_device<k052109_device> m_k052109;
4444   required_device<k051960_device> m_k051960;
4545   required_device<gfxdecode_device> m_gfxdecode;
46   
46
4747   DECLARE_READ16_MEMBER(k052109_halfword_r);
4848   DECLARE_WRITE16_MEMBER(k052109_halfword_w);
4949   DECLARE_READ16_MEMBER(k051937_halfword_r);
trunk/src/mame/includes/rainbow.h
r29404r29405
4343   optional_device<pc090oj_device> m_pc090oj;
4444   required_device<gfxdecode_device> m_gfxdecode;
4545   required_device<palette_device> m_palette;
46   
46
4747   DECLARE_WRITE16_MEMBER(jumping_sound_w);
4848   DECLARE_READ8_MEMBER(jumping_latch_r);
4949   DECLARE_WRITE16_MEMBER(rbisland_cchip_ctrl_w);
trunk/src/mame/includes/tunhunt.h
r29404r29405
3737   required_device<cpu_device> m_maincpu;
3838   required_device<gfxdecode_device> m_gfxdecode;
3939   required_device<screen_device> m_screen;
40   required_device<palette_device> m_palette;   
40   required_device<palette_device> m_palette;
4141};
trunk/src/mame/includes/konamigx.h
r29404r29405
5454   optional_device<k054539_device> m_k054539_2;
5555   required_device<gfxdecode_device> m_gfxdecode;
5656   required_device<screen_device> m_screen;
57   required_device<palette_device> m_palette;   
57   required_device<palette_device> m_palette;
5858
5959   DECLARE_WRITE32_MEMBER(esc_w);
6060   DECLARE_WRITE32_MEMBER(eeprom_w);
trunk/src/mame/includes/sprcros2.h
r29404r29405
88      m_spriteram(*this, "spriteram"),
99      m_master(*this,"master"),
1010      m_slave(*this,"slave"),
11      m_gfxdecode(*this, "gfxdecode"),     
11      m_gfxdecode(*this, "gfxdecode"),
1212      m_palette(*this, "palette") { }
1313
1414   UINT8 m_s_port3;
r29404r29405
2323   required_device<cpu_device> m_slave;
2424   required_device<gfxdecode_device> m_gfxdecode;
2525   required_device<palette_device> m_palette;
26   
26
2727   DECLARE_WRITE8_MEMBER(sprcros2_m_port7_w);
2828   DECLARE_WRITE8_MEMBER(sprcros2_s_port3_w);
2929   DECLARE_WRITE8_MEMBER(sprcros2_fgvideoram_w);
trunk/src/mame/includes/combatsc.h
r29404r29405
5858   optional_device<msm5205_device> m_msm5205;
5959   required_device<gfxdecode_device> m_gfxdecode;
6060   required_device<palette_device> m_palette;
61   
61
6262   DECLARE_WRITE8_MEMBER(combatsc_vreg_w);
6363   DECLARE_WRITE8_MEMBER(combatscb_sh_irqtrigger_w);
6464   DECLARE_READ8_MEMBER(combatscb_io_r);
trunk/src/mame/includes/rockrage.h
r29404r29405
3737   required_device<vlm5030_device> m_vlm;
3838   required_device<gfxdecode_device> m_gfxdecode;
3939   required_device<palette_device> m_palette;
40   
40
4141   DECLARE_WRITE8_MEMBER(rockrage_bankswitch_w);
4242   DECLARE_WRITE8_MEMBER(rockrage_sh_irqtrigger_w);
4343   DECLARE_WRITE8_MEMBER(rockrage_vreg_w);
r29404r29405
5353   K007420_CALLBACK_MEMBER(rockrage_sprite_callback);
5454
5555};
56
trunk/src/mame/includes/toki.h
r29404r29405
3232   optional_device<msm5205_device> m_msm;
3333   required_device<gfxdecode_device> m_gfxdecode;
3434   required_device<screen_device> m_screen;
35   required_device<palette_device> m_palette;   
35   required_device<palette_device> m_palette;
3636
3737   int m_msm5205next;
3838   int m_toggle;
trunk/src/mame/includes/pandoras.h
r29404r29405
4141   required_device<cpu_device> m_mcu;
4242   required_device<gfxdecode_device> m_gfxdecode;
4343   required_device<palette_device> m_palette;
44   
44
4545   DECLARE_WRITE8_MEMBER(pandoras_int_control_w);
4646   DECLARE_WRITE8_MEMBER(pandoras_cpua_irqtrigger_w);
4747   DECLARE_WRITE8_MEMBER(pandoras_cpub_irqtrigger_w);
trunk/src/mame/includes/taito_f2.h
r29404r29405
111111   optional_device<tc0510nio_device> m_tc0510nio;
112112   required_device<gfxdecode_device> m_gfxdecode;
113113   required_device<palette_device> m_palette;
114   
114
115115   DECLARE_WRITE16_MEMBER(growl_coin_word_w);
116116   DECLARE_WRITE16_MEMBER(taitof2_4p_coin_word_w);
117117   DECLARE_WRITE16_MEMBER(ninjak_coin_word_w);
trunk/src/mame/includes/gottlieb.h
r29404r29405
233233   required_shared_ptr<UINT8> m_videoram;
234234   required_shared_ptr<UINT8> m_charram;
235235   required_shared_ptr<UINT8> m_spriteram;
236   
236
237237   required_device<gfxdecode_device> m_gfxdecode;
238238   required_device<screen_device> m_screen;
239239   required_device<palette_device> m_palette;
240   
240
241241   UINT8 m_knocker_prev;
242242   UINT8 m_joystick_select;
243243   UINT8 m_track[2];
trunk/src/mame/includes/homedata.h
r29404r29405
1414      m_dac(*this, "dac"),
1515      m_ymsnd(*this, "ymsnd"),
1616      m_gfxdecode(*this, "gfxdecode"),
17      m_palette(*this, "palette")
17      m_palette(*this, "palette")
1818   {
1919   }
2020
trunk/src/mame/includes/deadang.h
r29404r29405
3030
3131   required_device<gfxdecode_device> m_gfxdecode;
3232   required_device<palette_device> m_palette;
33   
33
3434   tilemap_t *m_pf3_layer;
3535   tilemap_t *m_pf2_layer;
3636   tilemap_t *m_pf1_layer;
trunk/src/mame/includes/mugsmash.h
r29404r29405
2727   required_device<cpu_device> m_audiocpu;
2828   required_device<gfxdecode_device> m_gfxdecode;
2929   required_device<palette_device> m_palette;
30   
30
3131   DECLARE_WRITE16_MEMBER(mugsmash_reg2_w);
3232   DECLARE_READ16_MEMBER(mugsmash_input_ports_r);
3333   DECLARE_WRITE16_MEMBER(mugsmash_videoram1_w);
trunk/src/mame/includes/jackal.h
r29404r29405
3434   required_device<cpu_device> m_slavecpu;
3535   required_device<gfxdecode_device> m_gfxdecode;
3636   required_device<palette_device> m_palette;
37   
37
3838   DECLARE_READ8_MEMBER(jackalr_rotary_r);
3939   DECLARE_WRITE8_MEMBER(jackal_flipscreen_w);
4040   DECLARE_READ8_MEMBER(jackal_zram_r);
trunk/src/mame/includes/macrossp.h
r29404r29405
7171   required_device<cpu_device> m_audiocpu;
7272   required_device<gfxdecode_device> m_gfxdecode;
7373   required_device<palette_device> m_palette;
74   
74
7575   DECLARE_WRITE32_MEMBER(paletteram32_macrossp_w);
7676   DECLARE_READ32_MEMBER(macrossp_soundstatus_r);
7777   DECLARE_WRITE32_MEMBER(macrossp_soundcmd_w);
trunk/src/mame/includes/gladiatr.h
r29404r29405
3939   int m_fg_tile_bank;
4040   int m_bg_tile_bank;
4141
42   
42
4343   DECLARE_READ8_MEMBER( gladiator_dsw1_r );
4444   DECLARE_READ8_MEMBER( gladiator_dsw2_r );
4545   DECLARE_READ8_MEMBER( gladiator_controls_r );
r29404r29405
7070   DECLARE_WRITE8_MEMBER(glad_adpcm_w);
7171   DECLARE_READ8_MEMBER(f1_r);
7272   DECLARE_DRIVER_INIT(gladiatr);
73   DECLARE_DRIVER_INIT(ppking);   
73   DECLARE_DRIVER_INIT(ppking);
7474   TILE_GET_INFO_MEMBER(bg_get_tile_info);
7575   TILE_GET_INFO_MEMBER(fg_get_tile_info);
7676   DECLARE_MACHINE_RESET(ppking);
trunk/src/mame/includes/taito_o.h
r29404r29405
2424   required_device<tc0080vco_device> m_tc0080vco;
2525   required_device<gfxdecode_device> m_gfxdecode;
2626   required_device<palette_device> m_palette;
27   
27
2828   DECLARE_WRITE16_MEMBER(io_w);
2929   DECLARE_READ16_MEMBER(io_r);
3030   virtual void machine_start();
trunk/src/mame/includes/1943.h
r29404r29405
3030   required_shared_ptr<UINT8> m_spriteram;
3131   required_device<gfxdecode_device> m_gfxdecode;
3232   required_device<palette_device> m_palette;
33   
33
3434   /* video-related */
3535   tilemap_t *m_fg_tilemap;
3636   tilemap_t *m_bg_tilemap;
trunk/src/mame/includes/segas16b.h
r29404r29405
200200   UINT8               m_hwc_input_value;
201201   UINT8               m_mj_input_num;
202202   UINT8               m_mj_last_val;
203   
203
204204   required_device<gfxdecode_device> m_gfxdecode;
205205};
206206
trunk/src/mame/includes/pktgaldx.h
r29404r29405
4747   optional_device<decocomn_device> m_decocomn;
4848   required_device<gfxdecode_device> m_gfxdecode;
4949   required_device<palette_device> m_palette;
50   
50
5151   DECLARE_READ16_MEMBER(pckgaldx_unknown_r);
5252   DECLARE_READ16_MEMBER(pckgaldx_protection_r);
5353   DECLARE_WRITE16_MEMBER(pktgaldx_oki_bank_w);
trunk/src/mame/includes/cop01.h
r29404r29405
3636   required_device<cpu_device> m_audiocpu;
3737   required_device<gfxdecode_device> m_gfxdecode;
3838   required_device<palette_device> m_palette;
39   
39
4040   DECLARE_WRITE8_MEMBER(cop01_sound_command_w);
4141   DECLARE_READ8_MEMBER(cop01_sound_command_r);
4242   DECLARE_WRITE8_MEMBER(cop01_irq_ack_w);
trunk/src/mame/includes/fuukifg2.h
r29404r29405
4040
4141   /* devices */
4242   required_device<cpu_device> m_maincpu;
43   required_device<cpu_device> m_audiocpu;   
43   required_device<cpu_device> m_audiocpu;
4444   DECLARE_WRITE16_MEMBER(fuuki16_vregs_w);
4545   DECLARE_WRITE16_MEMBER(fuuki16_sound_command_w);
4646   DECLARE_WRITE8_MEMBER(fuuki16_sound_rombank_w);
trunk/src/mame/includes/f1gp.h
r29404r29405
4242   optional_shared_ptr<UINT16> m_spriteram;
4343   optional_shared_ptr<UINT16> m_fgregs;
4444   optional_shared_ptr<UINT16> m_rozregs;
45   
45
4646   optional_memory_bank m_z80bank;
4747
4848   /* devices referenced above */
r29404r29405
7474   optional_device<cpu_device> m_audiocpu;
7575   optional_device<k053936_device> m_k053936;
7676   required_device<palette_device> m_palette;
77   
77
7878   DECLARE_WRITE8_MEMBER(f1gp_sh_bankswitch_w);
7979   DECLARE_WRITE16_MEMBER(sound_command_w);
8080   DECLARE_READ16_MEMBER(command_pending_r);
trunk/src/mame/includes/carpolo.h
r29404r29405
6565   required_device<ttl7474_device> m_ttl7474_1a_2;
6666   required_device<gfxdecode_device> m_gfxdecode;
6767   required_device<palette_device> m_palette;
68   
68
6969   bitmap_ind16 *m_sprite_sprite_collision_bitmap1;
7070   bitmap_ind16 *m_sprite_sprite_collision_bitmap2;
7171   bitmap_ind16 *m_sprite_goal_collision_bitmap1;
trunk/src/mame/includes/matmania.h
r29404r29405
6060   required_device<gfxdecode_device> m_gfxdecode;
6161   required_device<screen_device> m_screen;
6262   required_device<palette_device> m_palette;
63   
63
6464   DECLARE_WRITE8_MEMBER(matmania_sh_command_w);
6565   DECLARE_WRITE8_MEMBER(maniach_sh_command_w);
6666   DECLARE_WRITE8_MEMBER(matmania_paletteram_w);
trunk/src/mame/includes/volfied.h
r29404r29405
4141   required_device<cpu_device> m_audiocpu;
4242   required_device<pc090oj_device> m_pc090oj;
4343   required_device<screen_device> m_screen;
44   
44
4545   DECLARE_WRITE16_MEMBER(volfied_cchip_ctrl_w);
4646   DECLARE_WRITE16_MEMBER(volfied_cchip_bank_w);
4747   DECLARE_WRITE16_MEMBER(volfied_cchip_ram_w);
trunk/src/mame/includes/crshrace.h
r29404r29405
2323   /* memory pointers */
2424   required_shared_ptr<UINT16> m_videoram1;
2525   required_shared_ptr<UINT16> m_videoram2;
26   
26
2727   required_memory_bank m_z80bank;
28   
28
2929   required_device<z80_device> m_audiocpu;
3030   required_device<k053936_device> m_k053936;
3131   required_device<buffered_spriteram16_device> m_spriteram;
trunk/src/mame/includes/airbustr.h
r29404r29405
5454   required_device<gfxdecode_device> m_gfxdecode;
5555   required_device<screen_device> m_screen;
5656   required_device<palette_device> m_palette;
57   
57
5858   DECLARE_READ8_MEMBER(devram_r);
5959   DECLARE_WRITE8_MEMBER(master_nmi_trigger_w);
6060   DECLARE_WRITE8_MEMBER(master_bankswitch_w);
trunk/src/mame/includes/popeye.h
r29404r29405
2727   UINT8 m_bitmap_type;
2828   tilemap_t *m_fg_tilemap;
2929   UINT8 m_lastflip;
30   int     m_field;
30   int   m_field;
3131
3232   DECLARE_READ8_MEMBER(protection_r);
3333   DECLARE_WRITE8_MEMBER(protection_w);
trunk/src/mame/includes/itech32.h
r29404r29405
196196   optional_device<cpu_device> m_dsp1;
197197   optional_device<cpu_device> m_dsp2;
198198   required_device<screen_device> m_screen;
199   required_device<palette_device> m_palette;   
199   required_device<palette_device> m_palette;
200200};
trunk/src/mame/includes/m92.h
r29404r29405
4545   required_device<gfxdecode_device> m_gfxdecode;
4646   required_device<screen_device> m_screen;
4747   required_device<palette_device> m_palette;
48   
48
4949   UINT16 m_sound_status;
5050   UINT8 m_irq_vectorbase;
5151   UINT32 m_raster_irq_position;
trunk/src/mame/includes/n8080.h
r29404r29405
5454   optional_device<sn76477_device> m_sn;
5555   required_device<screen_device> m_screen;
5656   required_device<palette_device> m_palette;
57   
57
5858   DECLARE_WRITE8_MEMBER(n8080_shift_bits_w);
5959   DECLARE_WRITE8_MEMBER(n8080_shift_data_w);
6060   DECLARE_READ8_MEMBER(n8080_shift_r);
trunk/src/mame/includes/espial.h
r29404r29405
4343   required_device<cpu_device> m_audiocpu;
4444   required_device<gfxdecode_device> m_gfxdecode;
4545   required_device<palette_device> m_palette;
46   
46
4747   DECLARE_WRITE8_MEMBER(espial_master_interrupt_mask_w);
4848   DECLARE_WRITE8_MEMBER(espial_master_soundlatch_w);
4949   DECLARE_WRITE8_MEMBER(espial_sound_nmi_mask_w);
trunk/src/mame/includes/lsasquad.h
r29404r29405
4343   optional_device<cpu_device> m_mcu;
4444   required_device<gfxdecode_device> m_gfxdecode;
4545   required_device<palette_device> m_palette;
46   
46
4747   DECLARE_WRITE8_MEMBER(lsasquad_bankswitch_w);
4848   DECLARE_WRITE8_MEMBER(lsasquad_sh_nmi_disable_w);
4949   DECLARE_WRITE8_MEMBER(lsasquad_sh_nmi_enable_w);
trunk/src/mame/includes/grchamp.h
r29404r29405
8989   required_device<discrete_device> m_discrete;
9090   required_device<gfxdecode_device> m_gfxdecode;
9191   required_device<palette_device> m_palette;
92   required_device<screen_device> m_screen;   
92   required_device<screen_device> m_screen;
9393};
9494
9595/* Discrete Sound Input Nodes */
trunk/src/mame/video/avgdvg.c
r29404r29405
681681   nvect = 0;
682682}
683683
684 
685 /*************************************
686 *
687 *  Mhavoc handler functions
688 *
689 *************************************/
690684
691 int avg_mhavoc_device::handler_1() //  mhavoc_latch1
685   /*************************************
686   *
687   *  Mhavoc handler functions
688   *
689   *************************************/
690
691   int avg_mhavoc_device::handler_1() //  mhavoc_latch1
692692{
693693   /*
694694    * Major Havoc just has ymin clipping
r29404r29405
860860   m_data = avgdvg_vectorram[m_pc];
861861}
862862
863
863
864864int avg_starwars_device::handler_6() // starwars_strobe2
865865{
866866   if ((OP2 == 0) && (m_dvy12 == 0))
r29404r29405
887887   return cycles;
888888}
889889
890 /*************************************
891 *
892 *  Quantum handler functions
893 *
894 *************************************/
890   /*************************************
891   *
892   *  Quantum handler functions
893   *
894   *************************************/
895895void avg_quantum_device::update_databus() // quantum_data
896896{
897897   m_data = ((UINT16 *)avgdvg_vectorram)[m_pc >> 1];
r29404r29405
10541054   return cycles;
10551055}
10561056
1057 /*************************************
1058 *
1059 *  Bzone handler functions
1060 *
1061 *************************************/
1057   /*************************************
1058   *
1059   *  Bzone handler functions
1060   *
1061   *************************************/
10621062int avg_bzone_device::handler_1() // bzone_latch1
10631063{
10641064   /*
r29404r29405
11331133 *  Tomcat handler functions
11341134 *
11351135 *************************************/
1136
1136
11371137int avg_tomcat_device::handler_6() // starwars_strobe2
11381138{
11391139   if ((OP2 == 0) && (m_dvy12 == 0))
r29404r29405
11661166 *  halt functions
11671167 *
11681168 *************************************/
1169
1169
11701170void avgdvg_device::vg_set_halt(int dummy)
11711171{
11721172   m_halt = dummy;
r29404r29405
13421342   avgdvg_vectorram_size = machine().root_device().memshare("vectorram")->bytes();
13431343
13441344   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
1345   
1345
13461346   xmin = visarea.min_x;
13471347   ymin = visarea.min_y;
13481348   xmax = visarea.max_x;
r29404r29405
13711371{
13721372   if(!m_vector->started())
13731373      throw device_missing_dependencies();
1374   
1374
13751375   const rectangle &visarea = machine().first_screen()->visible_area();
13761376
13771377   avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("vectorram")->ptr());
r29404r29405
13841384
13851385   vg_halt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device::vg_set_halt_callback),this));
13861386   vg_run_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device::run_state_machine),this));
1387   
1387
13881388   register_state();
13891389}
13901390
r29404r29405
14371437   m_clipy_min = 0;
14381438   m_clipx_max = 0;
14391439   m_clipy_max = 0;
1440   
1440
14411441   xmin = 0;
14421442   xmax = 0;
14431443   ymin = 0;
r29404r29405
14461446   ycenter = 0;
14471447   flip_x = 0;
14481448   flip_y = 0;
1449   nvect = 0;   
1449   nvect = 0;
14501450}
14511451
14521452dvg_device::dvg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
trunk/src/mame/video/avgdvg.h
r29404r29405
2424public:
2525   // construction/destruction
2626   avgdvg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
27   
27
2828   static void static_set_vector_tag(device_t &device, const char *tag);
29   
29
3030   DECLARE_CUSTOM_INPUT_MEMBER(done_r);
3131   DECLARE_WRITE8_MEMBER(go_w);
3232   DECLARE_WRITE8_MEMBER(reset_w);
33   
33
3434   DECLARE_WRITE16_MEMBER(go_word_w);
3535   DECLARE_WRITE16_MEMBER(reset_word_w);
3636
r29404r29405
4343protected:
4444   void apply_flipping(int *x, int *y);
4545   void vg_set_halt(int dummy);
46   
46
4747   void vg_flush();
4848   void vg_add_point_buf(int x, int y, rgb_t color, int intensity);
4949   void vg_add_clip (int xmin, int ymin, int xmax, int ymax);
r29404r29405
5252
5353   UINT8 *avgdvg_vectorram;
5454   size_t avgdvg_vectorram_size;
55   
55
5656   UINT8 *avgdvg_colorram;
57   
58   
57
58
5959   int xmin, xmax, ymin, ymax;
6060   int xcenter, ycenter;
6161   emu_timer *vg_run_timer, *vg_halt_timer;
r29404r29405
6464
6565   int nvect;
6666   vgvector vectbuf[MAXVECT];
67   
6867
68
6969   UINT16 m_pc;
7070   UINT8 m_sp;
7171   UINT16 m_dvx;
r29404r29405
103103   INT32 m_clipy_min;
104104   INT32 m_clipx_max;
105105   INT32 m_clipy_max;
106   
107106
108   virtual   int handler_0() = 0;
109   virtual   int handler_1() = 0;
110   virtual   int handler_2() = 0;
111   virtual   int handler_3() = 0;
112   virtual   int handler_4() = 0;
113   virtual   int handler_5() = 0;
114   virtual   int handler_6() = 0;
115   virtual   int handler_7() = 0;
107
108   virtual int handler_0() = 0;
109   virtual int handler_1() = 0;
110   virtual int handler_2() = 0;
111   virtual int handler_3() = 0;
112   virtual int handler_4() = 0;
113   virtual int handler_5() = 0;
114   virtual int handler_6() = 0;
115   virtual int handler_7() = 0;
116116   virtual UINT8 state_addr() = 0;
117117   virtual void update_databus() = 0;
118118   virtual void vggo() = 0;
119119   virtual void vgrst() = 0;
120   
120
121121   required_device<vector_device> m_vector;
122122};
123123
r29404r29405
126126public:
127127   // construction/destruction
128128   dvg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
129   
129
130130   void dvg_draw_to(int x, int y, int intensity);
131   
132   virtual   int handler_0();
133   virtual   int handler_1();
134   virtual   int handler_2();
135   virtual   int handler_3();
136   virtual   int handler_4();
137   virtual   int handler_5();
138   virtual   int handler_6();
139   virtual   int handler_7();
131
132   virtual int handler_0();
133   virtual int handler_1();
134   virtual int handler_2();
135   virtual int handler_3();
136   virtual int handler_4();
137   virtual int handler_5();
138   virtual int handler_6();
139   virtual int handler_7();
140140   virtual UINT8 state_addr();
141141   virtual void update_databus();
142142   virtual void vggo();
143143   virtual void vgrst();
144   
144
145145   virtual void device_start();
146146};
147147
r29404r29405
158158   int avg_common_strobe1();
159159   int avg_common_strobe2();
160160   int avg_common_strobe3();
161   
162   virtual   int handler_0();
163   virtual   int handler_1();
164   virtual   int handler_2();
165   virtual   int handler_3();
166   virtual   int handler_4();
167   virtual   int handler_5();
168   virtual   int handler_6();
169   virtual   int handler_7();
161
162   virtual int handler_0();
163   virtual int handler_1();
164   virtual int handler_2();
165   virtual int handler_3();
166   virtual int handler_4();
167   virtual int handler_5();
168   virtual int handler_6();
169   virtual int handler_7();
170170   virtual UINT8 state_addr();
171171   virtual void update_databus();
172172   virtual void vggo();
173173   virtual void vgrst();
174   
174
175175   virtual void device_start();
176176   void avg_start_common();
177177};
r29404r29405
184184public:
185185   // construction/destruction
186186   avg_tempest_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
187   
188   virtual   int handler_6();
189   virtual   int handler_7();
187
188   virtual int handler_6();
189   virtual int handler_7();
190190   virtual void vggo();
191191};
192192
r29404r29405
199199   // construction/destruction
200200   avg_mhavoc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
201201
202   virtual   int handler_1();
203   virtual   int handler_6();
204   virtual   int handler_7();
202   virtual int handler_1();
203   virtual int handler_6();
204   virtual int handler_7();
205205   virtual void update_databus();
206206   virtual void vgrst();
207207};
r29404r29405
214214public:
215215   // construction/destruction
216216   avg_starwars_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
217   virtual   int handler_6();
218   virtual   int handler_7();
217   virtual int handler_6();
218   virtual int handler_7();
219219   virtual void update_databus();
220220};
221221
r29404r29405
227227public:
228228   // construction/destruction
229229   avg_quantum_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
230   virtual   int handler_0();
231   virtual   int handler_1();
232   virtual   int handler_2();
233   virtual   int handler_3();
234   virtual   int handler_4();
235   virtual   int handler_5();
236   virtual   int handler_6();
237   virtual   int handler_7();
230   virtual int handler_0();
231   virtual int handler_1();
232   virtual int handler_2();
233   virtual int handler_3();
234   virtual int handler_4();
235   virtual int handler_5();
236   virtual int handler_6();
237   virtual int handler_7();
238238   virtual void update_databus();
239239   virtual void vggo();
240240};
r29404r29405
247247public:
248248   // construction/destruction
249249   avg_bzone_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
250   virtual   int handler_1();
251   virtual   int handler_6();
252   virtual   int handler_7();
250   virtual int handler_1();
251   virtual int handler_6();
252   virtual int handler_7();
253253};
254254
255255// device type definition
r29404r29405
260260public:
261261   // construction/destruction
262262   avg_tomcat_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
263   
264   virtual   int handler_6();
265   virtual   int handler_7();
263
264   virtual int handler_6();
265   virtual int handler_7();
266266};
267267
268268// device type definition
trunk/src/mame/video/k053246_k053247_k055673.h
r29404r29405
119119   const char *m_memory_region;
120120   required_device<gfxdecode_device> m_gfxdecode;
121121   required_device<palette_device> m_palette;
122   
122
123123   /* alt implementation - to be collapsed */
124124   void alt_k055673_vh_start(running_machine &machine, const char *gfx_memory_region, int alt_layout, int dx, int dy,
125125         void (*callback)(running_machine &machine, int *code,int *color,int *priority));
trunk/src/mame/video/canyon.c
r29404r29405
3939      int y = m_videoram[0x3d0 + 2 * i + 0x8];
4040      int c = m_videoram[0x3d0 + 2 * i + 0x9];
4141
42     
42
4343         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
4444         c >> 3,
4545         i,
trunk/src/mame/video/sspeedr.c
r29404r29405
196196
197197      y = 0xf0 - m_drones_vert[i >> 1];
198198
199     
199
200200         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
201201         code[i] ^ m_toggle,
202202         0,
r29404r29405
226226
227227   y = 0xf0 - m_driver_vert;
228228
229   
229
230230      m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
231231      m_driver_pic,
232232      0,
trunk/src/mame/video/wiz.c
r29404r29405
121121   UINT8 *cram = layer ? m_colorram2 : m_colorram;
122122   gfx_element *gfx = m_gfxdecode->gfx(charbank);
123123   int palbank = m_palbank[1] << 4 | m_palbank[0] << 3;
124   
124
125125   /* draw the tiles. They are characters, but draw them as sprites. */
126126   for (int offs = 0x400-1; offs >= 0; offs--)
127127   {
r29404r29405
129129      int sx = offs & 0x1f;
130130      int sy = offs >> 5;
131131      int color = aram[sx << 1 | 1] & 7;
132     
132
133133      // wiz/kungfut hw allows more color variety on screen
134134      if (colortype)
135135         color = layer ? (cram[offs] & 7) : ((color & 4) | (code & 3));
r29404r29405
154154   UINT8 *sram = set ? m_spriteram2 : m_spriteram;
155155   gfx_element *gfx = m_gfxdecode->gfx(charbank);
156156   int palbank = m_palbank[1] << 4 | m_palbank[0] << 3;
157   
157
158158   for (int offs = 0x20-4; offs >= 0; offs -= 4)
159159   {
160160      int code = sram[offs + 1];
161161      int sx = sram[offs + 3];
162162      int sy = sram[offs];
163163      int color = sram[offs + 2] & 7; // high bits unused
164     
164
165165      if (!sx || !sy) continue;
166     
166
167167      // like on galaxian hw, the first three sprites match against y-1 (not on m_spriteram2)
168168      if (set == 0 && offs <= 8)
169169         sy += (m_flipy) ? 1 : -1;
trunk/src/mame/video/grchamp.c
r29404r29405
121121   if( which==0 )
122122   {
123123      /* draw the current player sprite into a work bitmap */
124     
124
125125         m_gfxdecode->gfx(4)->opaque(m_work_bitmap,
126126         m_work_bitmap.cliprect(),
127127         m_cpu0_out[4]&0xf,
r29404r29405
187187      int sy = 240-source[0];
188188      int color = source[2];
189189      int code = source[1);
190     
190
191191         gfx->transpen(bitmap,cliprect,
192192         bank + (code & 0x3f),
193193         color,
trunk/src/mame/video/kopunch.c
r29404r29405
103103UINT32 kopunch_state::screen_update_kopunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
104104{
105105   bitmap.fill(0, cliprect);
106   
106
107107   // background does not wrap around horizontally
108108   rectangle bg_clip = cliprect;
109109   bg_clip.max_x = m_scrollx ^ 0xff;
trunk/src/mame/video/ladyfrog.c
r29404r29405
131131   m_paletteram_ext.resize(0x200);
132132   m_palette->basemem().set(m_paletteram, ENDIANNESS_LITTLE, 1);
133133   m_palette->extmem().set(m_paletteram_ext, ENDIANNESS_LITTLE, 1);
134   
134
135135   m_bg_tilemap->set_scroll_cols(32);
136136   m_bg_tilemap->set_scrolldy(15, 15);
137137
138   save_pointer(NAME(m_spriteram), 160);   
138   save_pointer(NAME(m_spriteram), 160);
139139   save_item(NAME(m_paletteram));
140140   save_item(NAME(m_paletteram_ext));
141141}
trunk/src/mame/video/sidearms.c
r29404r29405
185185         y = (30 * 8) - y;
186186      }
187187
188     
188
189189         gfx->transpen(bitmap,cliprect,
190190         code, color,
191191         flipx, flipy,
trunk/src/mame/video/k051316.h
r29404r29405
6868
6969#define MCFG_K051316_GFXDECODE(_gfxtag) \
7070   k051316_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
71   
71
7272#define MCFG_K051316_PALETTE(_palette_tag) \
7373   k051316_device::static_set_palette_tag(*device, "^" _palette_tag);
7474#endif
trunk/src/mame/video/tia.h
r29404r29405
3333
3434#define MCFG_TIA_DATABUS_CONTENTS_CB(_devcb) \
3535   devcb = &tia_video_device::set_databus_contents_callback(*device, DEVCB2_##_devcb);
36   
36
3737#define MCFG_TIA_VSYNC_CB(_devcb) \
3838   devcb = &tia_video_device::set_vsync_callback(*device, DEVCB2_##_devcb);
3939
r29404r29405
4949{
5050public:
5151   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
52   
52
5353   template<class _Object> static devcb2_base &set_read_input_port_callback(device_t &device, _Object object) { return downcast<tia_video_device &>(device).m_read_input_port_cb.set_callback(object); }
5454   template<class _Object> static devcb2_base &set_databus_contents_callback(device_t &device, _Object object) { return downcast<tia_video_device &>(device).m_databus_contents_cb.set_callback(object); }
5555   template<class _Object> static devcb2_base &set_vsync_callback(device_t &device, _Object object) { return downcast<tia_video_device &>(device).m_vsync_cb.set_callback(object); }
trunk/src/mame/video/gticlub.c
r29404r29405
7575      K001006_addr[i] = 0;
7676      K001006_device_sel[i] = 0;
7777      K001006_palette[i] = auto_alloc_array(machine, UINT32, 0x800);
78      memset(K001006_palette[i], 0, 0x800*sizeof(UINT32));     
78      memset(K001006_palette[i], 0, 0x800*sizeof(UINT32));
7979   }
8080   m_palette = palette;
8181}
trunk/src/mame/video/appoooh.c
r29404r29405
219219         sy = 239 - sy;
220220         flipx = !flipx;
221221      }
222     
222
223223            gfx->transpen(dest_bmp,cliprect,
224224            code,
225225            color,
r29404r29405
250250         sy = 239 - sy;
251251         flipx = !flipx;
252252      }
253     
253
254254            gfx->transpen(dest_bmp,cliprect,
255255            code,
256256            color,
trunk/src/mame/video/k007342.c
r29404r29405
4949   //m_regs[8],
5050   //m_scrollx[2],
5151   //m_scrolly[2],
52   m_gfxdecode(*this),   
52   m_gfxdecode(*this),
5353   m_gfxnum(0)
5454{
5555}
r29404r29405
7474      throw device_missing_dependencies();
7575
7676   // bind the init function
77    m_callback.bind_relative_to(*owner());
78   
77   m_callback.bind_relative_to(*owner());
78
7979   m_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k007342_device::get_tile_info0),this), tilemap_mapper_delegate(FUNC(k007342_device::scan),this), 8, 8, 64, 32);
8080   m_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k007342_device::get_tile_info1),this), tilemap_mapper_delegate(FUNC(k007342_device::scan),this), 8, 8, 64, 32);
8181
r29404r29405
281281   flags = TILE_FLIPYX((color & 0x30) >> 4);
282282
283283   tileinfo.category = (color & 0x80) >> 7;
284   
284
285285   if (!m_callback.isnull())
286286      m_callback(layer, m_regs[1], &code, &color, &flags);
287   
288287
288
289289   SET_TILE_INFO_MEMBER(m_gfxnum,
290290         code,
291291         color,
trunk/src/mame/video/k007342.h
r29404r29405
1212
1313   // static configuration
1414   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
15   static void static_set_gfxnum(device_t &device, int gfxnum) { downcast<k007342_device &>(device).m_gfxnum = gfxnum; }
15   static void static_set_gfxnum(device_t &device, int gfxnum) { downcast<k007342_device &>(device).m_gfxnum = gfxnum; }
1616   static void static_set_callback(device_t &device, k007342_delegate callback) { downcast<k007342_device &>(device).m_callback = callback; }
17   
17
1818   DECLARE_READ8_MEMBER( read );
1919   DECLARE_WRITE8_MEMBER( write );
2020   DECLARE_READ8_MEMBER( scroll_r );
r29404r29405
5656extern const device_type K007342;
5757
5858#define MCFG_K007342_ADD(_tag) \
59   MCFG_DEVICE_ADD(_tag, K007342, 0) \
60
59   MCFG_DEVICE_ADD(_tag, K007342, 0)
6160#define MCFG_K007342_GFXDECODE(_gfxtag) \
6261   k007342_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
6362
r29404r29405
6867   k007342_device::static_set_callback(*device, k007342_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
6968
7069#define MCFG_K007342_CALLBACK_DEVICE(_tag, _class, _method) \
71   k007342_device::static_set_callback(*device, k007342_delegate(&_class::_method, #_class "::" #_method, _tag));   
70   k007342_device::static_set_callback(*device, k007342_delegate(&_class::_method, #_class "::" #_method, _tag));
7271
7372// function definition for a callback
74#define K007342_CALLBACK_MEMBER(_name)     void _name(int layer, int bank, int *code, int *color, int *flags)   
73#define K007342_CALLBACK_MEMBER(_name)     void _name(int layer, int bank, int *code, int *color, int *flags)
7574
7675#endif
trunk/src/mame/video/c45.c
r29404r29405
232232
233233void namco_c45_road_device::device_stop()
234234{
235
236235}
237236
238237
trunk/src/mame/video/atarimo.c
r29404r29405
534534                  continue;
535535
536536               // draw the sprite
537                gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
537                  gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
538538               mark_dirty(sx, sx + m_tilewidth - 1, sy, sy + m_tileheight - 1);
539539            }
540540         }
r29404r29405
563563                  continue;
564564
565565               // draw the sprite
566                gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
566                  gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
567567               mark_dirty(sx, sx + m_tilewidth - 1, sy, sy + m_tileheight - 1);
568568            }
569569         }
trunk/src/mame/video/decocomn.h
r29404r29405
2323
2424   // static configuration
2525   static void static_set_palette_tag(device_t &device, const char *tag);
26   
26
2727   DECLARE_WRITE16_MEMBER( nonbuffered_palette_w );
2828   DECLARE_WRITE16_MEMBER( buffered_palette_w );
2929   DECLARE_WRITE16_MEMBER( palette_dma_w );
r29404r29405
5757
5858#define MCFG_DECOCOMN_PALETTE(_palette_tag) \
5959   decocomn_device::static_set_palette_tag(*device, "^" _palette_tag);
60   
60
6161#endif
trunk/src/mame/video/c45.h
r29404r29405
3838   namco_c45_road_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3939
4040   static void static_set_palette_tag(device_t &device, const char *tag);
41   
41
4242   // read/write handlers
4343   DECLARE_READ16_MEMBER( read );
4444   DECLARE_WRITE16_MEMBER( write );
45   
45
4646   // optional information overrides
47   virtual machine_config_constructor device_mconfig_additions() const;   
47   virtual machine_config_constructor device_mconfig_additions() const;
4848
4949   // C45 Land (Road) Emulation
5050   void set_transparent_color(pen_t pen) { m_transparent_color = pen; }
r29404r29405
5858   // internal helpers
5959   TILE_GET_INFO_MEMBER( get_road_info );
6060
61   // internal state   
61   // internal state
6262   pen_t           m_transparent_color;
6363   tilemap_t *     m_tilemap;
6464   UINT16          m_ram[0x20000/2]; // at 0x880000 in Final Lap; at 0xa00000 in Lucky&Wild
trunk/src/mame/video/bogeyman.c
r29404r29405
6363WRITE8_MEMBER(bogeyman_state::bogeyman_paletteram_w)
6464{
6565   /* RGB output is inverted */
66   m_palette->write(space, offset, UINT8(~data));
66   m_palette->write(space, offset, UINT8(~data));
6767}
6868
6969TILE_GET_INFO_MEMBER(bogeyman_state::get_bg_tile_info)
r29404r29405
122122            flipy = !flipy;
123123         }
124124
125         
125
126126            m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
127127            code, color,
128128            flipx, flipy,
r29404r29405
130130
131131         if (multi)
132132         {
133           
134133               m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
135134               code + 1, color,
136135               flipx, flipy,
trunk/src/mame/video/stlforce.c
r29404r29405
105105
106106         ypos = 512-ypos;
107107
108         
108
109109                  gfx->transpen(bitmap,
110110                  cliprect,
111111                  num,
trunk/src/mame/video/tc0110pcr.c
r29404r29405
4646
4747void tc0110pcr_device::device_config_complete()
4848{
49
5049}
5150
5251//-------------------------------------------------
trunk/src/mame/video/mermaid.c
r29404r29405
208208         sy = 240 - sy;
209209      }
210210
211     
211
212212         m_gfxdecode->gfx(1)->transpen(bitmap,(flip_screen_x() ? flip_spritevisiblearea : spritevisiblearea), code, color, flipx, flipy, sx, sy, 0);
213213   }
214214}
trunk/src/mame/video/tc0110pcr.h
r29404r29405
1515   DECLARE_WRITE16_MEMBER( step1_4bpg_word_w );  /* only 4 bits per color gun */
1616
1717   void restore_colors();
18   
18
1919   static void static_set_palette_tag(device_t &device, const char *tag);
20   
20
2121protected:
2222   // device-level overrides
2323   virtual void device_config_complete();
r29404r29405
2828   UINT16 *     m_ram;
2929   int          m_type;
3030   int          m_addr;
31   required_device<palette_device> m_palette;   
31   required_device<palette_device> m_palette;
3232};
3333
3434extern const device_type TC0110PCR;
3535
3636#define MCFG_TC0110PCR_ADD(_tag) \
37   MCFG_DEVICE_ADD(_tag, TC0110PCR, 0) \
38
37   MCFG_DEVICE_ADD(_tag, TC0110PCR, 0)
3938#define MCFG_TC0110PCR_PALETTE(_palette_tag) \
4039   tc0110pcr_device::static_set_palette_tag(*device, "^" _palette_tag);
4140
trunk/src/mame/video/djmain.c
r29404r29405
9393               int zw = ox + (((x + 1) * xscale + (1 << 11)) >> 12) - sx;
9494               int zh = oy + (((y + 1) * yscale + (1 << 11)) >> 12) - sy;
9595
96               
96
9797                        m_gfxdecode->gfx(0)->zoom_transpen(bitmap,
9898                        cliprect,
9999                        c,
r29404r29405
111111               int sx = ox + (x << 4);
112112               int sy = oy + (y << 4);
113113
114               
114
115115                     m_gfxdecode->gfx(0)->transpen(bitmap,
116116                     cliprect,
117117                     c,
trunk/src/mame/video/decmxc06.c
r29404r29405
9696      if (sy >= 256) sy -= 512;
9797      sx = 240 - sx;
9898      sy = 240 - sy;
99     
99
100100      if (machine.driver_data()->flip_screen())
101101      {
102102         sy = 240 - sy;
r29404r29405
122122            code += h-1;
123123            incy = 1;
124124         }
125         
125
126126         for (y = 0; y < h; y++)
127127         {
128128            if (spriteram[offs] & 0x8000)
trunk/src/mame/video/decmxc06.h
r29404r29405
55{
66public:
77   deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8   
8
99   // static configuration
1010   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
1111   static void static_set_palette_tag(device_t &device, const char *tag);
1212   static void set_gfx_region(device_t &device, int region);
13   
13
1414   void set_gfxregion(int region) { m_gfxregion = region; };
1515   void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
1616   void draw_sprites_bootleg( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask );
trunk/src/mame/video/tigeroad.c
r29404r29405
9696            flipy = !flipy;
9797         }
9898
99         
99
100100            m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
101101            tile_number,
102102            color,
trunk/src/mame/video/decospr.h
r29404r29405
99   decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1010
1111   // static configuration
12   static void static_set_gfxdecode_tag(device_t &device, const char *tag);   
12   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
1313   static void static_set_palette_tag(device_t &device, const char *tag);
1414   static void set_gfx_region(device_t &device, int gfxregion);
1515   static void set_pri_callback(device_t &device, decospr_priority_callback_func callback);
r29404r29405
8989
9090#define MCFG_DECO_SPRITE_PALETTE(_palette_tag) \
9191   decospr_device::static_set_palette_tag(*device, "^" _palette_tag);
92
trunk/src/mame/video/slapfght.c
r29404r29405
6060{
6161   m_pf1_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(slapfght_state::get_pf1_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
6262   m_fix_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(slapfght_state::get_fix_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
63   
63
6464   m_fix_tilemap->set_scrolldy(0, 15);
6565   m_pf1_tilemap->set_scrolldy(0, 14);
6666
r29404r29405
135135void slapfght_state::draw_perfrman_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer)
136136{
137137   UINT8 *src = m_spriteram->buffer();
138   
138
139139   for (int offs = 0; offs < m_spriteram->bytes(); offs += 4)
140140   {
141141      /*
142         0: xxxxxxxx - code
143         1: xxxxxxxx - x
144         2: x....... - priority over backdrop
145            .x...... - sprite-sprite priority (see point-pop sprites)
146            ..x..... - ?
147            ...xx... - no function?
148            .....xxx - color
149         3: xxxxxxxx - y
142          0: xxxxxxxx - code
143          1: xxxxxxxx - x
144          2: x....... - priority over backdrop
145             .x...... - sprite-sprite priority (see point-pop sprites)
146             ..x..... - ?
147             ...xx... - no function?
148             .....xxx - color
149          3: xxxxxxxx - y
150150      */
151     
151
152152      int code = src[offs + 0];
153153      int sy = src[offs + 3] - 1;
154154      int sx = src[offs + 1] - 13;
155155      int pri = src[offs + 2] >> 6 & 3;
156156      int color = (src[offs + 2] >> 1 & 3) | (src[offs + 2] << 2 & 4) | (m_palette_bank << 3);
157157      int fx = 0, fy = 0;
158     
158
159159      if (flip_screen())
160160      {
161161         sy = 256 - sy;
162162         sx = 240 - sx;
163163         fx = fy = 1;
164164      }
165     
165
166166      if (layer == pri)
167167         m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, fx, fy, sx, sy, 0);
168168   }
r29404r29405
189189   for (int offs = 0; offs < m_spriteram->bytes(); offs += 4)
190190   {
191191      /*
192         0: xxxxxxxx - code low
193         1: xxxxxxxx - x low
194         2: xx...... - code high
195            ..x..... - no function?
196            ...xxxx. - color
197            .......x - x high
198         3: xxxxxxxx - y
192          0: xxxxxxxx - code low
193          1: xxxxxxxx - x low
194          2: xx...... - code high
195             ..x..... - no function?
196             ...xxxx. - color
197             .......x - x high
198          3: xxxxxxxx - y
199199      */
200     
200
201201      int code = src[offs + 0] | ((src[offs + 2] & 0xc0) << 2);
202202      int sy = src[offs + 3];
203203      int sx = (src[offs + 1] | (src[offs + 2] << 8 & 0x100)) - 13;
r29404r29405
210210         sx = 284 - sx;
211211         fx = fy = 1;
212212      }
213     
213
214214      m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, fx, fy, sx, sy, 0);
215215   }
216216}
trunk/src/mame/video/bfm_dm01.c
r29404r29405
7676void bfmdm01_device::device_start()
7777{
7878   m_busy_cb.resolve_safe();
79   
79
8080   save_item(NAME(m_data_avail));
8181   save_item(NAME(m_control));
8282   save_item(NAME(m_xcounter));
r29404r29405
100100   m_control  = 0;
101101   m_xcounter = 0;
102102   m_data_avail = 0;
103   
103
104104   m_busy_cb(m_busy);
105105}
106106
trunk/src/mame/video/bfm_dm01.h
r29404r29405
1616public:
1717   bfmdm01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1818   ~bfmdm01_device() {}
19   
19
2020   template<class _Object> static devcb2_base &set_busy_callback(device_t &device, _Object object) { return downcast<bfmdm01_device &>(device).m_busy_cb.set_callback(object); }
2121
2222   DECLARE_READ8_MEMBER( control_r );
r29404r29405
4646
4747   UINT8 m_scanline[DM_BYTESPERROW];
4848   UINT8 m_comdata;
49   
49
5050   devcb2_write_line m_busy_cb;
5151
5252   int read_data(void);
trunk/src/mame/video/gyruss.c
r29404r29405
139139      int flip_x = ~m_spriteram[offs + 2] & 0x40;
140140      int flip_y =  m_spriteram[offs + 2] & 0x80;
141141
142      m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, x, y, 0);
142         m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, x, y, 0);
143143   }
144144}
145145
trunk/src/mame/video/deckarn.h
r29404r29405
66   deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
77   void set_gfxregion(int region) { m_gfxregion = region; };
88   void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority );
9   
9
1010   // static configuration
1111   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
1212   static void static_set_palette_tag(device_t &device, const char *tag);
trunk/src/mame/video/k053250.h
r29404r29405
1313   MCFG_VIDEO_SET_SCREEN(_screen_tag) \
1414   k053250_device::static_set_offsets(*device, offx, offy);
1515
16class k053250_device :   public device_t,
16class k053250_device :  public device_t,
1717                  public device_gfx_interface,
1818                  public device_video_interface
1919{
trunk/src/mame/video/dec8.c
r29404r29405
298298
299299UINT32 dec8_state::screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
300300{
301   
302   
303301   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
304302   m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
305303   m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0);
trunk/src/mame/video/combatsc.c
r29404r29405
526526//          if(m_vreg == 0x23 && (attributes & 0x02)) color += 1*16;
527527//          if(m_vreg == 0x66 ) color += 2*16;
528528
529          gfx->transpen(bitmap,cliprect,
529            gfx->transpen(bitmap,cliprect,
530530                     number, color,
531531                     attributes & 0x10,0, /* flip */
532532                     x, y, 15 );
trunk/src/mame/video/battlex.c
r29404r29405
8181         flipy = !flipy;
8282      }
8383
84      gfx->transpen(bitmap,cliprect, tile, color, flipx, flipy, sx, sy, 0);
84         gfx->transpen(bitmap,cliprect, tile, color, flipx, flipy, sx, sy, 0);
8585      source += 4;
8686   }
8787
trunk/src/mame/video/m52.c
r29404r29405
305305   /* this may not be correct */
306306   ypos = ypos + (22 - 8);
307307
308   
308
309309      m_gfxdecode->gfx(image)->transpen(bitmap,cliprect,
310310      0, 0,
311311      flip_screen(),
r29404r29405
313313      xpos,
314314      ypos, 0);
315315
316   
316
317317      m_gfxdecode->gfx(image)->transpen(bitmap,cliprect,
318318      0, 0,
319319      flip_screen(),
trunk/src/mame/video/gottlieb.c
r29404r29405
209209      if (flip_screen_x()) sx = 233 - sx;
210210      if (flip_screen_y()) sy = 228 - sy;
211211
212     
212
213213         m_gfxdecode->gfx(2)->transpen(bitmap,clip,
214214         code, 0,
215215         flip_screen_x(), flip_screen_y(),
trunk/src/mame/video/k001604.h
r29404r29405
2424   // static configuration
2525   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2626   static void static_set_palette_tag(device_t &device, const char *tag);
27   
27
2828   void draw_back_layer( bitmap_rgb32 &bitmap, const rectangle &cliprect );
2929   void draw_front_layer( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect );
3030   DECLARE_WRITE32_MEMBER( tile_w );
trunk/src/mame/video/mugsmash.c
r29404r29405
4343      xpos -= 28;
4444      ypos -= 16;
4545
46     
46
4747            gfx->transpen(
4848            bitmap,
4949            cliprect,
trunk/src/mame/video/mikie.c
r29404r29405
156156         flipy = !flipy;
157157      }
158158
159     
159
160160         m_gfxdecode->gfx(gfxbank)->transpen(bitmap,cliprect,
161161         code, color,
162162         flipx,flipy,
trunk/src/mame/video/munchmo.c
r29404r29405
6363
6464      for (sy = 0; sy < 256; sy += 8)
6565      {
66         
6766            gfx->opaque(bitmap,cliprect,
6867            *source++,
6968            0, /* color */
r29404r29405
9493      {
9594         for (col = 0; col < 4; col++)
9695         {
97            gfx->opaque(*m_tmpbitmap,m_tmpbitmap->cliprect(),
96               gfx->opaque(*m_tmpbitmap,m_tmpbitmap->cliprect(),
9897               rom[col + tile_number * 4 + row * 0x400],
9998               m_palette_bank,
10099               0,0, /* flip */
r29404r29405
135134         {
136135            sx = (sx >> 1) | (tile_number & 0x80);
137136            sx = 2 * ((- 32 - scroll - sx) & 0xff) + xadjust;
138            gfx->transpen(bitmap,cliprect,
137               gfx->transpen(bitmap,cliprect,
139138               0x7f - (tile_number & 0x7f),
140139               color_base - (attributes & 0x03),
141140               0,0,                            /* no flip */
trunk/src/mame/video/drgnmst.c
r29404r29405
9393            realy = ypos + incy * y;
9494            realnumber = number + x + y * 16;
9595
96            gfx->transpen(bitmap,cliprect, realnumber, colr, flipx, flipy, realx, realy, 15);
96               gfx->transpen(bitmap,cliprect, realnumber, colr, flipx, flipy, realx, realy, 15);
9797         }
9898      }
9999      source += 4;
trunk/src/mame/video/thepit.c
r29404r29405
266266         /* sprites 0-3 are drawn one pixel down */
267267         if (offs < 16) y++;
268268
269         
269
270270               state->m_gfxdecode->gfx(2 * state->m_graphics_bank + 1)->transpen(bitmap,cliprect,
271271               state->m_spriteram[offs + 1] & 0x3f,
272272               state->m_spriteram[offs + 2],
273273               flipx, flipy, x, y, 0);
274274
275         
275
276276               state->m_gfxdecode->gfx(2 * state->m_graphics_bank + 1)->transpen(bitmap,cliprect,
277277               state->m_spriteram[offs + 1] & 0x3f,
278278               state->m_spriteram[offs + 2],
trunk/src/mame/video/pooyan.c
r29404r29405
167167      int flipx = ~spriteram_2[offs] & 0x40;
168168      int flipy = spriteram_2[offs] & 0x80;
169169
170     
170
171171         m_gfxdecode->gfx(1)->transmask(bitmap,cliprect,
172172         code,
173173         color,
trunk/src/mame/video/champbas.c
r29404r29405
196196      int sx = m_spriteram_2[offs + 1] - 16;
197197      int sy = 255 - m_spriteram_2[offs];
198198
199     
199
200200            gfx->transmask(bitmap,cliprect,
201201            code, color,
202202            flipx, flipy,
r29404r29405
204204            m_palette->transpen_mask(*gfx, color, 0));
205205
206206      // wraparound
207     
207
208208            gfx->transmask(bitmap,cliprect,
209209            code, color,
210210            flipx, flipy,
r29404r29405
234234      color = (obj1[offs + 1]) & 0x0f;
235235      bank = ((obj1[offs + 1] >> 4) & 1);
236236
237     
237
238238            m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
239239            code + (bank << 6),
240240            color,
r29404r29405
257257      flipy = (~obj1[offs]) & 0x02;
258258      color = (obj1[offs + 1]) & 0x0f;
259259
260     
260
261261            m_gfxdecode->gfx(2)->transmask(bitmap,cliprect,
262262            code,
263263            color,
trunk/src/mame/video/baraduke.c
r29404r29405
123123   m_bg_tilemap[0]->set_scrolldx(-26, -227+26);
124124   m_bg_tilemap[1]->set_scrolldx(-24, -227+24);
125125   m_bg_tilemap[0]->set_scrolldy(-9, 9);
126   m_bg_tilemap[1]->set_scrolldy(-9, 9);   
126   m_bg_tilemap[1]->set_scrolldy(-9, 9);
127127   m_tx_tilemap->set_scrolldy(16,16);
128128}
129129
trunk/src/mame/video/tceptor.c
r29404r29405
474474         x -= 64;
475475         y -= 78;
476476
477         
477
478478                  m_gfxdecode->gfx(gfx)->zoom_transmask(bitmap,
479479                  cliprect,
480480                  code,
trunk/src/mame/video/gp9001.h
r29404r29405
141141
142142#define MCFG_GP9001_VDP_PALETTE(_palette_tag) \
143143   gp9001vdp_device::static_set_palette_tag(*device, "^" _palette_tag);
144
trunk/src/mame/video/tagteam.c
r29404r29405
163163         flipy = !flipy;
164164      }
165165
166     
166
167167         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
168168         code, color,
169169         flipx, flipy,
r29404r29405
175175      color = m_palettebank;
176176      sy += (flip_screen() ? -256 : 256);
177177
178     
178
179179         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
180180         code, color,
181181         flipx, flipy,
trunk/src/mame/video/battlane.c
r29404r29405
180180            flipy = !flipy;
181181         }
182182
183         
183
184184            m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
185185            code,
186186            color,
r29404r29405
191191         {
192192            dy = flipy ? 16 : -16;
193193
194           
194
195195               m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
196196               code + 1,
197197               color,
trunk/src/mame/video/tecmo_spr.c
r29404r29405
120120               int x = sx + 8 * (flipx ? (size - 1 - col) : col);
121121               int y = sy + 8 * (flipy ? (size - 1 - row) : row);
122122
123                gfxdecode->gfx(2)->transpen_raw(bitmap,cliprect,
123                  gfxdecode->gfx(2)->transpen_raw(bitmap,cliprect,
124124                  code + layout[row][col],
125125                  gfxdecode->gfx(2)->colorbase() + color * gfxdecode->gfx(2)->granularity(),
126126                  flipx, flipy,
trunk/src/mame/video/tc0480scp.h
r29404r29405
2525   // static configuration
2626   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2727   static void static_set_palette_tag(device_t &device, const char *tag);
28   
28
2929   /* When writing a driver, pass zero for the text and flip offsets initially:
3030   then tweak them once you have the 4 bg layer positions correct. Col_base
3131   may be needed when tilemaps use a palette area from sprites. */
trunk/src/mame/video/ygv608.c
r29404r29405
7373
7474void ygv608_device::set_gfxbank(UINT8 gfxbank)
7575{
76   m_namcond1_gfxbank = gfxbank;   
76   m_namcond1_gfxbank = gfxbank;
7777}
7878
7979/* interrupt generated every 1ms second */
r29404r29405
9595   {
9696      m_ports.s.p6 |= p6_fv;
9797      if (m_regs.s.r14 & r14_iev)
98         device.execute().set_input_line(2, HOLD_LINE);
98         device.execute().set_input_line(2, HOLD_LINE);
9999   }
100100
101101   /* once every 60Hz, set the position detection flag (somewhere) */
r29404r29405
103103   {
104104      m_ports.s.p6 |= p6_fp;
105105      if (m_regs.s.r14 & r14_iep)
106         device.execute().set_input_line(2, HOLD_LINE);
106         device.execute().set_input_line(2, HOLD_LINE);
107107   }
108108}
109109
trunk/src/mame/video/crimfght.c
r29404r29405
6464   m_layer_colorbase[1] = 4;
6565   m_layer_colorbase[2] = 8;
6666   m_sprite_colorbase = 16;
67   
67
6868   save_item(NAME(m_paletteram));
6969}
7070
trunk/src/mame/video/wolfpack.c
r29404r29405
139139
140140   int chop = (scaler[m_ship_size >> 2] * m_ship_h_precess) >> 16;
141141
142   
142
143143      m_gfxdecode->gfx(1)->zoom_transpen(bitmap,cliprect,
144144      m_ship_pic,
145145      0,
r29404r29405
157157   int x;
158158   int y;
159159
160   
160
161161      m_gfxdecode->gfx(3)->transpen(bitmap,cliprect,
162162      m_torpedo_pic,
163163      0,
r29404r29405
193193   if (!(m_pt_pic & 0x10))
194194      rect.max_x = 255;
195195
196   
196
197197      m_gfxdecode->gfx(2)->transpen(bitmap,rect,
198198      m_pt_pic,
199199      0,
r29404r29405
201201      2 * m_pt_horz,
202202      m_pt_pos_select ? 0x70 : 0xA0, 0);
203203
204   
204
205205      m_gfxdecode->gfx(2)->transpen(bitmap,rect,
206206      m_pt_pic,
207207      0,
r29404r29405
254254      {
255255         int code = m_alpha_num_ram[32 * i + j];
256256
257         
257
258258            m_gfxdecode->gfx(0)->opaque(bitmap,cliprect,
259259            code,
260260            m_video_invert,
trunk/src/mame/video/ygv608.h
r29404r29405
289289   // static configuration
290290   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
291291   static void static_set_palette_tag(device_t &device, const char *tag);
292   
292
293293   DECLARE_WRITE16_MEMBER( write );
294294   DECLARE_READ16_MEMBER( read );
295295
trunk/src/mame/video/darkmist.c
r29404r29405
172172
173173         palette+=32;
174174
175         
175
176176            m_gfxdecode->gfx(2)->transpen(
177177            bitmap,cliprect,
178178            tile,
trunk/src/mame/video/sonson.c
r29404r29405
154154         flipy = !flipy;
155155      }
156156
157     
157
158158         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
159159         code, color,
160160         flipx, flipy,
trunk/src/mame/video/seibu_crtc.h
r29404r29405
11/***************************************************************************
22
3   Seibu CRTC device
3    Seibu CRTC device
44
55***************************************************************************/
66
r29404r29405
1616
1717#define MCFG_SEIBU_CRTC_LAYER_EN_CB(_devcb) \
1818   devcb = &seibu_crtc_device::set_layer_en_callback(*device, DEVCB2_##_devcb);
19   
19
2020#define MCFG_SEIBU_CRTC_LAYER_SCROLL_CB(_devcb) \
2121   devcb = &seibu_crtc_device::set_layer_scroll_callback(*device, DEVCB2_##_devcb);
2222
r29404r29405
3737
3838   template<class _Object> static devcb2_base &set_layer_en_callback(device_t &device, _Object object) { return downcast<seibu_crtc_device &>(device).m_layer_en_cb.set_callback(object); }
3939   template<class _Object> static devcb2_base &set_layer_scroll_callback(device_t &device, _Object object) { return downcast<seibu_crtc_device &>(device).m_layer_scroll_cb.set_callback(object); }
40   
40
4141   // I/O operations
4242   DECLARE_WRITE16_MEMBER( write );
4343   DECLARE_WRITE16_MEMBER( write_alt );
r29404r29405
4747   DECLARE_READ16_MEMBER( read_xor );
4848   DECLARE_WRITE16_MEMBER(layer_en_w);
4949   DECLARE_WRITE16_MEMBER(layer_scroll_w);
50   
50
5151protected:
5252   // device-level overrides
5353   virtual void device_validity_check(validity_checker &valid) const;
trunk/src/mame/video/kaneko_spr.c
r29404r29405
314314               {
315315                  if (pri[x] < priority)
316316                  {
317
318317                     if (!rgb) dest[x] = pen_base + c;
319318                     else dest[x] = pal[pen_base + c];
320319
trunk/src/mame/video/mystston.c
r29404r29405
197197            flipy = !flipy;
198198         }
199199
200          gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
200            gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
201201      }
202202   }
203203}
trunk/src/mame/video/kaneko_spr.h
r29404r29405
8585   template<class _BitmapClass>
8686   void kaneko16_draw_sprites(running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes);
8787
88   
88
8989   template<class _BitmapClass>
9090   void kaneko16_draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx,
9191         UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
trunk/src/mame/video/twincobr.c
r29404r29405
9494   m_bg_tilemap->set_scrolldy(-30, -243 );
9595   m_fg_tilemap->set_scrolldy(-30, -243 );
9696   m_tx_tilemap->set_scrolldy(-30, -243 );
97   
97
9898   m_fg_tilemap->set_transparent_pen(0);
9999   m_tx_tilemap->set_transparent_pen(0);
100100}
trunk/src/mame/video/decbac06.h
r29404r29405
108108   TILEMAP_MAPPER_MEMBER(tile_shape2_8x8_scan);
109109   TILE_GET_INFO_MEMBER(get_pf8x8_tile_info);
110110   TILE_GET_INFO_MEMBER(get_pf16x16_tile_info);
111   required_device<gfxdecode_device> m_gfxdecode;   
111   required_device<gfxdecode_device> m_gfxdecode;
112112};
113113
114114extern const device_type DECO_BAC06;
trunk/src/mame/video/gotya.c
r29404r29405
125125      else
126126         sy = 31 - row;
127127
128     
128
129129         m_gfxdecode->gfx(0)->opaque(bitmap,cliprect,
130130         m_videoram2[row * 32 + col],
131131         m_videoram2[row * 32 + col + 0x10] & 0x0f,
r29404r29405
149149      if (flip_screen())
150150         sy = 240 - sy;
151151
152     
152
153153         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
154154         code, color,
155155         flip_screen_x(), flip_screen_y(),
trunk/src/mame/video/ms32.c
r29404r29405
9797
9898   // tp2m32 doesn't set the brightness registers so we need sensible defaults
9999   m_brt[0] = m_brt[1] = 0xffff;
100   
100
101101   save_item(NAME(m_irqreq));
102102   save_item(NAME(m_temp_bitmap_tilemaps));
103103   save_item(NAME(m_temp_bitmap_sprites));
trunk/src/mame/video/zaxxon.c
r29404r29405
428428      int sx = find_minimum_x(spriteram[offs + 3], flip);
429429
430430      /* draw with 256 pixel offsets to ensure we wrap properly */
431       gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy, 0);
432       gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy - 0x100, 0);
433       gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx - 0x100, sy, 0);
434       gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx - 0x100, sy - 0x100, 0);
431         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy, 0);
432         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy - 0x100, 0);
433         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx - 0x100, sy, 0);
434         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, sx - 0x100, sy - 0x100, 0);
435435   }
436436}
437437
trunk/src/mame/video/taito_h.c
r29404r29405
144144                     flipy ^= 0x0080;
145145                  }
146146
147                 
147
148148                           m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
149149                           tile,
150150                           color,
r29404r29405
256256                     flipy ^= 0x0080;
257257                  }
258258
259                 
259
260260                           m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
261261                           tile,
262262                           color,
r29404r29405
358358                        flipy ^= 0x0080;
359359                     }
360360
361                     
361
362362                              m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
363363                              tile,
364364                              color,
trunk/src/mame/video/psikyo4.c
r29404r29405
112112         {
113113            for (i = xstart; i != xend; i += xinc)
114114            {
115                gfx->transpen(bitmap,cliprect, tnum + loopnum, colr, flipx, flipy, xpos + 16 * i, ypos + 16 * j, 0);
115                  gfx->transpen(bitmap,cliprect, tnum + loopnum, colr, flipx, flipy, xpos + 16 * i, ypos + 16 * j, 0);
116116               loopnum++;
117117            }
118118         }
trunk/src/mame/video/taitosj.c
r29404r29405
301301
302302   /* draw the sprites into separate bitmaps and check overlapping region */
303303   m_sprite_layer_collbitmap1.fill(TRANSPARENT_PEN);
304    get_sprite_gfx_element(which1)->transpen(m_sprite_sprite_collbitmap1,m_sprite_sprite_collbitmap1.cliprect(),
304      get_sprite_gfx_element(which1)->transpen(m_sprite_sprite_collbitmap1,m_sprite_sprite_collbitmap1.cliprect(),
305305         m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 3] & 0x3f,
306306         0,
307307         m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x01,
r29404r29405
309309         sx1, sy1, 0);
310310
311311   m_sprite_sprite_collbitmap2.fill(TRANSPARENT_PEN);
312    get_sprite_gfx_element(which2)->transpen(m_sprite_sprite_collbitmap2,m_sprite_sprite_collbitmap2.cliprect(),
312      get_sprite_gfx_element(which2)->transpen(m_sprite_sprite_collbitmap2,m_sprite_sprite_collbitmap2.cliprect(),
313313         m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 3] & 0x3f,
314314         0,
315315         m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x01,
trunk/src/mame/video/chaknpop.c
r29404r29405
198198         flipy = !flipy;
199199      }
200200
201     
201
202202            m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
203203            tile,
204204            color,
trunk/src/mame/video/fitfight.c
r29404r29405
3434
3535      if (end) break;
3636      if (prio == layer)
37          gfx->transpen(bitmap,cliprect, number, colr, xflip, yflip, xpos, ypos, 0);
37            gfx->transpen(bitmap,cliprect, number, colr, xflip, yflip, xpos, ypos, 0);
3838
3939      source += 4;
4040   }
trunk/src/mame/video/cps1.c
r29404r29405
13971397   {"sf2acca",     CPS_B_21_DEF, mapper_S9263B, 0x36 },
13981398   {"sf2accp2",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
13991399   {"sf2amf",      CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 }, // probably wrong but this set is not completely dumped anyway
1400   {"sf2amf2",     CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
1400   {"sf2amf2",     CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
14011401   {"sf2dkot2",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
14021402   {"sf2m1",       CPS_B_21_DEF, mapper_S9263B, 0x36 },
14031403   {"sf2m2",       CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
trunk/src/mame/video/ddribble.c
r29404r29405
218218               ex = flipx ? (width - 1 - x) : x;
219219               ey = flipy ? (height - 1 - y) : y;
220220
221               
221
222222                  gfx->transpen(bitmap,cliprect,
223223                  (number)+x_offset[ex]+y_offset[ey],
224224                  color,
trunk/src/mame/video/shangkid.c
r29404r29405
141141      {
142142         sx = xpos+(c^xflip)*width;
143143         sy = ypos+(r^yflip)*height;
144         
144
145145            gfx->zoom_transpen(
146146            bitmap,
147147            cliprect,
r29404r29405
152152            (width<<16)/16, (height<<16)/16,transparent_pen );
153153
154154         // wrap around y
155         
155
156156            gfx->zoom_transpen(
157157            bitmap,
158158            cliprect,
r29404r29405
264264      if( pri==0 || (attr>>7)==pri )
265265      {
266266         tile += ((attr>>5)&0x3)*256;
267         
267
268268            m_gfxdecode->gfx(0)->transpen(
269269            bitmap,
270270            cliprect,
r29404r29405
297297      sx = videoram[0x1381+i]-64+8+16;
298298      if( attr&1 ) sx += 0x100;
299299
300     
300
301301            m_gfxdecode->gfx(1)->transpen(
302302            bitmap,
303303            cliprect,
trunk/src/mame/video/trackfld.c
r29404r29405
220220      //}
221221
222222
223     
223
224224         m_gfxdecode->gfx(0)->transmask(bitmap,cliprect,
225225         code + m_sprite_bank1 + m_sprite_bank2, color,
226226         flipx, flipy,
r29404r29405
228228         m_palette->transpen_mask(*m_gfxdecode->gfx(0), color, 0));
229229
230230      /* redraw with wraparound */
231     
231
232232         m_gfxdecode->gfx(0)->transmask(bitmap,cliprect,
233233         code + m_sprite_bank1 + m_sprite_bank2, color,
234234         flipx, flipy,
trunk/src/mame/video/k001005.h
r29404r29405
2828   ~k001005_device() {}
2929
3030   static void static_set_palette_tag(device_t &device, const char *tag);
31   
31
3232   void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect);
3333   void swap_buffers();
3434   void preprocess_texture_data(UINT8 *rom, int length, int gticlub);
trunk/src/mame/video/k007121.h
r29404r29405
99   ~k007121_device() {}
1010
1111   static void static_set_palette_tag(device_t &device, const char *tag);
12   
12
1313   DECLARE_READ8_MEMBER( ctrlram_r );
1414   DECLARE_WRITE8_MEMBER( ctrl_w );
1515
trunk/src/mame/video/oneshot.c
r29404r29405
122122      {
123123         for (blocky = 0; blocky < ysize; blocky++)
124124         {
125           
126125                  gfx->transpen(
127126                  bitmap,
128127                  cliprect,
r29404r29405
131130                  0,0,
132131                  xpos + blockx * 8, ypos + blocky * 8, 0);
133132
134           
133
135134                  gfx->transpen(
136135                  bitmap,
137136                  cliprect,
trunk/src/mame/video/cclimber.c
r29404r29405
569569         flipy = !flipy;
570570      }
571571
572      gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
572         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
573573   }
574574}
575575
r29404r29405
606606         flipy = !flipy;
607607      }
608608
609      gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
609         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
610610   }
611611}
612612
r29404r29405
643643         flipy = !flipy;
644644      }
645645
646      gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
646         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 0);
647647   }
648648}
649649
trunk/src/mame/video/amspdwy.c
r29404r29405
1818
1919WRITE8_MEMBER(amspdwy_state::amspdwy_paletteram_w)
2020{
21   m_palette->write(space, offset, UINT8(~data));
21   m_palette->write(space, offset, UINT8(~data));
2222}
2323
2424WRITE8_MEMBER(amspdwy_state::amspdwy_flipscreen_w)
trunk/src/mame/video/namcona1.c
r29404r29405
278278   {
279279      m_tilemap_palette_bank[i] = -1;
280280   }
281   
281
282282   m_bg_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info0),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
283283   m_bg_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info1),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
284284   m_bg_tilemap[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info2),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
trunk/src/mame/video/kaneko16.c
r29404r29405
180180WRITE16_MEMBER(kaneko16_berlwall_state::kaneko16_bg15_reg_w)
181181{
182182   COMBINE_DATA(&m_bg15_reg[0]);
183//   printf("kaneko16_bg15_reg_w %04x\n", m_bg15_reg[0]);
183//  printf("kaneko16_bg15_reg_w %04x\n", m_bg15_reg[0]);
184184   double brt1 = data & 0xff;
185185   brt1 = brt1 / 255.0;
186186
r29404r29405
198198      int flip    =   select & 0x20;
199199      int sx;//, sy;
200200
201   //   if (flip)   select ^= 0x1f;
201   //  if (flip)   select ^= 0x1f;
202202
203203      sx      =   (select & 0x1f) * 256;
204   //   sy      =   0;
204   //  sy      =   0;
205205
206206      const pen_t *pal = m_bgpalette->pens();
207207      UINT16* srcbitmap;
trunk/src/mame/video/stadhero.c
r29404r29405
2323//  machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
2424
2525   flip_screen_set(m_tilegen1->get_flip_state());
26   
26
2727   m_tilegen1->set_bppmultmask(0x8, 0x7);
2828   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
2929   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
trunk/src/mame/video/popeye.c
r29404r29405
5858
5959static const res_net_decode_info popeye_7051_decode_info =
6060{
61   1,      /*  one prom 5 lines */
62   0,      /*  start at 0 */
63   15,      /*  end at 15 (banked) */
61   1,      /*  one prom 5 lines */
62   0,      /*  start at 0 */
63   15,     /*  end at 15 (banked) */
6464   /*  R,   G,   B,  */
65   {   0,   0,   0 },      /*  offsets */
66   {   0,   3,   6 },      /*  shifts */
67   {0x07,0x07,0x03 }          /*  masks */
65   {   0,   0,   0 },      /*  offsets */
66   {   0,   3,   6 },      /*  shifts */
67   {0x07,0x07,0x03 }           /*  masks */
6868};
6969
7070static const res_net_decode_info popeye_7052_decode_info =
7171{
72   2,      /*  there may be two proms needed to construct color */
73   0,      /*  start at 0 */
74   255,   /*  end at 255 */
72   2,      /*  there may be two proms needed to construct color */
73   0,      /*  start at 0 */
74   255,    /*  end at 255 */
7575   /*  R,   G,   B,   R,   G,   B */
76   {   0,   0,   0, 256, 256, 256},      /*  offsets */
77   {   0,   3,   0,   0,  -1,   2},      /*  shifts */
78   {0x07,0x01,0x00,0x00,0x06,0x03}          /*  masks */
76   {   0,   0,   0, 256, 256, 256},        /*  offsets */
77   {   0,   3,   0,   0,  -1,   2},        /*  shifts */
78   {0x07,0x01,0x00,0x00,0x06,0x03}         /*  masks */
7979};
8080
8181static const res_net_info popeye_7051_txt_net_info =
r29404r29405
122122#if USE_NEW_COLOR
123123   for (i = 0; i < 16; i++)
124124   {
125      int prom_offs = i | ((i & 8) << 1);   /* address bits 3 and 4 are tied together */
125      int prom_offs = i | ((i & 8) << 1); /* address bits 3 and 4 are tied together */
126126      int r, g, b;
127127      r = compute_res_net(((color_prom[prom_offs] ^ m_invertmask) >> 0) & 0x07, 0, popeye_7051_txt_net_info);
128128      g = compute_res_net(((color_prom[prom_offs] ^ m_invertmask) >> 3) & 0x07, 1, popeye_7051_txt_net_info);
r29404r29405
344344   m_fg_tilemap->set_transparent_pen(0);
345345
346346   m_lastflip = 0;
347    m_field = 0;
347   m_field = 0;
348348
349    save_item(NAME(m_field));
350    save_item(NAME(m_lastflip));
349   save_item(NAME(m_field));
350   save_item(NAME(m_lastflip));
351351   save_item(NAME(*m_tmpbitmap2));
352352   save_pointer(NAME(m_bitmapram), popeye_bitmapram_size);
353353}
r29404r29405
362362   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
363363   m_fg_tilemap->set_transparent_pen(0);
364364
365    m_lastflip = 0;
366    m_field = 0;
365   m_lastflip = 0;
366   m_field = 0;
367367
368    save_item(NAME(m_field));
368   save_item(NAME(m_field));
369369   save_item(NAME(m_lastflip));
370370   save_item(NAME(*m_tmpbitmap2));
371371   save_pointer(NAME(m_bitmapram), popeye_bitmapram_size);
trunk/src/mame/video/starcrus.c
r29404r29405
164164   org_y = m_s1_y;
165165
166166   /* Draw ship 1 */
167   
167
168168         m_gfxdecode->gfx(8+((m_s1_sprite&0x04)>>2))->opaque(*m_ship1_vid,
169169         clip,
170170         (m_s1_sprite&0x03)^0x03,
r29404r29405
173173         m_s1_x-org_x, m_s1_y-org_y);
174174
175175   /* Draw ship 2 */
176   
176
177177         m_gfxdecode->gfx(10+((m_s2_sprite&0x04)>>2))->opaque(*m_ship2_vid,
178178         clip,
179179         (m_s2_sprite&0x03)^0x03,
r29404r29405
215215   if (m_p1_sprite & 0x08)  /* if p1 is a projectile */
216216   {
217217      /* Draw score/projectile 1 */
218     
218
219219            m_gfxdecode->gfx((m_p1_sprite&0x0c)>>2)->opaque(*m_proj1_vid,
220220            clip,
221221            (m_p1_sprite&0x03)^0x03,
r29404r29405
227227   if (m_p2_sprite & 0x08)  /* if p2 is a projectile */
228228   {
229229      /* Draw score/projectile 2 */
230     
230
231231            m_gfxdecode->gfx(4+((m_p2_sprite&0x0c)>>2))->opaque(*m_proj2_vid,
232232            clip,
233233            (m_p2_sprite&0x03)^0x03,
r29404r29405
269269   org_y = m_s1_y;
270270
271271   /* Draw ship 1 */
272   
272
273273         m_gfxdecode->gfx(8+((m_s1_sprite&0x04)>>2))->opaque(*m_ship1_vid,
274274         clip,
275275         (m_s1_sprite&0x03)^0x03,
r29404r29405
280280   if (m_p1_sprite & 0x08)  /* if p1 is a projectile */
281281   {
282282      /* Draw projectile 1 */
283     
283
284284            m_gfxdecode->gfx((m_p1_sprite&0x0c)>>2)->opaque(*m_proj1_vid,
285285            clip,
286286            (m_p1_sprite&0x03)^0x03,
r29404r29405
292292   if (m_p2_sprite & 0x08)  /* if p2 is a projectile */
293293   {
294294      /* Draw projectile 2 */
295     
295
296296            m_gfxdecode->gfx(4+((m_p2_sprite&0x0c)>>2))->opaque(*m_proj2_vid,
297297            clip,
298298            (m_p2_sprite&0x03)^0x03,
r29404r29405
340340   org_y = m_s2_y;
341341
342342   /* Draw ship 2 */
343   
343
344344         m_gfxdecode->gfx(10+((m_s2_sprite&0x04)>>2))->opaque(*m_ship2_vid,
345345         clip,
346346         (m_s2_sprite&0x03)^0x03,
r29404r29405
351351   if (m_p1_sprite & 0x08)  /* if p1 is a projectile */
352352   {
353353      /* Draw projectile 1 */
354     
354
355355            m_gfxdecode->gfx((m_p1_sprite&0x0c)>>2)->opaque(*m_proj1_vid,
356356            clip,
357357            (m_p1_sprite&0x03)^0x03,
r29404r29405
363363   if (m_p2_sprite & 0x08)  /* if p2 is a projectile */
364364   {
365365      /* Draw projectile 2 */
366     
366
367367            m_gfxdecode->gfx(4+((m_p2_sprite&0x0c)>>2))->opaque(*m_proj2_vid,
368368            clip,
369369            (m_p2_sprite&0x03)^0x03,
r29404r29405
393393   bitmap.fill(0, cliprect);
394394
395395   /* Draw ship 1 */
396   
396
397397         m_gfxdecode->gfx(8+((m_s1_sprite&0x04)>>2))->transpen(bitmap,
398398         cliprect,
399399         (m_s1_sprite&0x03)^0x03,
r29404r29405
403403         0);
404404
405405   /* Draw ship 2 */
406   
406
407407         m_gfxdecode->gfx(10+((m_s2_sprite&0x04)>>2))->transpen(bitmap,
408408         cliprect,
409409         (m_s2_sprite&0x03)^0x03,
r29404r29405
413413         0);
414414
415415   /* Draw score/projectile 1 */
416   
416
417417         m_gfxdecode->gfx((m_p1_sprite&0x0c)>>2)->transpen(bitmap,
418418         cliprect,
419419         (m_p1_sprite&0x03)^0x03,
r29404r29405
423423         0);
424424
425425   /* Draw score/projectile 2 */
426   
426
427427         m_gfxdecode->gfx(4+((m_p2_sprite&0x0c)>>2))->transpen(bitmap,
428428         cliprect,
429429         (m_p2_sprite&0x03)^0x03,
trunk/src/mame/video/nova2001.c
r29404r29405
283283         flipy = !flipy;
284284      }
285285
286      gfx->transpen(bitmap,cliprect,
286         gfx->transpen(bitmap,cliprect,
287287            tile,
288288            color,
289289            flipx, flipy,
r29404r29405
320320         flipy = !flipy;
321321      }
322322
323      gfx->transpen(bitmap,cliprect,
323         gfx->transpen(bitmap,cliprect,
324324            tile,
325325            color,
326326            flipx, flipy,
327327            sx, sy, 0);
328328
329329      // there's no X MSB, so draw with wraparound (fixes title screen)
330      gfx->transpen(bitmap,cliprect,
330         gfx->transpen(bitmap,cliprect,
331331            tile,
332332            color,
333333            flipx, flipy,
trunk/src/mame/video/galaxian.c
r29404r29405
577577      }
578578
579579      /* draw */
580     
580
581581            m_gfxdecode->gfx(1)->transpen(bitmap,clip,
582582            code, color,
583583            flipx, flipy,
trunk/src/mame/video/firetrk.c
r29404r29405
262262      y = 104;
263263   }
264264
265    m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, x, y, 0);
265      m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, x, y, 0);
266266}
267267
268268
r29404r29405
274274   int flip_x = *m_car_rot & 0x04;
275275   int flip_y = *m_car_rot & 0x08;
276276
277    m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, 144, 104, 0);
277      m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, 144, 104, 0);
278278}
279279
280280
r29404r29405
303303      y = 104;
304304   }
305305
306    m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, x, y, 0);
306      m_gfxdecode->gfx(gfx_bank)->transpen(bitmap,cliprect, code, color, flip_x, flip_y, x, y, 0);
307307}
308308
309309
r29404r29405
313313   int i;
314314
315315   for (i = 0; i < count; i++)
316      m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, alpha_ram[i], 0, 0, 0, x, i * height);
316         m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, alpha_ram[i], 0, 0, 0, x, i * height);
317317}
318318
319319
trunk/src/mame/video/strnskil.c
r29404r29405
107107      if (sx > 248)
108108         sx = sx - 256;
109109
110     
110
111111         m_gfxdecode->gfx(1)->transmask(bitmap,cliprect,
112112         code, color,
113113         flipx, flipy,
trunk/src/mame/video/k053244_k053245.h
r29404r29405
7070
7171   required_device<gfxdecode_device> m_gfxdecode;
7272   required_device<palette_device> m_palette;
73   
73
7474   DECLARE_READ16_MEMBER( k053244_reg_word_r );    // OBJSET0 debug handler
7575};
7676
trunk/src/mame/video/ppu2c0x.c
r29404r29405
930930   }
931931
932932   m_draw_phase = PPU_DRAW_OAM;
933   
933
934934   /* if sprites are on, draw them, but we call always to process them */
935935   draw_sprites(line_priority);
936936
937937   m_draw_phase = PPU_DRAW_BG;
938   
938
939939   /* done updating, whew */
940940   g_profiler.stop();
941941}
trunk/src/mame/video/segaic24.h
r29404r29405
1414
1515#define MCFG_S24TILE_DEVICE_GFXDECODE(_gfxtag) \
1616   segas24_tile::static_set_gfxdecode_tag(*device, "^" _gfxtag);
17   
17
1818#define MCFG_S24TILE_DEVICE_PALETTE(_palette_tag) \
1919   segas24_tile::static_set_palette_tag(*device, "^" _palette_tag);
20   
20
2121class segas24_tile : public device_t
2222{
2323   friend class segas24_tile_config;
trunk/src/mame/video/ppu2c0x.h
r29404r29405
180180   int is_sprite_8x16() { return m_regs[PPU_CONTROL0] & PPU_CONTROL0_SPRITE_SIZE; };
181181   int get_draw_phase() { return m_draw_phase; };
182182   int get_tilenum() { return m_tilecount; };
183   
183
184184   //27/12/2002 (HACK!)
185185   void set_latch( ppu2c0x_latch_delegate cb ) { m_latch = cb; m_latch.bind_relative_to(*owner()); };
186186
r29404r29405
213213   int                         m_scan_scale;           /* scan scale */
214214   int                         m_scanlines_per_frame;  /* number of scanlines per frame */
215215   int                         m_security_value;       /* 2C05 protection */
216   int                         m_tilecount;         /* MMC5 can change attributes to subsets of the 34 visibile tiles */
217   int                         m_draw_phase;         /* MMC5 uses different regs for BG and OAM */
216   int                         m_tilecount;            /* MMC5 can change attributes to subsets of the 34 visibile tiles */
217   int                         m_draw_phase;           /* MMC5 uses different regs for BG and OAM */
218218   ppu2c0x_latch_delegate      m_latch;
219219
220220   // timers
r29404r29405
223223   emu_timer                   *m_scanline_timer;      /* scanline timer */
224224
225225   const char        *m_cpu_tag;
226   
226
227227private:
228228   static const device_timer_id TIMER_HBLANK = 0;
229229   static const device_timer_id TIMER_NMI = 1;
r29404r29405
231231
232232   inline UINT8 readbyte(offs_t address);
233233   inline void writebyte(offs_t address, UINT8 data);
234   
234
235235};
236236
237237class ppu2c02_device : public ppu2c0x_device {
trunk/src/mame/video/mrflea.c
r29404r29405
8888      {
8989         int tile_number = base + source[0] + source[0x400] * 0x100;
9090         source++;
91         
91
9292            gfx->opaque(bitmap,cliprect,
9393            tile_number,
9494            0, /* color */
trunk/src/mame/video/hyperspt.c
r29404r29405
148148
149149      sy += 1;
150150
151     
151
152152         m_gfxdecode->gfx(0)->transmask(bitmap,cliprect,
153153         code, color,
154154         flipx, flipy,
r29404r29405
157157
158158      /* redraw with wraparound */
159159
160     
160
161161         m_gfxdecode->gfx(0)->transmask(bitmap,cliprect,
162162         code, color,
163163         flipx, flipy,
trunk/src/mame/video/solomon.c
r29404r29405
8686         flipy = !flipy;
8787      }
8888
89     
89
9090         m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
9191         code, color,
9292         flipx, flipy,
trunk/src/mame/video/goindol.c
r29404r29405
9999         tile += tile;
100100         palette = sprite_ram[offs + 2] >> 3;
101101
102         
102
103103                  m_gfxdecode->gfx(gfxbank)->transpen(bitmap,cliprect,
104104                  tile,
105105                  palette,
106106                  flip_screen(),flip_screen(),
107107                  sx,sy, 0);
108         
108
109109                  m_gfxdecode->gfx(gfxbank)->transpen(bitmap,cliprect,
110110                  tile+1,
111111                  palette,
trunk/src/mame/video/m10.c
r29404r29405
130130
131131   for (i = 0; i < 4; i++)
132132      if (m_flip)
133          m_back_gfx->opaque(bitmap,cliprect, i, color[i], 1, 1, 31 * 8 - xpos[i], 0);
133            m_back_gfx->opaque(bitmap,cliprect, i, color[i], 1, 1, 31 * 8 - xpos[i], 0);
134134      else
135          m_back_gfx->opaque(bitmap,cliprect, i, color[i], 0, 0, xpos[i], 0);
135            m_back_gfx->opaque(bitmap,cliprect, i, color[i], 0, 0, xpos[i], 0);
136136
137137   if (m_bottomline)
138138   {
trunk/src/mame/video/bwing.c
r29404r29405
261261
262262      // single/double
263263      if (!(attrib & 0x10))
264          gfx->transpen(bmp,clip, code, color, fx, fy, x, y, 0);
264            gfx->transpen(bmp,clip, code, color, fx, fy, x, y, 0);
265265      else
266          gfx->zoom_transpen(bmp,clip, code, color, fx, fy, x, y, 1<<16, 2<<16, 0);
266            gfx->zoom_transpen(bmp,clip, code, color, fx, fy, x, y, 1<<16, 2<<16, 0);
267267   }
268268}
269269
trunk/src/mame/video/segaic16.h
r29404r29405
9898
9999   // static configuration
100100   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
101   
101
102102   UINT8 segaic16_display_enable;
103103   UINT16 *segaic16_tileram_0;
104104   UINT16 *segaic16_textram_0;
trunk/src/mame/video/fcombat.c
r29404r29405
174174         else
175175            code &= ~0x10, code2 |= 0x10;
176176
177          gfx->transpen(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(), 0);
177            gfx->transpen(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(), 0);
178178      }
179179
180180      if(flags&0x10)
181181      {
182          gfx->transpen(bitmap,cliprect, code2 + 16, color, xflip, yflip, x, y + gfx->height(), 0);
183          gfx->transpen(bitmap,cliprect, code2 + 16 * 2, color, xflip, yflip, x, y + 2 * gfx->height(), 0);
184          gfx->transpen(bitmap,cliprect, code2 + 16 * 3, color, xflip, yflip, x, y + 3 * gfx->height(), 0);
182            gfx->transpen(bitmap,cliprect, code2 + 16, color, xflip, yflip, x, y + gfx->height(), 0);
183            gfx->transpen(bitmap,cliprect, code2 + 16 * 2, color, xflip, yflip, x, y + 2 * gfx->height(), 0);
184            gfx->transpen(bitmap,cliprect, code2 + 16 * 3, color, xflip, yflip, x, y + 3 * gfx->height(), 0);
185185
186186      }
187187
188      gfx->transpen(bitmap,cliprect, code, color, xflip, yflip, x, y, 0);
188         gfx->transpen(bitmap,cliprect, code, color, xflip, yflip, x, y, 0);
189189
190190      if (doubled) i += 4;
191191   }
trunk/src/mame/video/sbasketb.c
r29404r29405
154154            flipy = !flipy;
155155         }
156156
157         
157
158158            m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
159159            code, color,
160160            flipx, flipy,
trunk/src/mame/video/gaelco2.c
r29404r29405
377377
378378               /* normal sprite, pen 0 transparent */
379379               if (color_effect == 0){
380                  gfx->transpen(bitmap,cliprect, number,
380                     gfx->transpen(bitmap,cliprect, number,
381381                     color, xflip, yflip,
382382                     ((sx + ex*16) & 0x3ff) + spr_x_adjust,
383383                     ((sy + ey*16) & 0x1ff), 0);
trunk/src/mame/video/ssozumo.c
r29404r29405
160160            flipy = !flipy;
161161         }
162162
163         
163
164164            m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
165165            code, color,
166166            flipx, flipy,
trunk/src/mame/video/wecleman.c
r29404r29405
7474
7575void wecleman_state::get_sprite_info()
7676{
77
7877   const pen_t *base_pal = m_palette->pens();
7978   UINT8 *base_gfx = memregion("gfx1")->base();
8079   int gfx_max     = memregion("gfx1")->bytes();
trunk/src/mame/video/tc0080vco.h
r29404r29405
8484#define MCFG_TC0080VCO_ADD(_tag, _interface) \
8585   MCFG_DEVICE_ADD(_tag, TC0080VCO, 0) \
8686   MCFG_DEVICE_CONFIG(_interface)
87   
87
8888#define MCFG_TC0080VCO_GFXDECODE(_gfxtag) \
8989   tc0080vco_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
9090
trunk/src/mame/video/lastduel.c
r29404r29405
232232         flipy = !flipy;
233233      }
234234
235     
235
236236            m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
237237            code,
238238            color,
trunk/src/mame/video/alpha68k.c
r29404r29405
345345         fy = data & 0x4000;
346346         color = color_prom[tile << 1 | data >> 15];
347347
348          gfx->transpen(bitmap,cliprect, tile, color, 0, fy, mx, my, 0);
348            gfx->transpen(bitmap,cliprect, tile, color, 0, fy, mx, my, 0);
349349
350350         my = (my + 8) & 0xff;
351351      }
trunk/src/mame/video/k054338.c
r29404r29405
309309}
310310
311311void k054338_device::update_all_shadows( int rushingheroes_hack, palette_device *palette )
312{   
312{
313313   int i, d;
314314   int noclip = m_regs[K338_REG_CONTROL] & K338_CTL_CLIPSL;
315315
trunk/src/mame/video/namcos22.c
r29404r29405
16231623
16241624   int base = m_spriteram[0] & 0xffff; // alpinesa/alpinr2b
16251625   int num_sprites = ((m_spriteram[1] >> 16) - base) + 1;
1626   
1626
16271627   // airco22b doesn't use spriteset #1
16281628   if (m_gametype == NAMCOS22_AIR_COMBAT22)
16291629      num_sprites = 0;
trunk/src/mame/video/exerion.c
r29404r29405
385385         else
386386            code &= ~0x10, code2 |= 0x10;
387387
388          gfx->transmask(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(),
388            gfx->transmask(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(),
389389               m_palette->transpen_mask(*gfx, color, 0x10));
390390      }
391391
392      gfx->transmask(bitmap,cliprect, code, color, xflip, yflip, x, y,
392         gfx->transmask(bitmap,cliprect, code, color, xflip, yflip, x, y,
393393            m_palette->transpen_mask(*gfx, color, 0x10));
394394
395395      if (doubled) i += 4;
trunk/src/mame/video/yiear.c
r29404r29405
129129         sy++;   /* fix title screen & garbage at the bottom of the screen */
130130      }
131131
132     
132
133133         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
134134         code, color,
135135         flipx, flipy,
trunk/src/mame/video/taitoair.c
r29404r29405
163163                     flipy ^= 0x0080;
164164                  }
165165
166                 
166
167167                           m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
168168                           tile,
169169                           color,
trunk/src/mame/video/angelkds.c
r29404r29405
161161
162162      if (enable & enable_n)
163163      {
164         
165164               gfx->transpen(
166165               bitmap,
167166               cliprect,
r29404r29405
172171               );
173172         /* wraparound */
174173         if (xpos > 240)
175           
174
176175                  gfx->transpen(
177176                  bitmap,
178177                  cliprect,
r29404r29405
184183         /* wraparound */
185184         if (ypos > 240)
186185         {
187           
188186                  gfx->transpen(
189187                  bitmap,
190188                  cliprect,
r29404r29405
195193                  );
196194            /* wraparound */
197195            if (xpos > 240)
198               
196
199197                     gfx->transpen(
200198                     bitmap,
201199                     cliprect,
trunk/src/mame/video/tunhunt.c
r29404r29405
333333      {
334334         for( sy=0; sy<256; sy+=16 )
335335         {
336           
337336               m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
338337               picture_code,
339338               0, /* color */
r29404r29405
358357           vstop       = 0x00
359358
360359   */
361   
360
362361         m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
363362         picture_code,
364363         0, /* color */
trunk/src/mame/video/k007420.c
r29404r29405
3333void k007420_device::device_start()
3434{
3535   // bind the init function
36    m_callback.bind_relative_to(*owner());
37   
36   m_callback.bind_relative_to(*owner());
37
3838   m_ram = auto_alloc_array_clear(machine(), UINT8, 0x200);
3939
4040   save_pointer(NAME(m_ram), 0x200);
trunk/src/mame/video/k007420.h
r29404r29405
1111   ~k007420_device() {}
1212
1313   static void static_set_palette_tag(device_t &device, const char *tag);
14   static void static_set_bank_limit(device_t &device, int limit) { downcast<k007420_device &>(device).m_banklimit = limit; }
14   static void static_set_bank_limit(device_t &device, int limit) { downcast<k007420_device &>(device).m_banklimit = limit; }
1515   static void static_set_callback(device_t &device, k007420_delegate callback) { downcast<k007420_device &>(device).m_callback = callback; }
1616
1717   DECLARE_READ8_MEMBER( read );
r29404r29405
4848   k007420_device::static_set_callback(*device, k007420_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
4949
5050// function definition for a callback
51#define K007420_CALLBACK_MEMBER(_name)     void _name(int *code, int *color)   
51#define K007420_CALLBACK_MEMBER(_name)     void _name(int *code, int *color)
5252
5353
5454#endif
trunk/src/mame/video/ninjakd2.c
r29404r29405
384384            {
385385               int const tile = code ^ (x << big_xshift) ^ (y << big_yshift);
386386
387                gfx->transpen(bitmap,bitmap.cliprect(),
387                  gfx->transpen(bitmap,bitmap.cliprect(),
388388                     tile,
389389                     color,
390390                     flipx,flipy,
trunk/src/mame/video/raiden.c
r29404r29405
133133         flipx = !flipx;
134134      }
135135
136      gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 15);
136         gfx->transpen(bitmap,cliprect, code, color, flipx, flipy, x, y, 15);
137137   }
138138}
139139
trunk/src/mame/video/jalblend.c
r29404r29405
110110      x_index_base = flipx ? gfx->width()-1 : 0;
111111      y_index = flipy ? gfx->height()-1 : 0;
112112
113      // start coordinates
113      // start coordinates
114114      sx = offsx;
115115      sy = offsy;
116116
trunk/src/mame/video/bfm_adr2.c
r29404r29405
228228   m_palette->set_pen_color(12,rgb_t(0x80,0x00,0x00));
229229   m_palette->set_pen_color(13,rgb_t(0x80,0x00,0x80));
230230   m_palette->set_pen_color(14,rgb_t(0x80,0x80,0x00));
231   m_palette->set_pen_color(15,rgb_t(0x80,0x80,0x80));   
231   m_palette->set_pen_color(15,rgb_t(0x80,0x80,0x80));
232232}
233233
234234// video update ///////////////////////////////////////////////////////////
trunk/src/mame/video/bfm_adr2.h
r29404r29405
88   bfm_adder2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
99
1010   static void static_set_palette_tag(device_t &device, const char *tag);
11   
11
1212   TILE_GET_INFO_MEMBER( get_tile0_info );
1313   TILE_GET_INFO_MEMBER( get_tile1_info );
1414   UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/video/taito_o.c
r29404r29405
118118                     flipy ^= 0x0080;
119119                  }
120120
121                 
121
122122                           m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
123123                           tile,
124124                           color,
trunk/src/mame/video/cheekyms.c
r29404r29405
123123         if (!flip)
124124            code++;
125125
126          gfx->transpen(bitmap,cliprect, code, color, 0, 0, x, y, 0);
126            gfx->transpen(bitmap,cliprect, code, color, 0, 0, x, y, 0);
127127      }
128128      else
129129      {
130130         if (m_spriteram[offs + 0] & 0x02)
131131         {
132             gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0,        x, y, 0);
133             gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, 0x10 + x, y, 0);
132               gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0,        x, y, 0);
133               gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, 0x10 + x, y, 0);
134134         }
135135         else
136136         {
137             gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0, x,        y, 0);
138             gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, x, 0x10 + y, 0);
137               gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0, x,        y, 0);
138               gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, x, 0x10 + y, 0);
139139         }
140140      }
141141   }
trunk/src/mame/video/argus.c
r29404r29405
10021002         flipx = !flipx;
10031003         flipy = !flipy;
10041004      }
1005     
1005
10061006      fx = flipx;
10071007      fy = flipy;
10081008
trunk/src/mame/video/carpolo.c
r29404r29405
205205
206206   x = 240 - x;
207207   y = 240 - y;
208   
208
209209   m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
210210         remapped_code, col,
211211         0, flipy,
trunk/src/mame/video/deco16ic.h
r29404r29405
3939public:
4040   deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4141   ~deco16ic_device() {}
42   
42
4343   // static configuration
4444   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
4545   static void static_set_palette_tag(device_t &device, const char *tag);
46   
4746
47
4848   DECLARE_WRITE16_MEMBER( pf1_data_w );
4949   DECLARE_WRITE16_MEMBER( pf2_data_w );
5050
trunk/src/tools/unidasm.c
r29404r29405
231231   { "f8",         _8bit,  0, CPU_DISASSEMBLE_NAME(f8) },
232232   { "g65816",     _8bit,  0, CPU_DISASSEMBLE_NAME(g65816_generic) },
233233   { "h6280",      _8bit,  0, CPU_DISASSEMBLE_NAME(h6280) },
234   //   { "h8",         _16be,  0, CPU_DISASSEMBLE_NAME(h8) },
235   //   { "h8_24",      _16be,  0, CPU_DISASSEMBLE_NAME(h8_24) },
236   //   { "h8_32",      _16be,  0, CPU_DISASSEMBLE_NAME(h8_32) },
234   //  { "h8",         _16be,  0, CPU_DISASSEMBLE_NAME(h8) },
235   //  { "h8_24",      _16be,  0, CPU_DISASSEMBLE_NAME(h8_24) },
236   //  { "h8_32",      _16be,  0, CPU_DISASSEMBLE_NAME(h8_32) },
237237   { "hc11",       _8bit,  0, CPU_DISASSEMBLE_NAME(mb88) },
238238   { "hcd62121",   _16be,  0, CPU_DISASSEMBLE_NAME(hcd62121) },
239239   { "hd61700",    _8bit,  0, CPU_DISASSEMBLE_NAME(hd61700) },
trunk/src/tools/nltool.c
r29404r29405
5959
6060void CLIB_DECL logerror(const char *format, ...)
6161{
62    va_list arg;
63    va_start(arg, format);
64    vprintf(format, arg);
65    va_end(arg);
62   va_list arg;
63   va_start(arg, format);
64   vprintf(format, arg);
65   va_end(arg);
6666}
6767
6868struct options_entry oplist[] =
6969{
7070   { "time_to_run;t",   "1.0", OPTION_FLOAT,   "time to run the emulation (seconds)" },
71    { "logs;l",          "",    OPTION_STRING,  "colon separated list of terminals to log" },
71   { "logs;l",          "",    OPTION_STRING,  "colon separated list of terminals to log" },
7272   { "f",               "-",   OPTION_STRING,  "file to process (default is stdin)" },
7373   { "listdevices;ld",  "",    OPTION_BOOLEAN, "list all devices available for use" },
7474   { "help;h",          "0",   OPTION_BOOLEAN, "display help" },
r29404r29405
123123
124124   void init()
125125   {
126        m_setup = new netlist_setup_t(*this);
127        this->init_object(*this, "netlist");
128        m_setup->init();
126      m_setup = new netlist_setup_t(*this);
127      this->init_object(*this, "netlist");
128      m_setup->init();
129129   }
130130
131    void read_netlist(const char *buffer)
132    {
133
131   void read_netlist(const char *buffer)
132   {
134133      // read the netlist ...
135134
136        netlist_sources_t sources;
135      netlist_sources_t sources;
137136
138        sources.add(netlist_source_t(buffer));
139        sources.parse(*m_setup,"");
137      sources.add(netlist_source_t(buffer));
138      sources.parse(*m_setup,"");
140139      //m_setup->parse(buffer);
141140      log_setup();
142141
r29404r29405
147146      this->reset();
148147   }
149148
150    void log_setup()
151    {
152        NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
153        nl_util::pstring_list ll = nl_util::split(m_logs, ":");
154        for (int i=0; i < ll.count(); i++)
155        {
156            netlist_device_t *nc = m_setup->factory().new_device_by_classname("nld_log", *m_setup);
157            pstring name = "log_" + ll[i];
158            m_setup->register_dev(nc, name);
159            m_setup->register_link(name + ".I", ll[i]);
160        }
161    }
149   void log_setup()
150   {
151      NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
152      nl_util::pstring_list ll = nl_util::split(m_logs, ":");
153      for (int i=0; i < ll.count(); i++)
154      {
155         netlist_device_t *nc = m_setup->factory().new_device_by_classname("nld_log", *m_setup);
156         pstring name = "log_" + ll[i];
157         m_setup->register_dev(nc, name);
158         m_setup->register_link(name + ".I", ll[i]);
159      }
160   }
162161
163    pstring m_logs;
162   pstring m_logs;
164163protected:
165164
166165   void verror(const loglevel_e level, const char *format, va_list ap) const
167166   {
168       switch (level)
169       {
170           case NL_LOG:
171           case NL_WARNING:
172                vprintf(format, ap);
173                printf("\n");
174                break;
175           case NL_ERROR:
176               vprintf(format, ap);
177                printf("\n");
178               throw;
179               break;
180       }
167      switch (level)
168      {
169         case NL_LOG:
170         case NL_WARNING:
171            vprintf(format, ap);
172            printf("\n");
173            break;
174         case NL_ERROR:
175            vprintf(format, ap);
176            printf("\n");
177            throw;
178            break;
179      }
181180   }
182181
183182private:
r29404r29405
200199
201200static void run(core_options &opts)
202201{
203    netlist_tool_t nt;
204    osd_ticks_t t = osd_ticks();
202   netlist_tool_t nt;
203   osd_ticks_t t = osd_ticks();
205204
206    nt.init();
207    nt.m_logs = opts.value("l");
208    nt.read_netlist(filetobuf(opts.value("f")));
209    double ttr = opts.float_value("t");
205   nt.init();
206   nt.m_logs = opts.value("l");
207   nt.read_netlist(filetobuf(opts.value("f")));
208   double ttr = opts.float_value("t");
210209
211    printf("startup time ==> %5.3f\n", (double) (osd_ticks() - t) / (double) osd_ticks_per_second() );
212    printf("runnning ...\n");
213    t = osd_ticks();
210   printf("startup time ==> %5.3f\n", (double) (osd_ticks() - t) / (double) osd_ticks_per_second() );
211   printf("runnning ...\n");
212   t = osd_ticks();
214213
215    nt.process_queue(netlist_time::from_double(ttr));
214   nt.process_queue(netlist_time::from_double(ttr));
216215
217    double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
218    printf("%f seconds emulation took %f real time ==> %5.2f%%\n", ttr, emutime, ttr/emutime*100.0);
216   double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
217   printf("%f seconds emulation took %f real time ==> %5.2f%%\n", ttr, emutime, ttr/emutime*100.0);
219218}
220219
221220static void listdevices()
222221{
223    netlist_tool_t nt;
224    nt.init();
225    const netlist_factory_t::list_t &list = nt.setup().factory().list();
222   netlist_tool_t nt;
223   nt.init();
224   const netlist_factory_t::list_t &list = nt.setup().factory().list();
226225
227    nt.setup().start_devices();
228    nt.setup().resolve_inputs();
226   nt.setup().start_devices();
227   nt.setup().resolve_inputs();
229228
230    for (int i=0; i < list.count(); i++)
231    {
232        pstring out = pstring::sprintf("%-20s %s(<id>", list[i]->classname().cstr(),
233                list[i]->name().cstr() );
234        pstring terms("");
229   for (int i=0; i < list.count(); i++)
230   {
231      pstring out = pstring::sprintf("%-20s %s(<id>", list[i]->classname().cstr(),
232            list[i]->name().cstr() );
233      pstring terms("");
235234
236        net_device_t_base_factory *f = list[i];
237        netlist_device_t *d = f->Create();
238        d->init(nt, pstring::sprintf("dummy%d", i));
239        d->start_dev();
235      net_device_t_base_factory *f = list[i];
236      netlist_device_t *d = f->Create();
237      d->init(nt, pstring::sprintf("dummy%d", i));
238      d->start_dev();
240239
241        // get the list of terminals ...
242        for (int j=0; j < d->m_terminals.count(); j++)
243        {
244            pstring inp = d->m_terminals[j];
245            if (inp.startsWith(d->name() + "."))
246                inp = inp.substr(d->name().len() + 1);
247            terms += "," + inp;
248        }
240      // get the list of terminals ...
241      for (int j=0; j < d->m_terminals.count(); j++)
242      {
243         pstring inp = d->m_terminals[j];
244         if (inp.startsWith(d->name() + "."))
245            inp = inp.substr(d->name().len() + 1);
246         terms += "," + inp;
247      }
249248
250        if (list[i]->param_desc().startsWith("+"))
251        {
252            out += "," + list[i]->param_desc().substr(1);
253            terms = "";
254        }
255        else if (list[i]->param_desc() == "-")
256        {
257            /* no params at all */
258        }
259        else
260        {
261            out += "," + list[i]->param_desc();
262        }
263        out += ")";
264        printf("%s\n", out.cstr());
265        if (terms != "")
266            printf("Terminals: %s\n", terms.substr(1).cstr());
267    }
249      if (list[i]->param_desc().startsWith("+"))
250      {
251         out += "," + list[i]->param_desc().substr(1);
252         terms = "";
253      }
254      else if (list[i]->param_desc() == "-")
255      {
256         /* no params at all */
257      }
258      else
259      {
260         out += "," + list[i]->param_desc();
261      }
262      out += ")";
263      printf("%s\n", out.cstr());
264      if (terms != "")
265         printf("Terminals: %s\n", terms.substr(1).cstr());
266   }
268267}
269268
270269/*-------------------------------------------------
r29404r29405
291290      return 1;
292291   }
293292
294    if (opts.bool_value("ld"))
295    {
296        listdevices();
297    }
298    else
299    {
300        run(opts);
301    }
293   if (opts.bool_value("ld"))
294   {
295      listdevices();
296   }
297   else
298   {
299      run(opts);
300   }
302301
303302   return 0;
304303}
trunk/src/tools/srcclean.c
r29404r29405
3333
3434static int le_convert(char *buffer, int size)
3535{
36    char *pos;
37    char *end = buffer + size;
36   char *pos;
37   char *end = buffer + size;
3838
39    /* brute force */
40    *end = 0;
41    pos = strchr(buffer, 0x0d);
42    while (pos != NULL)
43    {
44        memmove(pos, pos+1,end - pos + 1);
45        size--;
46        buffer = pos + 1;
47        pos = strchr(buffer, 0x0d);
48    }
49    return size;
39   /* brute force */
40   *end = 0;
41   pos = strchr(buffer, 0x0d);
42   while (pos != NULL)
43   {
44      memmove(pos, pos+1,end - pos + 1);
45      size--;
46      buffer = pos + 1;
47      pos = strchr(buffer, 0x0d);
48   }
49   return size;
5050}
5151
5252/***************************************************************************
r29404r29405
5555
5656int main(int argc, char *argv[])
5757{
58    bool unix_le = false;
58   bool unix_le = false;
5959   int removed_tabs = 0;
6060   int added_tabs = 0;
6161   int removed_spaces = 0;
6262   int removed_continuations = 0;
63    int fixed_dos_style = 0;
63   int fixed_dos_style = 0;
6464   int fixed_mac_style = 0;
6565   int fixed_nix_style = 0;
6666   int added_newline = 0;
r29404r29405
8585   bool dry_run = false;
8686
8787   while (arg_found && argc > 1) {
88       if (strcmp(argv[1], "-u") == 0)
89       {
90           unix_le = true;
91           argc--;
92           argv++;
93       }
94       else if (strcmp(argv[1], "-d") == 0)
95        {
96            dry_run = true;
97            argc--;
98            argv++;
99        }
100       else
101           arg_found = false;
88      if (strcmp(argv[1], "-u") == 0)
89      {
90         unix_le = true;
91         argc--;
92         argv++;
93      }
94      else if (strcmp(argv[1], "-d") == 0)
95      {
96         dry_run = true;
97         argc--;
98         argv++;
99      }
100      else
101         arg_found = false;
102102
103103   }
104104
105    /* print usage info */
106    if (argc < 2)
107    {
108        printf("Usage:\nsrcclean [-u] [-d] <file>\n");
109        return 0;
110    }
105   /* print usage info */
106   if (argc < 2)
107   {
108      printf("Usage:\nsrcclean [-u] [-d] <file>\n");
109      return 0;
110   }
111111
112112   /* read the file */
113113   file = fopen(argv[1], "rb");
r29404r29405
121121
122122   /* check whether we have dos line endings and are in unix mode */
123123   if (unix_le && (strchr((char *) original, 0x0d) != NULL))
124       fixed_dos_style = 1;
124      fixed_dos_style = 1;
125125
126126   /* determine if we are a C file */
127127   ext = strrchr(argv[1], '.');
r29404r29405
245245         }
246246
247247         /* insert a proper CR/LF */
248          modified[dst++] = 0x0d;
248         modified[dst++] = 0x0d;
249249         modified[dst++] = 0x0a;
250250         col = 0;
251251
252252         /* skip over any LF in the source file */
253253         if (ch == 0x0d && original[src] == 0x0a)
254                src++;
254            src++;
255255         else if (ch == 0x0a)
256256            fixed_nix_style = 1;
257257         else
r29404r29405
367367      }
368368   }
369369
370    /* convert to unix_le if requested */
370   /* convert to unix_le if requested */
371371
372    if (unix_le)
373        dst = le_convert((char *) modified, dst);
372   if (unix_le)
373      dst = le_convert((char *) modified, dst);
374374
375375   /* if the result == original, skip it */
376376   if (dst != bytes || memcmp(original, modified, bytes))
r29404r29405
386386      if (hichars) printf(" fixed %d high-ASCII char(s)", hichars);
387387      if (fixed_nix_style && !unix_le) printf(" fixed *nix-style line-ends");
388388      if (fixed_mac_style) printf(" fixed Mac-style line-ends");
389        if (fixed_dos_style) printf(" fixed Dos-style line-ends");
389      if (fixed_dos_style) printf(" fixed Dos-style line-ends");
390390      printf("\n");
391391
392392      if (!dry_run)
393393      {
394           /* write the file */
395           file = fopen(argv[1], "wb");
396           fwrite(modified, 1, dst, file);
397           fclose(file);
394         /* write the file */
395         file = fopen(argv[1], "wb");
396         fwrite(modified, 1, dst, file);
397         fclose(file);
398398      }
399399   }
400400
trunk/src/osd/osdcore.h
r29404r29405
848848
849849        an allocated pointer to an osd_directory_entry representing
850850        info on the path; even if the file does not exist.
851      free with osd_free()
851        free with osd_free()
852852
853853-----------------------------------------------------------------------------*/
854854osd_directory_entry *osd_stat(const char *path);
trunk/src/osd/osdcomm.h
r29404r29405
113113
114114/* pointer-sized values */
115115#ifdef PTR64
116typedef UINT64                        FPTR;
116typedef UINT64                              FPTR;
117117#else
118typedef UINT32                        FPTR;
118typedef UINT32                              FPTR;
119119#endif
120120
121121
trunk/src/osd/sdl/gl_shader_mgr.c
r29404r29405
6868};
6969
7070static GLhandleARB glsl_mamebm_vsh_shader[GLSL_VERTEX_SHADER_MAX_NUMBER+9] =
71{
72   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
71{
72   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7373}; /* general, custom0-9 */
7474
7575static GLhandleARB glsl_mamebm_fsh_shader [GLSL_SHADER_FEAT_MAX_NUMBER+9] =
r29404r29405
8383};
8484
8585static GLhandleARB glsl_scrn_vsh_shader[10] =
86{
87   0, 0, 0, 0, 0, 0, 0, 0, 0, 0
86{
87   0, 0, 0, 0, 0, 0, 0, 0, 0, 0
8888}; /* custom0-9 */
8989
9090static GLhandleARB glsl_scrn_fsh_shader [10] =
91{
92   0, 0, 0, 0, 0, 0, 0, 0, 0, 0
91{
92   0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9393}; /* rgb32: custom0-9 */
9494
9595const char * glsl_shader_get_filter_name_mamebm(int glslShaderFeature)
trunk/src/osd/sdl/drawogl.c
r29404r29405
30913091   //FIXME: Handled in drawogl_window_draw as well
30923092   sdl->blittimer = 3;
30933093}
3094
trunk/src/osd/sdl/blit13.h
r29404r29405
5454
5555#define OP_RGB32PAL_ARGB32(_src) \
5656   (texsource->palette[0x200 + (((_src) >> 16) & 0xff) ] | \
57    texsource->palette[0x100 + (((_src) >> 8) & 0xff) ] | \
58    texsource->palette[((_src) & 0xff) ] | 0xff000000)
57      texsource->palette[0x100 + (((_src) >> 8) & 0xff) ] | \
58      texsource->palette[((_src) & 0xff) ] | 0xff000000)
5959
6060#define OP_PAL16_ARGB32(_src) (0xff000000 | texsource->palette[_src])
6161
trunk/src/osd/sdl/window.c
r29404r29405
620620         SDL_ShowCursor(SDL_ENABLE);
621621         if (SDL_GetWindowGrab(window->sdl_window ))
622622            SDL_SetWindowGrab(window->sdl_window, SDL_FALSE);
623           SDL_SetRelativeMouseMode(SDL_FALSE);
623         SDL_SetRelativeMouseMode(SDL_FALSE);
624624      }
625625      else
626626      {
627627         SDL_ShowCursor(SDL_DISABLE);
628628         if (!SDL_GetWindowGrab(window->sdl_window))
629629            SDL_SetWindowGrab(window->sdl_window, SDL_TRUE);
630            SDL_SetRelativeMouseMode(SDL_TRUE);
630         SDL_SetRelativeMouseMode(SDL_TRUE);
631631      }
632632      SDL_SetCursor(NULL); // Force an update in case the underlying driver has changed visibility
633633   }
trunk/src/emu/rendlay.c
r29404r29405
667667      m_numsymbolsvisible = xml_get_attribute_int_with_subst(machine, compnode, "numsymbolsvisible", 3);
668668      m_reelreversed = xml_get_attribute_int_with_subst(machine, compnode, "reelreversed", 0);
669669      m_beltreel = xml_get_attribute_int_with_subst(machine, compnode, "beltreel", 0);
670     
670
671671   }
672672
673673   // led7seg nodes
r29404r29405
10041004      render_font *font = machine.render().font_alloc("default");
10051005      float aspect = 1.0f;
10061006      INT32 width;
1007     
10081007
1008
10091009      int curry = 0;
10101010      int num_shown = m_numsymbolsvisible;
10111011
r29404r29405
11091109                           int effx = curx + x + chbounds.min_x;
11101110                           if (effx >= bounds.min_x && effx <= bounds.max_x)
11111111                           {
1112                              UINT32 spix = rgb_t(src[x]).a();
1112                              UINT32 spix = rgb_t(src[x]).a();
11131113                              if (spix != 0)
11141114                              {
11151115                                 rgb_t dpix = d[effx];
r29404r29405
12591259                        int effx = basex + curx + x;
12601260                        if (effx >= bounds.min_x && effx <= bounds.max_x)
12611261                        {
1262                           UINT32 spix = rgb_t(src[x]).a();
1262                           UINT32 spix = rgb_t(src[x]).a();
12631263                           if (spix != 0)
12641264                           {
12651265                              rgb_t dpix = d[effx];
r29404r29405
23092309//-------------------------------------------------
23102310
23112311
2312render_container *layout_view::item::screen_container(running_machine &machine) const
2313{
2314   return (m_screen != NULL) ? &m_screen->container() : NULL;
2312render_container *layout_view::item::screen_container(running_machine &machine) const
2313{
2314   return (m_screen != NULL) ? &m_screen->container() : NULL;
23152315}
23162316
23172317//-------------------------------------------------
trunk/src/emu/diimage.c
r29404r29405
891891            m_software_info_ptr = &m_software_part_ptr->info();
892892            m_software_list_name.cpy(m_software_info_ptr->list().list_name());
893893            m_full_software_name.cpy(m_software_part_ptr->info().shortname());
894           
894
895895            // if we had launched from softlist with a specified part, e.g. "shortname:part"
896896            // we would have recorded the wrong name, so record it again based on software_info
897897            if (m_software_info_ptr && m_full_software_name)
898898               m_err = set_image_filename(m_full_software_name);
899899
900            // check if image should be read-only     
900            // check if image should be read-only
901901            const char *read_only = get_feature("read_only");
902902            if (read_only && !strcmp(read_only, "true")) {
903903               make_readonly();
r29404r29405
11531153}
11541154
11551155//-------------------------------------------------
1156//  software_name_split - helper that splits a
1157//  software_list:software:part string into
1158//  separate software_list, software, and part
1156//  software_name_split - helper that splits a
1157//  software_list:software:part string into
1158//  separate software_list, software, and part
11591159//  strings.
11601160//
11611161//  str1:str2:str3  => swlist_name - str1, swname - str2, swpart - str3
r29404r29405
11771177      swname.cpy(swlist_swname);
11781178      return;
11791179   }
1180   
1180
11811181   // if one colon, it is the swname and swpart alone
11821182   const char *split2 = strchr(split1 + 1, ':');
11831183   if (split2 == NULL)
r29404r29405
12001200   // Note: old code would explicitly load swlist_name if it was specified, rather than
12011201   // searching the devices.
12021202   //
1203   // Also if not found, old code would attempt to open <drivername>.xml and even
1203   // Also if not found, old code would attempt to open <drivername>.xml and even
12041204   // <swinfo_name>.xml. Hopefully removing this won't break anything.
12051205   //
12061206
r29404r29405
12131213   const char *interface = NULL;
12141214   if (restrict_to_interface)
12151215      interface = image_interface();
1216   
1216
12171217   // find the software list if explicitly specified
12181218   software_list_device_iterator deviter(device().mconfig().root_device());
12191219   for (software_list_device *swlistdev = deviter.first(); swlistdev != NULL; swlistdev = deviter.next())
r29404r29405
12271227               return part;
12281228         }
12291229      }
1230   
1230
12311231   // if explicitly specified and not found, just error here
12321232   return NULL;
12331233}
r29404r29405
12841284               {
12851285                  const char *option = device().mconfig().options().value(req_image->brief_instance_name());
12861286                  // mount only if not already mounted
1287                  if (strlen(option) == 0 && !req_image->filename())
1287                  if (strlen(option) == 0 && !req_image->filename())
12881288                  {
12891289                     req_image->set_init_phase();
12901290                     req_image->load(requirement);
trunk/src/emu/output.c
r29404r29405
3131public:
3232   output_notify(output_notifier_func callback, void *param)
3333      : m_next(NULL),
34        m_notifier(callback),
35        m_param(param) { }
34         m_notifier(callback),
35         m_param(param) { }
3636
3737   output_notify *next() const { return m_next; }
3838
39   output_notify *        m_next;           /* link to next item */
39   output_notify *         m_next;           /* link to next item */
4040   output_notifier_func    m_notifier;       /* callback to call */
41   void *                 m_param;          /* parameter to pass the callback */
41   void *                  m_param;          /* parameter to pass the callback */
4242};
4343
4444
trunk/src/emu/rendlay.h
r29404r29405
149149      int                 m_stateoffset;
150150      int                 m_reelreversed;
151151      int                 m_numsymbolsvisible;
152      int               m_beltreel;
152      int                 m_beltreel;
153153   };
154154
155155   // a texture encapsulates a texture for a given element in a given state
trunk/src/emu/diimage.h
r29404r29405
7474public:
7575   image_device_format(const char *name, const char *description, const char *extensions, const char *optspec)
7676      : m_next(NULL),
77        m_name(name),
78        m_description(description),
79        m_extensions(extensions),
80        m_optspec(optspec)  { }
77         m_name(name),
78         m_description(description),
79         m_extensions(extensions),
80         m_optspec(optspec)  { }
8181
8282   image_device_format *next() const { return m_next; }
8383   const char *name() const { return m_name; }
trunk/src/emu/emualloc.h
r29404r29405
145145   dynamic_array<resource_pool_item *> m_hash;
146146   resource_pool_item *    m_ordered_head;
147147   resource_pool_item *    m_ordered_tail;
148   static UINT64         s_id;
148   static UINT64           s_id;
149149};
150150
151151
trunk/src/emu/sound/spu.c
r29404r29405
138138
139139                                       output_buffer_size=65536/8/*,
140140
141                                       sample_loop_cache_pool_size=64,
142                                       sample_loop_cache_extend_size=64,
143                                       sample_cache_pool_size=64,
144                                       sample_cache_extend_size=64,
141                                                    sample_loop_cache_pool_size=64,
142                                                    sample_loop_cache_extend_size=64,
143                                                    sample_cache_pool_size=64,
144                                                    sample_cache_extend_size=64,
145145
146                                       stream_marker_pool_size=64,
147                                       stream_marker_extend_size=64*/;
146                                                    stream_marker_pool_size=64,
147                                                    stream_marker_extend_size=64*/;
148148
149149//
150150//
trunk/src/emu/sound/votrax.h
r29404r29405
3838   votrax_sc01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3939
4040   template<class _Object> static devcb2_base &set_request_callback(device_t &device, _Object object) { return downcast<votrax_sc01_device &>(device).m_request_cb.set_callback(object); }
41   
41
4242   // writers
4343   DECLARE_WRITE8_MEMBER( write );
4444   DECLARE_WRITE8_MEMBER( inflection_w );
r29404r29405
7373   UINT8                       m_phoneme;              // 6-bit phoneme value
7474
7575   // outputs
76   devcb2_write_line         m_request_cb;          // callback for request
76   devcb2_write_line           m_request_cb;           // callback for request
7777   UINT8                       m_request_state;        // request as seen to the outside world
7878   UINT8                       m_internal_request;     // request managed by stream timing
7979
trunk/src/emu/sound/tc8830f.c
r29404r29405
111111            m_delta -= 8;
112112         if (m_delta <= 0)
113113            m_delta = 1;
114         
114
115115         // determine direction
116116         if (bit)
117117            m_output += m_delta;
118118         else
119119            m_output -= m_delta;
120         
120
121121         if (m_output > 32767)
122122            m_output = 32767;
123123         else if (m_output < -32768)
124124            m_output = -32768;
125         
125
126126         m_prevbits = m_prevbits << 1 | bit;
127127         mix = m_output;
128128      }
129     
129
130130      outputs[0][i] = mix;
131131   }
132132}
trunk/src/emu/sound/ay8910.c
r29404r29405
422422
423423INLINE void build_resisor_table(const ay_ym_param *par, INT32 *tab, int zero_is_off)
424424{
425    int j;
425   int j;
426426
427    for (j=0; j < par->res_count; j++)
428    {
429
430        if (zero_is_off && j == 0)
431        {
432            tab[j] = 1e6;
433        }
434        else
435            tab[j] = par->res[j];
436    }
427   for (j=0; j < par->res_count; j++)
428   {
429      if (zero_is_off && j == 0)
430      {
431         tab[j] = 1e6;
432      }
433      else
434         tab[j] = par->res[j];
435   }
437436}
438437
439438
r29404r29405
605604      psg->count_noise++;
606605      if (psg->count_noise >= NOISE_PERIOD(psg))
607606      {
608          /* toggle the prescaler output. Noise is no different to
609           * channels.
610           */
611            psg->count_noise = 0;
612          psg->prescale_noise ^= 1;
607         /* toggle the prescaler output. Noise is no different to
608          * channels.
609          */
610         psg->count_noise = 0;
611         psg->prescale_noise ^= 1;
613612
614          if ( psg->prescale_noise)
615          {
616               /* The Random Number Generator of the 8910 is a 17-bit shift */
617               /* register. The input to the shift register is bit0 XOR bit3 */
618               /* (bit0 is the output). This was verified on AY-3-8910 and YM2149 chips. */
613         if ( psg->prescale_noise)
614         {
615            /* The Random Number Generator of the 8910 is a 17-bit shift */
616            /* register. The input to the shift register is bit0 XOR bit3 */
617            /* (bit0 is the output). This was verified on AY-3-8910 and YM2149 chips. */
619618
620               psg->rng ^= (((psg->rng & 1) ^ ((psg->rng >> 3) & 1)) << 17);
621               psg->rng >>= 1;
622          }
619            psg->rng ^= (((psg->rng & 1) ^ ((psg->rng >> 3) & 1)) << 17);
620            psg->rng >>= 1;
621         }
623622      }
624623
625624      for (chan = 0; chan < NUM_CHANNELS; chan++)
r29404r29405
704703      normalize = 1;
705704   }
706705
707    if ((psg->intf->flags & AY8910_RESISTOR_OUTPUT) != 0)
708    {
709        for (chan=0; chan < NUM_CHANNELS; chan++)
710        {
711            build_resisor_table(psg->par, psg->vol_table[chan], psg->zero_is_off);
712            build_resisor_table(psg->par_env, psg->env_table[chan], 0);
713        }
714    }
715    else
716    {
717        for (chan=0; chan < NUM_CHANNELS; chan++)
718        {
719            build_single_table(psg->intf->res_load[chan], psg->par, normalize, psg->vol_table[chan], psg->zero_is_off);
720            build_single_table(psg->intf->res_load[chan], psg->par_env, normalize, psg->env_table[chan], 0);
721        }
722    }
706   if ((psg->intf->flags & AY8910_RESISTOR_OUTPUT) != 0)
707   {
708      for (chan=0; chan < NUM_CHANNELS; chan++)
709      {
710         build_resisor_table(psg->par, psg->vol_table[chan], psg->zero_is_off);
711         build_resisor_table(psg->par_env, psg->env_table[chan], 0);
712      }
713   }
714   else
715   {
716      for (chan=0; chan < NUM_CHANNELS; chan++)
717      {
718         build_single_table(psg->intf->res_load[chan], psg->par, normalize, psg->vol_table[chan], psg->zero_is_off);
719         build_single_table(psg->intf->res_load[chan], psg->par_env, normalize, psg->env_table[chan], 0);
720      }
721   }
723722   /*
724723    * The previous implementation added all three channels up instead of averaging them.
725724    * The factor of 3 will force the same levels if normalizing is used.
trunk/src/emu/sound/msm5205.h
r29404r29405
3535
3636#define MCFG_MSM6585_VCLK_CB(_devcb) \
3737   devcb = &msm6585_device::set_vclk_callback(*device, DEVCB2_##_devcb);
38   
3938
39
4040class msm5205_device : public device_t,
4141                     public device_sound_interface
4242{
r29404r29405
4444   msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4545   msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
4646   ~msm5205_device() {}
47   
47
4848   static void set_prescaler_selector(device_t &device, int select) { downcast<msm5205_device &>(device).m_select = select; }
4949   template<class _Object> static devcb2_base &set_vclk_callback(device_t &device, _Object object) { return downcast<msm5205_device &>(device).m_vclk_cb.set_callback(object); }
5050
trunk/src/emu/sound/aica.c
r29404r29405
14001400
14011401   // set up the IRQ callbacks
14021402   m_irq_cb.resolve_safe();
1403   m_main_irq_cb.resolve_safe();   
1403   m_main_irq_cb.resolve_safe();
14041404
14051405   m_stream = machine().sound().stream_alloc(*this, 0, 2, 44100);
1406   
1406
14071407   // save state
14081408   save_item(NAME(m_IrqTimA));
14091409   save_item(NAME(m_IrqTimBC));
r29404r29405
14161416   save_item(NAME(m_LPANTABLE),0x20000);
14171417   save_item(NAME(m_RPANTABLE),0x20000);
14181418   save_item(NAME(m_TimPris),3);
1419   save_item(NAME(m_TimCnt),3);   
1419   save_item(NAME(m_TimCnt),3);
14201420}
14211421
14221422void aica_device::set_ram_base(void *base, int size)
r29404r29405
14891489      m_bufferr(NULL),
14901490      m_length(0),
14911491      m_RBUFDST(NULL)
1492     
1492
14931493{
1494   memset(&m_udata.data, 0, sizeof(m_udata.data));   
1495   memset(m_EFSPAN, 0, sizeof(m_EFSPAN));   
1496   memset(m_Slots, 0, sizeof(m_Slots));   
1497   memset(m_RINGBUF, 0, sizeof(m_RINGBUF));   
1498   memset(m_MidiStack, 0, sizeof(m_MidiStack));   
1494   memset(&m_udata.data, 0, sizeof(m_udata.data));
1495   memset(m_EFSPAN, 0, sizeof(m_EFSPAN));
1496   memset(m_Slots, 0, sizeof(m_Slots));
1497   memset(m_RINGBUF, 0, sizeof(m_RINGBUF));
1498   memset(m_MidiStack, 0, sizeof(m_MidiStack));
14991499
1500   memset(m_LPANTABLE, 0, sizeof(m_LPANTABLE));   
1501   memset(m_RPANTABLE, 0, sizeof(m_RPANTABLE));   
1500   memset(m_LPANTABLE, 0, sizeof(m_LPANTABLE));
1501   memset(m_RPANTABLE, 0, sizeof(m_RPANTABLE));
15021502
1503   memset(m_TimPris, 0, sizeof(m_TimPris));   
1504   memset(m_TimCnt, 0, sizeof(m_TimCnt));   
1503   memset(m_TimPris, 0, sizeof(m_TimPris));
1504   memset(m_TimCnt, 0, sizeof(m_TimCnt));
15051505
1506   memset(&m_dma, 0, sizeof(m_dma));   
1507   
1508   memset(m_ARTABLE, 0, sizeof(m_ARTABLE));   
1509   memset(m_DRTABLE, 0, sizeof(m_DRTABLE));         
1506   memset(&m_dma, 0, sizeof(m_dma));
15101507
1511   memset(&m_DSP, 0, sizeof(m_DSP));         
1512   
1513   memset(m_EG_TABLE, 0, sizeof(m_EG_TABLE));         
1514   memset(m_PLFO_TRI, 0, sizeof(m_PLFO_TRI));         
1515   memset(m_PLFO_SQR, 0, sizeof(m_PLFO_SQR));         
1516   memset(m_PLFO_SAW, 0, sizeof(m_PLFO_SAW));         
1517   memset(m_PLFO_NOI, 0, sizeof(m_PLFO_NOI));         
1518   
1519   memset(m_ALFO_TRI, 0, sizeof(m_ALFO_TRI));         
1520   memset(m_ALFO_SQR, 0, sizeof(m_ALFO_SQR));         
1521   memset(m_ALFO_SAW, 0, sizeof(m_ALFO_SAW));         
1522   memset(m_ALFO_NOI, 0, sizeof(m_ALFO_NOI));         
1523   
1524   memset(m_PSCALES, 0, sizeof(m_PSCALES));         
1525   memset(m_ASCALES, 0, sizeof(m_ASCALES));         
1508   memset(m_ARTABLE, 0, sizeof(m_ARTABLE));
1509   memset(m_DRTABLE, 0, sizeof(m_DRTABLE));
1510
1511   memset(&m_DSP, 0, sizeof(m_DSP));
1512
1513   memset(m_EG_TABLE, 0, sizeof(m_EG_TABLE));
1514   memset(m_PLFO_TRI, 0, sizeof(m_PLFO_TRI));
1515   memset(m_PLFO_SQR, 0, sizeof(m_PLFO_SQR));
1516   memset(m_PLFO_SAW, 0, sizeof(m_PLFO_SAW));
1517   memset(m_PLFO_NOI, 0, sizeof(m_PLFO_NOI));
1518
1519   memset(m_ALFO_TRI, 0, sizeof(m_ALFO_TRI));
1520   memset(m_ALFO_SQR, 0, sizeof(m_ALFO_SQR));
1521   memset(m_ALFO_SAW, 0, sizeof(m_ALFO_SAW));
1522   memset(m_ALFO_NOI, 0, sizeof(m_ALFO_NOI));
1523
1524   memset(m_PSCALES, 0, sizeof(m_PSCALES));
1525   memset(m_ASCALES, 0, sizeof(m_ASCALES));
15261526}
15271527
15281528
trunk/src/emu/sound/aica.h
r29404r29405
8282   static void set_roffset(device_t &device, int roffset) { downcast<aica_device &>(device).m_roffset = roffset; }
8383   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<aica_device &>(device).m_irq_cb.set_callback(object); }
8484   template<class _Object> static devcb2_base &set_main_irq_callback(device_t &device, _Object object) { return downcast<aica_device &>(device).m_main_irq_cb.set_callback(object); }
85   
85
8686   // AICA register access
8787   DECLARE_READ16_MEMBER( read );
8888   DECLARE_WRITE16_MEMBER( write );
r29404r29405
9090   // MIDI I/O access
9191   DECLARE_WRITE16_MEMBER( midi_in );
9292   DECLARE_READ16_MEMBER( midi_out_r );
93   
93
9494   void set_ram_base(void *base, int size);
9595
9696protected:
r29404r29405
146146      UINT16 data[0xc0/2];
147147      UINT8 datab[0xc0];
148148   } m_udata;
149   
149
150150   UINT16 m_IRQL, m_IRQR;
151151   UINT16 m_EFSPAN[0x48];
152152   AICA_SLOT m_Slots[64];
r29404r29405
193193
194194   stream_sample_t *m_bufferl;
195195   stream_sample_t *m_bufferr;
196   
196
197197   int m_length;
198   
198
199199   signed short *m_RBUFDST;   //this points to where the sample will be stored in the RingBuf
200200   INT32 m_EG_TABLE[0x400];
201201   int m_PLFO_TRI[256],m_PLFO_SQR[256],m_PLFO_SAW[256],m_PLFO_NOI[256];
trunk/src/emu/sound/dmadac.c
r29404r29405
4646
4747void dmadac_sound_device::device_start()
4848{
49
5049   /* allocate a clear a buffer */
5150   m_buffer = auto_alloc_array_clear(machine(), INT16, BUFFER_SIZE);
5251
r29404r29405
186185
187186   /* flush out as much data as we can */
188187   for (i = 0; i < num_channels; i++)
189   {     
188   {
190189      devlist[i]->set_volume(volume);
191190   }
192191}
trunk/src/emu/sound/dmadac.h
r29404r29405
2424   void enable(UINT8 enable);
2525   void set_frequency(double frequency);
2626   void set_volume(UINT16 volume);
27   
27
2828protected:
2929   // device-level overrides
3030   virtual void device_start();
trunk/src/emu/sound/mos6560.h
r29404r29405
138138public:
139139   mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source);
140140   mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
141   
141
142142   template<class _Object> static devcb2_base &set_potx_rd_callback(device_t &device, _Object object) { return downcast<mos6560_device &>(device).m_read_potx.set_callback(object); }
143143   template<class _Object> static devcb2_base &set_poty_rd_callback(device_t &device, _Object object) { return downcast<mos6560_device &>(device).m_read_poty.set_callback(object); }
144144
trunk/src/emu/sound/qs1000.c
r29404r29405
239239   m_out_p1_cb.resolve_safe();
240240   m_out_p2_cb.resolve_safe();
241241   m_out_p3_cb.resolve_safe();
242   
242
243243   //m_serial_w_cb.resolve_safe();
244244
245245   m_cpu->i8051_set_serial_rx_callback(read8_delegate(FUNC(qs1000_device::data_to_i8052),this));
trunk/src/emu/sound/qs1000.h
r29404r29405
3838
3939#define MCFG_QS1000_OUT_P3_CB(_devcb) \
4040   devcb = &qs1000_device::set_out_p3_callback(*device, DEVCB2_##_devcb);
41   
41
4242/*#define MCFG_QS1000_SERIAL_W_CB(_devcb) \
43   devcb = &qs1000_device::set_serial_w_callback(*device, DEVCB2_##_devcb);*/
43    devcb = &qs1000_device::set_serial_w_callback(*device, DEVCB2_##_devcb);*/
4444
4545//**************************************************************************
4646//  TYPE DEFINITIONS
r29404r29405
6767   template<class _Object> static devcb2_base &set_out_p2_callback(device_t &device, _Object object) { return downcast<qs1000_device &>(device).m_out_p2_cb.set_callback(object); }
6868   template<class _Object> static devcb2_base &set_out_p3_callback(device_t &device, _Object object) { return downcast<qs1000_device &>(device).m_out_p3_cb.set_callback(object); }
6969   //template<class _Object> static devcb2_base &set_serial_w_callback(device_t &device, _Object object) { return downcast<qs1000_device &>(device).m_serial_w_cb.set_callback(object); }
70   
70
7171   // external
7272   void serial_in(UINT8 data);
7373   void set_irq(int state);
r29404r29405
113113   void set_voice_regs(int ch);
114114
115115   bool                    m_external_rom;
116   
116
117117   // Callbacks
118118   devcb2_read8             m_in_p1_cb;
119119   devcb2_read8             m_in_p2_cb;
trunk/src/emu/sound/scsp.c
r29404r29405
173173   memset(m_MidiStack, 0, sizeof(m_MidiStack));
174174   memset(m_LPANTABLE, 0, sizeof(m_LPANTABLE));
175175   memset(m_RPANTABLE, 0, sizeof(m_RPANTABLE));
176   memset(m_TimPris, 0, sizeof(m_TimPris));   
176   memset(m_TimPris, 0, sizeof(m_TimPris));
177177   memset(m_ARTABLE, 0, sizeof(m_ARTABLE));
178178   memset(m_DRTABLE, 0, sizeof(m_DRTABLE));
179179   memset(m_EG_TABLE, 0, sizeof(m_EG_TABLE));
r29404r29405
187187   memset(m_ALFO_NOI, 0, sizeof(m_ALFO_NOI));
188188   memset(m_PSCALES, 0, sizeof(m_PSCALES));
189189   memset(m_ASCALES, 0, sizeof(m_ASCALES));
190   memset(&m_Slots, 0, sizeof(m_Slots));   
191   memset(&m_udata.data, 0, sizeof(m_udata.data));   
190   memset(&m_Slots, 0, sizeof(m_Slots));
191   memset(&m_udata.data, 0, sizeof(m_udata.data));
192192   m_TimCnt[0] = 0;
193193   m_TimCnt[1] = 0;
194194   m_TimCnt[2] = 0;
r29404r29405
205205
206206   // set up the IRQ callbacks
207207   m_irq_cb.resolve_safe();
208   m_main_irq_cb.resolve_safe();   
208   m_main_irq_cb.resolve_safe();
209209
210210   m_stream = machine().sound().stream_alloc(*this, 0, 2, 44100, this);
211211}
r29404r29405
219219   m_bufferl = outputs[0];
220220   m_bufferr = outputs[1];
221221   m_length = samples;
222   DoMasterSamples(samples);   
222   DoMasterSamples(samples);
223223}
224224
225225unsigned char scsp_device::DecodeSCI(unsigned char irq)
r29404r29405
937937         *((unsigned short *) (m_DSP.COEF+(addr-0x700)/2))=val;
938938      else if(addr<0x7c0)
939939         *((unsigned short *) (m_DSP.MADRS+(addr-0x780)/2))=val;
940      else if(addr<0x800)   // MADRS is mirrored twice
940      else if(addr<0x800) // MADRS is mirrored twice
941941         *((unsigned short *) (m_DSP.MADRS+(addr-0x7c0)/2))=val;
942942      else if(addr<0xC00)
943943      {
trunk/src/emu/sound/scsp.h
r29404r29405
2121
2222#define MCFG_SCSP_MAIN_IRQ_CB(_devcb) \
2323   devcb = &scsp_device::set_main_irq_callback(*device, DEVCB2_##_devcb);
24   
2524
25
2626enum SCSP_STATE {SCSP_ATTACK,SCSP_DECAY1,SCSP_DECAY2,SCSP_RELEASE};
27   
27
2828struct SCSP_EG_t
2929{
3030   int volume; //
r29404r29405
5656      UINT16 data[0x10];  //only 0x1a bytes used
5757      UINT8 datab[0x20];
5858   } udata;
59   
59
6060   UINT8 Backwards;    //the wave is playing backwards
6161   UINT8 active;   //this slot is currently playing
6262   UINT8 *base;        //samples base address
r29404r29405
7676{
7777public:
7878   scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
79   
79
8080   static void set_roffset(device_t &device, int roffset) { downcast<scsp_device &>(device).m_roffset = roffset; }
8181   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<scsp_device &>(device).m_irq_cb.set_callback(object); }
8282   template<class _Object> static devcb2_base &set_main_irq_callback(device_t &device, _Object object) { return downcast<scsp_device &>(device).m_main_irq_cb.set_callback(object); }
r29404r29405
8888   // MIDI I/O access (used for comms on Model 2/3)
8989   DECLARE_WRITE16_MEMBER( midi_in );
9090   DECLARE_READ16_MEMBER( midi_out_r );
91   
91
9292   void set_ram_base(void *base);
9393
9494protected:
r29404r29405
9797
9898   // sound stream update overrides
9999   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
100   
100
101101private:
102102   int m_roffset;                /* offset in the region */
103   devcb2_write8      m_irq_cb;  /* irq callback */
103   devcb2_write8       m_irq_cb;  /* irq callback */
104104   devcb2_write_line   m_main_irq_cb;
105   
105
106106   union
107107   {
108108      UINT16 data[0x30/2];
109109      UINT8 datab[0x30];
110110   } m_udata;
111   
111
112112   SCSP_SLOT m_Slots[32];
113113   signed short m_RINGBUF[128];
114114   unsigned char m_BUFPTR;
r29404r29405
130130   UINT8 m_MidiOutW, m_MidiOutR;
131131   UINT8 m_MidiStack[32];
132132   UINT8 m_MidiW, m_MidiR;
133   
133
134134   INT32 m_EG_TABLE[0x400];
135135
136136   int m_LPANTABLE[0x10000];
r29404r29405
158158   int m_ARTABLE[64], m_DRTABLE[64];
159159
160160   SCSPDSP m_DSP;
161   
161
162162   stream_sample_t *m_bufferl;
163163   stream_sample_t *m_bufferr;
164164
165165   int m_length;
166166
167167   signed short *m_RBUFDST;   //this points to where the sample will be stored in the RingBuf
168   
168
169169   //LFO
170170   int m_PLFO_TRI[256], m_PLFO_SQR[256], m_PLFO_SAW[256], m_PLFO_NOI[256];
171171   int m_ALFO_TRI[256], m_ALFO_SQR[256], m_ALFO_SAW[256], m_ALFO_NOI[256];
172172   int m_PSCALES[8][256];
173173   int m_ASCALES[8][256];
174   
174
175175   void exec_dma(address_space &space);       /*state DMA transfer function*/
176176   unsigned char DecodeSCI(unsigned char irq);
177177   void CheckPendingIRQ();
r29404r29405
198198   unsigned short r16(address_space &space, unsigned int addr);
199199   inline INT32 UpdateSlot(SCSP_SLOT *slot);
200200   void DoMasterSamples(int nsamples);
201   
201
202202   //LFO
203203   void LFO_Init();
204204   signed int PLFO_Step(SCSP_LFO_t *LFO);
trunk/src/emu/sound/msm5232.c
r29404r29405
2626{
2727   int rate = clock()/CLOCK_RATE_DIVIDER;
2828   int voicenum;
29   
29
3030   m_gate_handler_cb.resolve();
3131
3232   init(clock(), rate);
trunk/src/emu/sound/msm5232.h
r29404r29405
66
77#define MCFG_MSM5232_SET_CAPACITORS(_a, _b, _c, _d, _e, _f, _g, _h) \
88   msm5232_device::static_set_capacitors(*device, _a, _b, _c, _d, _e, _f, _g, _h);
9   
9
1010#define MCFG_MSM5232_GATE_HANDLER_CB(_devcb) \
1111   devcb = &msm5232_device::set_gate_handler_callback(*device, DEVCB2_##_devcb);
1212
r29404r29405
4545public:
4646   msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4747   ~msm5232_device() {}
48   
48
4949   static void static_set_capacitors(device_t &device, double cap1, double cap2, double cap3, double cap4, double cap5, double cap6, double cap7, double cap8);
5050   template<class _Object> static devcb2_base &set_gate_handler_callback(device_t &device, _Object object) { return downcast<msm5232_device &>(device).m_gate_handler_cb.set_callback(object); }
5151
trunk/src/emu/sound/zsg2.c
r29404r29405
8989   m_mem_base = *region();
9090   m_mem_size = region()->bytes();
9191   m_mem_blocks = m_mem_size / 4;
92   
92
9393   m_mem_copy = auto_alloc_array_clear(machine(), UINT32, m_mem_blocks);
9494   m_full_samples = auto_alloc_array_clear(machine(), INT16, m_mem_blocks * 4 + 4); // +4 is for empty block
95   
95
9696   // register for savestates
9797   save_pointer(NAME(m_mem_copy), m_mem_blocks / sizeof(UINT32));
9898   save_pointer(NAME(m_full_samples), (m_mem_blocks * 4 + 4) / sizeof(INT16));
r29404r29405
129129   control_w(4, 0xffff);
130130   control_w(5, 0xffff);
131131   control_w(6, 0xffff);
132   
132
133133   for (int ch = 0; ch < 48; ch++)
134134      for (int reg = 0; reg < 0x10; reg++)
135135         chan_w(ch, reg, 0);
r29404r29405
155155
156156   if (block == 0)
157157      return &m_full_samples[m_mem_blocks]; // overflow or 0
158   
158
159159   if (block == m_mem_copy[offset])
160160      return &m_full_samples[offset * 4]; // cached
161   
161
162162   m_mem_copy[offset] = block;
163163   offset *= 4;
164   
164
165165   // decompress 32 byte block to 4 16-bit samples
166166   // 42222222 51111111 60000000 ssss3333
167167   m_full_samples[offset|0] = block >> 8 & 0x7f;
168168   m_full_samples[offset|1] = block >> 16 & 0x7f;
169169   m_full_samples[offset|2] = block >> 24 & 0x7f;
170170   m_full_samples[offset|3] = (block >> (8+1) & 0x40) | (block >> (16+2) & 0x20) | (block >> (24+3) & 0x10) | (block & 0xf);
171   
171
172172   // sign-extend and shift
173173   UINT8 shift = block >> 4 & 0xf;
174174   for (int i = offset; i < (offset + 4); i++)
r29404r29405
176176      m_full_samples[i] <<= 9;
177177      m_full_samples[i] >>= shift;
178178   }
179   
179
180180   return &m_full_samples[offset];
181181}
182182
r29404r29405
197197      {
198198         if (!m_chan[ch].is_playing)
199199            continue;
200         
200
201201         m_chan[ch].step_ptr += m_chan[ch].step;
202202         if (m_chan[ch].step_ptr & 0x40000)
203203         {
r29404r29405
215215            }
216216            m_chan[ch].samples = prepare_samples(m_chan[ch].page | m_chan[ch].cur_pos);
217217         }
218         
218
219219         INT32 sample = (m_chan[ch].samples[m_chan[ch].step_ptr >> 16 & 3] * m_chan[ch].vol) >> 16;
220         
220
221221         mix_l += (sample * m_chan[ch].panl + sample * (0x1f - m_chan[ch].panr)) >> 5;
222222         mix_r += (sample * m_chan[ch].panr + sample * (0x1f - m_chan[ch].panl)) >> 5;
223223      }
r29404r29405
246246         m_chan[ch].start_pos = (m_chan[ch].start_pos & 0x00ff) | (data << 8 & 0xff00);
247247         m_chan[ch].page = data << 8 & 0xff0000;
248248         break;
249     
249
250250      case 0x2:
251251         // no function? always 0
252252         break;
253     
253
254254      case 0x3:
255255         // unknown, always 0x0400
256256         break;
257     
257
258258      case 0x4:
259259         // frequency
260260         m_chan[ch].step = data + 1;
r29404r29405
266266         m_chan[ch].loop_pos = (m_chan[ch].loop_pos & 0xff00) | (data & 0xff);
267267         m_chan[ch].panr = data >> 8 & 0x1f;
268268         break;
269     
269
270270      case 0x6:
271271         // end address
272272         m_chan[ch].end_pos = data;
r29404r29405
278278         m_chan[ch].loop_pos = (m_chan[ch].loop_pos & 0x00ff) | (data << 8 & 0xff00);
279279         m_chan[ch].panl = data >> 8 & 0x1f;
280280         break;
281     
281
282282      case 0x9:
283283         // no function? always 0
284284         break;
285     
285
286286      case 0xb:
287287         // always writes 0
288288         // this register is read-only
289289         break;
290     
290
291291      case 0xe:
292292         // volume
293293         m_chan[ch].vol = data;
294294         break;
295     
295
296296      case 0xf:
297297         // flags
298298         m_chan[ch].flags = data;
299299         break;
300     
300
301301      default:
302302         break;
303303   }
r29404r29405
316316      default:
317317         break;
318318   }
319   
319
320320   return m_chan[ch].v[reg];
321321}
322322
r29404r29405
397397      default:
398398         break;
399399   }
400   
400
401401   return 0;
402402}
403403
trunk/src/emu/sound/ics2115.c
r29404r29405
3030   m_timer[0].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ics2115_device::timer_cb_0),this), this);
3131   m_timer[1].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ics2115_device::timer_cb_1),this), this);
3232   m_stream = machine().sound().stream_alloc(*this, 0, 2, 33075);
33   
33
3434   m_irq_cb.resolve_safe();
3535
3636   //Exact formula as per patent 5809466
trunk/src/emu/sound/zsg2.h
r29404r29405
7474   INT16 *m_full_samples;
7575
7676   sound_stream *m_stream;
77   
77
7878   devcb2_read32 m_ext_read_handler;
7979
8080   UINT32 read_memory(UINT32 offset);
trunk/src/emu/sound/ymf278b.c
r29404r29405
267267            if (slot->stepptr >= slot->endaddr)
268268            {
269269               slot->stepptr = slot->stepptr - slot->endaddr + slot->loopaddr;
270               
270
271271               // NOTE: loop overflow is still possible here if (slot->stepptr >= slot->endaddr)
272272               // This glitch may be (ab)used to your advantage to create pseudorandom noise.
273273            }
trunk/src/emu/sound/qsound.c
r29404r29405
1111
1212  Many thanks to CAB (the author of Amuse), without whom this probably would
1313  never have been finished.
14 
14
1515  TODO:
1616  - hook up the DSP!
1717  - is master volume really linear?
r29404r29405
116116   // create pan table
117117   for (int i = 0; i < 33; i++)
118118      m_pan_table[i] = (int)((256 / sqrt(32.0)) * sqrt((double)i));
119   
119
120120   // init sound regs
121121   memset(m_channel, 0, sizeof(m_channel));
122122
r29404r29405
165165            m_channel[ch].address += (m_channel[ch].step_ptr >> 12);
166166            m_channel[ch].step_ptr &= 0xfff;
167167            m_channel[ch].step_ptr += m_channel[ch].freq;
168           
168
169169            if (m_channel[ch].address >= m_channel[ch].end)
170170            {
171171               if (m_channel[ch].loop)
172172               {
173173                  // Reached the end, restart the loop
174174                  m_channel[ch].address -= m_channel[ch].loop;
175                 
175
176176                  // Make sure we don't overflow (what does the real chip do in this case?)
177177                  if (m_channel[ch].address >= m_channel[ch].end)
178178                     m_channel[ch].address = m_channel[ch].end - m_channel[ch].loop;
179                 
179
180180                  m_channel[ch].address &= 0xffff;
181181               }
182182               else
r29404r29405
186186                  break;
187187               }
188188            }
189           
189
190190            INT8 sample = read_sample(m_channel[ch].bank | m_channel[ch].address);
191191            *lmix++ += ((sample * m_channel[ch].lvol * m_channel[ch].vol) >> 14);
192192            *rmix++ += ((sample * m_channel[ch].rvol * m_channel[ch].vol) >> 14);
r29404r29405
237237      ch = address >> 3;
238238      reg = address & 7;
239239   }
240   
240
241241   // >= 0x80 is probably for the dsp?
242242   else if (address < 0x90)
243243   {
r29404r29405
312312            pan = 0x20;
313313         if (pan < 0)
314314            pan = 0;
315         
315
316316         m_channel[ch].rvol = m_pan_table[pan];
317317         m_channel[ch].lvol = m_pan_table[0x20 - pan];
318318         break;
319319      }
320     
320
321321      case 9:
322322         // unknown
323323         break;
trunk/src/emu/sound/k007232.h
r29404r29405
1212#define MCFG_K007232_PORT_WRITE_HANDLER(_devcb) \
1313   devcb = &k007232_device::set_port_write_handler(*device, DEVCB2_##_devcb);
1414
15   
15
1616class k007232_device : public device_t,
1717                           public device_sound_interface
1818{
1919public:
2020   k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2121   ~k007232_device() {}
22   
22
2323   template<class _Object> static devcb2_base &set_port_write_handler(device_t &device, _Object object) { return downcast<k007232_device &>(device).m_port_write_handler.set_callback(object); }
2424
2525   DECLARE_WRITE8_MEMBER( write );
trunk/src/emu/sound/cdp1869.c
r29404r29405
369369
370370machine_config_constructor cdp1869_device::device_mconfig_additions() const
371371{
372    return MACHINE_CONFIG_NAME( cdp1869 );
372   return MACHINE_CONFIG_NAME( cdp1869 );
373373}
374374
375375
trunk/src/emu/sound/cdp1869.h
r29404r29405
202202   static void static_set_char_ram_write(device_t &device, cdp1869_char_ram_write_delegate callback) { downcast<cdp1869_device &>(device).m_out_char_ram_func = callback; }
203203   static void static_set_pcb_read(device_t &device, cdp1869_pcb_read_delegate callback) { downcast<cdp1869_device &>(device).m_in_pcb_func = callback; }
204204   static void static_set_color_clock(device_t &device, int color_clock) { downcast<cdp1869_device &>(device).m_color_clock = color_clock; }
205   
205
206206   DECLARE_PALETTE_INIT(cdp1869);
207207
208208   virtual DECLARE_ADDRESS_MAP(io_map, 8);
r29404r29405
228228
229229protected:
230230   // device-level overrides
231   virtual machine_config_constructor device_mconfig_additions() const;   
231   virtual machine_config_constructor device_mconfig_additions() const;
232232   virtual void device_start();
233233   virtual void device_post_load();
234234   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/emu/sound/ymz280b.c
r29404r29405
505505      if (samples_left || voice->ended)
506506      {
507507         voice->ended = false;
508         
508
509509         /* if there are leftovers, ramp back to 0 */
510510         int base = new_samples - samples_left;
511511         int i, t = (base == 0) ? curr : m_scratch[base - 1];
trunk/src/emu/sound/upd7759.c
r29404r29405
220220void upd7759_device::device_start()
221221{
222222   m_drqcallback.resolve_safe();
223   
223
224224   /* chip configuration */
225225   m_sample_offset_shift = (type() == UPD7759) ? 1 : 0;
226226
r29404r29405
295295void upd7756_device::device_start()
296296{
297297   m_drqcallback.resolve_safe();
298   
298
299299   /* chip configuration */
300300   m_sample_offset_shift = (type() == UPD7759) ? 1 : 0;
301301
trunk/src/emu/sound/upd7759.h
r29404r29405
2222   ~upd775x_device() {}
2323
2424   template<class _Object> static devcb2_base &set_drq_callback(device_t &device, _Object object) { return downcast<upd775x_device &>(device).m_drqcallback.set_callback(object); }
25   
25
2626   void set_bank_base(offs_t base);
2727
2828   void reset_w(UINT8 data);
r29404r29405
8282   UINT32      m_rommask;                    /* maximum address offset */
8383
8484   devcb2_write_line m_drqcallback;
85   
85
8686   void update_adpcm(int data);
8787   void advance_state();
8888};
trunk/src/emu/sound/es5503.c
r29404r29405
235235
236236   m_irq_func.resolve_safe();
237237   m_adc_func.resolve_safe(0);
238   
238
239239   rege0 = 0xff;
240240
241241   for (osc = 0; osc < 32; osc++)
trunk/src/emu/sound/es5503.h
r29404r29405
1313
1414#define MCFG_ES5503_IRQ_FUNC(_write) \
1515   devcb = &es5503_device::static_set_irqf(*device, DEVCB2_##_write);
16   
16
1717#define MCFG_ES5503_ADC_FUNC(_read) \
1818   devcb = &es5503_device::static_set_adcf(*device, DEVCB2_##_read);
1919
r29404r29405
3131
3232   template<class _Object> static devcb2_base &static_set_irqf(device_t &device, _Object object) { return downcast<es5503_device &>(device).m_irq_func.set_callback(object); }
3333   template<class _Object> static devcb2_base &static_set_adcf(device_t &device, _Object object) { return downcast<es5503_device &>(device).m_adc_func.set_callback(object); }
34   
34
3535   DECLARE_READ8_MEMBER(read);
3636   DECLARE_WRITE8_MEMBER(write);
3737
r29404r29405
5353
5454   const address_space_config  m_space_config;
5555
56   devcb2_write_line    m_irq_func;
57   devcb2_read8       m_adc_func;
56   devcb2_write_line   m_irq_func;
57   devcb2_read8        m_adc_func;
5858
5959   emu_timer *m_sync_timer;
6060
trunk/src/emu/sound/sp0256.h
r29404r29405
7474public:
7575   sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
7676   ~sp0256_device() { }
77   
77
7878   template<class _Object> static devcb2_base &set_data_request_callback(device_t &device, _Object object) { return downcast<sp0256_device &>(device).m_drq_cb.set_callback(object); }
7979   template<class _Object> static devcb2_base &set_standby_callback(device_t &device, _Object object) { return downcast<sp0256_device &>(device).m_sby_cb.set_callback(object); }
80   
80
8181   DECLARE_WRITE8_MEMBER(ald_w);
8282   DECLARE_READ_LINE_MEMBER(lrq_r);
8383   DECLARE_READ_LINE_MEMBER(sby_r);
r29404r29405
101101   void micro();
102102
103103   sound_stream  *m_stream;          /* MAME core sound stream                       */
104   devcb2_write_line m_drq_cb;        /* Data request callback                        */
105   devcb2_write_line m_sby_cb;        /* Standby callback                             */
104   devcb2_write_line m_drq_cb;       /* Data request callback                        */
105   devcb2_write_line m_sby_cb;       /* Standby callback                             */
106106
107107   int            m_sby_line;        /* Standby line state                           */
108108   int            m_cur_len;         /* Fullness of current sound buffer.            */
trunk/src/emu/machine.h
r29404r29405
284284   void watchdog_fired(void *ptr = NULL, INT32 param = 0);
285285   void watchdog_vblank(screen_device &screen, bool vblank_state);
286286   const char *image_parent_basename(device_t *device);
287   astring &nvram_filename(astring &result, device_t &device);   
287   astring &nvram_filename(astring &result, device_t &device);
288288   void nvram_load();
289289   void nvram_save();
290290
trunk/src/emu/ioport.c
r29404r29405
706706
707707//-------------------------------------------------
708708//  restore_default_seq - restores the sequence
709//   from the default
709//  from the default
710710//-------------------------------------------------
711711
712712void input_type_entry::restore_default_seq()
trunk/src/emu/crsshair.c
r29404r29405
3838   UINT8               visible[MAX_PLAYERS];   /* visibility per player */
3939   bitmap_argb32 *     bitmap[MAX_PLAYERS];    /* bitmap per player */
4040   render_texture *    texture[MAX_PLAYERS];   /* texture per player */
41   screen_device *      screen[MAX_PLAYERS];     /* the screen on which this player's crosshair is drawn */
41   screen_device *     screen[MAX_PLAYERS];    /* the screen on which this player's crosshair is drawn */
4242   float               x[MAX_PLAYERS];         /* current X position */
4343   float               y[MAX_PLAYERS];         /* current Y position */
4444   float               last_x[MAX_PLAYERS];    /* last X position */
trunk/src/emu/ioport.h
r29404r29405
13611361   ioport_port *first_port() const { return m_portlist.first(); }
13621362   bool safe_to_read() const { return m_safe_to_read; }
13631363   natural_keyboard &natkeyboard() { return m_natkeyboard; }
1364
1364
13651365   // has... getters
13661366   bool has_configs() const { return m_has_configs; }
13671367   bool has_analog() const { return m_has_analog; }
r29404r29405
14481448   UINT32                  m_playback_accumulated_frames; // accumulated frames during playback
14491449
14501450   // has...
1451   bool               m_has_configs;
1452   bool               m_has_analog;
1453   bool               m_has_dips;
1454   bool               m_has_bioses;
1451   bool                    m_has_configs;
1452   bool                    m_has_analog;
1453   bool                    m_has_dips;
1454   bool                    m_has_bioses;
14551455};
14561456
14571457
trunk/src/emu/memarray.h
r29404r29405
7070   // entry-level readers and writers
7171   UINT32 read(int index) { return (this->*m_read_entry)(index); }
7272   void write(int index, UINT32 data) { (this->*m_write_entry)(index, data); }
73   
73
7474   // byte/word/dword-level readers and writers
7575   UINT8 read8(offs_t offset) { return reinterpret_cast<UINT8 *>(m_base)[offset]; }
7676   UINT16 read16(offs_t offset) { return reinterpret_cast<UINT16 *>(m_base)[offset]; }
trunk/src/emu/bus/nubus/nubus_specpdq.h
r29404r29405
5151      int m_width, m_height, m_patofsx, m_patofsy;
5252      UINT32 m_vram_addr, m_vram_src;
5353      UINT8 m_fillbytes[256];
54      required_device<palette_device> m_palette;   
54      required_device<palette_device> m_palette;
5555};
5656
5757
trunk/src/emu/bus/nubus/nubus_specpdq.c
r29404r29405
3737   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
3838   MCFG_SCREEN_SIZE(1280,1024)
3939   MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 844-1)
40   
40
4141   MCFG_PALETTE_ADD("palette", 256)
4242MACHINE_CONFIG_END
4343
trunk/src/emu/bus/adam/exp.h
r29404r29405
5151class device_adam_expansion_slot_card_interface;
5252
5353class adam_expansion_slot_device : public device_t,
54                           public device_slot_interface,
55                           public device_image_interface
54                           public device_slot_interface,
55                           public device_image_interface
5656{
5757public:
5858   // construction/destruction
trunk/src/emu/bus/megadrive/md_slot.c
r29404r29405
466466   bool is_smd, is_md;
467467   UINT32 tmplen = length(), offset, len;
468468   dynamic_buffer tmpROM(tmplen);
469   
469
470470   // STEP 1: store a (possibly headered) copy of the file and determine its type (SMD? MD? BIN?)
471471   fread(tmpROM, tmplen);
472472   is_smd = genesis_is_SMD(&tmpROM[0x200], tmplen - 0x200);
trunk/src/emu/bus/megadrive/md_carts.c
r29404r29405
11   /**********************************************************************
22
3    Megadrive carts
3   Megadrive carts
44
55**********************************************************************/
66
trunk/src/emu/bus/ieee488/c2031.h
r29404r29405
2929// ======================> c2031_device
3030
3131class c2031_device :  public device_t,
32                 public device_ieee488_interface
32                  public device_ieee488_interface
3333{
3434public:
3535   // construction/destruction
trunk/src/emu/bus/ieee488/c2040.h
r29404r29405
3838// ======================> c2040_device
3939
4040class c2040_device :  public device_t,
41                 public device_ieee488_interface
41                  public device_ieee488_interface
4242{
4343public:
4444   // construction/destruction
trunk/src/emu/bus/ieee488/c8050.c
r29404r29405
1313
1414    TODO:
1515
16   - Micropolis 8x50 stepper motor is same as 4040, except it takes 4 pulses to step a track instead of 1
16    - Micropolis 8x50 stepper motor is same as 4040, except it takes 4 pulses to step a track instead of 1
1717
1818    - BASIC program to set 8250/SFD-1001 to 8050 mode:
1919
trunk/src/emu/bus/ieee488/c2040fdc.c
r29404r29405
1111
1212/*
1313
14   TODO:
14    TODO:
1515
16   - writing starts in the middle of a byte
17   - 8050 PLL
16    - writing starts in the middle of a byte
17    - 8050 PLL
1818
1919*/
2020
r29404r29405
6767//  c2040_fdc_t - constructor
6868//-------------------------------------------------
6969
70c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
70c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
7171   device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
7272   m_write_sync(*this),
7373   m_write_ready(*this),
r29404r29405
9292   cur_live.write_start_time = attotime::never;
9393}
9494
95c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
95c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
9696   device_t(mconfig, C2040_FDC, "C2040 FDC", tag, owner, clock, "c2040fdc", __FILE__),
9797   m_write_sync(*this),
9898   m_write_ready(*this),
r29404r29405
117117   cur_live.write_start_time = attotime::never;
118118}
119119
120c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
120c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
121121   c2040_fdc_t(mconfig, C2040_FDC, "C2040 FDC", tag, owner, clock, "c2040fdc", __FILE__) { }
122122
123123
r29404r29405
242242{
243243   if(cur_live.write_start_time.is_never() || tm == cur_live.write_start_time || !cur_live.write_position)
244244      return;
245   
245
246246   if (LOG) logerror("%s committing %u transitions since %s\n", tm.as_string(), cur_live.write_position, cur_live.write_start_time.as_string());
247247
248248   if(get_floppy())
r29404r29405
336336            cur_live.cell_counter++;
337337            cur_live.cell_counter &= 0xf;
338338         }
339         
339
340340         if (!BIT(cell_counter, 1) && BIT(cur_live.cell_counter, 1)) {
341341            // read bit
342342            cur_live.shift_reg <<= 1;
343343            cur_live.shift_reg |= !(BIT(cur_live.cell_counter, 3) || BIT(cur_live.cell_counter, 2));
344344            cur_live.shift_reg &= 0x3ff;
345   
346            if (LOG) logerror("%s read bit %u (%u) >> %03x, rw=%u mode=%u\n", cur_live.tm.as_string(), cur_live.bit_counter,
345
346            if (LOG) logerror("%s read bit %u (%u) >> %03x, rw=%u mode=%u\n", cur_live.tm.as_string(), cur_live.bit_counter,
347347               !(BIT(cur_live.cell_counter, 3) || BIT(cur_live.cell_counter, 2)), cur_live.shift_reg, cur_live.rw_sel, cur_live.mode_sel);
348348
349349            // write bit
r29404r29405
375375         cur_live.e = m_gcr_rom->base()[cur_live.i];
376376
377377         int ready = !(BIT(cell_counter, 1) && !BIT(cur_live.cell_counter, 1) && (cur_live.bit_counter == 9));
378   
378
379379         if (!ready) {
380380            // load write shift register
381381            // E7 E6 I7 E5 E4 E3 E2 I2 E1 E0
r29404r29405
383383            offs_t i = cur_live.i;
384384
385385            cur_live.shift_reg_write = BIT(e,7)<<9 | BIT(e,6)<<8 | BIT(i,7)<<7 | BIT(e,5)<<6 | BIT(e,4)<<5 | BIT(e,3)<<4 | BIT(e,2)<<3 | BIT(i,2)<<2 | (e & 0x03);
386         
386
387387            if (LOG) logerror("%s load write shift register %03x\n",cur_live.tm.as_string(),cur_live.shift_reg_write);
388388         } else if (BIT(cell_counter, 1) && !BIT(cur_live.cell_counter, 1)) {
389389            // clock write shift register
390390            cur_live.shift_reg_write <<= 1;
391391            cur_live.shift_reg_write &= 0x3ff;
392           
392
393393            if (LOG) logerror("%s write shift << %03x\n",cur_live.tm.as_string(),cur_live.shift_reg_write);
394394         }
395395
r29404r29405
463463   offs_t i = checkpoint_live.i;
464464
465465   UINT8 data = (BIT(e, 6) << 7) | (BIT(i, 7) << 6) | (e & 0x33) | (BIT(e, 2) << 3) | (i & 0x04);
466   
466
467467   if (LOG) logerror("%s VIA reads data %02x (%03x)\n", machine().time().as_string(), data, checkpoint_live.shift_reg);
468   
468
469469   return data;
470470}
471471
trunk/src/emu/bus/ieee488/softbox.c
r29404r29405
3030#define I8255_1_TAG     "ic16"
3131#define COM8116_TAG     "ic14"
3232#define RS232_TAG       "rs232"
33#define CORVUS_HDC_TAG   "corvus"
33#define CORVUS_HDC_TAG  "corvus"
3434
3535
3636
trunk/src/emu/bus/ieee488/hardbox.c
r29404r29405
5353#define Z80_TAG         "z80"
5454#define I8255_0_TAG     "ic17"
5555#define I8255_1_TAG     "ic16"
56#define CORVUS_HDC_TAG   "corvus"
56#define CORVUS_HDC_TAG  "corvus"
5757
5858
5959
r29404r29405
8888            The version numbers listed are the ROM version reported by the HardBox diagnostics program.
8989            Disassembling the ROMs showed that v2.3 and v2.4 are for Corvus Systems drives but v3.1 is
9090            for Sunol Systems drives.  Both types use the Corvus flat cable interface but there may be
91            some programming differences, e.g. the v3.1 firmware for Sunol does not have the park heads
92       routine in the Corvus versions.  MESS emulates a Corvus drive so we default to the last
93       known HardBox firmware for Corvus (v2.4). */
91            some programming differences, e.g. the v3.1 firmware for Sunol does not have the park heads
92        routine in the Corvus versions.  MESS emulates a Corvus drive so we default to the last
93        known HardBox firmware for Corvus (v2.4). */
9494ROM_END
9595
9696
trunk/src/emu/bus/ieee488/c2031.c
r29404r29405
286286//-------------------------------------------------
287287
288288static SLOT_INTERFACE_START( c2031_floppies )
289    SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD )
289   SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD )
290290SLOT_INTERFACE_END
291291
292292
trunk/src/emu/bus/ieee488/c2040.c
r29404r29405
3636#define M6504_TAG       "uh3"
3737#define M6522_TAG       "um3"
3838#define M6530_TAG       "uk3"
39#define FDC_TAG         "fdc"
39#define FDC_TAG         "fdc"
4040
4141
4242
r29404r29405
385385
386386       bit     description
387387
388       PB0     
389       PB1     
390       PB2     
388       PB0
389       PB1
390       PB2
391391       PB3     WPS
392392       PB4
393393       PB5
394394       PB6     SYNC
395       PB7     
395       PB7
396396
397397   */
398398
r29404r29405
416416       PB0     DRV SEL
417417       PB1     DS0
418418       PB2     DS1
419       PB3     
419       PB3
420420       PB4
421421       PB5
422       PB6     
422       PB6
423423       PB7     M6504 IRQ
424424
425425   */
r29404r29405
452452//-------------------------------------------------
453453
454454static SLOT_INTERFACE_START( c2040_floppies )
455    SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD )
455   SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD )
456456SLOT_INTERFACE_END
457457
458458
r29404r29405
461461//-------------------------------------------------
462462
463463FLOPPY_FORMATS_MEMBER( c2040_device::floppy_formats )
464    FLOPPY_D64_FORMAT,
465    FLOPPY_G64_FORMAT,
466    FLOPPY_D67_FORMAT
464   FLOPPY_D64_FORMAT,
465   FLOPPY_G64_FORMAT,
466   FLOPPY_D67_FORMAT
467467FLOPPY_FORMATS_END
468468
469469
trunk/src/emu/bus/a2bus/a2ultraterm.c
r29404r29405
77    Notes:
88
99    C0nX: C0n0 is 6845 register address,
10         C0n1 is 6845 register data.
11         C0n2 is control 1: b7 = 0 to read RAM at cc00, 1 for ROM (writes always to RAM)
12                       b6 = 0 for Apple II video, 1 for 6845
13                       b5 = 0 for 17.430 MHz 6845 clock, 1 for 28.7595 MHz 6845 clock
14                       b4 = 0 for 512 byte RAM block addressing (VideoTerm emulation), 1 for 256-byte RAM page addressing
15                       b3-b0 = page select
16         C0n3 is control 2: b7 = 0 for attributes software controllable, 1 for DIP switches control attributes
17                       b5 = 0 for normal video if bit 7 set, 1 for inverse if bit 7 set
18                       b4 = 0 for lowlight if bit 7 set, 1 for highlight if bit 7 set
19                       b2 = 0 for high-density character set, 1 for low-density character set
20                       b1 = same as b5
21                       b0 = same as b4
10          C0n1 is 6845 register data.
11          C0n2 is control 1: b7 = 0 to read RAM at cc00, 1 for ROM (writes always to RAM)
12                             b6 = 0 for Apple II video, 1 for 6845
13                             b5 = 0 for 17.430 MHz 6845 clock, 1 for 28.7595 MHz 6845 clock
14                             b4 = 0 for 512 byte RAM block addressing (VideoTerm emulation), 1 for 256-byte RAM page addressing
15                             b3-b0 = page select
16          C0n3 is control 2: b7 = 0 for attributes software controllable, 1 for DIP switches control attributes
17                             b5 = 0 for normal video if bit 7 set, 1 for inverse if bit 7 set
18                             b4 = 0 for lowlight if bit 7 set, 1 for highlight if bit 7 set
19                             b2 = 0 for high-density character set, 1 for low-density character set
20                             b1 = same as b5
21                             b0 = same as b4
2222
2323    C800-CBFF: ROM page 1
2424    CC00-CFEF: VRAM window or ROM page 2
r29404r29405
4646#define ULTRATERM_MC6845_NAME "mc6845_uterm"
4747
4848#define CLOCK_LOW   17430000
49#define CLOCK_HIGH   28759500
49#define CLOCK_HIGH  28759500
5050
51#define CT1_MEMSEL   (0x80)   // 0 for read RAM at cc00, 1 for read ROM
52#define CT1_VIDSEL   (0x40)   // 0 for Apple video passthrough, 1 for 6845 video
53#define CT1_CLKSEL   (0x20)   // 0 for Videoterm clock, 1 for faster clock
54#define CT1_VTEMU   (0x10)   // Videoterm emulation mode if 0
51#define CT1_MEMSEL  (0x80)  // 0 for read RAM at cc00, 1 for read ROM
52#define CT1_VIDSEL  (0x40)  // 0 for Apple video passthrough, 1 for 6845 video
53#define CT1_CLKSEL  (0x20)  // 0 for Videoterm clock, 1 for faster clock
54#define CT1_VTEMU   (0x10)  // Videoterm emulation mode if 0
5555#define CT1_PAGEMASK (0x0f)
5656
57#define CT2_USEDIPS   (0x80)   // 0 to use the rest of ctrl2's bits, 1 to use DIPs
57#define CT2_USEDIPS (0x80)  // 0 to use the rest of ctrl2's bits, 1 to use DIPs
5858#define CT2_INVBIT7H (0x20)
59#define CT2_HLBIT7H   (0x10)
59#define CT2_HLBIT7H (0x10)
6060#define CT2_HIDENSITY (0x04)
6161#define CT2_INVBIT7L (0x02)
62#define CT2_HLBIT7L   (0x01)
62#define CT2_HLBIT7L (0x01)
6363
6464static MC6845_UPDATE_ROW( ultraterm_update_row );
6565
r29404r29405
9696
9797ROM_START( a2ultraterm )
9898   ROM_REGION(0x1000, ULTRATERM_ROM_REGION, 0)
99   ROM_LOAD( "frm_b537.bin", 0x000000, 0x001000, CRC(1e85a93e) SHA1(b4acd1775c08ae43996ab4edf6d8e28f4736346b) )
99   ROM_LOAD( "frm_b537.bin", 0x000000, 0x001000, CRC(1e85a93e) SHA1(b4acd1775c08ae43996ab4edf6d8e28f4736346b) )
100100
101101   ROM_REGION(0x1000, ULTRATERM_GFX_REGION, 0)
102   ROM_LOAD( "chs_7859.bin", 0x000000, 0x001000, CRC(ebe8f333) SHA1(3517fa9e7a39573f1cb159b3161d6939dec199ba) )
102   ROM_LOAD( "chs_7859.bin", 0x000000, 0x001000, CRC(ebe8f333) SHA1(3517fa9e7a39573f1cb159b3161d6939dec199ba) )
103103
104104   ROM_REGION(0x400, "pal", 0)
105   ROM_LOAD( "ult_2a313.jed", 0x000000, 0x000305, CRC(dcd51dea) SHA1(0ad0c5e802e48495da27f7bd26ee3ab1c92d74dd) )
105   ROM_LOAD( "ult_2a313.jed", 0x000000, 0x000305, CRC(dcd51dea) SHA1(0ad0c5e802e48495da27f7bd26ee3ab1c92d74dd) )
106106ROM_END
107107
108108ROM_START( a2ultratermenh )
109109   ROM_REGION(0x1000, ULTRATERM_ROM_REGION, 0)
110   ROM_LOAD( "frm_b5c9.bin", 0x000000, 0x001000, CRC(b71e05e0) SHA1(092e3eda4644d4f465809864a7f023ac7d1d1542) )
110   ROM_LOAD( "frm_b5c9.bin", 0x000000, 0x001000, CRC(b71e05e0) SHA1(092e3eda4644d4f465809864a7f023ac7d1d1542) )
111111
112112   ROM_REGION(0x1000, ULTRATERM_GFX_REGION, 0)
113   ROM_LOAD( "chs_5604.bin", 0x000000, 0x001000, CRC(3fb4e90a) SHA1(94ff75199232a9b613585c22f88470f73fb7dd09) )
113   ROM_LOAD( "chs_5604.bin", 0x000000, 0x001000, CRC(3fb4e90a) SHA1(94ff75199232a9b613585c22f88470f73fb7dd09) )
114114
115115   ROM_REGION(0x400, "pal", 0)
116   ROM_LOAD( "ult_251c.jed", 0x000000, 0x000305, CRC(12fabb0d) SHA1(d4a36837cb98bb65f7ddef7455eb5a7f8e648a82) )
116   ROM_LOAD( "ult_251c.jed", 0x000000, 0x000305, CRC(12fabb0d) SHA1(d4a36837cb98bb65f7ddef7455eb5a7f8e648a82) )
117117ROM_END
118118
119119/***************************************************************************
r29404r29405
245245
246246      case 2:
247247         m_ctrl1 = data;
248//         printf("%02x to ctrl1\n", data);
248//          printf("%02x to ctrl1\n", data);
249249
250250         // if disabling Videoterm emulation, change RAM banking
251251         if (data & CT1_VTEMU)
252252         {
253253            m_rambank = (data & CT1_PAGEMASK) * 256;
254254         }
255         break;
255         break;
256256
257257      case 3:
258258         m_ctrl2 = data;
259//         printf("%02x to ctrl2\n", data);
259//          printf("%02x to ctrl2\n", data);
260260         break;
261261   }
262262
263263   if (!(m_ctrl1 & CT1_VTEMU))
264264   {
265      m_rambank = ((offset >> 2) & 3) * 512;
265      m_rambank = ((offset >> 2) & 3) * 512;
266266   }
267267}
268268
r29404r29405
298298   }
299299   else
300300   {
301      if (m_ctrl1 & CT1_MEMSEL)   // read ROM?
301      if (m_ctrl1 & CT1_MEMSEL)   // read ROM?
302302      {
303303         return m_rom[offset + 0x800];
304304      }
305305
306      return m_ram[(offset - 0x400) + m_rambank];
306      return m_ram[(offset - 0x400) + m_rambank];
307307   }
308308}
309309
trunk/src/emu/bus/a2bus/a2corvus.c
r29404r29405
44
55    Implementation of the Corvus flat-cable hard disk interface
66    for the Apple II.
7
7
88    This same card was used in the Corvus Concept.
9
9
1010    C0n0 = drive read/write
1111    C0n1 = read status (busy in bit 7, data direction in bit 6)
12 
13   Reads and writes to C0n2+ happen; the contents of the reads are thrown away
12
13    Reads and writes to C0n2+ happen; the contents of the reads are thrown away
1414    immediately by all the code I've examined, and sending the writes to the
1515    drive's write port makes it not work so they're intended to be ignored too.
16
16
1717    5 MB: -chs 144,4,20 -ss 512
1818    10 MB: -chs 358,3,20 -ss 512
1919    20 MB: -chs 388,5,20 -ss 512
20
20
2121    To set up a disk from scratch on the Apple II:
2222    1) Create a disk of your desired capacity using CHDMAN -c none and the parameters
2323       listed above for each of the possible sizes.
2424    2) Boot apple2p with the corvus in slot 2 and a diskii(ng) in slot 6 with the
2525       "Corvus Hard Drive - Diagnostics.dsk" mounted.
2626    3) Press F to format.  Accept all the default options from now on;
27      there is no "format switch" to worry about with the current emulation.
27       there is no "format switch" to worry about with the current emulation.
2828    4) Quit MESS.  Restart with the corvus in slot 6 and a diskii(ng) in slot 7
2929       with the "Corvus Hard Drive - Utilities 1.dsk" mounted.
3030    5) When you get the BASIC prompt, "LOAD BSYSGEN"
r29404r29405
3535    10) When the format completes, type "RUN APPLESOFT BOOT PREP" and press Enter.
3636    11) Once it finishes, quit MESS.  Remove the diskii(ng) from slot 7 and
3737       the system should boot from the Corvus HD.
38
38
3939*********************************************************************/
4040
4141#include "a2corvus.h"
r29404r29405
5353const device_type A2BUS_CORVUS = &device_creator<a2bus_corvus_device>;
5454
5555#define CORVUS_ROM_REGION  "corvus_rom"
56#define CORVUS_HD_TAG      "corvushd"
56#define CORVUS_HD_TAG      "corvushd"
5757
5858static MACHINE_CONFIG_FRAGMENT(corvus)
5959   MCFG_DEVICE_ADD(CORVUS_HD_TAG, CORVUS_HDC, 0)
r29404r29405
158158{
159159   if (offset == 0)
160160   {
161      m_corvushd->write(space, 0, data);
161      m_corvushd->write(space, 0, data);
162162   }
163163}
164164
r29404r29405
180180{
181181   return m_rom[offset & 0x7ff];
182182}
183
trunk/src/emu/bus/a2bus/a2ssc.c
r29404r29405
228228{
229229   if (m_started)
230230   {
231      if (!(m_dsw2->read() & 4))
231      if (!(m_dsw2->read() & 4))
232232      {
233233         if (state)
234234         {
trunk/src/emu/bus/a2bus/a2vulcan.c
r29404r29405
7777
7878ROM_START( vulcangold )
7979   ROM_REGION(0x4000, VULCAN_ROM_REGION, 0)
80   ROM_LOAD( "ae vulcan gold rom v2.0.bin", 0x000000, 0x004000, CRC(19bc3958) SHA1(96a22c2540fa603648a4e638e176eee76523b4e1) )
80   ROM_LOAD( "ae vulcan gold rom v2.0.bin", 0x000000, 0x004000, CRC(19bc3958) SHA1(96a22c2540fa603648a4e638e176eee76523b4e1) )
8181ROM_END
8282
8383/***************************************************************************
trunk/src/emu/bus/a2bus/a2cffa.c
r29404r29405
153153         // Apple /// driver uses sta $c080,x when writing, which causes spurious reads of c088
154154         if (!m_inwritecycle)
155155         {
156            m_lastreaddata = m_ata->read_cs0(space, offset - 8, 0xffff);
156            m_lastreaddata = m_ata->read_cs0(space, offset - 8, 0xffff);
157157         }
158158         return m_lastreaddata & 0xff;
159159
r29404r29405
184184      case 0:
185185         m_lastdata &= 0x00ff;
186186         m_lastdata |= data<<8;
187//         printf("%02x to 0, m_lastdata = %x\n", data, m_lastdata);
187//          printf("%02x to 0, m_lastdata = %x\n", data, m_lastdata);
188188         m_inwritecycle = true;
189189         break;
190190
r29404r29405
199199      case 8:
200200         m_lastdata &= 0xff00;
201201         m_lastdata |= data;
202//         printf("%02x to 8, m_lastdata = %x\n", data, m_lastdata);
202//          printf("%02x to 8, m_lastdata = %x\n", data, m_lastdata);
203203         m_ata->write_cs0(space, offset-8, m_lastdata, 0xffff);
204204         break;
205205
trunk/src/emu/bus/a2bus/a2videoterm.c
r29404r29405
125125
126126ROM_START( a2aevm80 )
127127   ROM_REGION(0x800, VIDEOTERM_ROM_REGION, 0)
128   ROM_LOAD( "ae viewmaster 80 rom.bin", 0x000000, 0x000800, CRC(62a4b111) SHA1(159bf7c4add1435be215fddb648c0743fbcc49b5) )
128   ROM_LOAD( "ae viewmaster 80 rom.bin", 0x000000, 0x000800, CRC(62a4b111) SHA1(159bf7c4add1435be215fddb648c0743fbcc49b5) )
129129
130130   ROM_REGION(0x1000, VIDEOTERM_GFX_REGION, 0)
131   ROM_LOAD( "ae viewmaster 80 video rom.bin", 0x000000, 0x000800, CRC(4801ab90) SHA1(f90658ffee7740f3cb30ecef2e151f7dc6098833) )
131   ROM_LOAD( "ae viewmaster 80 video rom.bin", 0x000000, 0x000800, CRC(4801ab90) SHA1(f90658ffee7740f3cb30ecef2e151f7dc6098833) )
132132ROM_END
133133
134134/***************************************************************************
trunk/src/emu/bus/a2bus/a2videoterm.h
r29404r29405
5050
5151private:
5252   int m_rambank;
53public:   
53public:
5454   required_device<palette_device> m_palette;
5555};
5656
trunk/src/emu/bus/a2bus/a2pic.c
r29404r29405
3232
3333ROM_START( pic )
3434   ROM_REGION(0x000200, PIC_ROM_REGION, 0)
35   ROM_LOAD( "341-0057.bin", 0x000000, 0x000200, CRC(0d2d84ee) SHA1(bfc5b863d37e59875a6159528eb0f2b6082063b5) )
35   ROM_LOAD( "341-0057.bin", 0x000000, 0x000200, CRC(0d2d84ee) SHA1(bfc5b863d37e59875a6159528eb0f2b6082063b5) )
3636ROM_END
3737
3838static INPUT_PORTS_START( pic )
r29404r29405
182182{
183183   switch (offset)
184184   {
185      case 3:   
185      case 3:
186186         return m_ctx_data_in->read();
187187
188188      case 4:
189189         return m_ack;
190190
191      case 6:   // does reading this really work?
191      case 6: // does reading this really work?
192192         m_irqenable = true;
193193         break;
194194
r29404r29405
211211{
212212   switch (offset)
213213   {
214      case 0:   // set data out and send a strobe
214      case 0: // set data out and send a strobe
215215         m_ctx_data_out->write(data);
216216
217217         if (m_autostrobe)
218218         {
219219            start_strobe();
220220         }
221         break;
221         break;
222222
223      case 2:   // send a strobe
223      case 2: // send a strobe
224224         start_strobe();
225225         break;
226226
r29404r29405
236236   }
237237}
238238
239WRITE_LINE_MEMBER( a2bus_pic_device::ack_w )
239WRITE_LINE_MEMBER( a2bus_pic_device::ack_w )
240240{
241241   if (m_started)
242242   {
243      UINT8 dsw1 = m_dsw1->read();
243      UINT8 dsw1 = m_dsw1->read();
244244
245      if (dsw1 & 0x10)   // negative polarity
245      if (dsw1 & 0x10)    // negative polarity
246246      {
247247         m_ack = (state == ASSERT_LINE) ? 0x00 : 0x80;
248248      }
r29404r29405
251251         m_ack = (state == ASSERT_LINE) ? 0x80 : 0x00;
252252      }
253253
254      m_ack |= 0x40;   // set ACK flip-flop
254      m_ack |= 0x40;  // set ACK flip-flop
255255
256256      if ((dsw1 & 0x40) && (m_irqenable))
257257      {
r29404r29405
262262
263263void a2bus_pic_device::start_strobe()
264264{
265   int usec = ((m_dsw1->read() & 7) * 2) + 1;   // strobe length in microseconds
265   int usec = ((m_dsw1->read() & 7) * 2) + 1;  // strobe length in microseconds
266266
267   if (m_dsw1->read() & 0x8)   // negative polarity
267   if (m_dsw1->read() & 0x8)   // negative polarity
268268   {
269269      m_ctx->write_strobe(CLEAR_LINE);
270270   }
r29404r29405
278278
279279void a2bus_pic_device::clear_strobe()
280280{
281   if (m_dsw1->read() & 0x8)   // negative polarity
281   if (m_dsw1->read() & 0x8)   // negative polarity
282282   {
283283      m_ctx->write_strobe(ASSERT_LINE);
284284   }
trunk/src/emu/bus/econet/e01.c
r29404r29405
197197   update_interrupts();
198198}
199199
200WRITE_LINE_MEMBER( e01_device::fdc_drq_w )
200WRITE_LINE_MEMBER( e01_device::fdc_drq_w )
201201{
202202   m_fdc_drq = state;
203203
trunk/src/emu/bus/econet/econet.c
r29404r29405
196196//  econet_device - constructor
197197//-------------------------------------------------
198198
199econet_device::econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)   :
199econet_device::econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
200200   device_t(mconfig, ECONET, "Econet", tag, owner, clock, "econet", __FILE__),
201201   m_write_clk(*this),
202202   m_write_data(*this)
trunk/src/emu/bus/econet/econet.h
r29404r29405
3131//**************************************************************************
3232
3333#define MCFG_ECONET_ADD() \
34   MCFG_DEVICE_ADD(ECONET_TAG, ECONET, 0) \
34   MCFG_DEVICE_ADD(ECONET_TAG, ECONET, 0)
3535
36
3736#define MCFG_ECONET_SLOT_ADD(_tag, _num, _slot_intf, _def_slot) \
3837   MCFG_DEVICE_ADD(_tag, ECONET_SLOT, 0) \
3938   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
trunk/src/emu/bus/ep64/exp.h
r29404r29405
6969
7070#define MCFG_EP64_EXPANSION_BUS_SLOT_ADD(_tag, _def_slot) \
7171   MCFG_DEVICE_ADD(_tag, EP64_EXPANSION_BUS_SLOT, 0) \
72   MCFG_DEVICE_SLOT_INTERFACE(ep64_expansion_bus_cards, _def_slot, false) \
72   MCFG_DEVICE_SLOT_INTERFACE(ep64_expansion_bus_cards, _def_slot, false)
7373
74
7574#define MCFG_EP64_EXPANSION_BUS_SLOT_DAVE(_tag) \
7675   ep64_expansion_bus_slot_device::static_set_dave_tag(*device, "^"_tag);
7776
r29404r29405
9594class device_ep64_expansion_bus_card_interface;
9695
9796class ep64_expansion_bus_slot_device : public device_t,
98                              public device_slot_interface
97                              public device_slot_interface
9998{
10099   friend class device_ep64_expansion_bus_card_interface;
101100
trunk/src/emu/bus/sms_exp/smsexp.h
r29404r29405
5151   DECLARE_WRITE8_MEMBER(write_mapper);
5252   DECLARE_READ8_MEMBER(read_ram);
5353   DECLARE_WRITE8_MEMBER(write_ram);
54   
54
5555   int get_lphaser_xoffs();
5656
5757   device_sms_expansion_slot_interface *m_device;
trunk/src/emu/bus/wangpc/tig.c
r29404r29405
122122
123123   MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
124124
125   MCFG_DEVICE_ADD(UPD7720_0_TAG, UPD7220, XTAL_52_832MHz/28)
125   MCFG_DEVICE_ADD(UPD7720_0_TAG, UPD7220, XTAL_52_832MHz/28)
126126   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_0_map)
127   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(wangpc_tig_device, hgdc_draw_text)   
127   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(wangpc_tig_device, hgdc_draw_text)
128128   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
129129
130130   MCFG_DEVICE_ADD(UPD7720_1_TAG, UPD7220, XTAL_52_832MHz/28)
131131   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
132   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(wangpc_tig_device, hgdc_display_pixels)   
132   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(wangpc_tig_device, hgdc_display_pixels)
133133   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
134134MACHINE_CONFIG_END
135135
trunk/src/emu/bus/wangpc/wangpc.h
r29404r29405
8282class wangpcbus_device;
8383
8484class wangpcbus_slot_device : public device_t,
85                       public device_slot_interface
85                        public device_slot_interface
8686{
8787public:
8888   // construction/destruction
trunk/src/emu/bus/wangpc/tig.h
r29404r29405
6161   UINT8 m_option;
6262   UINT8 m_attr[16];
6363   UINT8 m_underline;
64   required_device<palette_device> m_palette;   
64   required_device<palette_device> m_palette;
6565};
6666
6767
trunk/src/emu/bus/compucolor/floppy.c
r29404r29405
111111
112112
113113//-------------------------------------------------
114//  device_config_complete -
114//  device_config_complete -
115115//-------------------------------------------------
116116
117117void compucolor_floppy_port_device::device_config_complete()
trunk/src/emu/bus/gameboy/gb_slot.c
r29404r29405
3636
3737device_gb_cart_interface::device_gb_cart_interface(const machine_config &mconfig, device_t &device)
3838   : device_slot_card_interface(mconfig, device),
39      has_rumble(false),
40      has_timer(false),
39      has_rumble(false),
40      has_timer(false),
4141      has_battery(false)
4242{
4343}
trunk/src/emu/bus/cbm2/hrg.h
r29404r29405
2626// ======================> cbm2_graphic_cartridge_device
2727
2828class cbm2_graphic_cartridge_device : public device_t,
29                             public device_cbm2_expansion_card_interface
29                              public device_cbm2_expansion_card_interface
3030{
3131public:
3232   // construction/destruction
trunk/src/emu/bus/cbm2/hrg.c
r29404r29405
1313
1414    TODO:
1515
16   http://www.wfking.de/hires.htm
16    http://www.wfking.de/hires.htm
1717
1818    - version A (EF9365, 512x512 interlaced, 1 page)
1919    - version B (EF9366, 512x256 non-interlaced, 2 pages)
trunk/src/emu/bus/cbm2/user.h
r29404r29405
104104// ======================> cbm2_user_port_device
105105
106106class cbm2_user_port_device : public device_t,
107                       public device_slot_interface
107                        public device_slot_interface
108108{
109109public:
110110   // construction/destruction
trunk/src/emu/bus/coco/coco_fdc.c
r29404r29405
8080
8181#define LOG_FDC                 0
8282#define WD_TAG                  "wd17xx"
83#define WD2797_TAG            "wd2797"
83#define WD2797_TAG              "wd2797"
8484#define DISTO_TAG               "disto"
8585#define CLOUD9_TAG              "cloud9"
8686
r29404r29405
437437//  dragon_fdc_device - constructor
438438//-------------------------------------------------
439439dragon_fdc_device::dragon_fdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
440   : coco_fdc_device(mconfig, type, name, tag, owner, clock, shortname, source)     
440   : coco_fdc_device(mconfig, type, name, tag, owner, clock, shortname, source)
441441{
442442}
443443dragon_fdc_device::dragon_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
trunk/src/emu/bus/coco/coco_fdc.h
r29404r29405
4646
4747      void set_intrq(UINT8 val) { m_intrq = val; }
4848      void set_drq(UINT8 val) { m_drq = val; }
49     
49
5050      DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
5151      DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
5252protected:
r29404r29405
6565      UINT8 m_intrq : 1;
6666
6767      optional_device<wd1773_device> m_wd17xx;              /* WD17xx */
68      optional_device<wd2797_device> m_wd2797;              /* WD2797 */     
68      optional_device<wd2797_device> m_wd2797;              /* WD2797 */
6969      optional_device<ds1315_device> m_ds1315;         /* DS1315 */
7070
7171      /* Disto RTC */
7272      optional_device<msm6242_device> m_disto_msm6242;        /* 6242 RTC on Disto interface */
73     
73
7474      offs_t m_msm6242_rtc_address;
7575};
7676
trunk/src/emu/bus/imi7000/imi5000h.h
r29404r29405
3232// ======================> imi5000h_device
3333
3434class imi5000h_device :  public device_t,
35                  public device_imi7000_interface
35                     public device_imi7000_interface
3636{
3737public:
3838   // construction/destruction
trunk/src/emu/bus/c64/magic_formel.c
r29404r29405
1111
1212/*
1313
14   TODO:
14    TODO:
1515
16   - pia6821 port A DDR needs to reset to 0xff or this won't boot
16    - pia6821 port A DDR needs to reset to 0xff or this won't boot
1717
1818*/
1919
r29404r29405
6969       PB2     RAM A9
7070       PB3     RAM A8
7171       PB4     RAM A12
72       PB5      U9A clr
72       PB5     U9A clr
7373       PB6
7474       PB7     ROMH enable
7575
trunk/src/emu/bus/bml3/bml3mp1805.h
r29404r29405
3333
3434   DECLARE_READ8_MEMBER(bml3_mp1805_r);
3535   DECLARE_WRITE8_MEMBER(bml3_mp1805_w);
36   
36
3737   DECLARE_WRITE_LINE_MEMBER( bml3_mc6843_intrq_w );
3838
3939protected:
trunk/src/emu/bus/vidbrain/exp.h
r29404r29405
108108// ======================> videobrain_expansion_slot_device
109109
110110class videobrain_expansion_slot_device : public device_t,
111                               public device_slot_interface,
112                               public device_image_interface
111                                 public device_slot_interface,
112                                 public device_image_interface
113113{
114114public:
115115   // construction/destruction
trunk/src/emu/bus/ecbbus/ecbbus.h
r29404r29405
6969//**************************************************************************
7070
7171#define MCFG_ECBBUS_ADD() \
72   MCFG_DEVICE_ADD(ECBBUS_TAG, ECBBUS, 0) \
73
72   MCFG_DEVICE_ADD(ECBBUS_TAG, ECBBUS, 0)
7473#define MCFG_ECBBUS_SLOT_ADD(_num, _tag, _slot_intf, _def_slot) \
7574   MCFG_DEVICE_ADD(_tag, ECBBUS_SLOT, 0) \
7675   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
r29404r29405
9493class ecbbus_device;
9594
9695class ecbbus_slot_device : public device_t,
97                     public device_slot_interface
96                     public device_slot_interface
9897{
9998public:
10099   // construction/destruction
trunk/src/emu/bus/ecbbus/grip.c
r29404r29405
305305static MC6845_INTERFACE( grip5_crtc_intf )
306306{
307307    false,
308   0,0,0,0,
308    0,0,0,0,
309309    8,
310310    NULL,
311311    grip5_update_row,
312312    NULL,
313   DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i1_w),
314   DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i2_w),
313    DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i1_w),
314    DEVCB_DEVICE_LINE_MEMBER(Z80STI_TAG, z80sti_device, i2_w),
315315    DEVCB_NULL,
316316    DEVCB_NULL,
317317    grip5_update_addr_changed
trunk/src/emu/bus/coleco/sac.h
r29404r29405
2626// ======================> coleco_super_action_controller_t
2727
2828class coleco_super_action_controller_t : public device_t,
29                              public device_colecovision_control_port_interface
29                                 public device_colecovision_control_port_interface
3030{
3131public:
3232   // construction/destruction
trunk/src/emu/bus/coleco/hand.h
r29404r29405
2626// ======================> coleco_hand_controller_t
2727
2828class coleco_hand_controller_t : public device_t,
29                        public device_colecovision_control_port_interface
29                           public device_colecovision_control_port_interface
3030{
3131public:
3232   // construction/destruction
trunk/src/emu/bus/coleco/std.h
r29404r29405
2525// ======================> colecovision_standard_cartridge_device
2626
2727class colecovision_standard_cartridge_device : public device_t,
28                                    public device_colecovision_cartridge_interface
28                                    public device_colecovision_cartridge_interface
2929{
3030public:
3131   // construction/destruction
trunk/src/emu/bus/coleco/exp.h
r29404r29405
6464class device_colecovision_cartridge_interface;
6565
6666class colecovision_cartridge_slot_device : public device_t,
67                                 public device_slot_interface,
68                                 public device_image_interface
67                                 public device_slot_interface,
68                                 public device_image_interface
6969{
7070public:
7171   // construction/destruction
trunk/src/emu/bus/plus4/c1551.h
r29404r29405
3030// ======================> c1551_device
3131
3232class c1551_device :  public device_t,
33                 public device_plus4_expansion_card_interface
33                  public device_plus4_expansion_card_interface
3434{
3535public:
3636   // construction/destruction
trunk/src/emu/bus/plus4/c1551.c
r29404r29405
355355//-------------------------------------------------
356356
357357static SLOT_INTERFACE_START( c1551_floppies )
358    SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD )
358   SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD )
359359SLOT_INTERFACE_END
360360
361361
trunk/src/emu/bus/adamnet/spi.c
r29404r29405
1818//**************************************************************************
1919
2020#define M6801_TAG       "m6801"
21#define MC2661_TAG      "mc2661"
22#define RS232_TAG      "rs232"
23#define CENTRONICS_TAG   "centronics"
21#define MC2661_TAG      "mc2661"
22#define RS232_TAG       "rs232"
23#define CENTRONICS_TAG  "centronics"
2424
2525
2626
trunk/src/emu/bus/adamnet/spi.h
r29404r29405
3030// ======================> adam_spi_device
3131
3232class adam_spi_device :  public device_t,
33                  public device_adamnet_card_interface
33                     public device_adamnet_card_interface
3434{
3535public:
3636   // construction/destruction
trunk/src/emu/bus/adamnet/fdc.h
r29404r29405
2929// ======================> adam_fdc_device
3030
3131class adam_fdc_device :  public device_t,
32                  public device_adamnet_card_interface
32                     public device_adamnet_card_interface
3333{
3434public:
3535   // construction/destruction
trunk/src/emu/bus/isa/3c505.c
r29404r29405
33 *
44 *  Created on: August 27, 2010
55 *      Author: Hans Ostermeyer
6 *     ISA conversion by R. Belmont
7 *
6 *      ISA conversion by R. Belmont
7 *
88 *  Released for general non-commercial use under the MAME license
99 *  Visit http://mamedev.org for licensing and usage restrictions.
1010 *
r29404r29405
566566         case 5: m_isa->irq5_w(state); break;
567567         case 6: m_isa->irq6_w(state); break;
568568         case 7: m_isa->irq7_w(state); break;
569         case 9: m_isa->irq2_w(state); break;   // IRQ 9 on ISA16 goes to IRQ 2
569         case 9: m_isa->irq2_w(state); break;    // IRQ 9 on ISA16 goes to IRQ 2
570570         case 10: m_isa->irq10_w(state); break;
571571         case 11: m_isa->irq11_w(state); break;
572572         case 12: m_isa->irq12_w(state); break;
r29404r29405
15791579   LOG2(("reading 3C505 Register at offset %02x = %02x", offset, data));
15801580   return data;
15811581}
1582
trunk/src/emu/bus/isa/adlib.h
r29404r29405
2323
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
26     
26
2727      DECLARE_READ8_MEMBER(ym3812_16_r);
2828      DECLARE_WRITE8_MEMBER(ym3812_16_w);
2929protected:
trunk/src/emu/bus/isa/mufdc.c
r29404r29405
11/***************************************************************************
22
3   Multi Unique FDC
3    Multi Unique FDC
44
55    license: MAME, GPL-2.0+
66    copyright-holders: Dirk Best
trunk/src/emu/bus/isa/mda.c
r29404r29405
9999MACHINE_CONFIG_FRAGMENT( pcvideo_mda )
100100   MCFG_SCREEN_ADD( MDA_SCREEN_NAME, RASTER)
101101   MCFG_SCREEN_RAW_PARAMS(MDA_CLOCK, 882, 0, 720, 370, 0, 350 )
102   MCFG_SCREEN_UPDATE_DEVICE( MDA_MC6845_NAME, mc6845_device, screen_update )   
102   MCFG_SCREEN_UPDATE_DEVICE( MDA_MC6845_NAME, mc6845_device, screen_update )
103103
104104   MCFG_PALETTE_ADD( "palette", 4 )
105105
trunk/src/emu/bus/isa/mufdc.h
r29404r29405
11/***************************************************************************
22
3   Multi Unique FDC
3    Multi Unique FDC
44
55    license: MAME, GPL-2.0+
66    copyright-holders: Dirk Best
r29404r29405
3333// ======================> mufdc_device
3434
3535class mufdc_device : public device_t,
36                  public device_isa8_card_interface
36                  public device_isa8_card_interface
3737{
3838public:
3939   // construction/destruction
trunk/src/emu/bus/isa/mda.h
r29404r29405
3939protected:
4040   // device-level overrides
4141   virtual void device_start();
42   virtual void device_reset();   
42   virtual void device_reset();
4343public:
4444   int m_framecnt;
4545
trunk/src/emu/bus/isa/sc499.c
r29404r29405
11/*
22 * sc499.c - ARCHIVE SC-499 cartridge tape controller (for Apollo DN3x00)
33 *  Created on: April 17, 2011
4 *     Author: Hans Ostermeyer
5 *     ISA conversion by R. Belmont
4 *      Author: Hans Ostermeyer
5 *      ISA conversion by R. Belmont
66 *
77 *  Released for general non-commercial use under the MAME license
88 *  Visit http://mamedev.org for licensing and usage restrictions.
r29404r29405
636636{
637637   if (state != irq_state)
638638   {
639      LOG2(("set_interrupt(%d)",state));
639      LOG2(("set_interrupt(%d)",state));
640640      switch (m_irq)
641641      {
642642         case 2: m_isa->irq2_w(state); break;
r29404r29405
659659{
660660   if (state != dma_drq_state)
661661   {
662      LOG2(("set_dma_drq(%d)",state));
662      LOG2(("set_dma_drq(%d)",state));
663663
664664      switch (m_drq)
665665      {
r29404r29405
668668         case 3: m_isa->drq3_w(state); break;
669669         default: logerror("sc499: invalid DRQ %d\n", m_drq); break;
670670      }
671     
671
672672      dma_drq_state = state;
673673   }
674674}
r29404r29405
11151115   return data;
11161116}
11171117
1118void sc499_device::dack_w(int line, UINT8 data)
1118void sc499_device::dack_w(int line, UINT8 data)
11191119{
11201120   LOG3(("dack_write: data=%x", data));
11211121
r29404r29405
13111311{
13121312   update_names(SC499_CTAPE, "ctape", "ct");
13131313};
1314
trunk/src/emu/bus/isa/pds.c
r29404r29405
4747
4848void isa8_pds_device::device_reset()
4949{
50
5150}
5251
5352void isa8_pds_device::device_stop()
5453{
55
5654}
5755
5856I8255_INTERFACE(pds_ppi_intf)
r29404r29405
7371{
7472   return MACHINE_CONFIG_NAME( pds_config );
7573}
76
trunk/src/emu/bus/isa/aga.c
r29404r29405
9292   m_isa->install_memory(0xb0000, 0xbffff, 0, 0, read8_delegate(FUNC(isa8_aga_device::pc_aga_videoram_r),this), write8_delegate(FUNC(isa8_aga_device::pc_aga_videoram_w),this));
9393   m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate( FUNC(isa8_aga_device::pc_aga_mda_r), this ), write8_delegate( FUNC(isa8_aga_device::pc_aga_mda_w), this ) );
9494   m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_aga_device::pc_aga_cga_r), this ), write8_delegate( FUNC(isa8_aga_device::pc_aga_cga_w), this ) );
95   
95
9696   /* Initialise the cga palette */
9797   int i;
9898
r29404r29405
113113         }
114114      }
115115   }
116     
117   UINT8 *gfx = &memregion("gfx1")->base()[0x8000];   
116
117   UINT8 *gfx = &memregion("gfx1")->base()[0x8000];
118118   /* just a plain bit pattern for graphics data generation */
119119   for (i = 0; i < 256; i++)
120120      gfx[i] = i;
r29404r29405
179179   m_isa->install_memory(0xb0000, 0xbffff, 0, 0, read8_delegate(FUNC(isa8_aga_pc200_device::pc200_videoram_r),this), write8_delegate(FUNC(isa8_aga_pc200_device::pc200_videoram_w),this));
180180   m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate( FUNC(isa8_aga_device::pc_aga_mda_r), this ), write8_delegate( FUNC(isa8_aga_device::pc_aga_mda_w), this ) );
181181   m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_aga_pc200_device::pc200_cga_r), this ), write8_delegate( FUNC(isa8_aga_pc200_device::pc200_cga_w), this ) );
182   
182
183183   /* Initialise the cga palette */
184184   int i;
185185
r29404r29405
200200         }
201201      }
202202   }
203     
204   UINT8 *gfx = &memregion("gfx1")->base()[0x8000];   
203
204   UINT8 *gfx = &memregion("gfx1")->base()[0x8000];
205205   /* just a plain bit pattern for graphics data generation */
206206   for (i = 0; i < 256; i++)
207207      gfx[i] = i;
r29404r29405
765765WRITE8_MEMBER (isa8_aga_device:: pc_aga_cga_w )
766766{
767767   if ( m_mode == AGA_COLOR ) {
768
769768      switch(offset) {
770769      case 0: case 2: case 4: case 6:
771770         m_mc6845->address_w( space, offset, data );
r29404r29405
867866}
868867
869868READ8_MEMBER( isa8_aga_device::pc_aga_videoram_r )
870{   
869{
871870   switch (m_mode) {
872871   case AGA_COLOR:
873872      if (offset>=0x8000) return m_videoram[offset-0x8000];
trunk/src/emu/bus/isa/omti8621.c
r29404r29405
33 *
44 *  Created on: August 30, 2010
55 *      Author: Hans Ostermeyer
6 *
6 *
77 *  Converted to ISA device by R. Belmont
8 *
8 *
99 *  Released for general non-commercial use under the MAME license
1010 *  Visit http://mamedev.org for licensing and usage restrictions.
1111 *
r29404r29405
7272   virtual void device_config_complete();
7373   virtual void device_start();
7474   virtual void device_reset();
75   
75
7676   void omti_disk_config(UINT16 disk_type);
7777public:
7878   UINT16 m_type;
r29404r29405
288288   sector_buffer.resize(OMTI_DISK_SECTOR_SIZE*OMTI_MAX_BLOCK_COUNT);
289289
290290   m_timer = timer_alloc(0, NULL);
291   
291
292292   our_disks[0] = subdevice<omti_disk_image_device>(OMTI_DISK0_TAG);
293293   our_disks[1] = subdevice<omti_disk_image_device>(OMTI_DISK1_TAG);
294294}
r29404r29405
388388 set_interrupt - update the IRQ state
389389 -------------------------------------------------*/
390390
391void omti8621_device::set_interrupt(enum line_state line_state)
391void omti8621_device::set_interrupt(enum line_state line_state)
392392{
393393   LOG2(("set_interrupt: status_port=%x, line_state %d", status_port, line_state));
394394   m_isa->irq14_w(line_state);
r29404r29405
396396
397397void omti8621_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
398398{
399   set_interrupt(ASSERT_LINE);
399   set_interrupt(ASSERT_LINE);
400400}
401401
402402/***************************************************************************
r29404r29405
525525 set_data_transfer - setup for data transfer from/to data
526526 ***************************************************************************/
527527
528void omti8621_device::set_data_transfer(UINT8 *data, UINT16 length)
528void omti8621_device::set_data_transfer(UINT8 *data, UINT16 length)
529529{
530530   // set controller for read data transfer
531531   omti_state = OMTI_STATE_DATA;
r29404r29405
541541 read_sectors_from_disk - read sectors starting at diskaddr into sector_buffer
542542 ***************************************************************************/
543543
544void omti8621_device::read_sectors_from_disk(INT32 diskaddr, UINT8 count, UINT8 lun)
544void omti8621_device::read_sectors_from_disk(INT32 diskaddr, UINT8 count, UINT8 lun)
545545{
546546   UINT8 *data_buffer = sector_buffer;
547547   device_image_interface *image = our_disks[lun]->m_image;
r29404r29405
561561 write_sectors_to_disk - write sectors starting at diskaddr from sector_buffer
562562 ***************************************************************************/
563563
564void omti8621_device::write_sectors_to_disk(INT32 diskaddr, UINT8 count, UINT8 lun)
564void omti8621_device::write_sectors_to_disk(INT32 diskaddr, UINT8 count, UINT8 lun)
565565{
566566   UINT8 *data_buffer = sector_buffer;
567567   device_image_interface *image = our_disks[lun]->m_image;
r29404r29405
586586 copy_sectors - copy sectors
587587 ***************************************************************************/
588588
589void omti8621_device::copy_sectors(INT32 dst_addr, INT32 src_addr, UINT8 count, UINT8 lun)
589void omti8621_device::copy_sectors(INT32 dst_addr, INT32 src_addr, UINT8 count, UINT8 lun)
590590{
591591   device_image_interface *image = our_disks[lun]->m_image;
592592
r29404r29405
613613 format track - format a track
614614 ***************************************************************************/
615615
616void omti8621_device::format_track(const UINT8 * cdb)
616void omti8621_device::format_track(const UINT8 * cdb)
617617{
618618   UINT8 lun = get_lun(cdb);
619619   UINT32 disk_addr = get_disk_address(cdb);
r29404r29405
668668 log_command - log command from a command descriptor block
669669 ***************************************************************************/
670670
671void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
671void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
672672{
673673   if (verbose > 0) {
674674      int i;
r29404r29405
767767 log_data - log data in the common data buffer
768768 ***************************************************************************/
769769
770void omti8621_device::log_data()
770void omti8621_device::log_data()
771771{
772772   if (verbose > 0) {
773773      int i;
r29404r29405
788788 do_command
789789 ***************************************************************************/
790790
791void omti8621_device::do_command(const UINT8 cdb[], const UINT16 cdb_length)
791void omti8621_device::do_command(const UINT8 cdb[], const UINT16 cdb_length)
792792{
793793   UINT8 lun = get_lun(cdb);
794794   omti_disk_image_device *disk = our_disks[lun];
r29404r29405
943943//          LOG(("do_command: UNEXPECTED omti_state %02x",omti_state));
944944//      }
945945      status_port |= OMTI_STATUS_IREQ;
946      if (command_duration == 0)
946      if (command_duration == 0)
947947      {
948948         set_interrupt(ASSERT_LINE);
949      }
950      else
949      }
950      else
951951      {
952952         // FIXME: should delay omti_state and status_port as well
953953         m_timer->adjust(attotime::from_msec(command_duration), 0);
r29404r29405
959959 get_command_length
960960 ***************************************************************************/
961961
962UINT8 omti8621_device::get_command_length(UINT8 command_byte)
962UINT8 omti8621_device::get_command_length(UINT8 command_byte)
963963{
964964   return command_byte == OMTI_CMD_COPY ? 10 : 6;
965965}
r29404r29405
968968 get_data
969969 ***************************************************************************/
970970
971UINT16 omti8621_device::get_data()
971UINT16 omti8621_device::get_data()
972972{
973973   UINT16 data = 0xff;
974974   if (data_index < data_length) {
r29404r29405
989989 set_data
990990 ***************************************************************************/
991991
992void omti8621_device::set_data(UINT16 data)
992void omti8621_device::set_data(UINT16 data)
993993{
994994   if (data_index < data_length) {
995995      data_buffer[data_index++] = data >> 8;
r29404r29405
10081008
10091009WRITE16_MEMBER(omti8621_device::write)
10101010{
1011   switch (mem_mask)
1011   switch (mem_mask)
10121012   {
10131013      case 0x00ff:
10141014         write8(space, offset*2+1, data, mem_mask);
r29404r29405
10261026
10271027WRITE8_MEMBER(omti8621_device::write8)
10281028{
1029   switch (offset)
1029   switch (offset)
10301030   {
10311031   case OMTI_PORT_DATA_OUT: //  0x00
10321032      switch (omti_state) {
r29404r29405
11201120
11211121READ16_MEMBER(omti8621_device::read)
11221122{
1123   switch (mem_mask)
1123   switch (mem_mask)
11241124   {
11251125      case 0x00ff:
11261126         return read8(space, offset*2+1, mem_mask);
r29404r29405
11381138
11391139   switch (offset) {
11401140   case OMTI_PORT_DATA_IN: // 0x00
1141      if (status_port & OMTI_STATUS_CD)
1141      if (status_port & OMTI_STATUS_CD)
11421142      {
11431143         data = command_status;
1144         switch (omti_state)
1144         switch (omti_state)
11451145         {
11461146         case OMTI_STATE_COMMAND:
11471147            LOG2(("reading OMTI 8621 Data Status Register 1 at offset %02x = %02x (omti state = %02x)", offset, data, omti_state));
r29404r29405
11551155            LOG(("UNEXPECTED reading OMTI 8621 Data Status Register 3 at offset %02x = %02x (omti state = %02x)", offset, data, omti_state));
11561156            break;
11571157         }
1158      }
1159      else
1158      }
1159      else
11601160      {
11611161         LOG(("UNEXPECTED reading OMTI 8621 Data Register 4 at offset %02x = %02x (status bit C/D = 0)", offset, data));
11621162      }
r29404r29405
11651165   case OMTI_PORT_STATUS: // 0x01
11661166      data = status_port;
11671167      // omit excessive logging
1168      if (data != last_data)
1168      if (data != last_data)
11691169      {
11701170         LOG2(("reading OMTI 8621 Status Register 5 at offset %02x = %02x", offset, data));
11711171//          last_data = data;
r29404r29405
13421342-------------------------------------------------*/
13431343
13441344void omti_disk_image_device::device_reset()
1345{   
1345{
13461346   LOG1(("device_reset_omti_disk"));
13471347
13481348   if (exists() && fseek(0, SEEK_END) == 0)
r29404r29405
13791379   }
13801380   return IMAGE_INIT_PASS;
13811381}
1382
trunk/src/emu/bus/isa/cga.c
r29404r29405
285285   m_vram.resize(m_vram_size);
286286   m_update_row = NULL;
287287   m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
288   m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", m_vram);   
288   m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", m_vram);
289289
290290   /* Initialise the cga palette */
291291   int i;
r29404r29405
17991799ROM_START( mc1502 )
18001800   ROM_REGION(0x2000,"gfx1", 0)
18011801   // taken from mc1502
1802   ROM_LOAD( "symgen.rom", 0x0000, 0x2000, CRC(b2747a52) SHA1(6766d275467672436e91ac2997ac6b77700eba1e))   
1802   ROM_LOAD( "symgen.rom", 0x0000, 0x2000, CRC(b2747a52) SHA1(6766d275467672436e91ac2997ac6b77700eba1e))
18031803ROM_END
18041804
18051805const rom_entry *isa8_cga_mc1502_device::device_rom_region() const
trunk/src/emu/bus/isa/aga.h
r29404r29405
3838   isa8_aga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3939   isa8_aga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
4040   // device-level overrides
41   virtual void device_start();   
41   virtual void device_start();
4242   // optional information overrides
4343   virtual machine_config_constructor device_mconfig_additions() const;
4444   virtual const rom_entry *device_rom_region() const;
r29404r29405
4646
4747   DECLARE_WRITE_LINE_MEMBER( hsync_changed );
4848   DECLARE_WRITE_LINE_MEMBER( vsync_changed );
49   
49
5050   DECLARE_READ8_MEMBER( pc_aga_mda_r );
5151   DECLARE_WRITE8_MEMBER( pc_aga_mda_w );
5252   DECLARE_READ8_MEMBER( pc_aga_cga_r );
r29404r29405
5656   DECLARE_WRITE8_MEMBER( pc_aga_videoram_w );
5757   DECLARE_READ8_MEMBER( pc_aga_videoram_r );
5858
59   required_device<palette_device> m_palette;   
60   required_device<mc6845_device> m_mc6845;   
61   
59   required_device<palette_device> m_palette;
60   required_device<mc6845_device> m_mc6845;
61
6262   required_ioport m_cga_config;
6363
6464   mc6845_update_row_func  m_update_row;
r29404r29405
7575   int   m_framecnt;
7676   UINT8   m_vsync;
7777   UINT8   m_hsync;
78   
7978
79
8080   UINT8   m_cga_palette_lut_2bpp[4];
8181
82   UINT8  *m_videoram;   
82   UINT8  *m_videoram;
8383};
8484
8585// device type definition
r29404r29405
9494   // construction/destruction
9595   isa8_aga_pc200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
9696   // device-level overrides
97   virtual void device_start();     
97   virtual void device_start();
9898   // optional information overrides
9999   virtual const rom_entry *device_rom_region() const;
100   
100
101101   UINT8 m_port8;
102102   UINT8 m_portd;
103103   UINT8 m_porte;
104   
104
105105   DECLARE_READ8_MEMBER( pc200_videoram_r );
106106   DECLARE_WRITE8_MEMBER( pc200_videoram_w );
107107   DECLARE_WRITE8_MEMBER( pc200_cga_w );
trunk/src/emu/bus/isa/omti8621.h
r29404r29405
22 * omti8621.h - SMS OMTI 8621 disk controller
33 *
44 *  Created on: August 30, 2010
5 *     Author: Hans Ostermeyer
6 *
5 *      Author: Hans Ostermeyer
6 *
77 *  Converted to ISA device March 3, 2014 by R. Belmont
88 *
99 *  Released for general non-commercial use under the MAME license
r29404r29405
2828 ***************************************************************************/
2929
3030class omti_disk_image_device;
31
31
3232/* ----- device interface ----- */
3333
3434class omti8621_device : public device_t, public device_isa16_card_interface
trunk/src/emu/bus/isa/cga.h
r29404r29405
6868   bool    m_superimpose;
6969   UINT8   m_plantronics; /* This should be moved into the appropriate subclass */
7070   offs_t  m_start_offset;
71   required_device<palette_device> m_palette;   
71   required_device<palette_device> m_palette;
7272};
7373
7474// device type definition
trunk/src/emu/bus/isa/ega.h
r29404r29405
9696      UINT8   m_vsync;
9797      UINT8   m_vblank;
9898      UINT8   m_display_enable;
99      required_device<palette_device> m_palette;   
99      required_device<palette_device> m_palette;
100100};
101101
102102
trunk/src/emu/bus/isa/gblaster.h
r29404r29405
2323
2424      // optional information overrides
2525      virtual machine_config_constructor device_mconfig_additions() const;
26     
26
2727      DECLARE_READ8_MEMBER(saa1099_16_r);
2828      DECLARE_WRITE8_MEMBER(saa1099_1_16_w);
2929      DECLARE_WRITE8_MEMBER(saa1099_2_16_w);
trunk/src/emu/bus/isa/isa.c
r29404r29405
243243      m_iowidth = m_iospace->data_width();
244244      m_prgwidth = m_prgspace->data_width();
245245   }
246   else   // use host CPU's program and I/O spaces directly
246   else    // use host CPU's program and I/O spaces directly
247247   {
248      m_iospace = &m_maincpu->space(AS_IO);
249      m_iowidth = m_maincpu->space_config(AS_IO)->m_databus_width;
248      m_iospace = &m_maincpu->space(AS_IO);
249      m_iowidth = m_maincpu->space_config(AS_IO)->m_databus_width;
250250      m_prgspace = &m_maincpu->space(AS_PROGRAM);
251      m_prgwidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width;
251      m_prgwidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width;
252252   }
253253}
254254
r29404r29405
679679void device_isa16_card_interface::dack16_w(int line,UINT16 data)
680680{
681681}
682
683
trunk/src/emu/bus/isa/sblaster.c
r29404r29405
11901190   set_isa_device();
11911191   // 1.0 always has the SAA1099s for CMS back-compatibility
11921192   m_isa->install_device(0x0220, 0x0221, 0, 0, read8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_1_16_w), this ) );
1193   m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_2_16_w), this ) );   
1193   m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_2_16_w), this ) );
11941194   m_isa->set_dma_channel(1, this, FALSE);
11951195   m_dsp.version = 0x0105;
11961196   sb8_device::device_start();
trunk/src/emu/bus/isa/isa.h
r29404r29405
156156   template<class _iochck> void set_iochck_callback(_iochck iochck) { m_write_iochck.set_callback(iochck); }
157157
158158   // for ISA8, put the 8-bit configs in the primary slots and the 16-bit configs in the secondary
159   virtual const address_space_config *memory_space_config(address_spacenum spacenum) const
160   {
159   virtual const address_space_config *memory_space_config(address_spacenum spacenum) const
160   {
161161      switch (spacenum)
162162      {
163163         case AS_PROGRAM: return &m_program_config;
164         case AS_IO:       return &m_io_config;
165         case AS_DATA:      return &m_program16_config;
166         case AS_3:       return &m_io16_config;
167         default:       fatalerror("isa: invalid memory space!\n");
164         case AS_IO:      return &m_io_config;
165         case AS_DATA:    return &m_program16_config;
166         case AS_3:       return &m_io16_config;
167         default:         fatalerror("isa: invalid memory space!\n");
168168      }
169169   }
170170
171171   void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler);
172   template<typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map, device_t &device), int bits = 8, UINT64 unitmask = U64(0xffffffffffffffff))
172   template<typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map, device_t &device), int bits = 8, UINT64 unitmask = U64(0xffffffffffffffff))
173173   {
174      m_iospace->install_device(addrstart, addrend, device, map, bits, unitmask);   
174      m_iospace->install_device(addrstart, addrend, device, map, bits, unitmask);
175175   }
176176   void install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data);
177177   void install_rom(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, const char *region);
r29404r29405
331331   void install16_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_delegate rhandler, write16_delegate whandler);
332332
333333   // for ISA16, put the 16-bit configs in the primary slots and the 8-bit configs in the secondary
334   virtual const address_space_config *memory_space_config(address_spacenum spacenum) const
335   {
334   virtual const address_space_config *memory_space_config(address_spacenum spacenum) const
335   {
336336      switch (spacenum)
337337      {
338338         case AS_PROGRAM: return &m_program16_config;
339         case AS_IO:       return &m_io16_config;
340         case AS_DATA:    return &m_program_config;
341         case AS_3:       return &m_io_config;
342         default:       fatalerror("isa: invalid memory space!\n");
339         case AS_IO:      return &m_io16_config;
340         case AS_DATA:    return &m_program_config;
341         case AS_3:       return &m_io_config;
342         default:         fatalerror("isa: invalid memory space!\n");
343343      }
344344   }
345345
trunk/src/emu/bus/isa/side116.h
r29404r29405
2626// ======================> side116_device
2727
2828class side116_device : public device_t,
29                  public device_isa8_card_interface
29                  public device_isa8_card_interface
3030{
3131public:
3232   // construction/destruction
trunk/src/emu/bus/isa/sblaster.h
r29404r29405
157157public:
158158      // construction/destruction
159159      sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source);
160     
160
161161      DECLARE_READ8_MEMBER(ym3812_16_r);
162      DECLARE_WRITE8_MEMBER(ym3812_16_w);     
162      DECLARE_WRITE8_MEMBER(ym3812_16_w);
163163protected:
164164      virtual void device_start();
165165      virtual void drq_w(int state) { m_isa->drq1_w(state); }
166166      virtual void irq_w(int state, int source) { m_isa->irq5_w(state); }
167167      virtual UINT8 dack_r(int line) { return sb_device::dack_r(line); }
168168      virtual void dack_w(int line, UINT8 data) { sb_device::dack_w(line, data); }
169private:     
170      required_device<ym3812_device> m_ym3812;     
169private:
170      required_device<ym3812_device> m_ym3812;
171171};
172172
173173class isa8_sblaster1_0_device : public sb8_device
r29404r29405
189189      // internal state
190190      required_device<saa1099_device> m_saa1099_1;
191191      required_device<saa1099_device> m_saa1099_2;
192     
192
193193};
194194
195195class isa8_sblaster1_5_device : public sb8_device
trunk/src/emu/bus/isa/dectalk.c
r29404r29405
143143   ROM_LOAD16_BYTE("pc_boot_hxl.am27c64.d6.e26", 0x0000, 0x2000, CRC(7492f1e3) SHA1(fe6946a227f01c94f2b99220320a616445c96ee0)) // Some cards have a different label on the chip which lists the sum16: 31AC (matches contents)
144144   ROM_LOAD16_BYTE("pc_boot_hxh.am27c64.d8.e27", 0x0001, 0x2000, CRC(1fe7fe40) SHA1(6e89c237f01aa22e0d21ff4d6fdf8137c6ace374)) // Some cards have a different label on the chip which lists the sum16: 1A25 (matches contents)
145145   ROM_REGION( 0x2000, "dectalk_dsp", 0 )
146   ROM_LOAD("spc_034c__2-1-92.tms320p15nl.d3.bin", 0x0000, 0x2000, CRC(d8b1201e) SHA1(4b873a5e882205fcac79a27562054b5c4d1a117c))
146   ROM_LOAD("spc_034c__2-1-92.tms320p15nl.d3.bin", 0x0000, 0x2000, CRC(d8b1201e) SHA1(4b873a5e882205fcac79a27562054b5c4d1a117c))
147147ROM_END
148148
149149const rom_entry* dectalk_isa_device::device_rom_region() const
trunk/src/emu/bus/comx35/printer.c
r29404r29405
7373   MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit1))
7474   MCFG_CENTRONICS_PERROR_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit2))
7575   MCFG_CENTRONICS_SELECT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit3))
76    MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
76   MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
7777
7878   MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0)
7979MACHINE_CONFIG_END
trunk/src/emu/bus/comx35/exp.h
r29404r29405
7474class device_comx_expansion_card_interface;
7575
7676class comx_expansion_slot_device : public device_t,
77                           public device_slot_interface
77                           public device_slot_interface
7878{
7979public:
8080   // construction/destruction
trunk/src/emu/bus/cbmiec/c1541.c
r29404r29405
706706//-------------------------------------------------
707707
708708static SLOT_INTERFACE_START( c1540_floppies )
709    SLOT_INTERFACE( "525ssqd", ALPS_3255190x )
709   SLOT_INTERFACE( "525ssqd", ALPS_3255190x )
710710SLOT_INTERFACE_END
711711
712712
r29404r29405
715715//-------------------------------------------------
716716
717717FLOPPY_FORMATS_MEMBER( base_c1541_device::floppy_formats )
718    FLOPPY_D64_FORMAT,
719    FLOPPY_G64_FORMAT
718   FLOPPY_D64_FORMAT,
719   FLOPPY_G64_FORMAT
720720FLOPPY_FORMATS_END
721721
722722
r29404r29405
889889
890890   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image")
891891   MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(MC6821_TAG, pia6821_device, ca1_w))
892    MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
892   MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
893893MACHINE_CONFIG_END
894894
895895
trunk/src/emu/bus/cbmiec/c1571.c
r29404r29405
1313
1414    TODO:
1515
16   - WD1770 set_floppy
16    - WD1770 set_floppy
1717    - 1571CR
1818        - MOS5710
1919    - ICT Mini Chief MC-20
r29404r29405
698698   MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c1571_device, cia_pb_r))
699699   MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_device, cia_pb_w))
700700   MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_device, cia_pc_w))
701   
701
702702   MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
703703   MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz)
704704   MCFG_64H156_BYTE_CALLBACK(WRITELINE(c1571_device, byte_w))
trunk/src/emu/bus/cbmiec/c1541.h
r29404r29405
4040// ======================> base_c1541_device
4141
4242class base_c1541_device :  public device_t,
43                     public device_cbm_iec_interface,
44                     public device_c64_floppy_parallel_interface
43                     public device_cbm_iec_interface,
44                     public device_c64_floppy_parallel_interface
4545{
4646public:
4747   // construction/destruction
trunk/src/emu/bus/cbmiec/c1571.h
r29404r29405
4242// ======================> c1571_device
4343
4444class c1571_device :  public device_t,
45                 public device_cbm_iec_interface,
46                 public device_c64_floppy_parallel_interface
45                  public device_cbm_iec_interface,
46                  public device_c64_floppy_parallel_interface
4747{
4848public:
4949   // construction/destruction
trunk/src/emu/bus/nes/act53.c
r29404r29405
77 Visit http://mamedev.org for licensing and usage restrictions.
88
99
10 Here we emulate the Multi-Discrete PCB designed by Tepples for
10 Here we emulate the Multi-Discrete PCB designed by Tepples for
1111 this homebew multicart [mapper 28]
1212
1313 ***********************************************************************************************************/
r29404r29405
6767
6868 Board ACTION 53
6969
70 In MESS: *VERY* preliminary support.
71 
70 In MESS: *VERY* preliminary support.
71
7272 This board uses 4 registers (reg is selected by writes to 0x5xxx)
7373 Info from nesdev wiki
74
74
7575 R:$00:  [...M ..CC]
7676     C = CHR Reg
7777     M = Mirroring
7878         This bit overwrites bit 0 of R:$80, but only if bit 1 of
7979         R:$80 is clear
80
80
8181 R:$01:  [...M PPPP]
8282     P = PRG Reg
8383     M = Mirroring
8484         This bit overwrites bit 0 of R:$80, but only if bit 1 of
8585         R:$80 is clear
86
86
8787 R:$80:  [..GG PSMM]
8888     G = Game Size (0=32K, 1=64K, 2=128K, 3=256K)
8989     P = PRG Size (0=32k mode, 1=16k mode)
r29404r29405
106106void nes_action53_device::update_prg()
107107{
108108   UINT8 prg_lo = 0, prg_hi = 0, helper = 0;
109   UINT8 out = (m_reg[3] & 0x3f) << 1;      // Outer PRG reg
110   UINT8 size = (m_reg[2] & 0x30) >> 4;   // Game size
111   UINT8 mask = (1 << (size + 1)) - 1;      // Bits to be taken from PRG reg
109   UINT8 out = (m_reg[3] & 0x3f) << 1;     // Outer PRG reg
110   UINT8 size = (m_reg[2] & 0x30) >> 4;    // Game size
111   UINT8 mask = (1 << (size + 1)) - 1;     // Bits to be taken from PRG reg
112112
113113   if (!BIT(m_reg[2], 3))
114114   {
r29404r29405
134134      }
135135   }
136136
137//   printf("banks : 0x%2X - 0x%2X\n", prg_lo, prg_hi);
137//  printf("banks : 0x%2X - 0x%2X\n", prg_lo, prg_hi);
138138   prg16_89ab(prg_lo);
139139   prg16_cdef(prg_hi);
140140}
trunk/src/emu/bus/nes/nes_ines.inc
r29404r29405
5656   { 24, KONAMI_VRC6 },
5757   { 25, KONAMI_VRC4 },
5858   { 26, KONAMI_VRC6 },
59   { 27, UNL_WORLDHERO },   // 27 World Hero board - Unsupported
60   { 28, BTL_ACTION53 },   // 28 - Multi-discrete PCB designed by Tepples for Action 53
59   { 27, UNL_WORLDHERO },  // 27 World Hero board - Unsupported
60   { 28, BTL_ACTION53 },   // 28 - Multi-discrete PCB designed by Tepples for Action 53
6161   // 29 Unused
6262   // 30 Unused
6363   // 31 Unused
r29404r29405
132132   // 100 images hacked to work with nesticle?
133133   // 101 Unused (Urusei Yatsura had been assigned to this mapper, but it's Mapper 87)
134134   // 102 Unused
135   { 103, UNL_2708 },   // 103 Bootleg cart 2708 (Doki Doki Panic - FDS Conversion) - Unsupported
135   { 103, UNL_2708 },  // 103 Bootleg cart 2708 (Doki Doki Panic - FDS Conversion) - Unsupported
136136   { 104, CAMERICA_GOLDENFIVE },
137137   { 105, STD_EVENT },
138138   { 106, BTL_SMB3 },
r29404r29405
191191   { 159, BANDAI_LZ93EX1 }, // with 24c01
192192   { 160, SACHEN_SA009 },
193193   // 161 Unused
194   { 162, WAIXING_FS304},   // not confirmed, but a lot of chinese releases use it like this...
194   { 162, WAIXING_FS304},  // not confirmed, but a lot of chinese releases use it like this...
195195   { 163, NANJING_BOARD},
196196   { 164, WAIXING_FFV },
197197   { 165, WAIXING_SH2 },
r29404r29405
264264   { 232, CAMERICA_BF9096 },
265265   { 233, BMC_SUPER22 },
266266   { 234, AVE_MAXI15 },
267   { 235, BMC_GOLD150 },   // 235 Golden Game x-in-1 - Unsupported
267   { 235, BMC_GOLD150 },   // 235 Golden Game x-in-1 - Unsupported
268268   // 236 Game 800-in-1 - Unsupported
269269   // 237 Unused
270270   { 238, UNL_603_5052 },
r29404r29405
525525   switch (m_pcb_id)
526526   {
527527      case STD_NROM:
528         if (prg_size == 3 * 0x4000)   // NROM368 are padded with 2k empty data at start to accomplish with iNES standard
528         if (prg_size == 3 * 0x4000) // NROM368 are padded with 2k empty data at start to accomplish with iNES standard
529529         {
530530            m_pcb_id = STD_NROM368;
531531            fseek(0x810, SEEK_SET);
r29404r29405
834834   }
835835
836836   // use info from nes.hsi if available!
837//   if (hashfile_extrainfo(*this, mapinfo))
837//  if (hashfile_extrainfo(*this, mapinfo))
838838   if (0)
839839   {
840840      if (4 == sscanf(mapinfo,"%d %d %d %d", &mapint1, &mapint2, &mapint3, &mapint4))
trunk/src/emu/bus/nes/camerica.c
r29404r29405
1313 * Camerica BF9096 Boards [mapper 232]
1414 * Camerica Golden Five [mapper 104]
1515
16 Aladdin Deck Enhancer pass-thru cart and the corresponding minicarts
16 Aladdin Deck Enhancer pass-thru cart and the corresponding minicarts
1717 (ALGNV11 & ALGQV11 PCBs) are emulated in a separate source file.
1818
19
19
2020 TODO:
2121 - check what causes flickering from PPU in Fire Hawk, Poogie and Big Nose (same PPU issue as Back to
2222   Future 2&3?)
r29404r29405
189189   {
190190      m_latch = data & 3;
191191      prg16_89ab(m_bank_base | m_latch);
192   }   
192   }
193193}
194194
195195/*-------------------------------------------------
trunk/src/emu/bus/nes/mmc5.c
r29404r29405
117117   m_split_chr = 0;
118118   m_ex1_bank = 0;
119119   m_vcount = 0;
120   
120
121121   memset(m_vrom_bank, 0x3ff, ARRAY_LENGTH(m_vrom_bank));
122122   m_prg_regs[0] = 0xfc;
123123   m_prg_regs[1] = 0xfd;
r29404r29405
241241void nes_exrom_device::hblank_irq(int scanline, int vblank, int blanked )
242242{
243243   m_vcount = scanline;
244   
244
245245   if (scanline == m_irq_count)
246246   {
247247      if (m_irq_enable)
r29404r29405
284284{
285285   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
286286   int tile = ppu->get_tilenum();
287   
287
288288   if (tile < 34)
289289   {
290290      if (!m_split_rev && tile < m_split_ctrl)
r29404r29405
303303   {
304304      case MMC5FILL:
305305         if ((offset & 0x3ff) >= 0x3c0)
306            return m_floodattr;         
306            return m_floodattr;
307307         return m_floodtile;
308308
309309      case EXRAM:
r29404r29405
315315
316316      case CIRAM:
317317      default:
318         // Uchuu Keibitai SDF uses extensively split screen for its intro,
318         // Uchuu Keibitai SDF uses extensively split screen for its intro,
319319         // but it does not work yet
320320         if (m_split_scr && !(m_exram_control & 0x02) && in_split())
321321         {
r29404r29405
338338         {
339339            if ((offset & 0x3ff) >= 0x3c0)
340340               return m_mmc5_attrib[(m_exram[offset & 0x3ff] >> 6) & 0x03];
341            else   // in this case, we write Ex1 CHR bank, but then access NT normally!
341            else    // in this case, we write Ex1 CHR bank, but then access NT normally!
342342            {
343343               m_ex1_chr = 1;
344344               m_ex1_bank = (m_exram[offset & 0x3ff] & 0x3f) | (m_high_chr << 6);
r29404r29405
350350
351351WRITE8_MEMBER(nes_exrom_device::nt_w)
352352{
353   int page = ((offset & 0xc00) >> 10);   
354   
353   int page = ((offset & 0xc00) >> 10);
354
355355   if (!m_nt_writable[page])
356356      return;
357   
357
358358   switch (m_nt_src[page])
359359   {
360360      case EXRAM:
361361         m_exram[offset & 0x3ff] = data;
362362         break;
363         
363
364364      case CIRAM:
365365      default:
366366         m_nt_access[page][offset & 0x3ff] = data;
r29404r29405
415415   // However, if a game enables Ex1 but does not write a new m_ex1_bank, I'm not sure here we get the correct behavior
416416   if (m_exram_control == 1 && ppu->get_draw_phase() == PPU_DRAW_BG && m_ex1_chr)
417417      return bg_ex1_chr_r(offset & 0xfff);
418   
418
419419   if (m_split_scr && !(m_exram_control & 0x02) && in_split() && ppu->get_draw_phase() == PPU_DRAW_BG && m_split_chr)
420420      return split_chr_r(offset & 0xfff);
421   
421
422422   if (ppu->is_sprite_8x16())
423423   {
424424      if (ppu->get_draw_phase() == PPU_DRAW_OAM)
r29404r29405
444444   if ((offset >= 0x1c00) && (offset <= 0x1fff))
445445   {
446446      // EXRAM
447      if (BIT(m_exram_control, 1))   // Modes 2,3 = read
447      if (BIT(m_exram_control, 1))    // Modes 2,3 = read
448448         return m_exram[offset - 0x1c00];
449      else         
449      else
450450         return m_open_bus;   // Modes 0,1 = open bus
451451   }
452452
r29404r29405
486486   if ((offset >= 0x1c00) && (offset <= 0x1fff))
487487   {
488488      // EXRAM
489      if (m_exram_control == 0x02)   // Mode 2 = write data
489      if (m_exram_control == 0x02)    // Mode 2 = write data
490490         m_exram[offset - 0x1c00] = data;
491      else if (m_exram_control != 0x03)   // Modes 0,1 = write data in frame / write 0 otherwise
491      else if (m_exram_control != 0x03)   // Modes 0,1 = write data in frame / write 0 otherwise
492492      {
493493         if (m_irq_status & 0x40)
494494            m_exram[offset - 0x1c00] = data;
r29404r29405
554554      case 0x1116:
555555      case 0x1117:
556556         m_prg_regs[offset & 3] = data & 0x7f;
557         m_prg_ram_mapped[offset & 3] = !BIT(data, 7);   // m_prg_ram_mapped[3] is not used, in fact!
557         m_prg_ram_mapped[offset & 3] = !BIT(data, 7);   // m_prg_ram_mapped[3] is not used, in fact!
558558         update_prg();
559559         break;
560560
trunk/src/emu/bus/nes/nxrom.c
r29404r29405
283283 -------------------------------------------------*/
284284
285285/*-------------------------------------------------
286
286
287287 NROM-368 board emulation
288
288
289289 iNES: mapper 0 with 3xPRG banks
290290 This is an homebrew extension to map linearly 46KB
291291 or PRG in boards with no PRG bankswitch logic
292
292
293293 In MESS: Supported
294
294
295295 -------------------------------------------------*/
296296
297297READ8_MEMBER(nes_nrom368_device::read_l)
r29404r29405
425425   // For most boards, chr_open_bus remains always zero.
426426   if (m_chr_open_bus)
427427      return m_open_bus;
428   
428
429429   return m_chr_access[bank][offset & 0x3ff];
430430}
431431
r29404r29405
549549}
550550
551551/*-------------------------------------------------
552
552
553553 NoCash NOCHR board emulation
554
554
555555 This is an homebrew PCB design on a single chip
556556 (+possibly CIC) which uses the NTRAM as CHRRAM!
557
557
558558 iNES: mapper 218
559
559
560560 In MESS: Supported.
561
561
562562 -------------------------------------------------*/
563563
564564WRITE8_MEMBER(nes_nochr_device::chr_w)
r29404r29405
569569   else if (mirr == PPU_MIRROR_LOW)
570570      m_ciram[(offset & 0x3ff) + 0x400] = data;
571571   else
572      m_ciram[offset & 0x7ff] = data;   // not sure here, since there is no software to test...
572      m_ciram[offset & 0x7ff] = data; // not sure here, since there is no software to test...
573573}
574574
575575READ8_MEMBER(nes_nochr_device::chr_r)
r29404r29405
580580   else if (mirr == PPU_MIRROR_LOW)
581581      return m_ciram[(offset & 0x3ff) + 0x400];
582582   else
583      return m_ciram[offset & 0x7ff];   // not sure here, since there is no software to test...
583      return m_ciram[offset & 0x7ff]; // not sure here, since there is no software to test...
584584}
trunk/src/emu/bus/nes/karastudio.c
r29404r29405
88
99
1010 Here we emulate the following PCBs Bandai Karaoke Studio [mapper 188]
11
11
1212 The Karaoke Studio cart consist of a large connector which fits the FC cart slot, with a microphone
13 connected. The game data is in the connector itself. The microphone has two buttons on it, and the
14 game uses these only to navigate through the menus (the two buttons are not read through the controller
15 port, which is not accessible from the cart, but from $6000-$7fff). Part of the connector body can be
13 connected. The game data is in the connector itself. The microphone has two buttons on it, and the
14 game uses these only to navigate through the menus (the two buttons are not read through the controller
15 port, which is not accessible from the cart, but from $6000-$7fff). Part of the connector body can be
1616 removed to be replaced by an expansion cart containing new songs (we emulate this by adding a -cart2 slot).
1717
18
18
1919 TODO:
2020 - verify expansion slot emulation for the Senyou Cassettes:
2121   not much documentation exists about the expansion carts (except for few paragraphs
2222   at Enri's FC webpage), so I implemented it based on "common sense"
2323   * expansion carts do not contain the required game data => main PRG must be in the main cart
24     so to remain connected even when an expansion is inserted (differently from Datach, where
24     so to remain connected even when an expansion is inserted (differently from Datach, where
2525     the base unit contains no PRG)
26   * bankswicth writes with bit3=0 (to access expansion) when no expansion is present should do
26   * bankswicth writes with bit3=0 (to access expansion) when no expansion is present should do
2727     nothing
2828
2929 ***********************************************************************************************************/
r29404r29405
4343
4444//-----------------------------------------
4545//
46//   Karaoke Studio Cartslot implementation
46//  Karaoke Studio Cartslot implementation
4747//
4848//-----------------------------------------
4949
r29404r29405
9393{
9494   if (m_cart)
9595      return m_cart->read(space, offset, mem_mask);
96   
96
9797   return 0xff;
9898}
9999
r29404r29405
102102   if (m_cart)
103103   {
104104      UINT8 *ROM = m_cart->get_cart_base();
105     
105
106106      if (!ROM)
107107         return IMAGE_INIT_FAIL;
108     
108
109109      // Existing exapnsion carts are all 128K, so we only load files of this size
110110      if (software_entry() == NULL)
111111      {
112112         if (length() != 0x20000)
113113            return IMAGE_INIT_FAIL;
114         
115         fread(&ROM, 0x20000);         
114
115         fread(&ROM, 0x20000);
116116      }
117117      else
118118      {
119119         if (get_software_region_length("rom") != 0x20000)
120120            return IMAGE_INIT_FAIL;
121         
121
122122         memcpy(ROM, get_software_region("rom"), 0x20000);
123123      }
124124   }
125   
125
126126   return IMAGE_INIT_PASS;
127127}
128128
r29404r29405
141141
142142//-----------------------------------------------
143143//
144//   Karaoke Studio Expansion cart implementation
144//  Karaoke Studio Expansion cart implementation
145145//
146146//-----------------------------------------------
147147
r29404r29405
181181
182182//------------------------------------------
183183//
184//   Karaoke Studio Base Cart implementation
184//  Karaoke Studio Base Cart implementation
185185//
186186//------------------------------------------
187187
r29404r29405
220220
221221 Bandai Karaoke Studio board emulation
222222
223 Games: Karaoke Studio + expansion carts with
223 Games: Karaoke Studio + expansion carts with
224224 additional songs
225225
226226 Note: we currently do not emulate properly the
r29404r29405
260260   // cart (when expansion is present, code keeps switching both from the expansion rom and from
261261   // the main ROM)
262262   // my guess is that writes with bit3=0 and no expansion just do nothing, but it shall be verified
263   
263
264264   if (offset >= 04000)
265265   {
266266      if (BIT(data, 3))
r29404r29405
268268         m_exp_active = 0;
269269         prg16_89ab(data & 7);
270270      }
271      else   // expansion cart
271      else    // expansion cart
272272      {
273273         m_exp_active = 1;
274274         m_subslot->write_prg_bank(data & 7);
r29404r29405
308308{
309309   return MACHINE_CONFIG_NAME( karaoke_studio );
310310}
311
trunk/src/emu/bus/nes/mmc5.h
r29404r29405
6666   UINT8 m_prg_ram_mapped[4];
6767
6868   UINT8 m_ex1_bank;
69   
69
7070   UINT8 m_high_chr;   // $5130
7171
7272   UINT8 m_split_scr;  // $5200
trunk/src/emu/bus/nes/karastudio.h
r29404r29405
66
77//-----------------------------------------
88//
9//   Karaoke Studio Cartslot implementation
9//  Karaoke Studio Cartslot implementation
1010//
1111//-----------------------------------------
1212
r29404r29405
1818   // construction/destruction
1919   kstudio_cart_interface(const machine_config &mconfig, device_t &device);
2020   virtual ~kstudio_cart_interface();
21   
21
2222   // reading and writing
2323   virtual DECLARE_READ8_MEMBER(read);
24   
24
2525   UINT8 *get_cart_base() { return m_rom; }
2626   void write_prg_bank(UINT8 bank) { m_bank = bank; }
27   
27
2828protected:
2929   // internal state
3030   UINT8 *m_rom;
r29404r29405
4242   // construction/destruction
4343   nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4444   virtual ~nes_kstudio_slot_device();
45   
45
4646   // device-level overrides
4747   virtual void device_start();
4848   virtual void device_config_complete() { update_names(); }
49   
49
5050   // image-level overrides
5151   virtual bool call_load();
5252   virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
53   
53
5454   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
5555   virtual bool is_readable()  const { return 1; }
5656   virtual bool is_writeable() const { return 0; }
r29404r29405
6060   virtual const char *image_interface() const { return "ks_cart"; }
6161   virtual const char *file_extensions() const { return "bin"; }
6262   virtual const option_guide *create_option_guide() const { return NULL; }
63   
63
6464   // slot interface overrides
6565   virtual void get_default_card_software(astring &result);
66   
66
6767   virtual DECLARE_READ8_MEMBER(read);
6868   void write_prg_bank(UINT8 bank) { if (m_cart) m_cart->write_prg_bank(bank); }
69   
69
7070   kstudio_cart_interface*      m_cart;
7171};
7272
r29404r29405
8181
8282//-----------------------------------------------
8383//
84//   Karaoke Studio Expansion cart implementation
84//  Karaoke Studio Expansion cart implementation
8585//
8686//-----------------------------------------------
8787
r29404r29405
9393public:
9494   // construction/destruction
9595   nes_kstudio_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
96   
96
9797   // optional information overrides
9898   virtual const rom_entry *device_rom_region() const;
9999   virtual UINT8* get_cart_base();
100   
100
101101protected:
102102   // device-level overrides
103103   virtual void device_start();
r29404r29405
110110
111111//-------------------------------------------
112112//
113//   Karaoke Studio Base Cart implementation
113//  Karaoke Studio Base Cart implementation
114114//
115115//-------------------------------------------
116116
trunk/src/emu/bus/nes/bandai.c
r29404r29405
1919 * Bandai Datach Joint ROM System [mapper 157] is emulated in a separate source file
2020   to implement also the subslot, but the PCB is basically a Bandai LZ93D50 + 24C02 EEPROM
2121   pcb with added barcode reader and subslot
22
22
2323 * Bandai Karaoke Studio [mapper 188] is emulated in a separate source file
2424   to implement also the subslot and the mic inputs
25 
26 
25
26
2727 TODO:
2828 - investigate why EEPROM does not work
2929 - add support to the PPU for the code necessary to Oeka Kids games (also needed by UNL-DANCE2000 PCB)
trunk/src/emu/bus/nes/nes_carts.c
r29404r29405
127127   SLOT_INTERFACE_INTERNAL("bf9093",           NES_BF9093)
128128   SLOT_INTERFACE_INTERNAL("bf9096",           NES_BF9096)
129129   SLOT_INTERFACE_INTERNAL("goldenfive",       NES_GOLDEN5)
130   SLOT_INTERFACE_INTERNAL("ade",            NES_ALADDIN)
130   SLOT_INTERFACE_INTERNAL("ade",              NES_ALADDIN)
131131   SLOT_INTERFACE_INTERNAL("cne_decathl",      NES_CNE_DECATHL)
132132   SLOT_INTERFACE_INTERNAL("cne_fsb",          NES_CNE_FSB)
133133   SLOT_INTERFACE_INTERNAL("cne_shlz",         NES_CNE_SHLZ)
r29404r29405
354354//
355355   SLOT_INTERFACE_INTERNAL("unknown",          NES_NROM)  //  a few pirate dumps uses the wrong mapper...
356356SLOT_INTERFACE_END
357
trunk/src/emu/bus/nes/bandai.h
r29404r29405
3838   // construction/destruction
3939   nes_fcg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
4040   nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
41   
41
4242   // device-level overrides
4343   virtual void device_start();
4444   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
r29404r29405
4646   virtual DECLARE_WRITE8_MEMBER(write_m);
4747
4848   virtual void pcb_reset();
49   
49
5050protected:
5151   UINT16     m_irq_count;
5252   int        m_irq_enable;
53   
53
5454   static const device_timer_id TIMER_IRQ = 0;
5555   emu_timer *irq_timer;
5656};
trunk/src/emu/bus/nes/datach.c
r29404r29405
3535
3636//--------------------------------
3737//
38//   Datach Cartslot implementation
38//  Datach Cartslot implementation
3939//
4040//--------------------------------
4141
r29404r29405
5555}
5656
5757READ8_MEMBER(datach_cart_interface::read)
58{
58{
5959   if (offset < 0x4000)
6060      return m_rom[(m_bank * 0x4000) + (offset & 0x3fff)];
6161   else
r29404r29405
113113         fread(&temp, length());
114114         memcpy(ROM, temp + shift, 0x40000);
115115
116         // double check that iNES files are really mapper 157
116         // double check that iNES files are really mapper 157
117117         // (or 16, since some older .nes files marked Datach as mapper 16)
118118         if (length() == 0x40010)
119119         {
r29404r29405
153153
154154//--------------------------------
155155//
156//   Datach Minicart implementation
156//  Datach Minicart implementation
157157//
158158//  Two kinds of PCB exist
159159//  * ROM only, used by most games
r29404r29405
221221
222222//---------------------------------
223223//
224//   Datach Base Unit implementation
224//  Datach Base Unit implementation
225225//
226226//---------------------------------
227227
r29404r29405
244244   serial_timer = timer_alloc(TIMER_SERIAL);
245245   irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
246246   serial_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1000));
247   
247
248248   save_item(NAME(m_irq_enable));
249249   save_item(NAME(m_irq_count));
250250   save_item(NAME(m_datach_latch));
r29404r29405
256256   prg16_89ab(0);
257257   prg16_cdef(m_prg_chunks - 1);
258258   chr8(0, m_chr_source);
259   
259
260260   m_irq_enable = 0;
261261   m_irq_count = 0;
262262   m_datach_latch = 0;
r29404r29405
269269 -------------------------------------------------*/
270270
271271/*-------------------------------------------------
272
272
273273 Bandai LZ93D50 + Datach barcode reader emulation
274
274
275275 Games: Datach Games
276
276
277277 iNES: mappers 157
278
278
279279 In MESS: Supported
280
280
281281 TODO: Datach carts should actually be handled
282282 separately! Original carts were minicarts to be
283283 inserted in a smaller slot of the Barcode reader
284284 FC cart. The Barcode reader acts as a passthrough
285285 but it has no internal ROM (it does not work if
286286 you don't have any minicart inserted)
287 
288 TODO2: This class should be derived from the
287
288 TODO2: This class should be derived from the
289289 LZ93D50 + X24C02 class, since the main board
290 has this EEPROM. Moreover, Datach - Battle Rush
290 has this EEPROM. Moreover, Datach - Battle Rush
291291 has a second X24C01 EEPROM that we don't emulate yet...
292
292
293293 -------------------------------------------------*/
294294
295295
r29404r29405
318318
319319   if (m_subslot->m_cart)
320320      return m_subslot->m_cart->read(space, offset, mem_mask);
321   else   // this is "fake" in the sense that we fill CPU space with 0xff if no Datach cart is loaded
321   else    // this is "fake" in the sense that we fill CPU space with 0xff if no Datach cart is loaded
322322      return hi_access_rom(offset);
323323}
324324
325325WRITE8_MEMBER(nes_datach_device::write_h)
326326{
327327   LOG_MMC(("Datach write_h, offset: %04x, data: %02x\n", offset, data));
328   
328
329329   switch (offset & 0x0f)
330330   {
331331      case 0: case 1: case 2: case 3:
r29404r29405
406406            m_irq_count = 0xffff;
407407         else
408408            m_irq_count--;
409         
409
410410         if (!m_irq_count)
411411         {
412412            machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
trunk/src/emu/bus/nes/datach.h
r29404r29405
77
88//--------------------------------
99//
10//   Datach Cartslot implementation
10//  Datach Cartslot implementation
1111//
1212//--------------------------------
1313
r29404r29405
8484
8585//--------------------------------
8686//
87//   Datach Minicart implementation
87//  Datach Minicart implementation
8888//
8989//--------------------------------
9090
r29404r29405
127127
128128//---------------------------------
129129//
130//   Datach Base Unit implementation
130//  Datach Base Unit implementation
131131//
132132//---------------------------------
133133
r29404r29405
138138public:
139139   // construction/destruction
140140   nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
141   
141
142142   // device-level overrides
143143   virtual void device_start();
144144   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
r29404r29405
146146   virtual DECLARE_READ8_MEMBER(read_m);
147147   virtual DECLARE_READ8_MEMBER(read_h);
148148   virtual DECLARE_WRITE8_MEMBER(write_h);
149   
149
150150   virtual void pcb_reset();
151   
151
152152protected:
153153   UINT8 m_datach_latch;
154154   required_device<i2cmem_device> m_i2cmem;
155   required_device<barcode_reader_device> m_reader;   
155   required_device<barcode_reader_device> m_reader;
156156   required_device<nes_datach_slot_device> m_subslot;
157157   UINT8 m_i2c_dir;
158158   UINT8 m_i2c_in_use;
159   
159
160160   static const device_timer_id TIMER_SERIAL = 1;
161161   emu_timer *serial_timer;
162162};
trunk/src/emu/bus/nes/sunsoft_dcs.c
r29404r29405
2727
2828//-----------------------------------------------
2929//
30//   Nantettate!! Baseball Cartslot implementation
30//  Nantettate!! Baseball Cartslot implementation
3131//
3232//-----------------------------------------------
3333
r29404r29405
119119
120120//-----------------------------------------------
121121//
122//   Nantettate!! Baseball Minicart implementation
122//  Nantettate!! Baseball Minicart implementation
123123//
124124//-----------------------------------------------
125125
r29404r29405
154154
155155//------------------------------------------------
156156//
157//   Nantettate!! Baseball base cart implementation
158//  a.k.a. Sunsoft Dual Cassette System
157//  Nantettate!! Baseball base cart implementation
158//  a.k.a. Sunsoft Dual Cassette System
159159//  (variant of Sunsoft-4 PCB)
160160//
161161//------------------------------------------------
trunk/src/emu/bus/nes/nes_slot.h
r29404r29405
119119   WAIXING_DQ8, WAIXING_FFV, WAIXING_WXZS2, SUPERGAME_LIONKING, SUPERGAME_BOOGERMAN,
120120   KAY_BOARD, HOSENKAN_BOARD, NITRA_TDA, GOUDER_37017, NANJING_BOARD,
121121   WHIRLWIND_2706,
122   NOCASH_NOCHR,   // homebrew PCB design which uses NTRAM for CHRRAM
123   BTL_ACTION53,   // homebrew PCB for homebrew multicarts
122   NOCASH_NOCHR,   // homebrew PCB design which uses NTRAM for CHRRAM
123   BTL_ACTION53,   // homebrew PCB for homebrew multicarts
124124   /* FFE boards, for mappers 6, 8, 17 */
125125   FFE3_BOARD, FFE4_BOARD, FFE8_BOARD, TEST_BOARD,
126126   /* Unsupported (for place-holder boards, with no working emulation) & no-board (at init) */
trunk/src/emu/bus/nes/aladdin.c
r29404r29405
3131
3232//----------------------------------
3333//
34//   Aladdin Cartslot implementation
34//  Aladdin Cartslot implementation
3535//
3636//----------------------------------
3737
r29404r29405
5252}
5353
5454READ8_MEMBER(aladdin_cart_interface::read)
55{
55{
5656   if (offset < 0x4000)
5757      return m_rom[(m_lobank * 0x4000) + (offset & 0x3fff)];
5858   else
r29404r29405
8686{
8787   if (m_cart)
8888      return m_cart->read(space, offset, mem_mask);
89   
89
9090   return 0xff;
9191}
9292
r29404r29405
100100
101101      if (!ROM)
102102         return IMAGE_INIT_FAIL;
103     
103
104104      if (software_entry() == NULL)
105105      {
106106         if (length() != 0x20010 && length() != 0x40010)
107107            return IMAGE_INIT_FAIL;
108         
108
109109         UINT8 temp[0x40010];
110110         size = length() - 0x10;
111111         fread(&temp, length());
112112         memcpy(ROM, temp + 0x10, size);
113         
114         // double check that iNES files are really mapper 71 or 232
113
114         // double check that iNES files are really mapper 71 or 232
115115         {
116116            UINT8 mapper = (temp[6] & 0xf0) >> 4;
117117            mapper |= temp[7] & 0xf0;
r29404r29405
123123      {
124124         if (get_software_region_length("rom") != 0x20000 && get_software_region_length("rom") != 0x40000)
125125            return IMAGE_INIT_FAIL;
126         
126
127127         size = get_software_region_length("rom");
128128         memcpy(ROM, get_software_region("rom"), size);
129129      }
130130
131131      m_cart->set_cart_size(size);
132132   }
133   
133
134134   return IMAGE_INIT_PASS;
135135}
136136
r29404r29405
149149      UINT32 len = core_fsize(m_file);
150150      dynamic_buffer rom(len);
151151      UINT8 mapper;
152   
152
153153      core_fread(m_file, rom, len);
154154
155155      mapper = (rom[6] & 0xf0) >> 4;
156156      mapper |= rom[7] & 0xf0;
157157
158//      if (mapper == 71)
159//         slot_string = "algn";
158//      if (mapper == 71)
159//          slot_string = "algn";
160160      if (mapper == 232)
161161         slot_string = "algq";
162162
163163      clear();
164     
164
165165      result.cpy(slot_string);
166166   }
167167   else
r29404r29405
171171
172172//----------------------------------
173173//
174//   Aladdin Minicart implementation
174//  Aladdin Minicart implementation
175175//
176176//----------------------------------
177177
r29404r29405
262262
263263//-----------------------------------------------
264264//
265//   Camerica/Codemasters Aladdin passthru
265//  Camerica/Codemasters Aladdin passthru
266266//  implementation
267267//
268268//-----------------------------------------------
r29404r29405
295295/*-------------------------------------------------
296296
297297 Camerica/Codemasters Aladdin Deck Enhancer
298
298
299299 iNES: mapper 71 & 232
300300
301301 In MESS: Supported (but timing issues in some games)
r29404r29405
307307   LOG_MMC(("aladdin read_h, offset: %04x\n", offset));
308308   // this shall be the proper code, but it's a bit slower, so we access directly the subcart below
309309   //return m_subslot->read(space, offset, mem_mask);
310   
310
311311   if (m_subslot->m_cart)
312312      return m_subslot->m_cart->read(space, offset, mem_mask);
313   else   // this is "fake" in the sense that we fill CPU space with 0xff if no Aladdin cart is loaded
313   else    // this is "fake" in the sense that we fill CPU space with 0xff if no Aladdin cart is loaded
314314      return hi_access_rom(offset);
315315}
316316
trunk/src/emu/bus/nes/sunsoft_dcs.h
r29404r29405
66
77//-----------------------------------------------
88//
9//   Nantettate!! Baseball Cartslot implementation
9//  Nantettate!! Baseball Cartslot implementation
1010//
1111//-----------------------------------------------
1212
r29404r29405
7777
7878//-----------------------------------------------
7979//
80//   Nantettate!! Baseball Minicart implementation
80//  Nantettate!! Baseball Minicart implementation
8181//
8282//-----------------------------------------------
8383
r29404r29405
106106
107107//------------------------------------------------
108108//
109//   Nantettate!! Baseball base cart implementation
110//  a.k.a. Sunsoft Dual Cassette System
109//  Nantettate!! Baseball base cart implementation
110//  a.k.a. Sunsoft Dual Cassette System
111111//  (variant of Sunsoft-4 PCB)
112112//
113113//------------------------------------------------
trunk/src/emu/bus/nes/aladdin.h
r29404r29405
66
77//----------------------------------
88//
9//   Aladdin Cartslot implementation
9//  Aladdin Cartslot implementation
1010//
1111//----------------------------------
1212
r29404r29405
1818   // construction/destruction
1919   aladdin_cart_interface(const machine_config &mconfig, device_t &device);
2020   virtual ~aladdin_cart_interface();
21   
21
2222   // reading and writing
2323   virtual DECLARE_READ8_MEMBER(read);
24   
24
2525   UINT8 *get_cart_base() { return m_rom; }
2626   void set_cart_size(UINT32 size) { m_rom_size = size; m_rom_mask = (size / 0x4000) - 1; }
2727   virtual void write_prg(UINT32 offset, UINT8 data) { }
28   
28
2929protected:
3030   // internal state
3131   UINT8 *m_rom;
r29404r29405
4343   // construction/destruction
4444   nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4545   virtual ~nes_aladdin_slot_device();
46   
46
4747   // device-level overrides
4848   virtual void device_start();
4949   virtual void device_config_complete() { update_names(); }
50   
50
5151   // image-level overrides
5252   virtual bool call_load();
5353   virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
54   
54
5555   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
5656   virtual bool is_readable()  const { return 1; }
5757   virtual bool is_writeable() const { return 0; }
r29404r29405
6161   virtual const char *image_interface() const { return "ade_cart"; }
6262   virtual const char *file_extensions() const { return "nes,bin"; }
6363   virtual const option_guide *create_option_guide() const { return NULL; }
64   
64
6565   // slot interface overrides
6666   virtual void get_default_card_software(astring &result);
67   
67
6868   virtual DECLARE_READ8_MEMBER(read);
6969   void write_prg(UINT32 offset, UINT8 data) { if (m_cart) m_cart->write_prg(offset, data); }
70   
70
7171   aladdin_cart_interface*      m_cart;
7272};
7373
r29404r29405
8282
8383//----------------------------------
8484//
85//   Aladdin Minicart implementation
85//  Aladdin Minicart implementation
8686//
8787//----------------------------------
8888
r29404r29405
9595   // construction/destruction
9696   nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
9797   nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
98   
98
9999   // optional information overrides
100100   virtual const rom_entry *device_rom_region() const;
101101   virtual UINT8* get_cart_base();
102102   virtual void write_prg(UINT32 offset, UINT8 data);
103   
103
104104protected:
105105   // device-level overrides
106106   virtual void device_start();
r29404r29405
115115public:
116116   // construction/destruction
117117   nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
118   
118
119119   // optional information overrides
120120   virtual void write_prg(UINT32 offset, UINT8 data);
121121
r29404r29405
134134
135135//-----------------------------------------------
136136//
137//   Codemasters Aladdin passthru implementation
137//  Codemasters Aladdin passthru implementation
138138//
139139//-----------------------------------------------
140140
trunk/src/emu/bus/nes/jy.c
r29404r29405
310310         prg32((last & 0x0f) | (exPrg >> 2));
311311         m_bank_6000 = (((m_mmc_prg_bank[3] * 4) + 3) & 0x3f) | (exPrg >> 2);
312312         break;
313         
313
314314      case 1: // 16KB
315315         prg16_89ab((m_mmc_prg_bank[1] & 0x1f) | (exPrg >> 1));
316316         prg16_cdef((last & 0x1f) | (exPrg >> 1));
317317         m_bank_6000 = (((m_mmc_prg_bank[3] * 2) + 1) & 0x1f) | (exPrg >> 1);
318318         break;
319         
319
320320      case 2: // 8KB
321321         prg8_89(m_mmc_prg_bank[0] | exPrg);
322322         prg8_ab(m_mmc_prg_bank[1] | exPrg);
r29404r29405
324324         prg8_ef(last | exPrg);
325325         m_bank_6000 = m_mmc_prg_bank[3] | exPrg;
326326         break;
327         
327
328328      case 3: // 8KB Alt
329329         prg8_89((unscramble(m_mmc_prg_bank[0]) & 0x3f) | exPrg);
330330         prg8_ab((unscramble(m_mmc_prg_bank[1]) & 0x3f) | exPrg);
r29404r29405
347347   // Block mode enabled: in this case lower bits select a 256KB page inside CHRROM
348348   // and the low bytes of m_mmc_vrom_bank select the banks inside such a page
349349
350   // docs suggest m_reg[3] & 0x1f for chr_page below,
350   // docs suggest m_reg[3] & 0x1f for chr_page below,
351351   // but 45 in 1 (JY-120A) menu requires to use this (from NEStopia)
352   UINT8 chr_page = (m_reg[3] & 1) | ((m_reg[3] & 0x18) >> 2);   
352   UINT8 chr_page = (m_reg[3] & 1) | ((m_reg[3] & 0x18) >> 2);
353353   UINT32 extra_chr_base = BIT(m_reg[3], 5) ? 0 : (chr_page * 0x100);
354354   UINT32 extra_chr_mask = BIT(m_reg[3], 5) ? 0xffffff : 0xff;
355   
355
356356   switch (m_reg[0] & 0x18)
357357   {
358358      case 0x00:  // 8KB
r29404r29405
360360         extra_chr_mask >>= 3;
361361         chr8(extra_chr_base | (m_mmc_vrom_bank[0] & extra_chr_mask), m_chr_source);
362362         break;
363         
363
364364      case 0x08:  // 4KB
365365         extra_chr_base >>= 2;
366366         extra_chr_mask >>= 2;
r29404r29405
369369         chr4_0(extra_chr_base | (m_mmc_vrom_bank[m_chr_latch[0]] & extra_chr_mask), m_chr_source);
370370         chr4_4(extra_chr_base | (m_mmc_vrom_bank[m_chr_latch[1]] & extra_chr_mask), m_chr_source);
371371         break;
372         
372
373373      case 0x10:  // 2KB
374374         extra_chr_base >>= 1;
375375         extra_chr_mask >>= 1;
r29404r29405
378378         chr2_4(extra_chr_base | (m_mmc_vrom_bank[4] & extra_chr_mask), m_chr_source);
379379         chr2_6(extra_chr_base | (m_mmc_vrom_bank[6] & extra_chr_mask), m_chr_source);
380380         break;
381         
381
382382      case 0x18:  // 1KB
383383         chr1_0(extra_chr_base | (m_mmc_vrom_bank[0] & extra_chr_mask), m_chr_source);
384384         chr1_1(extra_chr_base | (m_mmc_vrom_bank[1] & extra_chr_mask), m_chr_source);
r29404r29405
573573READ8_MEMBER(nes_jy_typec_device::chr_r)
574574{
575575   int bank = offset >> 10;
576   
576
577577   irq_clock(0, 2);
578578   switch (offset & 0xff0)
579579   {
trunk/src/emu/bus/nes/jy.h
r29404r29405
2020   virtual DECLARE_READ8_MEMBER(read_m);
2121   virtual DECLARE_WRITE8_MEMBER(write_l);
2222   virtual DECLARE_WRITE8_MEMBER(write_h);
23   
23
2424   virtual DECLARE_READ8_MEMBER(chr_r);
2525   virtual DECLARE_READ8_MEMBER(nt_r);
2626
r29404r29405
3939   UINT8 m_mul[2];
4040   UINT8 m_latch;
4141   UINT8 m_reg[4];
42   UINT8 m_chr_latch[2];   // type C uses a more complex CHR 4K mode, and these vars are only changed for those games
42   UINT8 m_chr_latch[2];   // type C uses a more complex CHR 4K mode, and these vars are only changed for those games
4343   UINT8 m_mmc_prg_bank[4];
4444   UINT16 m_mmc_nt_bank[4];
4545   UINT16 m_mmc_vrom_bank[8];
trunk/src/emu/render.c
r29404r29405
12121212
12131213            // get visible area
12141214            rectangle visarea = (screen->screen_type() == SCREEN_TYPE_VECTOR)
1215               ? rectangle(0, 639, 0, 479)   // use a hard-coded default visible area for vector screens
1215               ? rectangle(0, 639, 0, 479) // use a hard-coded default visible area for vector screens
12161216               : screen->visible_area();
12171217
12181218            // is our visible area too small?  if so, we need to bump up the size
trunk/src/emu/emupal.c
r29404r29405
8787
8888
8989//**************************************************************************
90//   INDIRECTION (AKA COLORTABLES)
90//  INDIRECTION (AKA COLORTABLES)
9191//**************************************************************************
9292
9393//-------------------------------------------------
r29404r29405
132132
133133//-------------------------------------------------
134134//  transpen_mask - return a mask of pens that
135//  whose indirect values match the given
135//  whose indirect values match the given
136136//  transcolor
137137//-------------------------------------------------
138138
r29404r29405
160160
161161//-------------------------------------------------
162162//  configure_tilemap_groups - configure groups
163//   within a tilemap to match the indirect masks
163//  within a tilemap to match the indirect masks
164164//-------------------------------------------------
165165
166166void palette_device::configure_tilemap_groups(tilemap_t &tmap, gfx_element &gfx, int transcolor)
r29404r29405
227227//-------------------------------------------------
228228
229229//-------------------------------------------------
230//  set_shadow_dRGB32 - configure delta RGB values
230//  set_shadow_dRGB32 - configure delta RGB values
231231//  for 1 of 4 shadow tables
232232//-------------------------------------------------
233233
r29404r29405
269269         g = rgb_t::clamp(g);
270270         b = rgb_t::clamp(b);
271271      }
272      rgb_t final = rgb_t(r, g, b);
272      rgb_t final = rgb_t(r, g, b);
273273
274274      // store either 16 or 32 bit
275275      if (m_format == BITMAP_FORMAT_RGB32)
r29404r29405
282282
283283
284284//**************************************************************************
285//   GENERIC WRITE HANDLERS
285//  GENERIC WRITE HANDLERS
286286//**************************************************************************
287287
288288//-------------------------------------------------
289289//  update_for_write - given a write of a given
290//   length to a given byte offset, update all
291//   potentially modified palette entries
290//  length to a given byte offset, update all
291//  potentially modified palette entries
292292//-------------------------------------------------
293293
294294inline void palette_device::update_for_write(offs_t byte_offset, int bytes_modified)
r29404r29405
319319   m_paletteram.write8(offset, data);
320320   update_for_write(offset, 1);
321321}
322
322
323323WRITE16_MEMBER(palette_device::write)
324324{
325325   m_paletteram.write16(offset, data, mem_mask);
r29404r29405
349349
350350
351351//-------------------------------------------------
352//  write_ext - write a byte to the extended
352//  write_ext - write a byte to the extended
353353//  paletteram
354354//-------------------------------------------------
355355
r29404r29405
369369
370370
371371//**************************************************************************
372//   DEVICE MANAGEMENT
372//  DEVICE MANAGEMENT
373373//**************************************************************************
374374
375375//-------------------------------------------------
r29404r29405
379379void palette_device::device_start()
380380{
381381   // bind the init function
382    m_init.bind_relative_to(*owner());
382   m_init.bind_relative_to(*owner());
383383
384384   // find the memory, if present
385385   const memory_share *share = memshare(tag());
r29404r29405
401401         m_paletteram.set(*share, bytes_per_entry / 2);
402402         m_paletteram_ext.set(*share_ext, bytes_per_entry / 2);
403403      }
404     
404
405405      // override endianness if provided
406406      if (m_endianness_supplied)
407407      {
r29404r29405
421421      allocate_palette();
422422      allocate_color_tables();
423423      allocate_shadow_tables();
424     
424
425425      // allocate indirection tables
426426      if (m_indirect_entries > 0)
427427      {
r29404r29405
447447   m_save_contrast.resize(m_palette->num_colors());
448448   save_item(NAME(m_save_pen));
449449   save_item(NAME(m_save_contrast));
450   
450
451451   // save indirection tables if we have them
452452   if (m_indirect_entries > 0)
453453   {
r29404r29405
510510
511511//-------------------------------------------------
512512//  device_validity_check - validate device
513//   configuration
513//  configuration
514514//-------------------------------------------------
515515
516516void palette_device::device_validity_check(validity_checker &valid) const
trunk/src/emu/validity.c
r29404r29405
966966void validity_checker::validate_devices()
967967{
968968   int_map device_map;
969   
969
970970   device_iterator iter_find(m_current_config->root_device());
971971   for (const device_t *device = iter_find.first(); device != NULL; device = iter_find.next())
972972   {
trunk/src/emu/clifront.h
r29404r29405
114114   cli_options &       m_options;
115115   osd_interface &     m_osd;
116116   int                 m_result;
117   UINT64            m_start_memory;
117   UINT64              m_start_memory;
118118};
119119
120120
trunk/src/emu/emupal.h
r29404r29405
159159
160160#define MCFG_PALETTE_ADD(_tag, _entries) \
161161   MCFG_DEVICE_ADD(_tag, PALETTE, 0) \
162   MCFG_PALETTE_ENTRIES(_entries) \
163
162   MCFG_PALETTE_ENTRIES(_entries)
164163#define MCFG_PALETTE_ADD_INIT_BLACK(_tag, _entries) \
165164   MCFG_PALETTE_ADD(_tag, _entries) \
166165   palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_all_black), downcast<palette_device *>(device)));
r29404r29405
262261   // constructor
263262   raw_to_rgb_converter(int bytes_per_entry = 0, raw_to_rgb_func func = NULL)
264263      : m_bytes_per_entry(bytes_per_entry),
265        m_func(func) { }
266   
264         m_func(func) { }
265
267266   // getters
268267   int bytes_per_entry() const { return m_bytes_per_entry; }
269   
268
270269   // helpers
271270   rgb_t operator()(UINT32 raw) const { return (*m_func)(raw); }
272271
r29404r29405
297296      UINT8 b = pal4bit(((raw >> 4) & 0x0c) | i);
298297      return rgb_t(r, g, b);
299298   }
300   
299
301300   // other standard decoders
302   static rgb_t RRRRGGGGBBBBRGBx_decoder(UINT32 raw);   // bits 3/2/1 are LSb
303   static rgb_t xRGBRRRRGGGGBBBB_decoder(UINT32 raw);   // bits 14/13/12 are LSb
301   static rgb_t RRRRGGGGBBBBRGBx_decoder(UINT32 raw);  // bits 3/2/1 are LSb
302   static rgb_t xRGBRRRRGGGGBBBB_decoder(UINT32 raw);  // bits 14/13/12 are LSb
304303
305304private:
306305   // internal data
307   int               m_bytes_per_entry;
308   raw_to_rgb_func      m_func;
306   int                 m_bytes_per_entry;
307   raw_to_rgb_func     m_func;
309308};
310309
311310
r29404r29405
314313// device type definition
315314extern const device_type PALETTE;
316315
317class palette_device :    public device_t
316class palette_device : public device_t
318317{
319318   static const int MAX_SHADOW_PRESETS = 4;
320319
r29404r29405
330329   static void static_set_indirect_entries(device_t &device, int entries);
331330   static void static_enable_shadows(device_t &device);
332331   static void static_enable_hilights(device_t &device);
333   
332
334333   // getters
335334   int entries() const { return m_entries; }
336335   int indirect_entries() const { return m_indirect_entries; }
r29404r29405
339338   const pen_t *pens() const { return m_pens; }
340339   pen_t *shadow_table() const { return m_shadow_table; }
341340   rgb_t pen_color(pen_t pen) { return m_palette->entry_color(pen); }
342   double pen_contrast(pen_t pen) { return m_palette->entry_contrast(pen); }
341   double pen_contrast(pen_t pen) { return m_palette->entry_contrast(pen); }
343342   pen_t black_pen() const { return m_black_pen; }
344343   pen_t white_pen() const { return m_white_pen; }
345344   memory_array &basemem() { return m_paletteram; }
r29404r29405
365364   void set_shadow_factor(double factor) { assert(m_shadow_group != 0); m_palette->group_set_contrast(m_shadow_group, factor); }
366365   void set_highlight_factor(double factor) { assert(m_hilight_group != 0); m_palette->group_set_contrast(m_hilight_group, factor); }
367366   void set_shadow_mode(int mode) { assert(mode >= 0 && mode < MAX_SHADOW_PRESETS); m_shadow_table = m_shadow_tables[mode].base; }
368   
367
369368   // generic read/write handlers
370369   DECLARE_READ8_MEMBER(read);
371370   DECLARE_WRITE8_MEMBER(write);
r29404r29405
388387   void palette_init_RRRRRGGGGGBBBBB(palette_device &palette);
389388   void palette_init_BBBBBGGGGGRRRRR(palette_device &palette);
390389   void palette_init_RRRRRGGGGGGBBBBB(palette_device &palette);
391   
390
392391   // helper to update palette when data changed
393392   void update() { if (!m_init.isnull()) m_init(*this); }
394393protected:
r29404r29405
402401   void allocate_palette();
403402   void allocate_color_tables();
404403   void allocate_shadow_tables();
405   
404
406405   void update_for_write(offs_t byte_offset, int bytes_modified);
407public:   // needed by konamigx
406public: // needed by konamigx
408407   void set_shadow_dRGB32(int mode, int dr, int dg, int db, bool noclip);
409408protected:
410409   void configure_rgb_shadows(int mode, float factor);
411   
410
412411private:
413412   // configuration state
414   int               m_entries;            // number of entries in the palette
415   int               m_indirect_entries;      // number of indirect colors in the palette
416   bool            m_enable_shadows;      // are shadows enabled?
417   bool            m_enable_hilights;      // are hilights enabled?
418   endianness_t      m_endianness;         // endianness of palette RAM
419   bool            m_endianness_supplied;   // endianness supplied in static config
413   int                 m_entries;              // number of entries in the palette
414   int                 m_indirect_entries;     // number of indirect colors in the palette
415   bool                m_enable_shadows;       // are shadows enabled?
416   bool                m_enable_hilights;      // are hilights enabled?
417   endianness_t        m_endianness;           // endianness of palette RAM
418   bool                m_endianness_supplied;  // endianness supplied in static config
420419
421420   // palette RAM
422   raw_to_rgb_converter m_raw_to_rgb;         // format of palette RAM
423   memory_array      m_paletteram;         // base memory
424   memory_array      m_paletteram_ext;      // extended memory
421   raw_to_rgb_converter m_raw_to_rgb;          // format of palette RAM
422   memory_array        m_paletteram;           // base memory
423   memory_array        m_paletteram_ext;       // extended memory
425424
426425   // internal state
427   palette_t *         m_palette;            // the palette itself
428   const pen_t *       m_pens;             // remapped palette pen numbers
429   bitmap_format       m_format;            // format assumed for palette data
430   pen_t *             m_shadow_table;         // table for looking up a shadowed pen
431   UINT32              m_shadow_group;         // index of the shadow group, or 0 if none
432   UINT32              m_hilight_group;      // index of the hilight group, or 0 if none
433   pen_t               m_white_pen;         // precomputed white pen value
434   pen_t               m_black_pen;         // precomputed black pen value
435   
426   palette_t *         m_palette;              // the palette itself
427   const pen_t *       m_pens;                 // remapped palette pen numbers
428   bitmap_format       m_format;               // format assumed for palette data
429   pen_t *             m_shadow_table;         // table for looking up a shadowed pen
430   UINT32              m_shadow_group;         // index of the shadow group, or 0 if none
431   UINT32              m_hilight_group;        // index of the hilight group, or 0 if none
432   pen_t               m_white_pen;            // precomputed white pen value
433   pen_t               m_black_pen;            // precomputed black pen value
434
436435   // indirection state
437   dynamic_array<rgb_t> m_indirect_colors;      // actual colors set for indirection
438   dynamic_array<UINT16> m_indirect_pens;      // indirection values
436   dynamic_array<rgb_t> m_indirect_colors;     // actual colors set for indirection
437   dynamic_array<UINT16> m_indirect_pens;      // indirection values
439438
440439   struct shadow_table_data
441440   {
r29404r29405
449448
450449   dynamic_array<pen_t> m_save_pen;           // pens for save/restore
451450   dynamic_array<float> m_save_contrast;      // brightness for save/restore
452   
451
453452   dynamic_array<pen_t> m_pen_array;
454453   dynamic_array<pen_t> m_shadow_array;
455454   dynamic_array<pen_t> m_hilight_array;
trunk/src/emu/validity.h
r29404r29405
4747   // helpers for devices
4848   void validate_tag(const char *tag);
4949   int region_length(const char *tag) { return m_region_map.find(tag); }
50   
50
5151   // generic registry of already-checked stuff
5252   bool already_checked(const char *string) { return (m_already_checked.add(string, 1, false) == TMERR_DUPLICATE); }
53   
53
5454private:
5555   // internal helpers
5656   const char *ioport_string_from_index(UINT32 index);
r29404r29405
9999   const device_t *        m_current_device;
100100   const char *            m_current_ioport;
101101   int_map                 m_region_map;
102   tagmap_t<UINT8>         m_already_checked;
102   tagmap_t<UINT8>         m_already_checked;
103103
104104   // callbacks
105105   output_delegate         m_saved_error_output;
trunk/src/emu/ui/menu.h
r29404r29405
2121    CONSTANTS
2222***************************************************************************/
2323
24// flags for menu items
24// flags for menu items
2525#define MENU_FLAG_LEFT_ARROW        (1 << 0)
2626#define MENU_FLAG_RIGHT_ARROW       (1 << 1)
2727#define MENU_FLAG_INVERT            (1 << 2)
r29404r29405
2929#define MENU_FLAG_REDTEXT           (1 << 4)
3030#define MENU_FLAG_DISABLE           (1 << 5)
3131
32// special menu item for separators
32// special menu item for separators
3333#define MENU_SEPARATOR_ITEM         "---"
3434
35// flags to pass to ui_menu_process
35// flags to pass to ui_menu_process
3636#define UI_MENU_PROCESS_NOKEYS      1
3737#define UI_MENU_PROCESS_LR_REPEAT   2
3838#define UI_MENU_PROCESS_CUSTOM_ONLY 4
3939
40// options for ui_menu_reset
40// options for ui_menu_reset
4141enum ui_menu_reset_options
4242{
4343   UI_MENU_RESET_SELECT_FIRST,
r29404r29405
5151    TYPE DEFINITIONS
5252***************************************************************************/
5353
54// menu-related events
54// menu-related events
5555struct ui_menu_event
5656{
57   void *          itemref;            // reference for the selected item
58   int             iptkey;             // one of the IPT_* values from inptport.h
59   unicode_char    unichar;            // unicode character if iptkey == IPT_SPECIAL
57   void *          itemref;            // reference for the selected item
58   int             iptkey;             // one of the IPT_* values from inptport.h
59   unicode_char    unichar;            // unicode character if iptkey == IPT_SPECIAL
6060};
6161
6262struct ui_menu_pool
6363{
64   ui_menu_pool *      next;           // chain to next one
65   UINT8 *             top;            // top of the pool
66   UINT8 *             end;            // end of the pool
64   ui_menu_pool *      next;           // chain to next one
65   UINT8 *             top;            // top of the pool
66   UINT8 *             end;            // end of the pool
6767};
6868
6969
r29404r29405
8686
8787   running_machine &machine() const { return m_machine; }
8888
89   render_container *  container;          // render_container we render to
90   ui_menu_event       menu_event;         // the UI menu_event that occurred
91   ui_menu *           parent;             // pointer to parent menu
92   int                 resetpos;           // reset position
93   void *              resetref;           // reset reference
94   int                 selected;           // which item is selected
95   int                 hover;              // which item is being hovered over
96   int                 visitems;           // number of visible items
97   int                 numitems;           // number of items in the menu
98   int                 allocitems;         // allocated size of array
99   ui_menu_item *      item;               // pointer to array of items
100   float               customtop;          // amount of extra height to add at the top
101   float               custombottom;       // amount of extra height to add at the bottom
102   ui_menu_pool *      pool;               // list of memory pools
89   render_container *  container;          // render_container we render to
90   ui_menu_event       menu_event;         // the UI menu_event that occurred
91   ui_menu *           parent;             // pointer to parent menu
92   int                 resetpos;           // reset position
93   void *              resetref;           // reset reference
94   int                 selected;           // which item is selected
95   int                 hover;              // which item is being hovered over
96   int                 visitems;           // number of visible items
97   int                 numitems;           // number of items in the menu
98   int                 allocitems;         // allocated size of array
99   ui_menu_item *      item;               // pointer to array of items
100   float               customtop;          // amount of extra height to add at the top
101   float               custombottom;       // amount of extra height to add at the bottom
102   ui_menu_pool *      pool;               // list of memory pools
103103
104   // free all items in the menu, and all memory allocated from the memory pool
104   // free all items in the menu, and all memory allocated from the memory pool
105105   void reset(ui_menu_reset_options options);
106106
107   // returns true if the menu has any non-default items in it
107   // returns true if the menu has any non-default items in it
108108   bool populated();
109109
110   // append a new item to the end of the menu
110   // append a new item to the end of the menu
111111   void item_append(const char *text, const char *subtext, UINT32 flags, void *ref);
112112
113   // process a menu, drawing it and returning any interesting events
113   // process a menu, drawing it and returning any interesting events
114114   const ui_menu_event *process(UINT32 flags);
115115
116   // configure the menu for custom rendering
116   // configure the menu for custom rendering
117117   virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
118118
119   // allocate temporary memory from the menu's memory pool
119   // allocate temporary memory from the menu's memory pool
120120   void *m_pool_alloc(size_t size);
121121
122   // make a temporary string copy in the menu's memory pool
122   // make a temporary string copy in the menu's memory pool
123123   const char *pool_strdup(const char *string);
124124
125   // retrieves the index of the currently selected menu item
125   // retrieves the index of the currently selected menu item
126126   void *get_selection();
127127
128   // changes the index of the currently selected menu item
128   // changes the index of the currently selected menu item
129129   void set_selection(void *selected_itemref);
130130
131   // request the specific handling of the game selection main menu
131   // request the specific handling of the game selection main menu
132132   bool is_special_main_menu() const;
133133   void set_special_main_menu(bool disable);
134134
135   // Global initialization
135   // Global initialization
136136   static void init(running_machine &machine);
137137   static void exit(running_machine &machine);
138138
139   // reset the menus, clearing everything
139   // reset the menus, clearing everything
140140   static void stack_reset(running_machine &machine);
141141
142   // push a new menu onto the stack
142   // push a new menu onto the stack
143143   static void stack_push(ui_menu *menu);
144144
145   // pop a menu from the stack
145   // pop a menu from the stack
146146   static void stack_pop(running_machine &machine);
147147
148   // test if one of the menus in the stack requires hide disable
148   // test if one of the menus in the stack requires hide disable
149149   static bool stack_has_special_main_menu();
150150
151   // highlight
151   // highlight
152152   static void highlight(render_container *container, float x0, float y0, float x1, float y1, rgb_t bgcolor);
153153
154   // draw arrow
154   // draw arrow
155155   static void draw_arrow(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation);
156156
157   // master handler
157   // master handler
158158   static UINT32 ui_handler(running_machine &machine, render_container *container, UINT32 state);
159159
160   // Used by sliders
160   // Used by sliders
161161   void validate_selection(int scandir);
162162   static ui_menu *menu_stack;
163163
164164   void do_handle();
165165
166   // To be reimplemented in the menu subclass
166   // To be reimplemented in the menu subclass
167167   virtual void populate() = 0;
168168
169   // To be reimplemented in the menu subclass
169   // To be reimplemented in the menu subclass
170170   virtual void handle() = 0;
171171
172172private:
r29404r29405
188188   static void render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param);
189189};
190190
191#endif  // __UI_MENU_H__
191#endif  // __UI_MENU_H__
trunk/src/emu/ui/mainmenu.c
r29404r29405
246246      case BIOS_SELECTION:
247247         ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_bios_selection(machine(), container)));
248248         break;
249           
249
250250      case BARCODE_READ:
251251         ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_barcode_reader(machine(), container)));
252252         break;
253           
253
254254      default:
255255         fatalerror("ui_menu_main::handle - unknown reference\n");
256256      }
trunk/src/emu/ui/ui.c
r29404r29405
4040    LOCAL VARIABLES
4141***************************************************************************/
4242
43// list of natural keyboard keys that are not associated with UI_EVENT_CHARs
43// list of natural keyboard keys that are not associated with UI_EVENT_CHARs
4444static const input_item_id non_char_keys[] =
4545{
4646   ITEM_ID_ESC,
r29404r29405
8888    GLOBAL VARIABLES
8989***************************************************************************/
9090
91// messagebox buffer
91// messagebox buffer
9292static astring messagebox_text;
9393static rgb_t messagebox_backcolor;
9494
95// slider info
95// slider info
9696static slider_state *slider_list;
9797static slider_state *slider_current;
9898
r29404r29405
101101    FUNCTION PROTOTYPES
102102***************************************************************************/
103103
104// slider controls
104// slider controls
105105static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
106106static slider_state *slider_init(running_machine &machine);
107107static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval);
r29404r29405
221221ui_manager::ui_manager(running_machine &machine)
222222   : m_machine(machine)
223223{
224   // initialize the other UI bits
224   // initialize the other UI bits
225225   ui_menu::init(machine);
226226   ui_gfx_init(machine);
227227
228   // reset instance variables
228   // reset instance variables
229229   m_font = NULL;
230230   m_handler_callback = NULL;
231231   m_handler_param = 0;
r29404r29405
245245   // request a callback upon exiting
246246   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_manager::exit), this));
247247
248   // retrieve options
248   // retrieve options
249249   m_use_natural_keyboard = machine.options().natural_keyboard();
250250   bitmap_argb32 *ui_mouse_bitmap = auto_alloc(machine, bitmap_argb32(32, 32));
251251   UINT32 *dst = &ui_mouse_bitmap->pix32(0);
r29404r29405
265265   machine().render().texture_free(m_mouse_arrow_texture);
266266   m_mouse_arrow_texture = NULL;
267267
268   // free the font
268   // free the font
269269   if (m_font != NULL)
270270   {
271271      machine().render().font_free(m_font);
r29404r29405
280280
281281void ui_manager::initialize(running_machine &machine)
282282{
283   // initialize the on-screen display system
283   // initialize the on-screen display system
284284   slider_list = slider_current = slider_init(machine);
285285}
286286
r29404r29405
712712      if (curwidth > maxwidth)
713713         maxwidth = curwidth;
714714
715      // if opaque, add a black box
715      // if opaque, add a black box
716716      if (draw == DRAW_OPAQUE)
717717         container->add_rect(curx, cury, curx + curwidth, cury + lineheight, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
718718
r29404r29405
11311131      // get cpu specific clock that takes internal multiplier/dividers into account
11321132      int clock = exec->device().clock();
11331133
1134      // count how many identical CPUs we have
1134      // count how many identical CPUs we have
11351135      int count = 1;
11361136      const char *name = exec->device().name();
11371137      execute_interface_iterator execinneriter(machine().root_device());
r29404r29405
11421142               count++;
11431143      }
11441144
1145      // if more than one, prepend a #x in front of the CPU name
1145      // if more than one, prepend a #x in front of the CPU name
11461146      if (count > 1)
11471147         string.catprintf("%d" UTF8_MULTIPLY, count);
11481148      string.cat(name);
11491149
1150      // display clock in kHz or MHz
1150      // display clock in kHz or MHz
11511151      if (clock >= 1000000)
11521152         string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000);
11531153      else
11541154         string.catprintf(" %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000);
11551155   }
11561156
1157   // loop over all sound chips
1157   // loop over all sound chips
11581158   sound_interface_iterator snditer(machine().root_device());
11591159   tagmap_t<UINT8> soundtags;
11601160   bool found_sound = false;
r29404r29405
11631163      if (soundtags.add(sound->device().tag(), 1, FALSE) == TMERR_DUPLICATE)
11641164         continue;
11651165
1166      // append the Sound: string
1166      // append the Sound: string
11671167      if (!found_sound)
11681168         string.cat("\nSound:\n");
11691169      found_sound = true;
11701170
1171      // count how many identical sound chips we have
1171      // count how many identical sound chips we have
11721172      int count = 1;
11731173      sound_interface_iterator sndinneriter(machine().root_device());
11741174      for (device_sound_interface *scan = sndinneriter.first(); scan != NULL; scan = sndinneriter.next())
r29404r29405
11771177            if (soundtags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
11781178               count++;
11791179      }
1180      // if more than one, prepend a #x in front of the CPU name
1180      // if more than one, prepend a #x in front of the CPU name
11811181      if (count > 1)
11821182         string.catprintf("%d" UTF8_MULTIPLY, count);
11831183      string.cat(sound->device().name());
11841184
1185      // display clock in kHz or MHz
1185      // display clock in kHz or MHz
11861186      int clock = sound->device().clock();
11871187      if (clock >= 1000000)
11881188         string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000);
r29404r29405
11921192         string.cat("\n");
11931193   }
11941194
1195   // display screen information
1195   // display screen information
11961196   string.cat("\nVideo:\n");
11971197   screen_device_iterator scriter(machine().root_device());
11981198   int scrcount = scriter.count();
r29404r29405
12501250
12511251UINT32 ui_manager::handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state)
12521252{
1253   // draw a standard message window
1253   // draw a standard message window
12541254   machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
12551255
1256   // an 'O' or left joystick kicks us to the next state
1256   // an 'O' or left joystick kicks us to the next state
12571257   if (state == 0 && (machine.input().code_pressed_once(KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT)))
12581258      state++;
12591259
1260   // a 'K' or right joystick exits the state
1260   // a 'K' or right joystick exits the state
12611261   else if (state == 1 && (machine.input().code_pressed_once(KEYCODE_K) || ui_input_pressed(machine, IPT_UI_RIGHT)))
12621262      state = UI_HANDLER_CANCEL;
12631263
1264   // if the user cancels, exit out completely
1264   // if the user cancels, exit out completely
12651265   else if (ui_input_pressed(machine, IPT_UI_CANCEL))
12661266   {
12671267      machine.schedule_exit();
r29404r29405
12801280
12811281UINT32 ui_manager::handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state)
12821282{
1283   // draw a standard message window
1283   // draw a standard message window
12841284   machine.ui().draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
12851285
1286   // if the user cancels, exit out completely
1286   // if the user cancels, exit out completely
12871287   if (ui_input_pressed(machine, IPT_UI_CANCEL))
12881288   {
12891289      machine.schedule_exit();
12901290      state = UI_HANDLER_CANCEL;
12911291   }
12921292
1293   // if any key is pressed, just exit
1293   // if any key is pressed, just exit
12941294   else if (machine.input().poll_switches() != INPUT_CODE_INVALID)
12951295      state = UI_HANDLER_CANCEL;
12961296
r29404r29405
13121312   UINT8 *key_down_ptr;
13131313   UINT8 key_down_mask;
13141314
1315   // loop while we have interesting events
1315   // loop while we have interesting events
13161316   while (ui_input_pop_event(machine(), &event))
13171317   {
1318      // if this was a UI_EVENT_CHAR event, post it
1318      // if this was a UI_EVENT_CHAR event, post it
13191319      if (event.event_type == UI_EVENT_CHAR)
13201320         machine().ioport().natkeyboard().post(event.ch);
13211321   }
13221322
1323   // process natural keyboard keys that don't get UI_EVENT_CHARs
1323   // process natural keyboard keys that don't get UI_EVENT_CHARs
13241324   for (i = 0; i < ARRAY_LENGTH(non_char_keys); i++)
13251325   {
1326      // identify this keycode
1326      // identify this keycode
13271327      itemid = non_char_keys[i];
13281328      code = machine().input().code_from_itemid(itemid);
13291329
1330      // ...and determine if it is pressed
1330      // ...and determine if it is pressed
13311331      pressed = machine().input().code_pressed(code);
13321332
1333      // figure out whey we are in the key_down map
1333      // figure out whey we are in the key_down map
13341334      key_down_ptr = &m_non_char_keys_down[i / 8];
13351335      key_down_mask = 1 << (i % 8);
13361336
13371337      if (pressed && !(*key_down_ptr & key_down_mask))
13381338      {
1339         // this key is now down
1339         // this key is now down
13401340         *key_down_ptr |= key_down_mask;
13411341
1342         // post the key
1342         // post the key
13431343         machine().ioport().natkeyboard().post(UCHAR_MAMEKEY_BEGIN + code.item_id());
13441344      }
13451345      else if (!pressed && (*key_down_ptr & key_down_mask))
13461346      {
1347         // this key is now up
1347         // this key is now up
13481348         *key_down_ptr &= ~key_down_mask;
13491349      }
13501350   }
r29404r29405
13571357
13581358void ui_manager::increase_frameskip()
13591359{
1360   // get the current value and increment it
1360   // get the current value and increment it
13611361   int newframeskip = machine().video().frameskip() + 1;
13621362   if (newframeskip > MAX_FRAMESKIP)
13631363      newframeskip = -1;
13641364   machine().video().set_frameskip(newframeskip);
13651365
1366   // display the FPS counter for 2 seconds
1366   // display the FPS counter for 2 seconds
13671367   machine().ui().show_fps_temp(2.0);
13681368}
13691369
r29404r29405
13741374
13751375void ui_manager::decrease_frameskip()
13761376{
1377   // get the current value and decrement it
1377   // get the current value and decrement it
13781378   int newframeskip = machine().video().frameskip() - 1;
13791379   if (newframeskip < -1)
13801380      newframeskip = MAX_FRAMESKIP;
13811381   machine().video().set_frameskip(newframeskip);
13821382
1383   // display the FPS counter for 2 seconds
1383   // display the FPS counter for 2 seconds
13841384   machine().ui().show_fps_temp(2.0);
13851385}
13861386
r29404r29405
13911391
13921392bool ui_manager::can_paste()
13931393{
1394   // retrieve the clipboard text
1394   // retrieve the clipboard text
13951395   char *text = osd_get_clipboard_text();
13961396
13971397   // free the string if allocated
r29404r29405
14091409
14101410void ui_manager::paste()
14111411{
1412   // retrieve the clipboard text
1412   // retrieve the clipboard text
14131413   char *text = osd_get_clipboard_text();
14141414
1415   // was a result returned?
1415   // was a result returned?
14161416   if (text != NULL)
14171417   {
1418      // post the text
1418      // post the text
14191419      machine().ioport().natkeyboard().post_utf8(text);
14201420
1421      // free the string
1421      // free the string
14221422      osd_free(text);
14231423   }
14241424}
r29404r29405
14311431
14321432void ui_manager::image_handler_ingame()
14331433{
1434   // run display routine for devices
1434   // run display routine for devices
14351435   if (machine().phase() == MACHINE_PHASE_RUNNING)
14361436   {
14371437      image_interface_iterator iter(machine().root_device());
r29404r29405
14501450{
14511451   bool is_paused = machine.paused();
14521452
1453   // first draw the FPS counter
1453   // first draw the FPS counter
14541454   if (machine.ui().show_fps_counter())
14551455   {
14561456      astring tempstring;
r29404r29405
14581458               JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
14591459   }
14601460
1461   // draw the profiler if visible
1461   // draw the profiler if visible
14621462   if (machine.ui().show_profiler())
14631463   {
14641464      const char *text = g_profiler.text(machine);
14651465      machine.ui().draw_text_full(container, text, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
14661466   }
14671467
1468   // if we're single-stepping, pause now
1468   // if we're single-stepping, pause now
14691469   if (machine.ui().single_step())
14701470   {
14711471      machine.pause();
14721472      machine.ui().set_single_step(false);
14731473   }
14741474
1475   // determine if we should disable the rest of the UI
1475   // determine if we should disable the rest of the UI
14761476   bool ui_disabled = (machine.ioport().has_keyboard() && !machine.ui_active());
14771477
1478   // is ScrLk UI toggling applicable here?
1478   // is ScrLk UI toggling applicable here?
14791479   if (machine.ioport().has_keyboard())
14801480   {
1481      // are we toggling the UI with ScrLk?
1481      // are we toggling the UI with ScrLk?
14821482      if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
14831483      {
1484         // toggle the UI
1484         // toggle the UI
14851485         machine.set_ui_active(!machine.ui_active());
14861486
1487         // display a popup indicating the new status
1487         // display a popup indicating the new status
14881488         if (machine.ui_active())
14891489         {
14901490            machine.ui().popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
r29404r29405
15081508      }
15091509   }
15101510
1511   // is the natural keyboard enabled?
1511   // is the natural keyboard enabled?
15121512   if (machine.ui().use_natural_keyboard() && (machine.phase() == MACHINE_PHASE_RUNNING))
15131513      machine.ui().process_natural_keyboard();
15141514
15151515   if (!ui_disabled)
15161516   {
1517      // paste command
1517      // paste command
15181518      if (ui_input_pressed(machine, IPT_UI_PASTE))
15191519         machine.ui().paste();
15201520   }
r29404r29405
15291529      return 0;
15301530   }
15311531
1532   // turn on menus if requested
1532   // turn on menus if requested
15331533   if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
15341534      return machine.ui().set_handler(ui_menu::ui_handler, 0);
15351535
1536   // if the on-screen display isn't up and the user has toggled it, turn it on
1536   // if the on-screen display isn't up and the user has toggled it, turn it on
15371537   if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
15381538      return machine.ui().set_handler(ui_menu_sliders::ui_handler, 1);
15391539
1540   // handle a reset request
1540   // handle a reset request
15411541   if (ui_input_pressed(machine, IPT_UI_RESET_MACHINE))
15421542      machine.schedule_hard_reset();
15431543   if (ui_input_pressed(machine, IPT_UI_SOFT_RESET))
15441544      machine.schedule_soft_reset();
15451545
1546   // handle a request to display graphics/palette
1546   // handle a request to display graphics/palette
15471547   if (ui_input_pressed(machine, IPT_UI_SHOW_GFX))
15481548   {
15491549      if (!is_paused)
r29404r29405
15511551      return machine.ui().set_handler(ui_gfx_ui_handler, is_paused);
15521552   }
15531553
1554   // handle a save state request
1554   // handle a save state request
15551555   if (ui_input_pressed(machine, IPT_UI_SAVE_STATE))
15561556   {
15571557      machine.pause();
15581558      return machine.ui().set_handler(handler_load_save, LOADSAVE_SAVE);
15591559   }
15601560
1561   // handle a load state request
1561   // handle a load state request
15621562   if (ui_input_pressed(machine, IPT_UI_LOAD_STATE))
15631563   {
15641564      machine.pause();
15651565      return machine.ui().set_handler(handler_load_save, LOADSAVE_LOAD);
15661566   }
15671567
1568   // handle a save snapshot request
1568   // handle a save snapshot request
15691569   if (ui_input_pressed(machine, IPT_UI_SNAPSHOT))
15701570      machine.video().save_active_screen_snapshots();
15711571
1572   // toggle pause
1572   // toggle pause
15731573   if (ui_input_pressed(machine, IPT_UI_PAUSE))
15741574   {
1575      // with a shift key, it is single step
1575      // with a shift key, it is single step
15761576      if (is_paused && (machine.input().code_pressed(KEYCODE_LSHIFT) || machine.input().code_pressed(KEYCODE_RSHIFT)))
15771577      {
15781578         machine.ui().set_single_step(true);
r29404r29405
15821582         machine.toggle_pause();
15831583   }
15841584
1585   // handle a toggle cheats request
1585   // handle a toggle cheats request
15861586   if (ui_input_pressed(machine, IPT_UI_TOGGLE_CHEAT))
15871587      machine.cheat().set_enable(!machine.cheat().enabled());
15881588
1589   // toggle movie recording
1589   // toggle movie recording
15901590   if (ui_input_pressed(machine, IPT_UI_RECORD_MOVIE))
15911591      machine.video().toggle_record_movie();
15921592
1593   // toggle profiler display
1593   // toggle profiler display
15941594   if (ui_input_pressed(machine, IPT_UI_SHOW_PROFILER))
15951595      machine.ui().set_show_profiler(!machine.ui().show_profiler());
15961596
1597   // toggle FPS display
1597   // toggle FPS display
15981598   if (ui_input_pressed(machine, IPT_UI_SHOW_FPS))
15991599      machine.ui().set_show_fps(!machine.ui().show_fps());
16001600
1601   // increment frameskip?
1601   // increment frameskip?
16021602   if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_INC))
16031603      machine.ui().increase_frameskip();
16041604
1605   // decrement frameskip?
1605   // decrement frameskip?
16061606   if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_DEC))
16071607      machine.ui().decrease_frameskip();
16081608
1609   // toggle throttle?
1609   // toggle throttle?
16101610   if (ui_input_pressed(machine, IPT_UI_THROTTLE))
16111611      machine.video().toggle_throttle();
16121612
1613   // check for fast forward
1613   // check for fast forward
16141614   if (machine.ioport().type_pressed(IPT_UI_FAST_FORWARD))
16151615   {
16161616      machine.video().set_fastforward(true);
r29404r29405
16341634   input_code code;
16351635   char file = 0;
16361636
1637   // if we're not in the middle of anything, skip
1637   // if we're not in the middle of anything, skip
16381638   if (state == LOADSAVE_NONE)
16391639      return 0;
16401640
1641   // okay, we're waiting for a key to select a slot; display a message
1641   // okay, we're waiting for a key to select a slot; display a message
16421642   if (state == LOADSAVE_SAVE)
16431643      machine.ui().draw_message_window(container, "Select position to save to");
16441644   else
16451645      machine.ui().draw_message_window(container, "Select position to load from");
16461646
1647   // check for cancel key
1647   // check for cancel key
16481648   if (ui_input_pressed(machine, IPT_UI_CANCEL))
16491649   {
1650      // display a popup indicating things were cancelled
1650      // display a popup indicating things were cancelled
16511651      if (state == LOADSAVE_SAVE)
16521652         popmessage("Save cancelled");
16531653      else
16541654         popmessage("Load cancelled");
16551655
1656      // reset the state
1656      // reset the state
16571657      machine.resume();
16581658      return UI_HANDLER_CANCEL;
16591659   }
16601660
1661   // check for A-Z or 0-9
1661   // check for A-Z or 0-9
16621662   for (input_item_id id = ITEM_ID_A; id <= ITEM_ID_Z; id++)
16631663      if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id)))
16641664         file = id - ITEM_ID_A + 'a';
r29404r29405
16731673   if (file == 0)
16741674      return state;
16751675
1676   // display a popup indicating that the save will proceed
1676   // display a popup indicating that the save will proceed
16771677   sprintf(filename, "%c", file);
16781678   if (state == LOADSAVE_SAVE)
16791679   {
r29404r29405
16861686      machine.schedule_load(filename);
16871687   }
16881688
1689   // remove the pause and reset the state
1689   // remove the pause and reset the state
16901690   machine.resume();
16911691   return UI_HANDLER_CANCEL;
16921692}
r29404r29405
17191719   machine.ui().draw_text_box(container, quit_message, JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
17201720   machine.pause();
17211721
1722   // if the user press ENTER, quit the game
1722   // if the user press ENTER, quit the game
17231723   if (ui_input_pressed(machine, IPT_UI_SELECT))
17241724      machine.schedule_exit();
17251725
1726   // if the user press ESC, just continue
1726   // if the user press ESC, just continue
17271727   else if (ui_input_pressed(machine, IPT_UI_CANCEL))
17281728   {
17291729      machine.resume();
r29404r29405
17831783   astring string;
17841784   int item;
17851785
1786   // add overall volume
1786   // add overall volume
17871787   *tailptr = slider_alloc(machine, "Master Volume", -32, 0, 0, 1, slider_volume, NULL);
17881788   tailptr = &(*tailptr)->next;
17891789
1790   // add per-channel volume
1790   // add per-channel volume
17911791   mixer_input info;
17921792   for (item = 0; machine.sound().indexed_mixer_input(item, info); item++)
17931793   {
r29404r29405
18001800      tailptr = &(*tailptr)->next;
18011801   }
18021802
1803   // add analog adjusters
1803   // add analog adjusters
18041804   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
18051805      for (field = port->first_field(); field != NULL; field = field->next())
18061806         if (field->type() == IPT_ADJUSTER)
r29404r29405
18101810            tailptr = &(*tailptr)->next;
18111811         }
18121812
1813   // add CPU overclocking (cheat only)
1813   // add CPU overclocking (cheat only)
18141814   if (machine.options().cheat())
18151815   {
18161816      execute_interface_iterator iter(machine.root_device());
r29404r29405
18231823      }
18241824   }
18251825
1826   // add screen parameters
1826   // add screen parameters
18271827   screen_device_iterator scriter(machine.root_device());
18281828   for (screen_device *screen = scriter.first(); screen != NULL; screen = scriter.next())
18291829   {
r29404r29405
18331833      int defyoffset = floor(screen->yoffset() * 1000.0f + 0.5f);
18341834      void *param = (void *)screen;
18351835
1836      // add refresh rate tweaker
1836      // add refresh rate tweaker
18371837      if (machine.options().cheat())
18381838      {
18391839         string.printf("%s Refresh Rate", slider_get_screen_desc(*screen));
r29404r29405
18411841         tailptr = &(*tailptr)->next;
18421842      }
18431843
1844      // add standard brightness/contrast/gamma controls per-screen
1844      // add standard brightness/contrast/gamma controls per-screen
18451845      string.printf("%s Brightness", slider_get_screen_desc(*screen));
18461846      *tailptr = slider_alloc(machine, string, 100, 1000, 2000, 10, slider_brightness, param);
18471847      tailptr = &(*tailptr)->next;
r29404r29405
18521852      *tailptr = slider_alloc(machine, string, 100, 1000, 3000, 50, slider_gamma, param);
18531853      tailptr = &(*tailptr)->next;
18541854
1855      // add scale and offset controls per-screen
1855      // add scale and offset controls per-screen
18561856      string.printf("%s Horiz Stretch", slider_get_screen_desc(*screen));
18571857      *tailptr = slider_alloc(machine, string, 500, defxscale, 1500, 2, slider_xscale, param);
18581858      tailptr = &(*tailptr)->next;
r29404r29405
18791879         int defyoffset = floor(config.m_overposy * 1000.0f + 0.5f);
18801880         void *param = (void *)laserdisc;
18811881
1882         // add scale and offset controls per-overlay
1882         // add scale and offset controls per-overlay
18831883         string.printf("Laserdisc '%s' Horiz Stretch", laserdisc->tag());
18841884         *tailptr = slider_alloc(machine, string, 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_overxscale, param);
18851885         tailptr = &(*tailptr)->next;
r29404r29405
18971897   for (screen_device *screen = scriter.first(); screen != NULL; screen = scriter.next())
18981898      if (screen->screen_type() == SCREEN_TYPE_VECTOR)
18991899      {
1900         // add flicker control
1900         // add flicker control
19011901         *tailptr = slider_alloc(machine, "Vector Flicker", 0, 0, 1000, 10, slider_flicker, NULL);
19021902         tailptr = &(*tailptr)->next;
19031903         *tailptr = slider_alloc(machine, "Beam Width", 10, 100, 1000, 10, slider_beam, NULL);
r29404r29405
19061906      }
19071907
19081908#ifdef MAME_DEBUG
1909   // add crosshair adjusters
1909   // add crosshair adjusters
19101910   for (port = machine.ioport().first_port(); port != NULL; port = port->next())
19111911      for (field = port->first_field(); field != NULL; field = field->next())
19121912         if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->player() == 0)
trunk/src/emu/ui/selgame.c
r29404r29405
4747
4848
4949//-------------------------------------------------
50//   build_driver_list - build a list of available
51//   drivers
50//  build_driver_list - build a list of available
51//  drivers
5252//-------------------------------------------------
5353
5454void ui_menu_select_game::build_driver_list()
r29404r29405
108108         m_error = false;
109109
110110      // handle selections
111      else
111      else
112112      {
113113         switch(menu_event->iptkey)
114114         {
trunk/src/emu/ui/imgcntrl.c
r29404r29405
119119         need_confirm = false;
120120         break;
121121   }
122   
122
123123   if (entry != NULL)
124124      osd_free(entry);
125125}
trunk/src/emu/ui/viewgfx.c
r29404r29405
4141// information about a single gfx device
4242struct ui_gfx_info
4343{
44   device_gfx_interface *interface;   // pointer to device's gfx interface
45   UINT8 setcount;                  // how many gfx sets device has
46   UINT8 rotate[MAX_GFX_ELEMENTS];      // current rotation (orientation) value
47   UINT8 columns[MAX_GFX_ELEMENTS];   // number of items per row
48   int   offset[MAX_GFX_ELEMENTS];      // current offset of top,left item
49   int   color[MAX_GFX_ELEMENTS];      // current color selected
44   device_gfx_interface *interface;    // pointer to device's gfx interface
45   UINT8 setcount;                     // how many gfx sets device has
46   UINT8 rotate[MAX_GFX_ELEMENTS];     // current rotation (orientation) value
47   UINT8 columns[MAX_GFX_ELEMENTS];    // number of items per row
48   int   offset[MAX_GFX_ELEMENTS];     // current offset of top,left item
49   int   color[MAX_GFX_ELEMENTS];      // current color selected
5050};
5151
5252struct ui_gfx_state
5353{
54   bool            started;      // have we called ui_gfx_count_devices() yet?
55   UINT8           mode;         // which mode are we in?
54   bool            started;        // have we called ui_gfx_count_devices() yet?
55   UINT8           mode;           // which mode are we in?
5656
5757   // intermediate bitmaps
58   bool            bitmap_dirty;   // is the bitmap dirty?
59   bitmap_rgb32 *  bitmap;         // bitmap for drawing gfx and tilemaps
60   render_texture *texture;      // texture for rendering the above bitmap
58   bool            bitmap_dirty;   // is the bitmap dirty?
59   bitmap_rgb32 *  bitmap;         // bitmap for drawing gfx and tilemaps
60   render_texture *texture;        // texture for rendering the above bitmap
6161
6262   // palette-specific data
6363   struct
6464   {
65      palette_device *device;      // pointer to current device
66      int   devcount;            // how many palette devices exist
67      int   devindex;            // which palette device is visible
68      UINT8 which;            // which subset (pens or indirect colors)?
69      UINT8 columns;            // number of items per row
70      int   offset;            // current offset of top left item
65      palette_device *device;     // pointer to current device
66      int   devcount;             // how many palette devices exist
67      int   devindex;             // which palette device is visible
68      UINT8 which;                // which subset (pens or indirect colors)?
69      UINT8 columns;              // number of items per row
70      int   offset;               // current offset of top left item
7171   } palette;
7272
7373   // graphics-specific data
7474   struct
7575   {
76      UINT8   devcount;   // how many gfx devices exist
77      UINT8   devindex;   // which device is visible
78      UINT8   set;      // which set is visible
76      UINT8   devcount;   // how many gfx devices exist
77      UINT8   devindex;   // which device is visible
78      UINT8   set;        // which set is visible
7979   } gfxset;
80   
80
8181   // information about each gfx device
8282   ui_gfx_info gfxdev[MAX_GFX_DECODERS];
8383
8484   // tilemap-specific data
8585   struct
8686   {
87      int   which;            // which tilemap are we viewing?
88      int   xoffs;            // current X offset
89      int   yoffs;            // current Y offset
90      int   zoom;               // zoom factor
91      UINT8 rotate;            // current rotation (orientation) value
87      int   which;                // which tilemap are we viewing?
88      int   xoffs;                // current X offset
89      int   yoffs;                // current Y offset
90      int   zoom;                 // zoom factor
91      UINT8 rotate;               // current rotation (orientation) value
9292   } tilemap;
9393};
9494
r29404r29405
254254UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 uistate)
255255{
256256   ui_gfx_state &state = ui_gfx;
257   
257
258258   // if we have nothing, implicitly cancel
259259   if (!ui_gfx_is_relevant(machine))
260260      goto cancel;
trunk/src/emu/ui/selgame.h
r29404r29405
3131private:
3232   // internal state
3333   enum { VISIBLE_GAMES_IN_LIST = 15 };
34   UINT8               m_error;
35   UINT8               m_rerandomize;
36   char               m_search[40];
37   int                  m_matchlist[VISIBLE_GAMES_IN_LIST];
34   UINT8                   m_error;
35   UINT8                   m_rerandomize;
36   char                    m_search[40];
37   int                     m_matchlist[VISIBLE_GAMES_IN_LIST];
3838   dynamic_array<const game_driver *> m_driverlist;
3939   auto_pointer<driver_enumerator> m_drivlist;
4040
trunk/src/emu/ui/ui.h
r29404r29405
170170
171171private:
172172   // instance variables
173   running_machine &      m_machine;
174   render_font *         m_font;
175   ui_callback            m_handler_callback;
176   UINT32               m_handler_param;
177   bool               m_single_step;
178   bool               m_showfps;
179   osd_ticks_t            m_showfps_end;
180   bool               m_show_profiler;
181   osd_ticks_t            m_popup_text_end;
182   bool               m_use_natural_keyboard;
183   UINT8 *               m_non_char_keys_down;
184   render_texture *      m_mouse_arrow_texture;
185   bool               m_mouse_show;
173   running_machine &       m_machine;
174   render_font *           m_font;
175   ui_callback             m_handler_callback;
176   UINT32                  m_handler_param;
177   bool                    m_single_step;
178   bool                    m_showfps;
179   osd_ticks_t             m_showfps_end;
180   bool                    m_show_profiler;
181   osd_ticks_t             m_popup_text_end;
182   bool                    m_use_natural_keyboard;
183   UINT8 *                 m_non_char_keys_down;
184   render_texture *        m_mouse_arrow_texture;
185   bool                    m_mouse_show;
186186
187   // text generators
187   // text generators
188188   astring &disclaimer_string(astring &buffer);
189189   astring &warnings_string(astring &buffer);
190190
191   // UI handlers
191   // UI handlers
192192   static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state);
193193   static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state);
194194   static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state);
trunk/src/emu/ui/filesel.c
r29404r29405
203203   // this should really be in the OSD layer
204204   static const char valid_filename_char[] =
205205   {
206      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     // 00-0f
207      0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     // 10-1f
208      1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0,     //  !"#$%&'()*+,-./
209      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,     // 0123456789:;<=>?
210      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     // @ABCDEFGHIJKLMNO
211      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,     // PQRSTUVWXYZ[\]^_
212      0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     // `abcdefghijklmno
213      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0,     // pqrstuvwxyz{|}~ 
206      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     // 00-0f
207      0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     // 10-1f
208      1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0,     //  !"#$%&'()*+,-./
209      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,     // 0123456789:;<=>?
210      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     // @ABCDEFGHIJKLMNO
211      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,     // PQRSTUVWXYZ[\]^_
212      0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     // `abcdefghijklmno
213      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0,     // pqrstuvwxyz{|}~
214214   };
215215   return (unichar < ARRAY_LENGTH(valid_filename_char)) && valid_filename_char[unichar];
216216}
r29404r29405
222222
223223ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, astring &current_directory, astring &current_file)
224224   : ui_menu(machine, container),
225     m_current_directory(current_directory),
226     m_current_file(current_file)
225      m_current_directory(current_directory),
226      m_current_file(current_file)
227227{
228228   m_image = image;
229229}
r29404r29405
344344
345345ui_menu_file_selector::ui_menu_file_selector(running_machine &machine, render_container *container, device_image_interface *image, astring &current_directory, astring &current_file, bool has_empty, bool has_softlist, bool has_create, int *result)
346346   : ui_menu(machine, container),
347     m_current_directory(current_directory),
348     m_current_file(current_file)
347      m_current_directory(current_directory),
348      m_current_file(current_file)
349349{
350350   m_image = image;
351351   m_has_empty = has_empty;
trunk/src/emu/ui/swlist.c
r29404r29405
360360
361361/***************************************************************************
362362    SOFTWARE MENU - list of available software lists - i.e. cartridges,
363   floppies
363    floppies
364364***************************************************************************/
365365
366366//-------------------------------------------------
trunk/src/emu/ui/imginfo.c
r29404r29405
186186      }
187187   }
188188}
189
190
trunk/src/emu/ui/filesel.h
r29404r29405
4141   virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
4242
4343private:
44   device_image_interface *      m_image;
45   astring &                  m_current_directory;
46   astring &                  m_current_file;
47   const image_device_format *      m_current_format;
48   char                     m_filename_buffer[1024];
44   device_image_interface *        m_image;
45   astring &                       m_current_directory;
46   astring &                       m_current_file;
47   const image_device_format *     m_current_format;
48   char                            m_filename_buffer[1024];
4949};
5050
5151
r29404r29405
8282   };
8383
8484   // internal state
85   device_image_interface *   m_image;
86   astring &               m_current_directory;
87   astring &               m_current_file;
88   bool                  m_has_empty;
89   bool                  m_has_softlist;
90   bool                  m_has_create;
91   int *                  m_result;
92   file_selector_entry *      m_entrylist;
93   char                  m_filename_buffer[1024];
85   device_image_interface *    m_image;
86   astring &                   m_current_directory;
87   astring &                   m_current_file;
88   bool                        m_has_empty;
89   bool                        m_has_softlist;
90   bool                        m_has_create;
91   int *                       m_result;
92   file_selector_entry *       m_entrylist;
93   char                        m_filename_buffer[1024];
9494
9595   // methods
9696   int compare_entries(const file_selector_entry *e1, const file_selector_entry *e2);
r29404r29405
113113
114114private:
115115   // internal state
116   floppy_image_format_t **   m_formats;
117   int                     m_ext_match;
118   int                     m_total_usable;
119   int *                  m_result;
116   floppy_image_format_t **    m_formats;
117   int                         m_ext_match;
118   int                         m_total_usable;
119   int *                       m_result;
120120};
121121
122122
r29404r29405
134134
135135private:
136136   // internal state
137   bool      m_can_in_place;
138   int *      m_result;
137   bool        m_can_in_place;
138   int *       m_result;
139139};
140140
141141// helper
trunk/src/emu/ui/swlist.h
r29404r29405
2929   };
3030
3131   // variables
32   const software_info *   m_info;
33   const char *         m_interface;
34   const software_part **   m_selected_part;
35   bool               m_opt_fmgr;
36   int *               m_result;
32   const software_info *   m_info;
33   const char *            m_interface;
34   const software_part **  m_selected_part;
35   bool                    m_opt_fmgr;
36   int *                   m_result;
3737};
3838
3939
r29404r29405
5555   };
5656
5757   // variables
58   software_list_device *         m_swlist; // currently selected list
59   const char *               m_interface;
60   astring &                  m_result;
61   entry_info *               m_entrylist;
62   char                     m_filename_buffer[1024];
63   bool                     m_ordered_by_shortname;
58   software_list_device *          m_swlist; // currently selected list
59   const char *                    m_interface;
60   astring &                       m_result;
61   entry_info *                    m_entrylist;
62   char                            m_filename_buffer[1024];
63   bool                            m_ordered_by_shortname;
6464
6565   // functions
6666   int compare_entries(const entry_info *e1, const entry_info *e2, bool shortname);
r29404r29405
7878   virtual void handle();
7979
8080private:
81   const char *               m_interface;
82   software_list_device **         m_result;
81   const char *                    m_interface;
82   software_list_device **         m_result;
8383};
8484
8585#endif  /* __UI_SWLIST_H__ */
trunk/src/emu/ui/barcode.c
r29404r29405
11/***************************************************************************
22
3   ui/barcode.c
4 
5   MESS's "barcode reader" control
6 
3    ui/barcode.c
4
5    MESS's "barcode reader" control
6
77    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
r29404r29405
2121
2222
2323/**************************************************
24
24
2525 BARCODE INPUT MENU
26
26
2727 **************************************************/
2828
2929
r29404r29405
6767   }
6868
6969   item_append("New Barcode:", new_barcode, 0, ITEMREF_NEW_BARCODE);
70   
70
7171   // finish up the menu
7272   item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
7373   item_append("Enter Code", NULL, 0, ITEMREF_ENTER);
r29404r29405
108108               }
109109            }
110110            break;
111           
111
112112         case IPT_SPECIAL:
113113            if (get_selection() == ITEMREF_NEW_BARCODE)
114114            {
115115               int buflen = strlen(m_barcode_buffer);
116               
116
117117               // if it's a backspace and we can handle it, do so
118118               if ((event->unichar == 8 || event->unichar == 0x7f) && buflen > 0)
119119                  *(char *)utf8_previous_char(&m_barcode_buffer[buflen]) = 0;
r29404r29405
140140/**************************************************
141141
142142 READER MENU
143
143
144144**************************************************/
145145
146146//-------------------------------------------------
r29404r29405
168168void ui_menu_barcode_reader::populate()
169169{
170170   astring buffer;
171   
171
172172   barcode_reader_device_iterator iter(machine().config().root_device());
173173   for (const barcode_reader_device *bcreader = iter.first(); bcreader != NULL; bcreader = iter.next())
174174   {
175175      char label[0x400];
176176      sprintf(label,"[%s (%s)]",bcreader->name(),bcreader->basetag());
177177      item_append(label, NULL, 0, (void *)bcreader);
178   }   
178   }
179179}
180180
181181
r29404r29405
187187{
188188   // process the menu
189189   const ui_menu_event *event = process(0);
190   
190
191191   // process the event
192192   if (event != NULL && event->iptkey == IPT_UI_SELECT)
193193   {
r29404r29405
195195      {
196196         ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_barcode_code(machine(), container, (barcode_reader_device *)event->itemref)));
197197      }
198     
198
199199   }
200200}
trunk/src/emu/ui/filemngr.c
r29404r29405
134134      }
135135   }
136136}
137
138
trunk/src/emu/ui/barcode.h
r29404r29405
2222   virtual ~ui_menu_barcode_code();
2323   virtual void populate();
2424   virtual void handle();
25   
25
2626private:
2727   barcode_reader_device *m_reader;
2828   char  m_barcode_buffer[20];
trunk/src/emu/ui/menu.c
r29404r29405
8383{
8484   int x;
8585
86   // initialize the menu stack
86   // initialize the menu stack
8787   ui_menu::stack_reset(machine);
8888
89   // create a texture for hilighting items
89   // create a texture for hilighting items
9090   hilight_bitmap = auto_bitmap_rgb32_alloc(machine, 256, 1);
9191   for (x = 0; x < 256; x++)
9292   {
r29404r29405
9898   hilight_texture = machine.render().texture_alloc();
9999   hilight_texture->set_bitmap(*hilight_bitmap, hilight_bitmap->cliprect(), TEXFORMAT_ARGB32);
100100
101   // create a texture for arrow icons
101   // create a texture for arrow icons
102102   arrow_texture = machine.render().texture_alloc(render_triangle);
103103
104   // add an exit callback to free memory
104   // add an exit callback to free memory
105105   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_menu::exit), &machine));
106106}
107107
r29404r29405
112112
113113void ui_menu::exit(running_machine &machine)
114114{
115   // free menus
115   // free menus
116116   ui_menu::stack_reset(machine);
117117   ui_menu::clear_free_list(machine);
118118
119   // free textures
119   // free textures
120120   machine.render().texture_free(hilight_texture);
121121   machine.render().texture_free(arrow_texture);
122122}
r29404r29405
146146
147147ui_menu::~ui_menu()
148148{
149   // free the pools
149   // free the pools
150150   while (pool)
151151   {
152152      ui_menu_pool *ppool = pool;
r29404r29405
154154      auto_free(machine(), ppool);
155155   }
156156
157   // free the item array
157   // free the item array
158158   if (item)
159159      auto_free(machine(), item);
160160}
r29404r29405
167167
168168void ui_menu::reset(ui_menu_reset_options options)
169169{
170   // based on the reset option, set the reset info
170   // based on the reset option, set the reset info
171171   resetpos = 0;
172172   resetref = NULL;
173173   if (options == UI_MENU_RESET_REMEMBER_POSITION)
r29404r29405
175175   else if (options == UI_MENU_RESET_REMEMBER_REF)
176176      resetref = item[selected].ref;
177177
178   // reset all the pools and the numitems back to 0
178   // reset all the pools and the numitems back to 0
179179   for (ui_menu_pool *ppool = pool; ppool != NULL; ppool = ppool->next)
180180      ppool->top = (UINT8 *)(ppool + 1);
181181   numitems = 0;
r29404r29405
184184   astring backtext;
185185   backtext.printf("Return to %s",emulator_info::get_capstartgamenoun());
186186
187   // add an item to return
187   // add an item to return
188188   if (parent == NULL)
189189      item_append(backtext.cstr(), NULL, 0, NULL);
190190   else if (parent->is_special_main_menu())
r29404r29405
237237   ui_menu_item *pitem;
238238   int index;
239239
240   // only allow multiline as the first item
240   // only allow multiline as the first item
241241   if ((flags & MENU_FLAG_MULTILINE) != 0)
242242      assert(numitems == 1);
243243
244   // only allow a single multi-line item
244   // only allow a single multi-line item
245245   else if (numitems >= 2)
246246      assert((item[0].flags & MENU_FLAG_MULTILINE) == 0);
247247
248   // realloc the item array if necessary
248   // realloc the item array if necessary
249249   if (numitems >= allocitems)
250250   {
251251      int olditems = allocitems;
r29404r29405
258258   }
259259   index = numitems++;
260260
261   // copy the previous last item to the next one
261   // copy the previous last item to the next one
262262   if (index != 0)
263263   {
264264      index--;
265265      item[index + 1] = item[index];
266266   }
267267
268   // allocate a new item and populate it
268   // allocate a new item and populate it
269269   pitem = &item[index];
270270   pitem->text = (text != NULL) ? pool_strdup(text) : NULL;
271271   pitem->subtext = (subtext != NULL) ? pool_strdup(subtext) : NULL;
272272   pitem->flags = flags;
273273   pitem->ref = ref;
274274
275   // update the selection if we need to
275   // update the selection if we need to
276276   if (resetpos == index || (resetref != NULL && resetref == ref))
277277      selected = index;
278278   if (resetpos == numitems - 1)
r29404r29405
287287
288288const ui_menu_event *ui_menu::process(UINT32 flags)
289289{
290   // reset the menu_event
290   // reset the menu_event
291291   menu_event.iptkey = IPT_INVALID;
292292
293   // first make sure our selection is valid
293   // first make sure our selection is valid
294294   validate_selection(1);
295295
296   // draw the menu
296   // draw the menu
297297   if (numitems > 1 && (item[0].flags & MENU_FLAG_MULTILINE) != 0)
298298      draw_text_box();
299299   else
300300      draw(flags & UI_MENU_PROCESS_CUSTOM_ONLY);
301301
302   // process input
302   // process input
303303   if (!(flags & UI_MENU_PROCESS_NOKEYS))
304304   {
305      // read events
305      // read events
306306      handle_events();
307307
308      // handle the keys if we don't already have an menu_event
308      // handle the keys if we don't already have an menu_event
309309      if (menu_event.iptkey == IPT_INVALID)
310310         handle_keys(flags);
311311   }
312312
313   // update the selected item in the menu_event
313   // update the selected item in the menu_event
314314   if (menu_event.iptkey != IPT_INVALID && selected >= 0 && selected < numitems)
315315   {
316316      menu_event.itemref = item[selected].ref;
r29404r29405
331331
332332   assert(size < UI_MENU_POOL_SIZE);
333333
334   // find a pool with enough room
334   // find a pool with enough room
335335   for (ppool = pool; ppool != NULL; ppool = ppool->next)
336336      if (ppool->end - ppool->top >= size)
337337      {
r29404r29405
340340         return result;
341341      }
342342
343   // allocate a new pool
343   // allocate a new pool
344344   ppool = (ui_menu_pool *)auto_alloc_array_clear(machine(), UINT8, sizeof(*ppool) + UI_MENU_POOL_SIZE);
345345
346   // wire it up
346   // wire it up
347347   ppool->next = pool;
348348   pool = ppool;
349349   ppool->top = (UINT8 *)(ppool + 1);
r29404r29405
423423   INT32 mouse_target_x, mouse_target_y;
424424   float mouse_x = -1, mouse_y = -1;
425425
426   // compute the width and height of the full menu
426   // compute the width and height of the full menu
427427   visible_width = 0;
428428   visible_main_menu_height = 0;
429429   for (itemnum = 0; itemnum < numitems; itemnum++)
r29404r29405
431431      const ui_menu_item &pitem = item[itemnum];
432432      float total_width;
433433
434      // compute width of left hand side
434      // compute width of left hand side
435435      total_width = gutter_width + machine().ui().get_string_width(pitem.text) + gutter_width;
436436
437      // add in width of right hand side
437      // add in width of right hand side
438438      if (pitem.subtext)
439439         total_width += 2.0f * gutter_width + machine().ui().get_string_width(pitem.subtext);
440440
441      // track the maximum
441      // track the maximum
442442      if (total_width > visible_width)
443443         visible_width = total_width;
444444
445      // track the height as well
445      // track the height as well
446446      visible_main_menu_height += line_height;
447447   }
448448
449   // account for extra space at the top and bottom
449   // account for extra space at the top and bottom
450450   visible_extra_menu_height = customtop + custombottom;
451451
452   // add a little bit of slop for rounding
452   // add a little bit of slop for rounding
453453   visible_width += 0.01f;
454454   visible_main_menu_height += 0.01f;
455455
456   // if we are too wide or too tall, clamp it down
456   // if we are too wide or too tall, clamp it down
457457   if (visible_width + 2.0f * UI_BOX_LR_BORDER > 1.0f)
458458      visible_width = 1.0f - 2.0f * UI_BOX_LR_BORDER;
459459
460   // if the menu and extra menu won't fit, take away part of the regular menu, it will scroll
460   // if the menu and extra menu won't fit, take away part of the regular menu, it will scroll
461461   if (visible_main_menu_height + visible_extra_menu_height + 2.0f * UI_BOX_TB_BORDER > 1.0f)
462462      visible_main_menu_height = 1.0f - 2.0f * UI_BOX_TB_BORDER - visible_extra_menu_height;
463463
464464   visible_lines = floor(visible_main_menu_height / line_height);
465465   visible_main_menu_height = (float)visible_lines * line_height;
466466
467   // compute top/left of inner menu area by centering
467   // compute top/left of inner menu area by centering
468468   visible_left = (1.0f - visible_width) * 0.5f;
469469   visible_top = (1.0f - (visible_main_menu_height + visible_extra_menu_height)) * 0.5f;
470470
471   // if the menu is at the bottom of the extra, adjust
471   // if the menu is at the bottom of the extra, adjust
472472   visible_top += customtop;
473473
474   // first add us a box
474   // first add us a box
475475   x1 = visible_left - UI_BOX_LR_BORDER;
476476   y1 = visible_top - UI_BOX_TB_BORDER;
477477   x2 = visible_left + visible_width + UI_BOX_LR_BORDER;
r29404r29405
479479   if (!customonly)
480480      machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
481481
482   // determine the first visible line based on the current selection
482   // determine the first visible line based on the current selection
483483   top_line = selected - visible_lines / 2;
484484   if (top_line < 0)
485485      top_line = 0;
486486   if (top_line + visible_lines >= numitems)
487487      top_line = numitems - visible_lines;
488488
489   // determine effective positions taking into account the hilighting arrows
489   // determine effective positions taking into account the hilighting arrows
490490   effective_width = visible_width - 2.0f * gutter_width;
491491   effective_left = visible_left + gutter_width;
492492
493   // locate mouse
493   // locate mouse
494494   mouse_hit = false;
495495   mouse_button = false;
496496   if (!customonly)
r29404r29405
501501            mouse_hit = true;
502502   }
503503
504   // loop over visible lines
504   // loop over visible lines
505505   hover = numitems + 1;
506506   if (!customonly)
507507      for (linenum = 0; linenum < visible_lines; linenum++)
r29404r29405
519519         float line_x1 = x2 - 0.5f * UI_LINE_WIDTH;
520520         float line_y1 = line_y + line_height;
521521
522         // set the hover if this is our item
522         // set the hover if this is our item
523523         if (mouse_hit && line_x0 <= mouse_x && line_x1 > mouse_x && line_y0 <= mouse_y && line_y1 > mouse_y && pitem.is_selectable())
524524            hover = itemnum;
525525
526         // if we're selected, draw with a different background
526         // if we're selected, draw with a different background
527527         if (itemnum == selected)
528528         {
529529            fgcolor = UI_SELECTED_COLOR;
r29404r29405
532532            fgcolor3 = UI_SELECTED_COLOR;
533533         }
534534
535         // else if the mouse is over this item, draw with a different background
535         // else if the mouse is over this item, draw with a different background
536536         else if (itemnum == hover)
537537         {
538538            fgcolor = UI_MOUSEOVER_COLOR;
r29404r29405
541541            fgcolor3 = UI_MOUSEOVER_COLOR;
542542         }
543543
544         // if we have some background hilighting to do, add a quad behind everything else
544         // if we have some background hilighting to do, add a quad behind everything else
545545         if (bgcolor != UI_TEXT_BG_COLOR)
546546            highlight(container, line_x0, line_y0, line_x1, line_y1, bgcolor);
547547
548         // if we're on the top line, display the up arrow
548         // if we're on the top line, display the up arrow
549549         if (linenum == 0 && top_line != 0)
550550         {
551551            draw_arrow(
r29404r29405
560560               hover = -2;
561561         }
562562
563         // if we're on the bottom line, display the down arrow
563         // if we're on the bottom line, display the down arrow
564564         else if (linenum == visible_lines - 1 && itemnum != numitems - 1)
565565         {
566566            draw_arrow(
r29404r29405
575575               hover = -1;
576576         }
577577
578         // if we're just a divider, draw a line
578         // if we're just a divider, draw a line
579579         else if (strcmp(itemtext, MENU_SEPARATOR_ITEM) == 0)
580580            container->add_line(visible_left, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
581581
582         // if we don't have a subitem, just draw the string centered
582         // if we don't have a subitem, just draw the string centered
583583         else if (pitem.subtext == NULL)
584584            machine().ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
585585                     JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, NULL, NULL);
586586
587         // otherwise, draw the item on the left and the subitem text on the right
587         // otherwise, draw the item on the left and the subitem text on the right
588588         else
589589         {
590590            int subitem_invert = pitem.flags & MENU_FLAG_INVERT;
591591            const char *subitem_text = pitem.subtext;
592592            float item_width, subitem_width;
593593
594            // draw the left-side text
594            // draw the left-side text
595595            machine().ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
596596                     JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, &item_width, NULL);
597597
598            // give 2 spaces worth of padding
598            // give 2 spaces worth of padding
599599            item_width += 2.0f * gutter_width;
600600
601            // if the subitem doesn't fit here, display dots
601            // if the subitem doesn't fit here, display dots
602602            if (machine().ui().get_string_width(subitem_text) > effective_width - item_width)
603603            {
604604               subitem_text = "...";
r29404r29405
606606                  selected_subitem_too_big = TRUE;
607607            }
608608
609            // draw the subitem right-justified
609            // draw the subitem right-justified
610610            machine().ui().draw_text_full(container, subitem_text, effective_left + item_width, line_y, effective_width - item_width,
611611                     JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, &subitem_width, NULL);
612612
613            // apply arrows
613            // apply arrows
614614            if (itemnum == selected && (pitem.flags & MENU_FLAG_LEFT_ARROW))
615615            {
616616               draw_arrow(
r29404r29405
636636         }
637637      }
638638
639   // if the selected subitem is too big, display it in a separate offset box
639   // if the selected subitem is too big, display it in a separate offset box
640640   if (selected_subitem_too_big)
641641   {
642642      const ui_menu_item &pitem = item[selected];
r29404r29405
646646      float target_width, target_height;
647647      float target_x, target_y;
648648
649      // compute the multi-line target width/height
649      // compute the multi-line target width/height
650650      machine().ui().draw_text_full(container, pitem.subtext, 0, 0, visible_width * 0.75f,
651651               JUSTIFY_RIGHT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height);
652652
653      // determine the target location
653      // determine the target location
654654      target_x = visible_left + visible_width - target_width - UI_BOX_LR_BORDER;
655655      target_y = line_y + line_height + UI_BOX_TB_BORDER;
656656      if (target_y + target_height + UI_BOX_TB_BORDER > visible_main_menu_height)
657657         target_y = line_y - target_height - UI_BOX_TB_BORDER;
658658
659      // add a box around that
659      // add a box around that
660660      machine().ui().draw_outlined_box(container, target_x - UI_BOX_LR_BORDER,
661661                     target_y - UI_BOX_TB_BORDER,
662662                     target_x + target_width + UI_BOX_LR_BORDER,
r29404r29405
665665               JUSTIFY_RIGHT, WRAP_WORD, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, NULL, NULL);
666666   }
667667
668   // if there is something special to add, do it by calling the virtual method
668   // if there is something special to add, do it by calling the virtual method
669669   custom_render((selected >= 0 && selected < numitems) ? item[selected].ref : NULL, customtop, custombottom, x1, y1, x2, y2);
670670
671   // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
671   // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
672672   visitems = visible_lines - (top_line != 0) - (top_line + visible_lines != numitems);
673673}
674674
r29404r29405
692692   float target_width, target_height, prior_width;
693693   float target_x, target_y;
694694
695   // compute the multi-line target width/height
695   // compute the multi-line target width/height
696696   machine().ui().draw_text_full(container, text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER - 2.0f * gutter_width,
697697            JUSTIFY_LEFT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height);
698698   target_height += 2.0f * line_height;
699699   if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
700700      target_height = floor((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
701701
702   // maximum against "return to prior menu" text
702   // maximum against "return to prior menu" text
703703   prior_width = machine().ui().get_string_width(backtext) + 2.0f * gutter_width;
704704   target_width = MAX(target_width, prior_width);
705705
706   // determine the target location
706   // determine the target location
707707   target_x = 0.5f - 0.5f * target_width;
708708   target_y = 0.5f - 0.5f * target_height;
709709
710   // make sure we stay on-screen
710   // make sure we stay on-screen
711711   if (target_x < UI_BOX_LR_BORDER + gutter_width)
712712      target_x = UI_BOX_LR_BORDER + gutter_width;
713713   if (target_x + target_width + gutter_width + UI_BOX_LR_BORDER > 1.0f)
r29404r29405
717717   if (target_y + target_height + UI_BOX_TB_BORDER > 1.0f)
718718      target_y = 1.0f - UI_BOX_TB_BORDER - target_height;
719719
720   // add a box around that
720   // add a box around that
721721   machine().ui().draw_outlined_box(container, target_x - UI_BOX_LR_BORDER - gutter_width,
722722                  target_y - UI_BOX_TB_BORDER,
723723                  target_x + target_width + gutter_width + UI_BOX_LR_BORDER,
r29404r29405
725725   machine().ui().draw_text_full(container, text, target_x, target_y, target_width,
726726            JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
727727
728   // draw the "return to prior menu" text with a hilight behind it
728   // draw the "return to prior menu" text with a hilight behind it
729729   highlight(
730730                  container,
731731                  target_x + 0.5f * UI_LINE_WIDTH,
r29404r29405
736736   machine().ui().draw_text_full(container, backtext, target_x, target_y + target_height - line_height, target_width,
737737            JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, NULL, NULL);
738738
739   // artificially set the hover to the last item so a double-click exits
739   // artificially set the hover to the last item so a double-click exits
740740   hover = numitems - 1;
741741}
742742
r29404r29405
751751   int stop = FALSE;
752752   ui_event local_menu_event;
753753
754   // loop while we have interesting events
754   // loop while we have interesting events
755755   while (!stop && ui_input_pop_event(machine(), &local_menu_event))
756756   {
757757      switch (local_menu_event.event_type)
758758      {
759         // if we are hovering over a valid item, select it with a single click
759         // if we are hovering over a valid item, select it with a single click
760760         case UI_EVENT_MOUSE_DOWN:
761761            if (hover >= 0 && hover < numitems)
762762               selected = hover;
r29404r29405
772772            }
773773            break;
774774
775         // if we are hovering over a valid item, fake a UI_SELECT with a double-click
775         // if we are hovering over a valid item, fake a UI_SELECT with a double-click
776776         case UI_EVENT_MOUSE_DOUBLE_CLICK:
777777            if (hover >= 0 && hover < numitems)
778778            {
r29404r29405
790790            }
791791            break;
792792
793         // translate CHAR events into specials
793         // translate CHAR events into specials
794794         case UI_EVENT_CHAR:
795795            menu_event.iptkey = IPT_SPECIAL;
796796            menu_event.unichar = local_menu_event.ch;
797797            stop = TRUE;
798798            break;
799799
800         // ignore everything else
800         // ignore everything else
801801         default:
802802            break;
803803      }
r29404r29405
817817   int ignoreleft = FALSE;
818818   int code;
819819
820   // bail if no items
820   // bail if no items
821821   if (numitems == 0)
822822      return;
823823
824   // if we hit select, return TRUE or pop the stack, depending on the item
824   // if we hit select, return TRUE or pop the stack, depending on the item
825825   if (exclusive_input_pressed(IPT_UI_SELECT, 0))
826826   {
827827      if (selected == numitems - 1)
r29404r29405
832832      return;
833833   }
834834
835   // hitting cancel also pops the stack
835   // hitting cancel also pops the stack
836836   if (exclusive_input_pressed(IPT_UI_CANCEL, 0))
837837   {
838838      ui_menu::stack_pop(machine());
839839      return;
840840   }
841841
842   // validate the current selection
842   // validate the current selection
843843   validate_selection(1);
844844
845   // swallow left/right keys if they are not appropriate
845   // swallow left/right keys if they are not appropriate
846846   ignoreleft = ((item[selected].flags & MENU_FLAG_LEFT_ARROW) == 0);
847847   ignoreright = ((item[selected].flags & MENU_FLAG_RIGHT_ARROW) == 0);
848848
849   // accept left/right keys as-is with repeat
849   // accept left/right keys as-is with repeat
850850   if (!ignoreleft && exclusive_input_pressed(IPT_UI_LEFT, (flags & UI_MENU_PROCESS_LR_REPEAT) ? 6 : 0))
851851      return;
852852   if (!ignoreright && exclusive_input_pressed(IPT_UI_RIGHT, (flags & UI_MENU_PROCESS_LR_REPEAT) ? 6 : 0))
853853      return;
854854
855   // up backs up by one item
855   // up backs up by one item
856856   if (exclusive_input_pressed(IPT_UI_UP, 6))
857857   {
858858      selected = (selected + numitems - 1) % numitems;
859859      validate_selection(-1);
860860   }
861861
862   // down advances by one item
862   // down advances by one item
863863   if (exclusive_input_pressed(IPT_UI_DOWN, 6))
864864   {
865865      selected = (selected + 1) % numitems;
866866      validate_selection(1);
867867   }
868868
869   // page up backs up by visitems
869   // page up backs up by visitems
870870   if (exclusive_input_pressed(IPT_UI_PAGE_UP, 6))
871871   {
872872      selected -= visitems - 1;
873873      validate_selection(1);
874874   }
875875
876   // page down advances by visitems
876   // page down advances by visitems
877877   if (exclusive_input_pressed(IPT_UI_PAGE_DOWN, 6))
878878   {
879879      selected += visitems - 1;
880880      validate_selection(-1);
881881   }
882882
883   // home goes to the start
883   // home goes to the start
884884   if (exclusive_input_pressed(IPT_UI_HOME, 0))
885885   {
886886      selected = 0;
887887      validate_selection(1);
888888   }
889889
890   // end goes to the last
890   // end goes to the last
891891   if (exclusive_input_pressed(IPT_UI_END, 0))
892892   {
893893      selected = numitems - 1;
894894      validate_selection(-1);
895895   }
896896
897   // pause enables/disables pause
897   // pause enables/disables pause
898898   if (!ignorepause && exclusive_input_pressed(IPT_UI_PAUSE, 0))
899899   {
900900      if (machine().paused())
r29404r29405
903903         machine().pause();
904904   }
905905
906   // handle a toggle cheats request
906   // handle a toggle cheats request
907907   if (ui_input_pressed_repeat(machine(), IPT_UI_TOGGLE_CHEAT, 0))
908908      machine().cheat().set_enable(!machine().cheat().enabled());
909909
910   // see if any other UI keys are pressed
910   // see if any other UI keys are pressed
911911   if (menu_event.iptkey == IPT_INVALID)
912912      for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
913913      {
r29404r29405
927927
928928void ui_menu::validate_selection(int scandir)
929929{
930   // clamp to be in range
930   // clamp to be in range
931931   if (selected < 0)
932932      selected = 0;
933933   else if (selected >= numitems)
934934      selected = numitems - 1;
935935
936   // skip past unselectable items
936   // skip past unselectable items
937937   while (!item[selected].is_selectable())
938938      selected = (selected + numitems + scandir) % numitems;
939939}
r29404r29405
10381038
10391039UINT32 ui_menu::ui_handler(running_machine &machine, render_container *container, UINT32 state)
10401040{
1041   // if we have no menus stacked up, start with the main menu
1041   // if we have no menus stacked up, start with the main menu
10421042   if (menu_stack == NULL)
10431043      stack_push(auto_alloc_clear(machine, ui_menu_main(machine, container)));
10441044
1045   // update the menu state
1045   // update the menu state
10461046   if (menu_stack != NULL)
10471047      menu_stack->do_handle();
10481048
1049   // clear up anything pending to be released
1049   // clear up anything pending to be released
10501050   clear_free_list(machine);
10511051
1052   // if the menus are to be hidden, return a cancel here
1052   // if the menus are to be hidden, return a cancel here
10531053   if (machine.ui().is_menu_active() && ((ui_input_pressed(machine, IPT_UI_CONFIGURE) && !stack_has_special_main_menu()) || menu_stack == NULL))
10541054      return UI_HANDLER_CANCEL;
10551055
r29404r29405
10721072   int height = dest.height();
10731073   int x, y;
10741074
1075   // start with all-transparent
1075   // start with all-transparent
10761076   dest.fill(rgb_t(0x00,0x00,0x00,0x00));
10771077
1078   // render from the tip to the bottom
1078   // render from the tip to the bottom
10791079   for (y = 0; y < height; y++)
10801080   {
10811081      int linewidth = (y * (halfwidth - 1) + (height / 2)) * 255 * 2 / height;
10821082      UINT32 *target = &dest.pix32(y, halfwidth);
10831083
1084      // don't antialias if height < 12
1084      // don't antialias if height < 12
10851085      if (dest.height() < 12)
10861086      {
10871087         int pixels = (linewidth + 254) / 255;
r29404r29405
10891089         linewidth = pixels * 255;
10901090      }
10911091
1092      // loop while we still have data to generate
1092      // loop while we still have data to generate
10931093      for (x = 0; linewidth > 0; x++)
10941094      {
10951095         int dalpha;
10961096
1097         // first column we only consume one pixel
1097         // first column we only consume one pixel
10981098         if (x == 0)
10991099         {
11001100            dalpha = MIN(0xff, linewidth);
11011101            target[x] = rgb_t(dalpha,0xff,0xff,0xff);
11021102         }
11031103
1104         // remaining columns consume two pixels, one on each side
1104         // remaining columns consume two pixels, one on each side
11051105         else
11061106         {
11071107            dalpha = MIN(0x1fe, linewidth);
trunk/src/emu/ui/devctrl.h
r29404r29405
2323protected:
2424   _DeviceType *current_device() { return m_device; }
2525   int count() { return m_count; }
26   
26
2727   int current_index();
2828   void previous();
2929   void next();
r29404r29405
3232   // device iterator
3333   typedef device_type_iterator<&device_creator<_DeviceType>, _DeviceType> iterator;
3434
35   _DeviceType *   m_device;
36   int            m_count;
35   _DeviceType *   m_device;
36   int             m_count;
3737};
3838
3939
trunk/src/emu/drivers/xtal.h
r29404r29405
138138   XTAL_17_36MHz       = 17360000,     /* OMTI Series 10 SCSI controller */
139139   XTAL_17_73447MHz    = 17734470,     /* (~4x PAL subcarrier) */
140140   XTAL_17_734472MHz   = 17734472,     /* actually ~4x PAL subcarrier */
141   XTAL_17_9712MHz       = 17971200,
141   XTAL_17_9712MHz     = 17971200,
142142   XTAL_18MHz          = 18000000,     /* S.A.R, Ikari Warriors 3 */
143143   XTAL_18_432MHz      = 18432000,     /* Extremely common, used on 100's of PCBs (48000 * 384) */
144144   XTAL_18_720MHz      = 18720000,     /* Nokia MikroMikko 1 */
trunk/src/emu/imagedev/harddriv.h
r29404r29405
3636
3737   void set_device_load(device_image_load_delegate _load) { m_device_image_load = _load; }
3838   void set_device_unload(device_image_func_delegate _unload) { m_device_image_unload = _unload; }
39   
39
4040   // image-level overrides
4141   virtual bool call_load();
4242   virtual bool call_create(int create_format, option_resolution *create_args);
r29404r29405
7171   chd_file        m_origchd;              /* handle to the original CHD */
7272   chd_file        m_diffchd;              /* handle to the diff CHD */
7373   hard_disk_file  *m_hard_disk_handle;
74   
74
7575   device_image_load_delegate      m_device_image_load;
76   device_image_func_delegate      m_device_image_unload;   
76   device_image_func_delegate      m_device_image_unload;
7777};
7878
7979// device type definition
r29404r29405
8888#define MCFG_HARDDISK_CONFIG_ADD(_tag,_config) \
8989   MCFG_DEVICE_ADD(_tag, HARDDISK, 0) \
9090   MCFG_DEVICE_CONFIG(_config)
91   
91
9292#define MCFG_HARDDISK_LOAD(_class,_load)                                \
9393   static_cast<harddisk_image_device *>(device)->set_device_load( DEVICE_IMAGE_LOAD_DELEGATE(_class,_load));
9494
9595#define MCFG_HARDDISK_UNLOAD(_class,_unload)                            \
9696   static_cast<harddisk_image_device *>(device)->set_device_unload( DEVICE_IMAGE_UNLOAD_DELEGATE(_class,_unload));
97   
97
9898#endif /* HARDDRIV_H */
trunk/src/emu/imagedev/flopdrv.c
r29404r29405
206206a fixed set of circumstances */
207207/* use this to set ready state of drive */
208208void legacy_floppy_image_device::floppy_drive_set_ready_state(int state, int flag)
209{   
209{
210210   if (flag)
211211   {
212212      /* set ready only if drive is present, disk is in the drive,
r29404r29405
252252
253253
254254void legacy_floppy_image_device::floppy_drive_seek(signed int signed_tracks)
255{   
255{
256256   LOG(("seek from: %d delta: %d\n",m_current_track, signed_tracks));
257257
258258   /* update position */
r29404r29405
432432   const char *extension;
433433
434434   device_image_interface *image = NULL;
435   interface(image);   /* figure out the floppy options */
435   interface(image);   /* figure out the floppy options */
436436   floppy_options = ((floppy_interface*)static_config())->formats;
437437
438438   if (has_been_created())
r29404r29405
621621/* step */
622622WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_stp_w )
623623{
624
625624   /* move head one track when going from high to low and write gate is high */
626625   if (m_active && m_stp && state == CLEAR_LINE && m_wtg)
627626   {
trunk/src/emu/softlist.c
r29404r29405
4040      POS_PART,
4141      POS_DATA
4242   };
43   
43
4444   // internal parsing helpers
4545   const char *filename() const { return m_list.filename(); }
4646   const char *infoname() const { return (m_current_info != NULL) ? m_current_info->shortname() : "???"; }
r29404r29405
7474   void parse_soft_end(const char *name);
7575
7676   // internal parsing state
77   software_list_device &   m_list;
78   astring &            m_errors;
79   XML_Parser           m_parser;
80   bool                 m_done;
81   bool               m_data_accum_expected;
82   astring               m_data_accum;
83   software_info *         m_current_info;
84   software_part *         m_current_part;
85   parse_position          m_pos;
77   software_list_device &  m_list;
78   astring &               m_errors;
79   XML_Parser              m_parser;
80   bool                    m_done;
81   bool                    m_data_accum_expected;
82   astring                 m_data_accum;
83   software_info *         m_current_info;
84   software_part *         m_current_part;
85   parse_position          m_pos;
8686};
8787
8888
r29404r29405
106106
107107software_part::software_part(software_info &info, const char *name, const char *interface)
108108   : m_next(NULL),
109     m_info(info),
110     m_name(name),
111     m_interface(interface)
109      m_info(info),
110      m_name(name),
111      m_interface(interface)
112112{
113113   // ensure strings we are passed are in the string pool
114114   assert(info.list().string_pool_contains(name));
r29404r29405
117117
118118
119119//-------------------------------------------------
120//  feature - return the value of the given
121//   feature, if specified
120//  feature - return the value of the given
121//  feature, if specified
122122//-------------------------------------------------
123123
124124const char *software_part::feature(const char *feature_name) const
r29404r29405
136136
137137//-------------------------------------------------
138138//  is_compatible - determine if we are compatible
139//   with the given software_list_device
139//  with the given software_list_device
140140//-------------------------------------------------
141141
142142bool software_part::is_compatible(const software_list_device &swlistdev) const
r29404r29405
150150   // copy the comma-delimited strings and ensure they end with a final comma
151151   astring comp(compatibility, ",");
152152   astring filt(filter, ",");
153   
153
154154   // iterate over filter items and see if they exist in the compatibility list; if so, return true
155155   for (int start = 0, end = filt.chr(start, ','); end != -1; start = end + 1, end = filt.chr(start, ','))
156156   {
r29404r29405
164164
165165//-------------------------------------------------
166166//  matches_interface - determine if we match
167//   an interface in the provided list
167//  an interface in the provided list
168168//-------------------------------------------------
169169
170170bool software_part::matches_interface(const char *interface_list) const
r29404r29405
175175
176176   // copy the comma-delimited interface list and ensure it ends with a final comma
177177   astring interfaces(interface_list, ",");
178   
178
179179   // then add a comma to the end of our interface and return true if we find it in the list string
180180   astring our_interface(m_interface, ",");
181181   return (interfaces.find(0, our_interface) != -1);
r29404r29405
193193
194194software_info::software_info(software_list_device &list, const char *name, const char *parent, const char *supported)
195195   : m_next(NULL),
196     m_list(list),
197     m_supported(SOFTWARE_SUPPORTED_YES),
198     m_shortname(name),
199     m_parentname(parent)
196      m_list(list),
197      m_supported(SOFTWARE_SUPPORTED_YES),
198      m_shortname(name),
199      m_parentname(parent)
200200{
201201   // ensure strings we are passed are in the string pool
202202   assert(list.string_pool_contains(name));
r29404r29405
215215
216216//-------------------------------------------------
217217//  find_part - find a part by name with an
218//   optional interface match
218//  optional interface match
219219//-------------------------------------------------
220220
221221software_part *software_info::find_part(const char *partname, const char *interface)
r29404r29405
225225
226226   if (partname == NULL && interface == NULL)
227227      return m_partdata.first();
228   
228
229229   // look for the part by name and match against the interface if provided
230230   for (software_part *part = m_partdata.first(); part != NULL; part = part->next())
231231      if (partname != NULL && strcmp(partname, part->name()) == 0)
232232      {
233233         if (interface == NULL || part->matches_interface(interface))
234234            return part;
235      }
235      }
236236      else if (partname == NULL && part->matches_interface(interface))
237237            return part;
238238   return NULL;
r29404r29405
241241
242242//-------------------------------------------------
243243//  has_multiple_parts - return true if we have
244//   more than one part matching the given
245//   interface
244//  more than one part matching the given
245//  interface
246246//-------------------------------------------------
247247
248248bool software_info::has_multiple_parts(const char *interface) const
249249{
250250   int count = 0;
251   
251
252252   // increment the count for each match and stop if we hit more than 1
253253   for (software_part *part = first_part(); part != NULL; part = part->next())
254254      if (part->matches_interface(interface))
255255         if (++count > 1)
256256            return true;
257   
257
258258   return false;
259259}
260260
r29404r29405
290290      if (result != NULL)
291291         return result;
292292   }
293   
293
294294   // no space anywhere, create a new pool and prepend it (so it gets used first)
295295   const char *result = m_chunklist.prepend(*global_alloc(pool_chunk)).add(string);
296296   assert(result != NULL);
r29404r29405
299299
300300
301301//-------------------------------------------------
302//  contains - determine if the given string
302//  contains - determine if the given string
303303//  pointer lives in the pool
304304//-------------------------------------------------
305305
r29404r29405
313313   for (pool_chunk *chunk = m_chunklist.first(); chunk != NULL; chunk = chunk->next())
314314      if (chunk->contains(string))
315315         return true;
316   
316
317317   return false;
318318}
319319
r29404r29405
323323//-------------------------------------------------
324324
325325const_string_pool::pool_chunk::pool_chunk()
326   : m_next(NULL),
327     m_used(0)
326   : m_next(NULL),
327      m_used(0)
328328{
329329}
330330
r29404r29405
338338   // get the length of the string (no string can be longer than a full pool)
339339   int bytes = strlen(string) + 1;
340340   assert(bytes < POOL_SIZE);
341   
341
342342   // if too big, return NULL
343343   if (m_used + bytes > POOL_SIZE)
344344      return NULL;
r29404r29405
405405
406406//-------------------------------------------------
407407//  find_approx_matches - search ourselves for
408//   a list of possible matches of the given name
409//   and optional interface
408//  a list of possible matches of the given name
409//  and optional interface
410410//-------------------------------------------------
411411
412412void software_list_device::find_approx_matches(const char *name, int matches, software_info **list, const char *interface)
r29404r29405
456456
457457
458458//-------------------------------------------------
459//   release - reset to a pre-parsed state
459//  release - reset to a pre-parsed state
460460//-------------------------------------------------
461461
462462void software_list_device::release()
r29404r29405
471471
472472
473473//-------------------------------------------------
474//   find_by_name - find a software list by name
475//   across all software list devices
474//  find_by_name - find a software list by name
475//  across all software list devices
476476//-------------------------------------------------
477477
478478software_list_device *software_list_device::find_by_name(const machine_config &config, const char *name)
r29404r29405
488488
489489//-------------------------------------------------
490490//  software_display_matches - display a list of
491//   possible matches in the system to the given
492//   name, across all software list devices
491//  possible matches in the system to the given
492//  name, across all software list devices
493493//-------------------------------------------------
494494
495495void software_list_device::display_matches(const machine_config &config, const char *interface, const char *name)
r29404r29405
528528
529529
530530//-------------------------------------------------
531//   find - find an item by name in the software
531//  find - find an item by name in the software
532532//  list, using wildcards and optionally starting
533//   from an intermediate point
533//  from an intermediate point
534534//-------------------------------------------------
535535
536536software_info *software_list_device::find(const char *look_for, software_info *prev)
r29404r29405
566566   if (filerr == FILERR_NONE)
567567   {
568568      // parse if no error
569      softlist_parser   parser(*this, m_errors);
569      softlist_parser parser(*this, m_errors);
570570      m_file.close();
571571   }
572572   else
573573      m_errors.printf("Error opening file: %s\n", filename());
574   
574
575575   // indicate that we've been parsed
576576   m_parsed = true;
577577}
r29404r29405
579579
580580//-------------------------------------------------
581581//  device_validity_check - validate the device
582//   configuration
582//  configuration
583583//-------------------------------------------------
584584
585585void software_list_device::device_validity_check(validity_checker &valid) const
r29404r29405
592592   // do device validation only in case of validate command
593593   if (strcmp(mconfig().options().command(), CLICOMMAND_VALIDATE) != 0)
594594      return;
595   
595
596596   // actually do the validate
597597   const_cast<software_list_device *>(this)->internal_validity_check(valid);
598598}
r29404r29405
600600
601601//-------------------------------------------------
602602//  internal_validity_check - internal helper to
603//   check the list
603//  check the list
604604//-------------------------------------------------
605605
606606void software_list_device::internal_validity_check(validity_checker &valid)
r29404r29405
734734
735735softlist_parser::softlist_parser(software_list_device &list, astring &errors)
736736   : m_list(list),
737     m_errors(errors),
738     m_done(false),
739     m_data_accum_expected(false),
740     m_current_info(NULL),
741     m_current_part(NULL),
742     m_pos(POS_ROOT)
737      m_errors(errors),
738      m_done(false),
739      m_data_accum_expected(false),
740      m_current_info(NULL),
741      m_current_part(NULL),
742      m_pos(POS_ROOT)
743743{
744744   mame_printf_verbose("Parsing %s\n", m_list.m_file.filename());
745745
r29404r29405
805805
806806//-------------------------------------------------
807807//  parse_error - append a parsing error with
808//   filename, line and column information
808//  filename, line and column information
809809//-------------------------------------------------
810810
811811void ATTR_PRINTF(2,3) softlist_parser::parse_error(const char *fmt, ...)
812812{
813   // always start with filename(line.column):
813   // always start with filename(line.column):
814814   m_errors.catprintf("%s(%d.%d): ", filename(), line(), column());
815   
815
816816   // append the remainder of the string
817817   va_list va;
818818   va_start(va, fmt);
819819   m_errors.catvprintf(fmt, va);
820820   va_end(va);
821   
821
822822   // append a newline at the end
823823   m_errors.cat("\n");
824824}
r29404r29405
826826
827827//-------------------------------------------------
828828//  parse_attributes - helper to parse a set of
829//   attributes into a list of strings
829//  attributes into a list of strings
830830//-------------------------------------------------
831831
832832void softlist_parser::parse_attributes(const char **attributes, int numattrs, const char *attrlist[], const char *outlist[])
r29404r29405
835835   for( ; attributes[0]; attributes += 2)
836836   {
837837      int index;
838     
838
839839      // look for a match among the attributes provided
840840      for (index = 0; index < numattrs; index++)
841841         if (strcmp(attributes[0], attrlist[index]) == 0)
r29404r29405
844844            outlist[index] = attributes[1];
845845            break;
846846         }
847     
847
848848      // if not found, report an unknown attribute
849849      if (index == numattrs)
850850         unknown_attribute(attributes[0]);
r29404r29405
854854
855855//-------------------------------------------------
856856//  add_rom_entry - append a new ROM entry to the
857//   current part's list
857//  current part's list
858858//-------------------------------------------------
859859
860860void softlist_parser::add_rom_entry(const char *name, const char *hashdata, UINT32 offset, UINT32 length, UINT32 flags)
r29404r29405
903903      case POS_SOFT:
904904         state->parse_soft_start(tagname, attributes);
905905         break;
906     
906
907907      case POS_PART:
908908         state->parse_part_start(tagname, attributes);
909909         break;
910     
910
911911      case POS_DATA:
912912         state->parse_data_start(tagname, attributes);
913913         break;
914914   }
915   
915
916916   // increment the state since this is a tag start
917917   state->m_pos = parse_position(state->m_pos + 1);
918918}
r29404r29405
949949      case POS_DATA:
950950         break;
951951   }
952   
952
953953   // stop accumulating
954954   state->m_data_accum_expected = false;
955955   state->m_data_accum.reset();
r29404r29405
991991      static const char *attrnames[] = { "name", "description" };
992992      const char *attrvalues[ARRAY_LENGTH(attrnames)] = { 0 };
993993      parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues);
994     
994
995995      if (attrvalues[1] != NULL)
996996         m_list.m_description = m_list.add_string(attrvalues[1]);
997997   }
r29404r29405
10021002
10031003//-------------------------------------------------
10041004//  parse_main_start - handle tag start within
1005//   a softwarelist tag
1005//  a softwarelist tag
10061006//-------------------------------------------------
10071007
10081008void softlist_parser::parse_main_start(const char *tagname, const char **attributes)
r29404r29405
10261026
10271027//-------------------------------------------------
10281028//  parse_main_start - handle tag start within
1029//   a software tag
1029//  a software tag
10301030//-------------------------------------------------
10311031
10321032void softlist_parser::parse_soft_start(const char *tagname, const char **attributes)
r29404r29405
10621062      else
10631063         parse_error("Incomplete other_info definition");
10641064   }
1065   
1065
10661066   // <sharedfeat name='' value=''>
10671067   else if (strcmp(tagname, "sharedfeat") == 0)
10681068   {
10691069      static const char *attrnames[] = { "name", "value" };
10701070      const char *attrvalues[ARRAY_LENGTH(attrnames)] = { 0 };
10711071      parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues);
1072   
1072
10731073      if (attrvalues[0] != NULL && attrvalues[1] != NULL)
10741074         m_current_info->m_shared_info.append(*global_alloc(feature_list_item(m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1]))));
10751075      else
10761076         parse_error("Incomplete sharedfeat definition");
10771077   }
1078   
1078
10791079   // <part name='' interface=''>
10801080   else if (strcmp(tagname, "part" ) == 0)
10811081   {
r29404r29405
10951095
10961096//-------------------------------------------------
10971097//  parse_part_start - handle tag start within
1098//   a part tag
1098//  a part tag
10991099//-------------------------------------------------
11001100
11011101void softlist_parser::parse_part_start(const char *tagname, const char **attributes)
r29404r29405
11131113      static const char *attrnames[] = { "name", "size" };
11141114      const char *attrvalues[ARRAY_LENGTH(attrnames)] = { 0 };
11151115      parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues);
1116     
1116
11171117      if (attrvalues[0] != NULL && attrvalues[1] != NULL && strcmp(attrvalues[0], "") != 0 && strcmp(attrvalues[1], "") != 0)
11181118         add_rom_entry(attrvalues[0], NULL, 0, strtol(attrvalues[1], NULL, 0), ROMENTRYTYPE_REGION);
11191119      else
11201120         parse_error("Incomplete dataarea definition");
11211121   }
1122   
1122
11231123   // <diskarea name=''>
11241124   else if (strcmp(tagname, "diskarea") == 0)
11251125   {
r29404r29405
11321132      else
11331133         parse_error("Incomplete diskarea definition");
11341134   }
1135   
1135
11361136   // <feature name='' value=''>
11371137   else if (strcmp(tagname, "feature") == 0)
11381138   {
11391139      static const char *attrnames[] = { "name", "value" };
11401140      const char *attrvalues[ARRAY_LENGTH(attrnames)] = { 0 };
11411141      parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues);
1142   
1142
11431143      if (attrvalues[0] != NULL)
11441144         m_current_part->m_featurelist.append(*global_alloc(feature_list_item(m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1]))));
11451145      else
11461146         parse_error("Incomplete feature definition");
11471147   }
1148   
1148
11491149   // <dipswitch>
11501150   else if (strcmp(tagname, "dipswitch") == 0)
11511151      ;
r29404r29405
11561156
11571157//-------------------------------------------------
11581158//  parse_data_start - handle tag start within a
1159//   dataarea or diskarea tag
1159//  dataarea or diskarea tag
11601160//-------------------------------------------------
11611161
11621162void softlist_parser::parse_data_start(const char *tagname, const char **attributes)
r29404r29405
11741174      static const char *attrnames[] = { "name", "size", "crc", "sha1", "offset", "value", "status", "loadflag" };
11751175      const char *attrvalues[ARRAY_LENGTH(attrnames)] = { 0 };
11761176      parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues);
1177     
1177
11781178      const char *name = attrvalues[0];
11791179      const char *sizestr = attrvalues[1];
11801180      const char *crc = attrvalues[2];
r29404r29405
12371237      else
12381238         parse_error("Incomplete rom definition");
12391239   }
1240   
1240
12411241   // <rom name='' sha1='' status='' writeable=''>
12421242   else if (strcmp(tagname, "disk") == 0)
12431243   {
r29404r29405
12621262      else if (status == NULL || !strcmp(status, "nodump")) // a no_dump chd is not an incomplete entry
12631263         parse_error("Incomplete disk definition");
12641264   }
1265   
1265
12661266   // <dipvalue>
12671267   else if (strcmp(tagname, "dipvalue") == 0)
12681268      ;
r29404r29405
12731273
12741274//-------------------------------------------------
12751275//  parse_soft_end - handle end-of-tag post-
1276//   processing within the <software> tag
1276//  processing within the <software> tag
12771277//-------------------------------------------------
12781278
12791279void softlist_parser::parse_soft_end(const char *tagname)
r29404r29405
12991299      assert(m_current_part != NULL);
13001300      if (m_current_part == NULL)
13011301         return;
1302   
1302
13031303      // was any dataarea/rom information encountered? if so, add a terminator
13041304      if (m_current_part->romdata() != NULL)
13051305         add_rom_entry(NULL, NULL, 0, 0, ROMENTRYTYPE_END);
1306     
1306
13071307      // get the info; if present, copy shared data (we assume name/value strings live
13081308      // in the string pool and don't need to be reallocated)
13091309      if (m_current_info != NULL)
trunk/src/emu/softlist.h
r29404r29405
7878   // construction/destruction
7979   feature_list_item(const char *name = NULL, const char *value = NULL)
8080      : m_next(NULL),
81        m_name(name),
82        m_value(value) { }
81         m_name(name),
82         m_value(value) { }
8383
8484   // getters
8585   feature_list_item *next() const { return m_next; }
r29404r29405
8787   const char *value() const { return m_value; }
8888
8989private:
90   // internal state     
90   // internal state
9191   feature_list_item * m_next;
92   const char *       m_name;
93   const char *       m_value;
92   const char *        m_name;
93   const char *        m_value;
9494};
9595
9696
r29404r29405
101101{
102102   friend class softlist_parser;
103103   friend class simple_list<software_part>;
104   
104
105105public:
106106   // construction/destruction
107107   software_part(software_info &info, const char *name = NULL, const char *interface = NULL);
r29404r29405
121121
122122private:
123123   // internal state
124   software_part *      m_next;
125   software_info &      m_info;
126   const char *      m_name;
127   const char *      m_interface;
124   software_part *     m_next;
125   software_info &     m_info;
126   const char *        m_name;
127   const char *        m_interface;
128128   simple_list<feature_list_item> m_featurelist;
129129   dynamic_array<rom_entry> m_romdata;
130130};
r29404r29405
137137{
138138   friend class softlist_parser;
139139   friend class simple_list<software_info>;
140   
140
141141public:
142142   // construction/destruction
143143   software_info(software_list_device &list, const char *name, const char *parent, const char *supported);
144   
144
145145   // getters
146146   software_info *next() const { return m_next; }
147147   software_list_device &list() const { return m_list; }
r29404r29405
156156   int num_parts() const { return m_partdata.count(); }
157157   software_part *first_part() const { return m_partdata.first(); }
158158   software_part *last_part() const { return m_partdata.last(); }
159   
159
160160   // additional operations
161161   software_part *find_part(const char *partname, const char *interface = NULL);
162162   bool has_multiple_parts(const char *interface) const;
163163
164164private:
165165   // internal state
166   software_info *         m_next;
167   software_list_device &   m_list;
168   UINT32                m_supported;
169   const char *         m_shortname;
170   const char *         m_longname;
171   const char *         m_parentname;
172   const char *         m_year;           // Copyright year on title screen, actual release dates can be tracked in external resources
173   const char *         m_publisher;
166   software_info *         m_next;
167   software_list_device &  m_list;
168   UINT32                  m_supported;
169   const char *            m_shortname;
170   const char *            m_longname;
171   const char *            m_parentname;
172   const char *            m_year;           // Copyright year on title screen, actual release dates can be tracked in external resources
173   const char *            m_publisher;
174174   simple_list<feature_list_item> m_other_info;   // Here we store info like developer, serial #, etc. which belong to the software entry as a whole
175175   simple_list<feature_list_item> m_shared_info;  // Here we store info like TV standard compatibility, or add-on requirements, etc. which get inherited
176                                   // by each part of this software entry (after loading these are stored in partdata->featurelist)
176                                    // by each part of this software entry (after loading these are stored in partdata->featurelist)
177177   simple_list<software_part> m_partdata;
178178};
179179
r29404r29405
228228   virtual void device_validity_check(validity_checker &valid) const ATTR_COLD;
229229
230230   // configuration state
231   astring                    m_list_name;
231   astring                     m_list_name;
232232   softlist_type               m_list_type;
233233   const char *                m_filter;
234234
235235   // internal state
236   bool                  m_parsed;
237   emu_file                m_file;
238   const char *            m_description;
239   astring                m_errors;
240   simple_list<software_info>    m_infolist;
241   const_string_pool         m_stringpool;
236   bool                        m_parsed;
237   emu_file                    m_file;
238   const char *                m_description;
239   astring                     m_errors;
240   simple_list<software_info>  m_infolist;
241   const_string_pool           m_stringpool;
242242};
243243
244244
trunk/src/emu/dioutput.c
r29404r29405
4040   if (m_output_name)
4141      output_set_value(m_output_name, value);
4242   else
43      fatalerror("Output name not set!");   
43      fatalerror("Output name not set!");
4444}
4545
4646void device_output_interface::set_led_value(int value)
trunk/src/emu/devfind.c
r29404r29405
7373      mame_printf_error("Tag not defined for required device\n");
7474      return false;
7575   }
76   
76
7777   // just pass through in the found case
7878   if (found)
7979      return true;
trunk/src/emu/diserial.h
r29404r29405
156156   UINT8 m_rcv_bit_count;
157157   /* the byte of data received */
158158   UINT8 m_rcv_byte_received;
159   
159
160160   bool m_rcv_framing_error;
161161   bool m_rcv_parity_error;
162162
trunk/src/emu/mame.c
r29404r29405
170170         astring errors;
171171         options.parse_standard_inis(errors);
172172      }
173     
173
174174      // otherwise, perform validity checks before anything else
175175      if (system != NULL)
176176      {
r29404r29405
189189
190190      web.set_machine(machine);
191191      web.push_message("update_machine");
192     
192
193193      // run the machine
194194      error = machine.run(firstrun);
195195      firstrun = false;
trunk/src/emu/rendfont.c
r29404r29405
392392         // if that worked, we're done
393393         if (result)
394394         {
395             // don't do that - glyphs data point into this array ...
396             // m_rawdata.reset();
395            // don't do that - glyphs data point into this array ...
396            // m_rawdata.reset();
397397            return true;
398398         }
399399      }
trunk/src/emu/machine/mc68681.c
r29404r29405
167167   {
168168      LOG(( "68681: Interrupt line not active (IMR & ISR = %02X)\n", ISR & IMR));
169169      write_irq(CLEAR_LINE);
170      m_read_vector = false;   // clear IACK too
170      m_read_vector = false;  // clear IACK too
171171   }
172172};
173173
r29404r29405
235235      // timer output to bit 3?
236236      if ((OPCR & 0xc) == 0x4)
237237      {
238         OPR ^= 0x8;
238         OPR ^= 0x8;
239239         write_outport(OPR ^ 0xff);
240240      }
241241
r29404r29405
280280
281281         // reading this clears all the input change bits
282282         IPCR &= 0x0f;
283         ISR &= ~INT_INPUT_PORT_CHANGE;
283         ISR &= ~INT_INPUT_PORT_CHANGE;
284284         update_interrupts();
285285      }
286286      break;
r29404r29405
304304         break;
305305
306306      case 0x0a: /* 1X/16X Test */
307         r = 0x61;   // the old 68681 returned this and it makes Apollo happy
307         r = 0x61;   // the old 68681 returned this and it makes Apollo happy
308308         break;
309309
310310      case 0x0d: /* IP */
311311         if (!read_inport.isnull())
312312         {
313            r = read_inport();   // TODO: go away
313            r = read_inport();  // TODO: go away
314314         }
315315         else
316316         {
317317            r = IP_last_state;
318318         }
319319
320         r |= 0x80;   // bit 7 is always set
320         r |= 0x80;  // bit 7 is always set
321321
322322         // bit 6 is /IACK (note the active-low)
323323         if (m_read_vector)
r29404r29405
328328         {
329329            r |= 0x40;
330330         }
331         break;
331         break;
332332
333333      case 0x0e: /* Start counter command */
334334      {
r29404r29405
402402         // check for pending input port delta interrupts
403403         if ((((IPCR>>4) & data) & 0x0f) != 0)
404404         {
405            ISR |= INT_INPUT_PORT_CHANGE;
405            ISR |= INT_INPUT_PORT_CHANGE;
406406         }
407407
408408         m_chanA->ACR_updated();
r29404r29405
466466
467467      if (ACR & 1)
468468      {
469         ISR |= INT_INPUT_PORT_CHANGE;
469         ISR |= INT_INPUT_PORT_CHANGE;
470470         update_interrupts();
471471      }
472472   }
r29404r29405
486486
487487      if (ACR & 2)
488488      {
489         ISR |= INT_INPUT_PORT_CHANGE;
489         ISR |= INT_INPUT_PORT_CHANGE;
490490         update_interrupts();
491491      }
492492   }
r29404r29405
506506
507507      if (ACR & 4)
508508      {
509         ISR |= INT_INPUT_PORT_CHANGE;
509         ISR |= INT_INPUT_PORT_CHANGE;
510510         update_interrupts();
511511      }
512512   }
r29404r29405
526526
527527      if (ACR & 8)
528528      {
529         ISR |= INT_INPUT_PORT_CHANGE;
529         ISR |= INT_INPUT_PORT_CHANGE;
530530         update_interrupts();
531531      }
532532   }
r29404r29405
671671{
672672   receive_register_extract();
673673
674//   printf("%s ch %d rcv complete\n", tag(), m_ch);
674//  printf("%s ch %d rcv complete\n", tag(), m_ch);
675675
676676   if ( rx_enabled )
677677   {
r29404r29405
693693
694694void mc68681_channel::tra_complete()
695695{
696//   printf("%s ch %d Tx complete\n", tag(), m_ch);
696//  printf("%s ch %d Tx complete\n", tag(), m_ch);
697697   tx_ready = 1;
698698   SR |= STATUS_TRANSMITTER_READY;
699699
r29404r29405
730730   if ((MR2&0xC0) != 0x80)
731731   {
732732      int bit = transmit_register_get_data_bit();
733//      printf("%s ch %d transmit %d\n", tag(), m_ch, bit);
733//      printf("%s ch %d transmit %d\n", tag(), m_ch, bit);
734734      if (m_ch == 0)
735735      {
736736         m_uart->write_a_tx(bit);
r29404r29405
740740         m_uart->write_b_tx(bit);
741741      }
742742   }
743   else   // must call this to advance the transmitter
743   else    // must call this to advance the transmitter
744744   {
745745      transmit_register_get_data_bit();
746746   }
r29404r29405
750750{
751751   if (rx_enabled)
752752   {
753      if (rx_fifo_num > 0)
753      if (rx_fifo_num > 0)
754754      {
755755         SR |= STATUS_RECEIVER_READY;
756756      }
r29404r29405
867867   rx_fifo_num--;
868868   update_interrupts();
869869
870//   printf("Rx read %02x\n", rv);
870//  printf("Rx read %02x\n", rv);
871871
872872   return rv;
873873};
r29404r29405
917917      CSR = data;
918918      tx_baud_rate = m_uart->calc_baud(m_ch, data & 0xf);
919919      rx_baud_rate = m_uart->calc_baud(m_ch, (data>>4) & 0xf);
920//      printf("%s ch %d CSR %02x Tx baud %d Rx baud %d\n", tag(), m_ch, data, tx_baud_rate, rx_baud_rate);
920//      printf("%s ch %d CSR %02x Tx baud %d Rx baud %d\n", tag(), m_ch, data, tx_baud_rate, rx_baud_rate);
921921      set_rcv_rate(rx_baud_rate);
922922      set_tra_rate(tx_baud_rate);
923923      break;
r29404r29405
10001000         break;
10011001   }
10021002
1003//   printf("%s ch %d MR1 %02x MR2 %02x => %d bits / char, %d stop bits, parity %d\n", tag(), m_ch, MR1, MR2, (MR1 & 3)+5, stopbits, parity);
1003//  printf("%s ch %d MR1 %02x MR2 %02x => %d bits / char, %d stop bits, parity %d\n", tag(), m_ch, MR1, MR2, (MR1 & 3)+5, stopbits, parity);
10041004
10051005   set_data_frame(1, (MR1 & 3)+5, parity, stopbits);
10061006}
r29404r29405
10921092         printf("Write %02x to TX when TX not ready!\n", data);
10931093    }*/
10941094
1095//   printf("%s ch %d Tx %02x\n", tag(), m_ch, data);
1095//  printf("%s ch %d Tx %02x\n", tag(), m_ch, data);
10961096
10971097   tx_ready = 0;
10981098   SR &= ~STATUS_TRANSMITTER_READY;
trunk/src/emu/machine/mc68328.h
r29404r29405
633633   template<class _Object> static devcb2_base &set_out_spim_callback(device_t &device, _Object object) { return downcast<mc68328_device &>(device).m_out_spim_cb.set_callback(object); }
634634   template<class _Object> static devcb2_base &set_in_spim_callback(device_t &device, _Object object) { return downcast<mc68328_device &>(device).m_in_spim_cb.set_callback(object); }
635635   template<class _Object> static devcb2_base &set_spim_xch_trigger_callback(device_t &device, _Object object) { return downcast<mc68328_device &>(device).m_spim_xch_trigger_cb.set_callback(object); }
636   
637   
636
637
638638   DECLARE_WRITE16_MEMBER(write);
639639   DECLARE_READ16_MEMBER(read);
640640   DECLARE_WRITE_LINE_MEMBER(set_penirq_line);
r29404r29405
699699
700700   required_device<cpu_device> m_cpu;
701701};
702   
703702
703
704704extern const device_type MC68328;
705705
706706#define MCFG_MC68328_CPU(_tag) \
707707   mc68328_device::static_set_cpu_tag(*device, "^"_tag);
708   
708
709709#define MCFG_MC68328_OUT_PORT_A_CB(_devcb) \
710710   devcb = &mc68328_device::set_out_port_a_callback(*device, DEVCB2_##_devcb);
711   
711
712712#define MCFG_MC68328_OUT_PORT_B_CB(_devcb) \
713713   devcb = &mc68328_device::set_out_port_b_callback(*device, DEVCB2_##_devcb);
714   
714
715715#define MCFG_MC68328_OUT_PORT_C_CB(_devcb) \
716716   devcb = &mc68328_device::set_out_port_c_callback(*device, DEVCB2_##_devcb);
717   
717
718718#define MCFG_MC68328_OUT_PORT_D_CB(_devcb) \
719719   devcb = &mc68328_device::set_out_port_d_callback(*device, DEVCB2_##_devcb);
720   
720
721721#define MCFG_MC68328_OUT_PORT_E_CB(_devcb) \
722722   devcb = &mc68328_device::set_out_port_e_callback(*device, DEVCB2_##_devcb);
723   
723
724724#define MCFG_MC68328_OUT_PORT_F_CB(_devcb) \
725725   devcb = &mc68328_device::set_out_port_f_callback(*device, DEVCB2_##_devcb);
726   
726
727727#define MCFG_MC68328_OUT_PORT_G_CB(_devcb) \
728728   devcb = &mc68328_device::set_out_port_g_callback(*device, DEVCB2_##_devcb);
729   
729
730730#define MCFG_MC68328_OUT_PORT_J_CB(_devcb) \
731731   devcb = &mc68328_device::set_out_port_j_callback(*device, DEVCB2_##_devcb);
732   
732
733733#define MCFG_MC68328_OUT_PORT_K_CB(_devcb) \
734734   devcb = &mc68328_device::set_out_port_k_callback(*device, DEVCB2_##_devcb);
735   
735
736736#define MCFG_MC68328_OUT_PORT_M_CB(_devcb) \
737737   devcb = &mc68328_device::set_out_port_m_callback(*device, DEVCB2_##_devcb);
738   
738
739739#define MCFG_MC68328_IN_PORT_A_CB(_devcb) \
740740   devcb = &mc68328_device::set_in_port_a_callback(*device, DEVCB2_##_devcb);
741   
741
742742#define MCFG_MC68328_IN_PORT_B_CB(_devcb) \
743743   devcb = &mc68328_device::set_in_port_b_callback(*device, DEVCB2_##_devcb);
744   
744
745745#define MCFG_MC68328_IN_PORT_C_CB(_devcb) \
746746   devcb = &mc68328_device::set_in_port_c_callback(*device, DEVCB2_##_devcb);
747   
747
748748#define MCFG_MC68328_IN_PORT_D_CB(_devcb) \
749749   devcb = &mc68328_device::set_in_port_d_callback(*device, DEVCB2_##_devcb);
750   
750
751751#define MCFG_MC68328_IN_PORT_E_CB(_devcb) \
752752   devcb = &mc68328_device::set_in_port_e_callback(*device, DEVCB2_##_devcb);
753   
753
754754#define MCFG_MC68328_IN_PORT_F_CB(_devcb) \
755755   devcb = &mc68328_device::set_in_port_f_callback(*device, DEVCB2_##_devcb);
756   
756
757757#define MCFG_MC68328_IN_PORT_G_CB(_devcb) \
758758   devcb = &mc68328_device::set_in_port_g_callback(*device, DEVCB2_##_devcb);
759   
759
760760#define MCFG_MC68328_IN_PORT_J_CB(_devcb) \
761761   devcb = &mc68328_device::set_in_port_j_callback(*device, DEVCB2_##_devcb);
762   
762
763763#define MCFG_MC68328_IN_PORT_K_CB(_devcb) \
764764   devcb = &mc68328_device::set_in_port_k_callback(*device, DEVCB2_##_devcb);
765   
765
766766#define MCFG_MC68328_IN_PORT_M_CB(_devcb) \
767767   devcb = &mc68328_device::set_in_port_m_callback(*device, DEVCB2_##_devcb);
768   
768
769769#define MCFG_MC68328_OUT_PWM_CB(_devcb) \
770770   devcb = &mc68328_device::set_out_pwm_callback(*device, DEVCB2_##_devcb);
771   
771
772772#define MCFG_MC68328_OUT_SPIM_CB(_devcb) \
773773   devcb = &mc68328_device::set_out_spim_callback(*device, DEVCB2_##_devcb);
774   
774
775775#define MCFG_MC68328_IN_SPIM_CB(_devcb) \
776776   devcb = &mc68328_device::set_in_spim_callback(*device, DEVCB2_##_devcb);
777   
777
778778#define MCFG_MC68328_SPIM_XCH_TRIGGER_CB(_devcb) \
779779   devcb = &mc68328_device::set_spim_xch_trigger_callback(*device, DEVCB2_##_devcb);
780780
trunk/src/emu/machine/mc68681.h
r29404r29405
149149   PAIR  CTR;  /* Counter/Timer Preset Value */
150150   UINT8 IPCR; /* Input Port Control Register */
151151
152   bool m_read_vector;   // if this is read and IRQ is active, it counts as pulling IACK
152   bool m_read_vector; // if this is read and IRQ is active, it counts as pulling IACK
153153
154154   /* state */
155155   UINT8 IP_last_state; /* last state of IP bits */
trunk/src/emu/machine/lh5810.h
r29404r29405
4343
4444#define MCFG_LH5810_PORTA_W_CB(_devcb) \
4545   devcb = &lh5810_device::set_porta_w_callback(*device, DEVCB2_##_devcb);
46   
46
4747#define MCFG_LH5810_PORTB_R_CB(_devcb) \
4848   devcb = &lh5810_device::set_portb_r_callback(*device, DEVCB2_##_devcb);
49   
49
5050#define MCFG_LH5810_PORTB_W_CB(_devcb) \
5151   devcb = &lh5810_device::set_portb_w_callback(*device, DEVCB2_##_devcb);
52   
52
5353#define MCFG_LH5810_PORTC_W_CB(_devcb) \
5454   devcb = &lh5810_device::set_portc_w_callback(*device, DEVCB2_##_devcb);
55
55
5656#define MCFG_LH5810_OUT_INT_CB(_devcb) \
5757   devcb = &lh5810_device::set_out_int_callback(*device, DEVCB2_##_devcb); //currently unused
5858
r29404r29405
7676   template<class _Object> static devcb2_base &set_portb_w_callback(device_t &device, _Object object) { return downcast<lh5810_device &>(device).m_portb_w_cb.set_callback(object); }
7777   template<class _Object> static devcb2_base &set_portc_w_callback(device_t &device, _Object object) { return downcast<lh5810_device &>(device).m_portc_w_cb.set_callback(object); }
7878   template<class _Object> static devcb2_base &set_out_int_callback(device_t &device, _Object object) { return downcast<lh5810_device &>(device).m_out_int_cb.set_callback(object); }
79   
79
8080   DECLARE_READ8_MEMBER( data_r );
8181   DECLARE_WRITE8_MEMBER( data_w );
8282
trunk/src/emu/machine/74145.h
r29404r29405
2323
2424#define MCFG_TTL74145_OUTPUT_LINE_2_CB(_devcb) \
2525   devcb = &ttl74145_device::set_output_line_2_callback(*device, DEVCB2_##_devcb);
26   
26
2727#define MCFG_TTL74145_OUTPUT_LINE_3_CB(_devcb) \
2828   devcb = &ttl74145_device::set_output_line_3_callback(*device, DEVCB2_##_devcb);
29   
29
3030#define MCFG_TTL74145_OUTPUT_LINE_4_CB(_devcb) \
3131   devcb = &ttl74145_device::set_output_line_4_callback(*device, DEVCB2_##_devcb);
32   
32
3333#define MCFG_TTL74145_OUTPUT_LINE_5_CB(_devcb) \
3434   devcb = &ttl74145_device::set_output_line_5_callback(*device, DEVCB2_##_devcb);
35   
35
3636#define MCFG_TTL74145_OUTPUT_LINE_6_CB(_devcb) \
3737   devcb = &ttl74145_device::set_output_line_6_callback(*device, DEVCB2_##_devcb);
38   
38
3939#define MCFG_TTL74145_OUTPUT_LINE_7_CB(_devcb) \
4040   devcb = &ttl74145_device::set_output_line_7_callback(*device, DEVCB2_##_devcb);
41   
41
4242#define MCFG_TTL74145_OUTPUT_LINE_8_CB(_devcb) \
4343   devcb = &ttl74145_device::set_output_line_8_callback(*device, DEVCB2_##_devcb);
44   
44
4545#define MCFG_TTL74145_OUTPUT_LINE_9_CB(_devcb) \
4646   devcb = &ttl74145_device::set_output_line_9_callback(*device, DEVCB2_##_devcb);
4747
r29404r29405
5656public:
5757   // construction/destruction
5858   ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
59   
59
6060   template<class _Object> static devcb2_base &set_output_line_0_callback(device_t &device, _Object object) { return downcast<ttl74145_device &>(device).m_output_line_0_cb.set_callback(object); }
6161   template<class _Object> static devcb2_base &set_output_line_1_callback(device_t &device, _Object object) { return downcast<ttl74145_device &>(device).m_output_line_1_cb.set_callback(object); }
6262   template<class _Object> static devcb2_base &set_output_line_2_callback(device_t &device, _Object object) { return downcast<ttl74145_device &>(device).m_output_line_2_cb.set_callback(object); }
r29404r29405
6767   template<class _Object> static devcb2_base &set_output_line_7_callback(device_t &device, _Object object) { return downcast<ttl74145_device &>(device).m_output_line_7_cb.set_callback(object); }
6868   template<class _Object> static devcb2_base &set_output_line_8_callback(device_t &device, _Object object) { return downcast<ttl74145_device &>(device).m_output_line_8_cb.set_callback(object); }
6969   template<class _Object> static devcb2_base &set_output_line_9_callback(device_t &device, _Object object) { return downcast<ttl74145_device &>(device).m_output_line_9_cb.set_callback(object); }
70   
70
7171   UINT16 read();
7272   void write(UINT8 data);
7373protected:
trunk/src/emu/machine/kr2376.c
r29404r29405
346346ioport_constructor kr2376_device::device_input_ports() const
347347{
348348   return INPUT_PORTS_NAME( kr2376 );
349}
No newline at end of file
349}
trunk/src/emu/machine/s3c2410.c
r29404r29405
101101void s3c2410_device::device_start()
102102{
103103   s3c24xx_device_start();
104   
105   address_space &space = m_cpu->memory().space( AS_PROGRAM);   
104
105   address_space &space = m_cpu->memory().space( AS_PROGRAM);
106106   space.install_readwrite_handler( 0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2410_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_memcon_w), this));
107107   space.install_readwrite_handler( 0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2410_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_usb_host_w), this));
108108   space.install_readwrite_handler( 0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2410_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_irq_w), this));
trunk/src/emu/machine/com8116.h
r29404r29405
9090   int m_fx4;
9191   int m_fr;
9292   int m_ft;
93   
93
9494   const int *m_fr_divisors;
9595   const int *m_ft_divisors;
9696
trunk/src/emu/machine/kr2376.h
r29404r29405
5959   ~kr2376_device() {}
6060
6161   template<class _Object> static devcb2_base &set_strobe_wr_callback(device_t &device, _Object object) { return downcast<kr2376_device &>(device).m_write_strobe.set_callback(object); }
62   
62
6363   /* keyboard data */
6464   DECLARE_READ8_MEMBER( data_r );
6565
r29404r29405
7474   virtual void device_start();
7575   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7676   virtual ioport_constructor device_input_ports() const;
77   
77
7878private:
7979   // internal state
8080   int m_pins[41];
r29404r29405
9191   /* timers */
9292   emu_timer *m_scan_timer;          /* keyboard scan timer */
9393   devcb2_write_line m_write_strobe;
94   
94
9595   enum
9696   {
9797      TIMER_SCAN_TICK
9898   };
99   
99
100100   void change_output_lines();
101101   void clock_scan_counters();
102102   void detect_keypress();
trunk/src/emu/machine/s3c2410.h
r29404r29405
1616
1717#define MCFG_S3C2410_ADD(_tag, _clock, _config, _palette_tag) \
1818   MCFG_DEVICE_ADD(_tag, S3C2410, _clock) \
19   MCFG_DEVICE_CONFIG(_config)   \
19   MCFG_DEVICE_CONFIG(_config) \
2020   s3c2410_device::static_set_palette_tag(*device, "^" _palette_tag);
2121
2222#define S3C2410_INTERFACE(name) \
r29404r29405
454454#define S3C24XX_DMA_COUNT   4
455455#define S3C24XX_SPI_COUNT   2
456456
457class s3c2410_device : public device_t,
457class s3c2410_device : public device_t,
458458                        public s3c2410_interface
459459{
460460public:
r29404r29405
465465   static void static_set_palette_tag(device_t &device, const char *tag);
466466
467467   DECLARE_WRITE_LINE_MEMBER( frnb_w );
468   
468
469469   // device-level overrides
470470   virtual void device_config_complete();
471471   virtual void device_start();
r29404r29405
475475   required_device<palette_device> m_palette;
476476public:
477477   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
478   
478
479479   void s3c24xx_reset();
480480   inline int iface_core_pin_r(int pin);
481481   void s3c24xx_lcd_reset();
r29404r29405
633633   void s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask);
634634   READ32_MEMBER( s3c24xx_spi_0_r );
635635   READ32_MEMBER( s3c24xx_spi_1_r );
636   WRITE32_MEMBER( s3c24xx_spi_0_w );   
636   WRITE32_MEMBER( s3c24xx_spi_0_w );
637637   WRITE32_MEMBER( s3c24xx_spi_1_w );
638638   void s3c24xx_sdi_reset();
639639   READ32_MEMBER( s3c24xx_sdi_r );
r29404r29405
661661   void s3c2410_touch_screen( int state);
662662   void s3c2410_request_eint( UINT32 number);
663663   void s3c2410_nand_calculate_mecc( UINT8 *data, UINT32 size, UINT8 *mecc);
664   
664
665665   /*******************************************************************************
666      TYPE DEFINITIONS
666       TYPE DEFINITIONS
667667   *******************************************************************************/
668668
669669   struct s3c24xx_memcon_regs_t
r29404r29405
10701070   devcb_resolved_write8 m_command_w;
10711071   devcb_resolved_write8 m_address_w;
10721072   devcb_resolved_read8  m_nand_data_r;
1073   devcb_resolved_write8 m_nand_data_w;   
1073   devcb_resolved_write8 m_nand_data_w;
10741074};
10751075
10761076extern const device_type S3C2410;
trunk/src/emu/machine/s3c24xx.inc
r29404r29405
8686/* ... */
8787
8888void S3C24_CLASS_NAME::s3c24xx_reset()
89{   
89{
9090   verboselog( machine(), 1, "reset\n");
9191   m_cpu->reset();
9292   this->reset();
r29404r29405
34723472
34733473void S3C24_CLASS_NAME::s3c24xx_device_start()
34743474{
3475
34763475   verboselog( machine(), 1, "s3c24xx device start\n");
34773476   m_pin_r.resolve(m_iface_core.pin_r, *this);
34783477   m_pin_w.resolve(m_iface_core.pin_w, *this);
trunk/src/emu/machine/bcreader.c
r29404r29405
44
55    Generic barcode reader emulation.
66
7   This device only provides the storage of the actual barcode, entered
8   by the user via Internal UI, both as a raw strip of pixels (up to 95,
9   for an EAN-13 barcode) and as an array of 0-9 digits.
10 
11   It is up to the driver to handle the serial transfer of the data to
12   the emulated machine, depending on the used protocol
13 
14   E.g. Bandai Datach games directly read the raw pixel sequence of
15   black/white bars;
16   OTOH Barcode Battle (used by Barcode World for NES and a few SNES
17   titles) sends the digits as sequences of 20 bytes (13 for the code,
18   suitably padded for shorted codes, followed by a signature) and the
19   actual serial transmission to the console is up to the slot device
20   connected to the NES/SNES controller port (yet to be emulated, in this
21   case)
7    This device only provides the storage of the actual barcode, entered
8    by the user via Internal UI, both as a raw strip of pixels (up to 95,
9    for an EAN-13 barcode) and as an array of 0-9 digits.
2210
11    It is up to the driver to handle the serial transfer of the data to
12    the emulated machine, depending on the used protocol
13
14    E.g. Bandai Datach games directly read the raw pixel sequence of
15    black/white bars;
16    OTOH Barcode Battle (used by Barcode World for NES and a few SNES
17    titles) sends the digits as sequences of 20 bytes (13 for the code,
18    suitably padded for shorted codes, followed by a signature) and the
19    actual serial transmission to the console is up to the slot device
20    connected to the NES/SNES controller port (yet to be emulated, in this
21    case)
22
2323    Note: we currently support the following barcode formats
2424    * UPC-A: 12 digits
2525    * EAN-13: 13 digits (extension of the former)
26   * EAN-8: 8 digits (same encoding as UPC-A, but 4-digits blocks instead
27     of 6-digits blocks)
26    * EAN-8: 8 digits (same encoding as UPC-A, but 4-digits blocks instead
27      of 6-digits blocks)
2828    Notice that since EAN-13 is an extension of UPC-A, we just treat UPC-A
29    as an EAN-13 code with leading '0'. If any barcode reader shall be found   
30   which supports the older format only, this shall be changed
29    as an EAN-13 code with leading '0'. If any barcode reader shall be found
30    which supports the older format only, this shall be changed
3131
32 
33   TODO: add support for UPC-E barcodes? these are 8 digits barcodes with 17
34   black stripes (they are compressed UPC-A codes). Datach reader does not
35   support these, so it is low priority
3632
37 
38   TODO 2: verify barcode checksum in is_valid() and not only length, so
39   that we can then use the actual last digit in the decode function below,
40   rather than replacing it with the checksum value
41 
42 
43   TODO 3: possibly the white spaces before the actual barcode (see the
44   61 white pixels sent by read_pixel() before and after the code), shall
45   be moved to the specific implementations to emulate different "sensitivity"
46   of the readers? Bandai Datach seems to need at least 32 pixels...
33    TODO: add support for UPC-E barcodes? these are 8 digits barcodes with 17
34    black stripes (they are compressed UPC-A codes). Datach reader does not
35    support these, so it is low priority
4736
37
38    TODO 2: verify barcode checksum in is_valid() and not only length, so
39    that we can then use the actual last digit in the decode function below,
40    rather than replacing it with the checksum value
41
42
43    TODO 3: possibly the white spaces before the actual barcode (see the
44    61 white pixels sent by read_pixel() before and after the code), shall
45    be moved to the specific implementations to emulate different "sensitivity"
46    of the readers? Bandai Datach seems to need at least 32 pixels...
47
4848***************************************************************************/
4949
5050#include "emu.h"
r29404r29405
8585
8686//-------------------------------------------------
8787//  Barcode Decoding - convert the entered sequence
88//  of digits into a sequence of B/W pixels (the
88//  of digits into a sequence of B/W pixels (the
8989//  actual bars) - each digit corresponds to 7 pixels
9090//  0 is black, 1 is white
9191//-------------------------------------------------
r29404r29405
140140   if (len == 13)
141141   {
142142      // UPC-A and EAN-13
143     
143
144144      m_pixel_data[output++] = 0;
145145      m_pixel_data[output++] = 1;
146146      m_pixel_data[output++] = 0;
147     
147
148148      for (int i = 1; i < 7; i++)
149149      {
150150         if (bcread_parity_type[m_byte_data[0]][i - 1])
r29404r29405
158158               m_pixel_data[output++] = bcread_data_LE[m_byte_data[i]][j];
159159         }
160160      }
161     
161
162162      m_pixel_data[output++] = 1;
163163      m_pixel_data[output++] = 0;
164164      m_pixel_data[output++] = 1;
165165      m_pixel_data[output++] = 0;
166166      m_pixel_data[output++] = 1;
167     
167
168168      for (int i = 7; i < 12; i++)
169169      {
170170         for (int j = 0; j < 7; j++)
r29404r29405
178178   else if (len == 8)
179179   {
180180      // EAN-8 (same encoding as UPC-A, but only 4+4 digits, instead of 6+6)
181     
181
182182      m_pixel_data[output++] = 0;
183183      m_pixel_data[output++] = 1;
184184      m_pixel_data[output++] = 0;
185     
185
186186      for (int i = 0; i < 4; i++)
187187      {
188188         for (int j = 0; j < 7; j++)
189189            m_pixel_data[output++] = bcread_data_LO[m_byte_data[i]][j];
190190      }
191     
191
192192      m_pixel_data[output++] = 1;
193193      m_pixel_data[output++] = 0;
194194      m_pixel_data[output++] = 1;
195195      m_pixel_data[output++] = 0;
196196      m_pixel_data[output++] = 1;
197     
197
198198      for (int i = 4; i < 7; i++)
199199      {
200200         for (int j = 0; j < 7; j++)
201201            m_pixel_data[output++] = bcread_data_RE[m_byte_data[i]][j];
202202      }
203     
203
204204      // ignore the last digit and compute it as checksum of the first 12
205205      for (int i = 0; i < 7; i++)
206206         sum += (i & 1) ? (m_byte_data[i] * 1) : (m_byte_data[i] * 3);
207207   }
208   
208
209209   if (m_pixel_data)
210210   {
211211      sum = (10 - (sum % 10)) % 10;
212212      if (sum != m_byte_data[len - 1])
213         logerror("WARNING: wrong checksum detected in the barcode! chksum %d last digit %d\n",
213         logerror("WARNING: wrong checksum detected in the barcode! chksum %d last digit %d\n",
214214                        sum, m_byte_data[len - 1]);
215     
215
216216      for (int i = 0; i < 7; i++)
217217         m_pixel_data[output++] = bcread_data_RE[sum][i];
218     
218
219219      m_pixel_data[output++] = 0;
220220      m_pixel_data[output++] = 1;
221221      m_pixel_data[output++] = 0;
222222   }
223   
223
224224   m_byte_length = len;
225225   m_pixel_length = output;
226226
227//   printf("byte len %d - pixel len\n", m_byte_length, m_pixel_length);
227//  printf("byte len %d - pixel len\n", m_byte_length, m_pixel_length);
228228}
229229
230230
231231//-------------------------------------------------
232232//  write_code - invoked by UI, stores the barcode
233//  both as an array of digits and as a sequence
233//  both as an array of digits and as a sequence
234234//  of B/W pixels (the actual bars)
235235//-------------------------------------------------
236236
r29404r29405
322322         return 0;
323323      }
324324   }
325   
325
326326   // no pending transfer = black pixel = 0
327327   return 0;
328328}
trunk/src/emu/machine/i8251.c
r29404r29405
686686WRITE_LINE_MEMBER(i8251_device::write_rxd)
687687{
688688   m_rxd = state;
689//   device_serial_interface::rx_w(state);
689//  device_serial_interface::rx_w(state);
690690}
691691
692692WRITE_LINE_MEMBER(i8251_device::write_cts)
trunk/src/emu/machine/bcreader.h
r29404r29405
3131   // TODO: add checksum validation!
3232   bool is_valid(int len) { return (len != 12 && len != 13 && len != 8) ? FALSE : TRUE; }
3333   void decode(int len);
34   
34
3535protected:
3636   // device-level overrides
3737   virtual void device_start();
38   
38
3939   UINT8 m_byte_data[13];
4040   UINT8 m_pixel_data[100];
4141   int m_byte_length;
trunk/src/emu/machine/upd765.c
r29404r29405
133133   intrq_cb.resolve_safe();
134134   drq_cb.resolve_safe();
135135   hdl_cb.resolve_safe();
136   
136
137137   for(int i=0; i != 4; i++) {
138138      char name[2];
139139      flopi[i].tm = timer_alloc(i);
trunk/src/emu/machine/tmp68301.h
r29404r29405
2828
2929   template<class _Object> static devcb2_base &set_in_parallel_callback(device_t &device, _Object object) { return downcast<tmp68301_device &>(device).m_in_parallel_cb.set_callback(object); }
3030   template<class _Object> static devcb2_base &set_out_parallel_callback(device_t &device, _Object object) { return downcast<tmp68301_device &>(device).m_out_parallel_cb.set_callback(object); }
31   
31
3232   // Hardware Registers
3333   DECLARE_READ16_MEMBER( regs_r );
3434   DECLARE_WRITE16_MEMBER( regs_w );
r29404r29405
5858private:
5959   devcb2_read16         m_in_parallel_cb;
6060   devcb2_write16        m_out_parallel_cb;
61   
61
6262   // internal state
6363   UINT16 m_regs[0x400];
6464
trunk/src/emu/machine/mm58167.c
r29404r29405
11/**********************************************************************
22
33    mm58167.c - National Semiconductor MM58167 real-time clock emulation
4
4
55    TODO: alarms and IRQs not used by the Apple /// and aren't implemented.
6
6
77**********************************************************************/
88
99#include "mm58167.h"
r29404r29405
1818// registers (0-7 are the live data, 8-f are the setting for the compare IRQ)
1919typedef enum
2020{
21   R_CNT_MILLISECONDS = 0,   // 0 = milliseconds
22   R_CNT_HUNDTENTHS,      // 1 = hundreds and tenths of seconds
23   R_CNT_SECONDS,         // 2 = seconds
24   R_CNT_MINUTES,         // 3 = minutes
25   R_CNT_HOURS,         // 4 = hours
26   R_CNT_DAYOFWEEK,      // 5 = day of the week
27   R_CNT_DAYOFMONTH,      // 6 = day of the month
28   R_CNT_MONTH,         // 7 = month
29   R_RAM_MILLISECONDS,      // 8 = milliseconds
30   R_RAM_HUNDTENTHS,      // 9 = hundreds and tenths of seconds
31   R_RAM_SECONDS,         // a = seconds
32   R_RAM_MINUTES,         // b = minutes
33   R_RAM_HOURS,         // c = hours
34   R_RAM_DAYOFWEEK,      // d = day of the week
35   R_RAM_DAYOFMONTH,      // e = day of the month
36   R_RAM_MONTH,         // f = month
37   R_CTL_IRQSTATUS,      // 10 = IRQ status (b7 = compare, b6 = 10th sec, b5 = sec, b4 = min, b3 = hour, b2 = day, b1 = week, b0 = month)
38   R_CTL_IRQCONTROL,      // 11 = IRQ control (same bit layout as status, but write here to enable/disable/clear)
39   R_CTL_RESETCOUNTERS,   // 12 = reset counters
40   R_CTL_RESETRAM,         // 13 = reset RAM
41   R_CTL_STATUS,         // 14 = status bit
42   R_CTL_GOCMD,         // 15 = GO Command
43   R_CTL_STANDBYIRQ,      // 16 = standby IRQ
44   R_CTL_TESTMODE         // 17 = test mode
21   R_CNT_MILLISECONDS = 0, // 0 = milliseconds
22   R_CNT_HUNDTENTHS,       // 1 = hundreds and tenths of seconds
23   R_CNT_SECONDS,          // 2 = seconds
24   R_CNT_MINUTES,          // 3 = minutes
25   R_CNT_HOURS,            // 4 = hours
26   R_CNT_DAYOFWEEK,        // 5 = day of the week
27   R_CNT_DAYOFMONTH,       // 6 = day of the month
28   R_CNT_MONTH,            // 7 = month
29   R_RAM_MILLISECONDS,     // 8 = milliseconds
30   R_RAM_HUNDTENTHS,       // 9 = hundreds and tenths of seconds
31   R_RAM_SECONDS,          // a = seconds
32   R_RAM_MINUTES,          // b = minutes
33   R_RAM_HOURS,            // c = hours
34   R_RAM_DAYOFWEEK,        // d = day of the week
35   R_RAM_DAYOFMONTH,       // e = day of the month
36   R_RAM_MONTH,            // f = month
37   R_CTL_IRQSTATUS,        // 10 = IRQ status (b7 = compare, b6 = 10th sec, b5 = sec, b4 = min, b3 = hour, b2 = day, b1 = week, b0 = month)
38   R_CTL_IRQCONTROL,       // 11 = IRQ control (same bit layout as status, but write here to enable/disable/clear)
39   R_CTL_RESETCOUNTERS,    // 12 = reset counters
40   R_CTL_RESETRAM,         // 13 = reset RAM
41   R_CTL_STATUS,           // 14 = status bit
42   R_CTL_GOCMD,            // 15 = GO Command
43   R_CTL_STANDBYIRQ,       // 16 = standby IRQ
44   R_CTL_TESTMODE          // 17 = test mode
4545} mm58167_regs_t;
4646
4747//-------------------------------------------------
r29404r29405
8181{
8282   set_current_time(machine());
8383
84   m_regs[R_CTL_STATUS] = 0;   // not busy
84   m_regs[R_CTL_STATUS] = 0;   // not busy
8585   m_milliseconds = 0;
8686}
8787
r29404r29405
116116
117117void mm58167_device::rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second)
118118{
119   m_regs[R_CNT_SECONDS] = make_bcd(second);         // seconds (BCD)
120   m_regs[R_CNT_MINUTES] = make_bcd(minute);         // minutes (BCD)
121   m_regs[R_CNT_HOURS] = make_bcd(hour);            // hour (BCD)
122   m_regs[R_CNT_DAYOFWEEK] = make_bcd(day_of_week);   // day of the week (BCD)
123   m_regs[R_CNT_DAYOFMONTH] = make_bcd(day);         // day of the month (BCD)
124   m_regs[R_CNT_MONTH] = make_bcd(month);            // month (BCD)
119   m_regs[R_CNT_SECONDS] = make_bcd(second);           // seconds (BCD)
120   m_regs[R_CNT_MINUTES] = make_bcd(minute);           // minutes (BCD)
121   m_regs[R_CNT_HOURS] = make_bcd(hour);               // hour (BCD)
122   m_regs[R_CNT_DAYOFWEEK] = make_bcd(day_of_week);    // day of the week (BCD)
123   m_regs[R_CNT_DAYOFMONTH] = make_bcd(day);           // day of the month (BCD)
124   m_regs[R_CNT_MONTH] = make_bcd(month);              // month (BCD)
125125}
126126
127127READ8_MEMBER(mm58167_device::read)
128128{
129//   printf("read reg %x = %02x\n", offset, m_regs[offset]);
129//  printf("read reg %x = %02x\n", offset, m_regs[offset]);
130130   return m_regs[offset];
131131}
132132
133133WRITE8_MEMBER(mm58167_device::write)
134134{
135//   printf("%02x to reg %x\n", data, offset);
135//  printf("%02x to reg %x\n", data, offset);
136136
137137   if ((offset >= R_RAM_MILLISECONDS) && (offset != R_CTL_IRQSTATUS))
138138   {
r29404r29405
149149      case R_CTL_RESETRAM:
150150         if (data == 0xff)
151151         {
152            for (int i = R_RAM_MILLISECONDS; i < R_CTL_IRQSTATUS; i++)
152            for (int i = R_RAM_MILLISECONDS; i < R_CTL_IRQSTATUS; i++)
153153            {
154154               m_regs[i] = 0;
155155            }
r29404r29405
159159      case R_CTL_IRQCONTROL:
160160         if (data != 0)
161161         {
162            logerror("MM58167: IRQs not implemented\n");
162            logerror("MM58167: IRQs not implemented\n");
163163         }
164164         break;
165165   }
166166}
167
trunk/src/emu/machine/rp5c15.h
r29404r29405
5252public:
5353   // construction/destruction
5454   rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
55   
55
5656   template<class _Object> static devcb2_base &set_out_alarm_callback(device_t &device, _Object object) { return downcast<rp5c15_device &>(device).m_out_alarm_cb.set_callback(object); }
5757   template<class _Object> static devcb2_base &set_out_clkout_callback(device_t &device, _Object object) { return downcast<rp5c15_device &>(device).m_out_clkout_cb.set_callback(object); }
5858
trunk/src/emu/machine/mm58167.h
r29404r29405
11/**********************************************************************
22
33    mm58167.h - National Semiconductor MM58167 real-time clock emulation
4 
5   license: MAME, BSD-3-Clause, LGPL v2
6   copyright-holders: R. Belmont
74
5    license: MAME, BSD-3-Clause, LGPL v2
6    copyright-holders: R. Belmont
7
88**********************************************************************/
99
1010#pragma once
trunk/src/emu/machine/hd63450.c
r29404r29405
6161   // get the CPU device
6262   m_cpu = machine().device<cpu_device>(m_cpu_tag);
6363   assert(m_cpu != NULL);
64   
64
6565   // resolve callbacks
6666   m_dma_end.resolve();
6767   m_dma_error.resolve_safe();
r29404r29405
7373   m_dma_write_1.resolve();
7474   m_dma_write_2.resolve();
7575   m_dma_write_3.resolve();
76   
76
7777   // Initialise timers and registers
7878   for (int x = 0; x < 4 ; x++)
7979   {
r29404r29405
8686READ16_MEMBER(hd63450_device::read)
8787{
8888   int channel,reg;
89   
89
9090   channel = (offset & 0x60) >> 5;
9191   reg = offset & 0x1f;
9292
r29404r29405
321321   address_space &space = m_cpu->space(AS_PROGRAM);
322322   int data;
323323   int datasize = 1;
324   
324
325325   if(m_in_progress[x] != 0)  // DMA in progress in channel x
326326      {
327327         if(m_reg[x].ocr & 0x80)  // direction: 1 = device -> memory
trunk/src/emu/machine/hd63450.h
r29404r29405
1616
1717#define MCFG_HD63450_DMA_READ_1_CB(_devcb) \
1818   devcb = &hd63450_device::set_dma_read_1_callback(*device, DEVCB2_##_devcb);
19   
19
2020#define MCFG_HD63450_DMA_READ_2_CB(_devcb) \
2121   devcb = &hd63450_device::set_dma_read_2_callback(*device, DEVCB2_##_devcb);
2222
2323#define MCFG_HD63450_DMA_READ_3_CB(_devcb) \
2424   devcb = &hd63450_device::set_dma_read_3_callback(*device, DEVCB2_##_devcb);
25   
25
2626#define MCFG_HD63450_DMA_WRITE_0_CB(_devcb) \
2727   devcb = &hd63450_device::set_dma_write_0_callback(*device, DEVCB2_##_devcb);
2828
2929#define MCFG_HD63450_DMA_WRITE_1_CB(_devcb) \
3030   devcb = &hd63450_device::set_dma_write_1_callback(*device, DEVCB2_##_devcb);
31   
31
3232#define MCFG_HD63450_DMA_WRITE_2_CB(_devcb) \
3333   devcb = &hd63450_device::set_dma_write_2_callback(*device, DEVCB2_##_devcb);
34   
34
3535#define MCFG_HD63450_DMA_WRITE_3_CB(_devcb) \
3636   devcb = &hd63450_device::set_dma_write_3_callback(*device, DEVCB2_##_devcb);
37   
3837
38
3939struct hd63450_regs
4040{  // offsets in bytes
4141   unsigned char csr;  // [00] Channel status register (R/W)
r29404r29405
8181   template<class _Object> static devcb2_base &set_dma_write_0_callback(device_t &device, _Object object) { return downcast<hd63450_device &>(device).m_dma_write_0.set_callback(object); }
8282   template<class _Object> static devcb2_base &set_dma_write_1_callback(device_t &device, _Object object) { return downcast<hd63450_device &>(device).m_dma_write_1.set_callback(object); }
8383   template<class _Object> static devcb2_base &set_dma_write_2_callback(device_t &device, _Object object) { return downcast<hd63450_device &>(device).m_dma_write_2.set_callback(object); }
84   template<class _Object> static devcb2_base &set_dma_write_3_callback(device_t &device, _Object object) { return downcast<hd63450_device &>(device).m_dma_write_3.set_callback(object); }   
84   template<class _Object> static devcb2_base &set_dma_write_3_callback(device_t &device, _Object object) { return downcast<hd63450_device &>(device).m_dma_write_3.set_callback(object); }
8585
8686   DECLARE_READ16_MEMBER( read );
8787   DECLARE_WRITE16_MEMBER( write );
88   
88
8989   void single_transfer(int x);
9090   void set_timer(int channel, attotime tm);
9191   int get_vector(int channel);
9292   int get_error_vector(int channel);
93   
93
9494protected:
9595   // device-level overrides
9696   virtual void device_config_complete();
r29404r29405
107107   devcb2_write8 m_dma_write_1;
108108   devcb2_write8 m_dma_write_2;
109109   devcb2_write8 m_dma_write_3;
110   
110
111111   // internal state
112112   hd63450_regs m_reg[4];
113113   emu_timer* m_timer[4];  // for timing data reading/writing each channel
trunk/src/emu/machine/z80dma.c
r29404r29405
897897WRITE_LINE_MEMBER(z80dma_device::bai_w)
898898{
899899}
900
trunk/src/emu/machine/smc92x4.c
r29404r29405
189189
190190smc92x4_device::smc92x4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
191191: device_t(mconfig, SMC92X4, "SMC 9224/9234 Hard/Floppy Disk Controller", tag, owner, clock, "smc92x4", __FILE__),
192  m_out_intrq(*this),
193  m_out_dip(*this),
194  m_out_auxbus(*this),
195  m_in_auxbus(*this),
196  m_in_dma(*this),
197  m_out_dma(*this)
192   m_out_intrq(*this),
193   m_out_dip(*this),
194   m_out_auxbus(*this),
195   m_in_auxbus(*this),
196   m_in_dma(*this),
197   m_out_dma(*this)
198198{
199199}
200200
trunk/src/emu/machine/mb87078.c
r29404r29405
119119void mb87078_device::device_start()
120120{
121121   m_gain_changed_cb.resolve_safe();
122   
122
123123   save_item(NAME(m_channel_latch));
124124   save_item(NAME(m_reset_comp));
125125   save_item(NAME(m_latch[0]));
trunk/src/emu/machine/tms5501.c
r29404r29405
443443      }
444444   }
445445
446   m_xi7 = state;   
446   m_xi7 = state;
447447}
448448
449449
r29404r29405
458458      set_interrupt(IRQ_SENS);
459459   }
460460
461   m_sens = state;   
461   m_sens = state;
462462}
463463
464464
r29404r29405
501501   }
502502   else
503503   {
504      m_write_irq(CLEAR_LINE);   
504      m_write_irq(CLEAR_LINE);
505505   }
506506}
507507
r29404r29405
522522         m_irq &= ~(1 << i);
523523
524524         check_interrupt();
525     
525
526526         if (LOG) logerror("%s: TMS5501 '%s' Interrupt Acknowledge %02x\n", machine().describe_context(), tag(), rst);
527527         break;
528528      }
trunk/src/emu/machine/smc92x4.h
r29404r29405
223223   // We expect the embedding board to replace the drive according to the
224224   // select lines.
225225   legacy_floppy_image_device    *m_drive;
226   mfm_harddisk_device           *m_harddisk;
226   mfm_harddisk_device           *m_harddisk;
227227};
228228
229229#define MCFG_SMC92X4_ADD(_tag, _intrf) \
trunk/src/emu/machine/k053252.h
r29404r29405
1919   devcb = &k053252_device::set_int2_ack_callback(*device, DEVCB2_##_devcb);
2020
2121/*#define MCFG_K053252_INT_TIME_CB(_devcb) \
22   devcb = &k053252_device::set_int_time_callback(*device, DEVCB2_##_devcb); */
22    devcb = &k053252_device::set_int_time_callback(*device, DEVCB2_##_devcb); */
2323
2424#define MCFG_K053252_OFFSETS(_offsx, _offsy) \
2525   k053252_device::set_offsets(*device, _offsx, _offsy);
r29404r29405
3838   template<class _Object> static devcb2_base &set_int2_ack_callback(device_t &device, _Object object) { return downcast<k053252_device &>(device).m_int2_ack_cb.set_callback(object); }
3939   //template<class _Object> static devcb2_base &set_int_time_callback(device_t &device, _Object object) { return downcast<k053252_device &>(device).m_int_time_cb.set_callback(object); }
4040   static void set_offsets(device_t &device, int offsx, int offsy) { downcast<k053252_device &>(device).m_offsx = offsx; downcast<k053252_device &>(device).m_offsy = offsy;}
41   
41
4242   DECLARE_READ8_MEMBER( read );  // CCU registers
4343   DECLARE_WRITE8_MEMBER( write );
4444
trunk/src/emu/machine/6850acia.c
r29404r29405
329329            {
330330               m_status &= ~SR_DCD;
331331            }
332   
332
333333            m_rx_counter++;
334334
335335            switch (m_rx_state)
r29404r29405
430430                  m_rx_counter = 0;
431431
432432                  if (LOG) logerror("MC6850 '%s': RX STOP BIT\n", tag());
433     
433
434434                  if (!m_rxd)
435435                  {
436436                     m_status |= SR_FE;
r29404r29405
536536            if (m_tx_counter == m_divide)
537537            {
538538               m_tx_counter = 0;
539               
539
540540               m_tx_bits++;
541541
542542               if (LOG) logerror("MC6850 '%s': TX STOP BIT %d\n", tag(), m_tx_bits);
trunk/src/emu/machine/mb87078.h
r29404r29405
2525public:
2626   mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2727   ~mb87078_device() {}
28   
28
2929   template<class _Object> static devcb2_base &set_gain_changed_callback(device_t &device, _Object object) { return downcast<mb87078_device &>(device).m_gain_changed_cb.set_callback(object); }
3030
3131   void data_w(int data, int dsel);
r29404r29405
5757   int          m_channel_latch; /* current channel */
5858   UINT8        m_latch[2][4];   /* 6bit+3bit 4 data latches */
5959   UINT8        m_reset_comp;
60   
60
6161   devcb2_write8 m_gain_changed_cb;
6262};
6363
trunk/src/emu/machine/mc2661.h
r29404r29405
7878// ======================> mc2661_device
7979
8080class mc2661_device :  public device_t,
81                  public device_serial_interface
81                  public device_serial_interface
8282{
8383public:
8484   // construction/destruction
trunk/src/emu/machine/mc6846.h
r29404r29405
1818
1919#define MCFG_MC6846_OUT_CP2_CB(_devcb) \
2020   devcb = &mc6846_device::set_out_cp2_callback(*device, DEVCB2_##_devcb);
21   
21
2222#define MCFG_MC6846_IN_PORT_CB(_devcb) \
2323   devcb = &mc6846_device::set_in_port_callback(*device, DEVCB2_##_devcb);
2424
r29404r29405
4141   template<class _Object> static devcb2_base &set_in_port_callback(device_t &device, _Object object) { return downcast<mc6846_device &>(device).m_in_port_cb.set_callback(object); }
4242   template<class _Object> static devcb2_base &set_out_cto_callback(device_t &device, _Object object) { return downcast<mc6846_device &>(device).m_out_cto_cb.set_callback(object); }
4343   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<mc6846_device &>(device).m_irq_cb.set_callback(object); }
44   
44
4545   /* interface to CPU via address/data bus*/
4646   DECLARE_READ8_MEMBER(read);
4747   DECLARE_WRITE8_MEMBER(write);
trunk/src/emu/machine/laserdsc.c
r29404r29405
314314   // if we have a palette and it's not started, wait for it
315315   if (m_overlay_palette != NULL && !m_overlay_palette->started())
316316      throw device_missing_dependencies();
317   
317
318318   // initialize the various pieces
319319   init_disc();
320320   init_video();
r29404r29405
373373{
374374   texture_format texformat = !m_overupdate_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32;
375375   if (m_overlay_palette == NULL && texformat == TEXFORMAT_PALETTE16)
376      mame_printf_error("Overlay screen does not have palette defined\n");     
376      mame_printf_error("Overlay screen does not have palette defined\n");
377377}
378378
379379//-------------------------------------------------
trunk/src/emu/machine/hd64610.h
r29404r29405
3636
3737#define MCFG_HD64610_OUT_IRQ_CB(_devcb) \
3838   devcb = &hd64610_device::set_out_irq_callback(*device, DEVCB2_##_devcb);
39   
39
4040#define MCFG_HD64610_OUT_1HZ_CB(_devcb) \
4141   devcb = &hd64610_device::set_out_1hz_callback(*device, DEVCB2_##_devcb);
42   
4342
43
4444//**************************************************************************
4545//  TYPE DEFINITIONS
4646//**************************************************************************
r29404r29405
5454public:
5555   // construction/destruction
5656   hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
57   
57
5858   template<class _Object> static devcb2_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<hd64610_device &>(device).m_out_irq_cb.set_callback(object); }
5959   template<class _Object> static devcb2_base &set_out_1hz_callback(device_t &device, _Object object) { return downcast<hd64610_device &>(device).m_out_1hz_cb.set_callback(object); }
6060
trunk/src/emu/machine/mc68901.c
r29404r29405
530530   receive_register_extract();
531531   m_receive_buffer = get_received_char();
532532   //if (m_receive_pending) TODO: error?
533     
533
534534   m_receive_pending = 1;
535535   rx_buffer_full();
536536}
trunk/src/emu/machine/mc68901.h
r29404r29405
7474
7575#define MCFG_MC68901_OUT_TDO_CB(_devcb) \
7676   devcb = &mc68901_device::set_out_tdo_callback(*device, DEVCB2_##_devcb);
77   
77
7878#define MCFG_MC68901_OUT_SO_CB(_devcb) \
7979   devcb = &mc68901_device::set_out_so_callback(*device, DEVCB2_##_devcb);
8080
8181/*#define MCFG_MC68901_OUT_RR_CB(_devcb) \
82   devcb = &mc68901_device::set_out_rr_callback(*device, DEVCB2_##_devcb);
82    devcb = &mc68901_device::set_out_rr_callback(*device, DEVCB2_##_devcb);
8383
8484#define MCFG_MC68901_OUT_TR_CB(_devcb) \
85   devcb = &mc68901_device::set_out_tr_callback(*device, DEVCB2_##_devcb);*/
86   
85    devcb = &mc68901_device::set_out_tr_callback(*device, DEVCB2_##_devcb);*/
8786
87
8888//**************************************************************************
8989//  TYPE DEFINITIONS
9090//**************************************************************************
r29404r29405
9898public:
9999   // construction/destruction
100100   mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
101   
101
102102   static void set_timer_clock(device_t &device, int timer_clock) { downcast<mc68901_device &>(device).m_timer_clock = timer_clock; }
103103   static void set_rx_clock(device_t &device, int rx_clock) { downcast<mc68901_device &>(device).m_rx_clock = rx_clock; }
104104   static void set_tx_clock(device_t &device, int tx_clock) { downcast<mc68901_device &>(device).m_tx_clock = tx_clock; }
trunk/src/emu/machine/6522via.c
r29404r29405
470470void via6522_device::output_pb()
471471{
472472   UINT8 pb = (m_out_b & m_ddr_b) | ~m_ddr_b;
473   
473
474474   if (T1_SET_PB7(m_acr))
475475      pb = (pb & 0x7f) | (m_t1_pb7 << 7);
476476
trunk/src/emu/machine/ncr5380.h
r29404r29405
4040public:
4141   // construction/destruction
4242   ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
43   
43
4444   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<ncr5380_device &>(device).m_irq_cb.set_callback(object); }
4545
4646   // our API
trunk/src/emu/machine/mos6530.h
r29404r29405
7070
7171   DECLARE_READ8_MEMBER( read );
7272   DECLARE_WRITE8_MEMBER( write );
73   
73
7474   UINT8 porta_in_get();
7575   UINT8 portb_in_get();
7676
7777   UINT8 porta_out_get();
7878   UINT8 portb_out_get();
79   
79
8080protected:
8181   // device-level overrides
8282   virtual void device_config_complete();
8383   virtual void device_start();
8484   virtual void device_reset();
8585   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
86   
86
8787private:
8888   // internal state
8989
r29404r29405
9999   emu_timer *     m_timer;
100100
101101   UINT32          m_clock;
102   
103   void update_irqstate();   
102
103   void update_irqstate();
104104   UINT8 get_timer();
105   
105
106106   void porta_in_set(UINT8 data, UINT8 mask);
107107   void portb_in_set(UINT8 data, UINT8 mask);
108   
108
109109   enum
110110   {
111111      TIMER_END_CALLBACK
trunk/src/emu/machine/ins8154.h
r29404r29405
4646
4747#define MCFG_INS8154_IN_A_CB(_devcb) \
4848   devcb = &ins8154_device::set_in_a_callback(*device, DEVCB2_##_devcb);
49   
49
5050#define MCFG_INS8154_OUT_A_CB(_devcb) \
5151   devcb = &ins8154_device::set_out_a_callback(*device, DEVCB2_##_devcb);
52   
52
5353#define MCFG_INS8154_IN_B_CB(_devcb) \
5454   devcb = &ins8154_device::set_in_b_callback(*device, DEVCB2_##_devcb);
55   
55
5656#define MCFG_INS8154_OUT_B_CB(_devcb) \
5757   devcb = &ins8154_device::set_out_b_callback(*device, DEVCB2_##_devcb);
5858
r29404r29405
7676   template<class _Object> static devcb2_base &set_in_b_callback(device_t &device, _Object object) { return downcast<ins8154_device &>(device).m_in_b_cb.set_callback(object); }
7777   template<class _Object> static devcb2_base &set_out_b_callback(device_t &device, _Object object) { return downcast<ins8154_device &>(device).m_out_b_cb.set_callback(object); }
7878   template<class _Object> static devcb2_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<ins8154_device &>(device).m_out_irq_cb.set_callback(object); }
79   
79
8080   DECLARE_READ8_MEMBER( ins8154_r );
8181   DECLARE_WRITE8_MEMBER( ins8154_w );
8282
trunk/src/emu/machine/8530scc.c
r29404r29405
2323    IMPLEMENTATION
2424***************************************************************************/
2525
26scc8530_t::scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
26scc8530_t::scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
2727   device_t(mconfig, SCC8530, "Zilog 8530 SCC", tag, owner, clock, "scc8530", __FILE__),
2828   intrq_cb(*this)
2929{
trunk/src/emu/machine/wd17xx.c
r29404r29405
376376
377377/* set intrq after delay */
378378TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_command_callback )
379{   
379{
380380   if (m_last_command_data != FDC_FORCE_INT)
381381   {
382382      wd17xx_set_intrq();
trunk/src/emu/machine/wd17xx.h
r29404r29405
6868   WRITE_LINE_MEMBER( wprt_w );
6969   WRITE_LINE_MEMBER( dden_w );
7070   READ_LINE_MEMBER( drq_r );
71   READ_LINE_MEMBER( intrq_r );   
71   READ_LINE_MEMBER( intrq_r );
7272protected:
7373   // device-level overrides
7474   virtual void device_config_complete();
r29404r29405
179179   UINT8   m_was_busy;
180180
181181   /* Pointer to interface */
182   const wd17xx_interface *m_intf;   
182   const wd17xx_interface *m_intf;
183183};
184184
185185extern ATTR_DEPRECATED const device_type WD1770;
trunk/src/emu/machine/i8271.c
r29404r29405
133133   {
134134      m_CommandParameters[i] = 0;
135135   }
136   
136
137137   for (int i = 0; i < 2; i++ )
138138   {
139139      m_CurrentTrack[i] = 0;
140140   }
141   
141
142142   for (int i = 0; i < 4; i++ )
143143   {
144144      m_BadTracks[i] = 0;
r29404r29405
313313      /* stop it */
314314      m_data_timer->reset();
315315      break;
316     
316
317317   case TIMER_TIMED_COMMAND_COMPLETE:
318318      command_complete(1,1);
319319
320320      /* stop it, but don't allow it to be free'd */
321321      m_command_complete_timer->reset();
322322      break;
323     
323
324324   default:
325325      break;
326326   }
327327}
328   
328
329329/* setup a timed data request - data request will be triggered in a few usecs time */
330330void i8271_device::timed_data_request()
331331{
r29404r29405
345345void i8271_device::timed_command_complete()
346346{
347347   int usecs;
348   
348
349349   /* 64 for single density - 2 crc bytes later*/
350350   usecs = 64*2;
351351
r29404r29405
669669void i8271_device::do_read_id()
670670{
671671   chrn_id id;
672   
672
673673   /* get next id from disc */
674674   current_image()->floppy_drive_get_next_id(m_side,&id);
675675
trunk/src/emu/machine/rp5c01.h
r29404r29405
5151public:
5252   // construction/destruction
5353   rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
54   
54
5555   template<class _Object> static devcb2_base &set_out_alarm_callback(device_t &device, _Object object) { return downcast<rp5c01_device &>(device).m_out_alarm_cb.set_callback(object); }
5656
5757   DECLARE_READ8_MEMBER( read );
trunk/src/emu/machine/i8271.h
r29404r29405
4646
4747   DECLARE_READ8_MEMBER(data_r);
4848   DECLARE_WRITE8_MEMBER(data_w);
49   
49
5050protected:
5151   // device-level overrides
5252   virtual void device_config_complete();
5353   virtual void device_start();
5454   virtual void device_reset();
5555   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
56   
56
5757private:
5858   // internal state
5959   enum
r29404r29405
6464
6565   devcb2_write_line m_write_irq;
6666   devcb2_write_line m_write_drq;
67   
67
6868   int m_flags;
6969   int m_state;
7070   unsigned char m_Command;
r29404r29405
127127
128128   emu_timer *m_data_timer;
129129   emu_timer *m_command_complete_timer;
130   
130
131131   legacy_floppy_image_device *current_image();
132132   void seek_to_track(int track);
133133   void load_bad_tracks(int surface);
trunk/src/emu/machine/latch8.c
r29404r29405
5454   {
5555      int i;
5656      for (i=0; i<8; i++)
57      {         
57      {
5858         if (i==0 && !m_read_0.isnull()) { res &= ~( 1 << i); res |= ((m_read_0(space, 0, 0xff) >> m_offset[i]) & 0x01) << i; }
5959         if (i==1 && !m_read_1.isnull()) { res &= ~( 1 << i); res |= ((m_read_1(space, 0, 0xff) >> m_offset[i]) & 0x01) << i; }
6060         if (i==2 && !m_read_2.isnull()) { res &= ~( 1 << i); res |= ((m_read_2(space, 0, 0xff) >> m_offset[i]) & 0x01) << i; }
r29404r29405
6262         if (i==4 && !m_read_4.isnull()) { res &= ~( 1 << i); res |= ((m_read_4(space, 0, 0xff) >> m_offset[i]) & 0x01) << i; }
6363         if (i==5 && !m_read_5.isnull()) { res &= ~( 1 << i); res |= ((m_read_5(space, 0, 0xff) >> m_offset[i]) & 0x01) << i; }
6464         if (i==6 && !m_read_6.isnull()) { res &= ~( 1 << i); res |= ((m_read_6(space, 0, 0xff) >> m_offset[i]) & 0x01) << i; }
65         if (i==7 && !m_read_7.isnull()) { res &= ~( 1 << i); res |= ((m_read_7(space, 0, 0xff) >> m_offset[i]) & 0x01) << i;}         
65         if (i==7 && !m_read_7.isnull()) { res &= ~( 1 << i); res |= ((m_read_7(space, 0, 0xff) >> m_offset[i]) & 0x01) << i;}
6666      }
6767   }
6868   return (res & ~m_maskout) ^ m_xorvalue;
r29404r29405
150150      m_has_read(0),
151151      m_maskout(0),
152152      m_xorvalue(0),
153      m_nosync(0),   
153      m_nosync(0),
154154      m_write_0(*this),
155155      m_write_1(*this),
156156      m_write_2(*this),
r29404r29405
168168      m_read_6(*this),
169169      m_read_7(*this)
170170{
171   memset(m_offset, 0, sizeof(m_offset));   
171   memset(m_offset, 0, sizeof(m_offset));
172172}
173173
174174
175175//-------------------------------------------------
176176//  device_validity_check - validate device
177//   configuration
177//  configuration
178178//-------------------------------------------------
179179
180180void latch8_device::device_validity_check(validity_checker &valid) const
r29404r29405
202202   m_write_5.resolve();
203203   m_write_6.resolve();
204204   m_write_7.resolve();
205   
205
206206   m_read_0.resolve();
207207   m_read_1.resolve();
208208   m_read_2.resolve();
r29404r29405
211211   m_read_5.resolve();
212212   m_read_6.resolve();
213213   m_read_7.resolve();
214   
214
215215   /* setup nodemap */
216216   if (!m_write_0.isnull()) m_has_write = 1;
217217   if (!m_write_1.isnull()) m_has_write = 1;
r29404r29405
221221   if (!m_write_5.isnull()) m_has_write = 1;
222222   if (!m_write_6.isnull()) m_has_write = 1;
223223   if (!m_write_7.isnull()) m_has_write = 1;
224   
224
225225   /* setup device read handlers */
226226   if (!m_read_0.isnull()) m_has_read = 1;
227227   if (!m_read_1.isnull()) m_has_read = 1;
trunk/src/emu/machine/latch8.h
r29404r29405
2626{
2727public:
2828   latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
29   
30   
29
30
3131   /* write & read full byte */
3232
3333   DECLARE_READ8_MEMBER( read );
r29404r29405
7676   static void set_maskout(device_t &device, UINT32 maskout) { downcast<latch8_device &>(device).m_maskout = maskout; }
7777   static void set_xorvalue(device_t &device, UINT32 xorvalue) { downcast<latch8_device &>(device).m_xorvalue = xorvalue; }
7878   static void set_nosync(device_t &device, UINT32 nosync) { downcast<latch8_device &>(device).m_nosync = nosync; }
79     
79
8080   template<class _Object> static devcb2_base &set_write_0(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[0] = offset; return downcast<latch8_device &>(device).m_write_0.set_callback(object); }
8181   template<class _Object> static devcb2_base &set_write_1(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[1] = offset; return downcast<latch8_device &>(device).m_write_1.set_callback(object); }
8282   template<class _Object> static devcb2_base &set_write_2(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[2] = offset; return downcast<latch8_device &>(device).m_write_2.set_callback(object); }
r29404r29405
8585   template<class _Object> static devcb2_base &set_write_5(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[5] = offset; return downcast<latch8_device &>(device).m_write_5.set_callback(object); }
8686   template<class _Object> static devcb2_base &set_write_6(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[6] = offset; return downcast<latch8_device &>(device).m_write_6.set_callback(object); }
8787   template<class _Object> static devcb2_base &set_write_7(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[7] = offset; return downcast<latch8_device &>(device).m_write_7.set_callback(object); }
88   
88
8989   template<class _Object> static devcb2_base &set_read_0(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[0] = offset; return downcast<latch8_device &>(device).m_read_0.set_callback(object); }
9090   template<class _Object> static devcb2_base &set_read_1(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[1] = offset; return downcast<latch8_device &>(device).m_read_1.set_callback(object); }
9191   template<class _Object> static devcb2_base &set_read_2(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[2] = offset; return downcast<latch8_device &>(device).m_read_2.set_callback(object); }
r29404r29405
9494   template<class _Object> static devcb2_base &set_read_5(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[5] = offset; return downcast<latch8_device &>(device).m_read_5.set_callback(object); }
9595   template<class _Object> static devcb2_base &set_read_6(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[6] = offset; return downcast<latch8_device &>(device).m_read_6.set_callback(object); }
9696   template<class _Object> static devcb2_base &set_read_7(device_t &device, _Object object, UINT32 offset) { downcast<latch8_device &>(device).m_offset[7] = offset; return downcast<latch8_device &>(device).m_read_7.set_callback(object); }
97   
97
9898protected:
9999   // device-level overrides
100100   virtual void device_start();
101101   virtual void device_reset();
102102   virtual void device_validity_check(validity_checker &valid) const;
103   
103
104104   TIMER_CALLBACK_MEMBER( timerproc );
105105   void update(UINT8 new_val, UINT8 mask);
106106   inline UINT8 bitx_r( offs_t offset, int bit);
r29404r29405
110110   UINT8            m_value;
111111   UINT8            m_has_write;
112112   UINT8            m_has_read;
113   
113
114114   /* only for byte reads, does not affect bit reads and node_map */
115115   UINT32           m_maskout;
116116   UINT32           m_xorvalue;  /* after mask */
117117   UINT32           m_nosync;
118   
118
119119   devcb2_write8    m_write_0;
120120   devcb2_write8    m_write_1;
121121   devcb2_write8    m_write_2;
r29404r29405
133133   devcb2_read8     m_read_5;
134134   devcb2_read8     m_read_6;
135135   devcb2_read8     m_read_7;
136   
136
137137   UINT32           m_offset[8];
138138};
139139
r29404r29405
186186/* Upon read, replace bits by reading from another device handler */
187187#define MCFG_LATCH8_READ_0(_devcb, _from_bit) \
188188   devcb = &latch8_device::set_read_0(*device, DEVCB2_##_devcb, _from_bit);
189   
189
190190#define MCFG_LATCH8_READ_1(_devcb, _from_bit) \
191191   devcb = &latch8_device::set_read_1(*device, DEVCB2_##_devcb, _from_bit);
192192
trunk/src/emu/machine/64h156.c
r29404r29405
1919    - cycle exact VIA
2020
2121    - get these running and we're golden
22       - Bounty Bob Strikes Back (aligned halftracks)
22        - Bounty Bob Strikes Back (aligned halftracks)
2323        - Quiwi (speed change within track)
2424        - Defender of the Crown (V-MAX! v2, density checks)
2525        - Test Drive / Cabal (HLS, sub-cycle jitter)
r29404r29405
201201{
202202   if(cur_live.write_start_time.is_never() || tm == cur_live.write_start_time || !cur_live.write_position)
203203      return;
204   
204
205205   if (LOG) logerror("%s committing %u transitions since %s\n", tm.as_string(), cur_live.write_position, cur_live.write_start_time.as_string());
206206
207207   m_floppy->write_flux(cur_live.write_start_time, tm, cur_live.write_position, cur_live.write_buffer);
r29404r29405
293293            cur_live.cell_counter++;
294294            cur_live.cell_counter &= 0xf;
295295         }
296         
296
297297         if (!BIT(cell_counter, 1) && BIT(cur_live.cell_counter, 1)) {
298298            // read bit
299299            cur_live.shift_reg <<= 1;
300300            cur_live.shift_reg |= !(BIT(cur_live.cell_counter, 3) || BIT(cur_live.cell_counter, 2));
301301            cur_live.shift_reg &= 0x3ff;
302   
303            if (LOG) logerror("%s read bit %u (%u) >> %03x, oe=%u soe=%u sync=%u byte=%u\n", cur_live.tm.as_string(), cur_live.bit_counter,
302
303            if (LOG) logerror("%s read bit %u (%u) >> %03x, oe=%u soe=%u sync=%u byte=%u\n", cur_live.tm.as_string(), cur_live.bit_counter,
304304               !(BIT(cur_live.cell_counter, 3) || BIT(cur_live.cell_counter, 2)), cur_live.shift_reg, cur_live.oe, cur_live.soe, cur_live.sync, cur_live.byte);
305305
306306            syncpoint = true;
r29404r29405
392392   if (bit) {
393393      cur_live.zero_counter = 0;
394394      cur_live.cycles_until_random_flux = (rand() % 31) + 289;
395     
395
396396      get_next_edge(next);
397397   }
398398
trunk/src/emu/machine/z8536.h
r29404r29405
7676// ======================> z8536_device
7777
7878class z8536_device :  public device_t,
79                 public device_z80daisy_interface
79                  public device_z80daisy_interface
8080{
8181public:
8282   // construction/destruction
trunk/src/emu/machine/nsc810.c
r29404r29405
308308      }
309309   }
310310}
311
trunk/src/emu/machine/msm6242.h
r29404r29405
2727public:
2828   // construction/destruction
2929   msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   
31   
30
31
3232   template<class _Object> static devcb2_base &set_out_int_handler(device_t &device, _Object object) { return downcast<msm6242_device &>(device).m_out_int_handler.set_callback(object); }
3333
3434   // I/O operations
trunk/src/emu/machine/ds75161a.h
r29404r29405
3737
3838#define MCFG_DS75161A_IN_REN_CB(_devcb) \
3939   devcb = &ds75161a_device::set_in_ren_callback(*device, DEVCB2_##_devcb);
40   
40
4141#define MCFG_DS75161A_IN_IFC_CB(_devcb) \
4242   devcb = &ds75161a_device::set_in_ifc_callback(*device, DEVCB2_##_devcb);
43   
43
4444#define MCFG_DS75161A_IN_NDAC_CB(_devcb) \
4545   devcb = &ds75161a_device::set_in_ndac_callback(*device, DEVCB2_##_devcb);
46   
46
4747#define MCFG_DS75161A_IN_NRFD_CB(_devcb) \
4848   devcb = &ds75161a_device::set_in_nrfd_callback(*device, DEVCB2_##_devcb);
49   
49
5050#define MCFG_DS75161A_IN_DAV_CB(_devcb) \
5151   devcb = &ds75161a_device::set_in_dav_callback(*device, DEVCB2_##_devcb);
52   
52
5353#define MCFG_DS75161A_IN_EOI_CB(_devcb) \
5454   devcb = &ds75161a_device::set_in_eoi_callback(*device, DEVCB2_##_devcb);
55   
55
5656#define MCFG_DS75161A_IN_ATN_CB(_devcb) \
5757   devcb = &ds75161a_device::set_in_atn_callback(*device, DEVCB2_##_devcb);
5858
r29404r29405
6161
6262#define MCFG_DS75161A_OUT_REN_CB(_devcb) \
6363   devcb = &ds75161a_device::set_out_ren_callback(*device, DEVCB2_##_devcb);
64   
64
6565#define MCFG_DS75161A_OUT_IFC_CB(_devcb) \
6666   devcb = &ds75161a_device::set_out_ifc_callback(*device, DEVCB2_##_devcb);
67   
67
6868#define MCFG_DS75161A_OUT_NDAC_CB(_devcb) \
6969   devcb = &ds75161a_device::set_out_ndac_callback(*device, DEVCB2_##_devcb);
70   
70
7171#define MCFG_DS75161A_OUT_NRFD_CB(_devcb) \
7272   devcb = &ds75161a_device::set_out_nrfd_callback(*device, DEVCB2_##_devcb);
73   
73
7474#define MCFG_DS75161A_OUT_DAV_CB(_devcb) \
7575   devcb = &ds75161a_device::set_out_dav_callback(*device, DEVCB2_##_devcb);
76   
76
7777#define MCFG_DS75161A_OUT_EOI_CB(_devcb) \
7878   devcb = &ds75161a_device::set_out_eoi_callback(*device, DEVCB2_##_devcb);
79   
79
8080#define MCFG_DS75161A_OUT_ATN_CB(_devcb) \
8181   devcb = &ds75161a_device::set_out_atn_callback(*device, DEVCB2_##_devcb);
8282
r29404r29405
9494public:
9595   // construction/destruction
9696   ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
97   
97
9898   template<class _Object> static devcb2_base &set_in_ren_callback(device_t &device, _Object object) { return downcast<ds75161a_device &>(device).m_in_ren_cb.set_callback(object); }
9999   template<class _Object> static devcb2_base &set_in_ifc_callback(device_t &device, _Object object) { return downcast<ds75161a_device &>(device).m_in_ifc_cb.set_callback(object); }
100100   template<class _Object> static devcb2_base &set_in_ndac_callback(device_t &device, _Object object) { return downcast<ds75161a_device &>(device).m_in_ndac_cb.set_callback(object); }
trunk/src/emu/machine/wd33c93.h
r29404r29405
5353public:
5454   // construction/destruction
5555   wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
56   
56
5757   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<wd33c93_device &>(device).m_irq_cb.set_callback(object); }
5858
5959   DECLARE_READ8_MEMBER(read);
trunk/src/emu/machine/smc91c9x.h
r29404r29405
2525   ~smc91c9x_device() {}
2626
2727   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<smc91c9x_device &>(device).m_irq_handler.set_callback(object); }
28   
28
2929   DECLARE_READ16_MEMBER( read );
3030   DECLARE_WRITE16_MEMBER( write );
3131
r29404r29405
8686
8787#define MCFG_SMC91C94_ADD(_tag) \
8888   MCFG_DEVICE_ADD(_tag, SMC91C94, 0)
89   
89
9090#define MCFG_SMC91C94_IRQ_CALLBACK(_write) \
9191   devcb = &smc91c94_device::set_irq_callback(*device, DEVCB2_##_write);
9292
trunk/src/emu/machine/s3c2440.c
r29404r29405
104104void s3c2440_device::device_start()
105105{
106106   address_space &space = m_cpu->memory().space( AS_PROGRAM);
107    space.install_readwrite_handler(0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_w), this));
108    space.install_readwrite_handler(0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_w), this));
109    space.install_readwrite_handler(0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_irq_w), this));
110    space.install_readwrite_handler(0x4b000000, 0x4b000023, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_w), this));
111    space.install_readwrite_handler(0x4b000040, 0x4b000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_w), this));
112    space.install_readwrite_handler(0x4b000080, 0x4b0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_w), this));
113    space.install_readwrite_handler(0x4b0000c0, 0x4b0000e3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_w), this));
114    space.install_readwrite_handler(0x4c000000, 0x4c00001b, read32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_w), this));
115    space.install_readwrite_handler(0x4d000000, 0x4d000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_w), this));
116    space.install_readwrite_handler(0x4d000400, 0x4d0007ff, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_w), this));
117    space.install_readwrite_handler(0x4e000000, 0x4e00003f, read32_delegate(FUNC(s3c2440_device::s3c24xx_nand_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_nand_w), this));
118    space.install_readwrite_handler(0x4f000000, 0x4f0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_cam_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_cam_w), this));
119    space.install_readwrite_handler(0x50000000, 0x5000002b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_w), this));
120    space.install_readwrite_handler(0x50004000, 0x5000402b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_w), this));
121    space.install_readwrite_handler(0x50008000, 0x5000802b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_w), this));
122    space.install_readwrite_handler(0x51000000, 0x51000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_w), this));
123    space.install_readwrite_handler(0x52000140, 0x5200026f, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_w), this));
124    space.install_readwrite_handler(0x53000000, 0x5300000b, read32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_w), this));
125    space.install_readwrite_handler(0x54000000, 0x54000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iic_w), this));
126    space.install_readwrite_handler(0x55000000, 0x55000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iis_w), this));
127    space.install_readwrite_handler(0x56000000, 0x560000df, read32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_w), this));
128    space.install_readwrite_handler(0x57000040, 0x5700008b, read32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_w), this));
129    space.install_readwrite_handler(0x58000000, 0x58000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_adc_w), this));
130    space.install_readwrite_handler(0x59000000, 0x59000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_w), this));
131    space.install_readwrite_handler(0x59000020, 0x59000037, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_w), this));
132    space.install_readwrite_handler(0x5a000000, 0x5a000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_w), this));
133    space.install_readwrite_handler(0x5b000000, 0x5b00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_w), this));   
107   space.install_readwrite_handler(0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_w), this));
108   space.install_readwrite_handler(0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_w), this));
109   space.install_readwrite_handler(0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_irq_w), this));
110   space.install_readwrite_handler(0x4b000000, 0x4b000023, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_w), this));
111   space.install_readwrite_handler(0x4b000040, 0x4b000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_w), this));
112   space.install_readwrite_handler(0x4b000080, 0x4b0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_w), this));
113   space.install_readwrite_handler(0x4b0000c0, 0x4b0000e3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_w), this));
114   space.install_readwrite_handler(0x4c000000, 0x4c00001b, read32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_w), this));
115   space.install_readwrite_handler(0x4d000000, 0x4d000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_w), this));
116   space.install_readwrite_handler(0x4d000400, 0x4d0007ff, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_w), this));
117   space.install_readwrite_handler(0x4e000000, 0x4e00003f, read32_delegate(FUNC(s3c2440_device::s3c24xx_nand_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_nand_w), this));
118   space.install_readwrite_handler(0x4f000000, 0x4f0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_cam_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_cam_w), this));
119   space.install_readwrite_handler(0x50000000, 0x5000002b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_w), this));
120   space.install_readwrite_handler(0x50004000, 0x5000402b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_w), this));
121   space.install_readwrite_handler(0x50008000, 0x5000802b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_w), this));
122   space.install_readwrite_handler(0x51000000, 0x51000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_w), this));
123   space.install_readwrite_handler(0x52000140, 0x5200026f, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_w), this));
124   space.install_readwrite_handler(0x53000000, 0x5300000b, read32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_w), this));
125   space.install_readwrite_handler(0x54000000, 0x54000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iic_w), this));
126   space.install_readwrite_handler(0x55000000, 0x55000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iis_w), this));
127   space.install_readwrite_handler(0x56000000, 0x560000df, read32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_w), this));
128   space.install_readwrite_handler(0x57000040, 0x5700008b, read32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_w), this));
129   space.install_readwrite_handler(0x58000000, 0x58000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_adc_w), this));
130   space.install_readwrite_handler(0x59000000, 0x59000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_w), this));
131   space.install_readwrite_handler(0x59000020, 0x59000037, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_w), this));
132   space.install_readwrite_handler(0x5a000000, 0x5a000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_w), this));
133   space.install_readwrite_handler(0x5b000000, 0x5b00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_w), this));
134134
135135   s3c24xx_device_start();
136   
136
137137   s3c24xx_video_start();
138138}
139139
trunk/src/emu/machine/pckeybrd.c
r29404r29405
336336      ioport_queue_chars_delegate(FUNC(pc_keyboard_device::queue_chars), this),
337337      ioport_accept_char_delegate(FUNC(pc_keyboard_device::accept_char), this),
338338      ioport_charqueue_empty_delegate(FUNC(pc_keyboard_device::charqueue_empty), this));
339     
339
340340   m_out_keypress_func.resolve_safe();
341341   m_keyboard_timer = timer_alloc();
342342}
trunk/src/emu/machine/s3c2440.h
r29404r29405
1515
1616#define MCFG_S3C2440_ADD(_tag, _clock, _config, _palette_tag) \
1717   MCFG_DEVICE_ADD(_tag, S3C2440, _clock) \
18   MCFG_DEVICE_CONFIG(_config)   \
18   MCFG_DEVICE_CONFIG(_config) \
1919   s3c2440_device::static_set_palette_tag(*device, "^" _palette_tag);
2020
2121#define S3C2440_INTERFACE(name) \
r29404r29405
486486#define S3C24XX_DMA_COUNT   4
487487#define S3C24XX_SPI_COUNT   2
488488
489class s3c2440_device : public device_t,
489class s3c2440_device : public device_t,
490490                        public s3c2440_interface
491491{
492492public:
r29404r29405
508508   required_device<palette_device> m_palette;
509509public:
510510   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
511   
511
512512   void s3c24xx_reset();
513513   inline int iface_core_pin_r(int pin);
514514   void s3c24xx_lcd_reset();
r29404r29405
696696   void s3c24xx_nand_auto_boot();
697697   void s3c24xx_device_reset();
698698   void s3c24xx_device_start();
699   
700699
700
701701   void s3c2440_uart_fifo_w( int uart, UINT8 data);
702702   void s3c2440_touch_screen( int state);
703703   void s3c2440_request_irq( UINT32 int_type);
r29404r29405
705705
706706
707707   /*******************************************************************************
708      TYPE DEFINITIONS
708       TYPE DEFINITIONS
709709   *******************************************************************************/
710710
711711   struct s3c24xx_memcon_regs_t
r29404r29405
11191119      s3c24xx_ac97_regs_t regs;
11201120   };
11211121
1122   
1122
11231123   UINT8 m_steppingstone[4*1024];
11241124   s3c24xx_memcon_t m_memcon;
11251125   s3c24xx_usbhost_t m_usbhost;
r29404r29405
11561156   devcb_resolved_write8 m_address_w;
11571157   devcb_resolved_read8  m_nand_data_r;
11581158   devcb_resolved_write8 m_nand_data_w;
1159   
1159
11601160};
11611161
11621162extern const device_type S3C2440;
trunk/src/emu/machine/pckeybrd.h
r29404r29405
7373   optional_ioport m_ioport_5;
7474   optional_ioport m_ioport_6;
7575   optional_ioport m_ioport_7;
76   
76
7777   devcb2_write_line m_out_keypress_func;
7878   emu_timer *m_keyboard_timer;
7979};
r29404r29405
8585
8686   DECLARE_WRITE8_MEMBER( write );
8787
88   static void static_set_type(device_t &device, KEYBOARD_TYPE type, int default_set)
88   static void static_set_type(device_t &device, KEYBOARD_TYPE type, int default_set)
8989      { downcast<at_keyboard_device &>(device).m_scan_code_set = default_set; downcast<at_keyboard_device &>(device).m_type = type; }
90     
90
9191protected:
9292   virtual void device_reset();
9393   virtual void device_start();
trunk/src/emu/machine/netlist.c
r29404r29405
7373
7474void netlist_mame_sub_interface::static_set_mult_offset(device_t &device, const double mult, const double offset)
7575{
76    netlist_mame_sub_interface &netlist = dynamic_cast<netlist_mame_sub_interface &>(device);
77    netlist.m_mult = mult;
78    netlist.m_offset = offset;
76   netlist_mame_sub_interface &netlist = dynamic_cast<netlist_mame_sub_interface &>(device);
77   netlist.m_mult = mult;
78   netlist.m_offset = offset;
7979}
8080
8181
r29404r29405
105105   }
106106   if (m_mult != 1.0 || m_offset != 0.0)
107107   {
108       // disable automatic scaling for ioports
109       m_auto_port = false;
108      // disable automatic scaling for ioports
109      m_auto_port = false;
110110   }
111111
112112}
r29404r29405
116116// ----------------------------------------------------------------------------------------
117117
118118netlist_mame_analog_output_t::netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
119        : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog output", tag, owner, clock, "netlist_analog_output", __FILE__),
120            netlist_mame_sub_interface(*owner),
121            m_in("")
119      : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog output", tag, owner, clock, "netlist_analog_output", __FILE__),
120         netlist_mame_sub_interface(*owner),
121         m_in("")
122122{
123123}
124124
125125void netlist_mame_analog_output_t::static_set_params(device_t &device, const char *in_name, netlist_analog_output_delegate adelegate)
126126{
127    netlist_mame_analog_output_t &netlist = downcast<netlist_mame_analog_output_t &>(device);
128    netlist.m_in = in_name;
129    netlist.m_delegate = adelegate;
127   netlist_mame_analog_output_t &netlist = downcast<netlist_mame_analog_output_t &>(device);
128   netlist.m_in = in_name;
129   netlist.m_delegate = adelegate;
130130}
131131
132132void netlist_mame_analog_output_t::custom_netlist_additions(netlist_setup_t &setup)
133133{
134    pstring dname = "OUT_" + m_in;
135    m_delegate.bind_relative_to(owner()->machine().root_device());
136    NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>(
137            setup.factory().new_device_by_classname("nld_analog_callback", setup));
134   pstring dname = "OUT_" + m_in;
135   m_delegate.bind_relative_to(owner()->machine().root_device());
136   NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>(
137         setup.factory().new_device_by_classname("nld_analog_callback", setup));
138138
139    setup.register_dev(dev, dname);
140    dev->register_callback(m_delegate);
141    setup.register_link(dname + ".IN", m_in);
139   setup.register_dev(dev, dname);
140   dev->register_callback(m_delegate);
141   setup.register_link(dname + ".IN", m_in);
142142}
143143
144144void netlist_mame_analog_output_t::device_start()
145145{
146    LOG_DEV_CALLS(("start %s\n", tag()));
146   LOG_DEV_CALLS(("start %s\n", tag()));
147147}
148148
149149
r29404r29405
185185// ----------------------------------------------------------------------------------------
186186
187187netlist_mame_stream_input_t::netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
188        : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__),
189            netlist_mame_sub_interface(*owner),
190            m_channel(0),
191            m_param_name("")
188      : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__),
189         netlist_mame_sub_interface(*owner),
190         m_channel(0),
191         m_param_name("")
192192{
193193}
194194
195195void netlist_mame_stream_input_t::static_set_params(device_t &device, int channel, const char *param_name)
196196{
197    netlist_mame_stream_input_t &netlist = downcast<netlist_mame_stream_input_t &>(device);
198    netlist.m_param_name = param_name;
199    netlist.m_channel = channel;
197   netlist_mame_stream_input_t &netlist = downcast<netlist_mame_stream_input_t &>(device);
198   netlist.m_param_name = param_name;
199   netlist.m_channel = channel;
200200}
201201
202202void netlist_mame_stream_input_t::device_start()
203203{
204    LOG_DEV_CALLS(("start %s\n", tag()));
204   LOG_DEV_CALLS(("start %s\n", tag()));
205205}
206206
207207void netlist_mame_stream_input_t::custom_netlist_additions(netlist_setup_t &setup)
208208{
209    NETLIB_NAME(sound_in) *snd_in = setup.netlist().get_first_device<NETLIB_NAME(sound_in)>();
210    if (snd_in == NULL)
211    {
212        snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.factory().new_device_by_classname("nld_sound_in", setup));
213        setup.register_dev(snd_in, "STREAM_INPUT");
214    }
209   NETLIB_NAME(sound_in) *snd_in = setup.netlist().get_first_device<NETLIB_NAME(sound_in)>();
210   if (snd_in == NULL)
211   {
212      snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.factory().new_device_by_classname("nld_sound_in", setup));
213      setup.register_dev(snd_in, "STREAM_INPUT");
214   }
215215
216    pstring sparam = pstring::sprintf("STREAM_INPUT.CHAN%d", m_channel);
217    setup.register_param(sparam, m_param_name);
218    sparam = pstring::sprintf("STREAM_INPUT.MULT%d", m_channel);
219    setup.register_param(sparam, m_mult);
220    sparam = pstring::sprintf("STREAM_INPUT.OFFSET%d", m_channel);
221    setup.register_param(sparam, m_offset);
216   pstring sparam = pstring::sprintf("STREAM_INPUT.CHAN%d", m_channel);
217   setup.register_param(sparam, m_param_name);
218   sparam = pstring::sprintf("STREAM_INPUT.MULT%d", m_channel);
219   setup.register_param(sparam, m_mult);
220   sparam = pstring::sprintf("STREAM_INPUT.OFFSET%d", m_channel);
221   setup.register_param(sparam, m_offset);
222222}
223223
224224// ----------------------------------------------------------------------------------------
r29404r29405
226226// ----------------------------------------------------------------------------------------
227227
228228netlist_mame_stream_output_t::netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
229        : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__),
230            netlist_mame_sub_interface(*owner),
231            m_channel(0),
232            m_out_name("")
229      : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__),
230         netlist_mame_sub_interface(*owner),
231         m_channel(0),
232         m_out_name("")
233233{
234234}
235235
236236void netlist_mame_stream_output_t::static_set_params(device_t &device, int channel, const char *out_name)
237237{
238    netlist_mame_stream_output_t &netlist = downcast<netlist_mame_stream_output_t &>(device);
239    netlist.m_out_name = out_name;
240    netlist.m_channel = channel;
238   netlist_mame_stream_output_t &netlist = downcast<netlist_mame_stream_output_t &>(device);
239   netlist.m_out_name = out_name;
240   netlist.m_channel = channel;
241241}
242242
243243void netlist_mame_stream_output_t::device_start()
244244{
245    LOG_DEV_CALLS(("start %s\n", tag()));
245   LOG_DEV_CALLS(("start %s\n", tag()));
246246}
247247
248248void netlist_mame_stream_output_t::custom_netlist_additions(netlist_setup_t &setup)
249249{
250    NETLIB_NAME(sound_out) *snd_out;
251    pstring sname = pstring::sprintf("STREAM_OUT_%d", m_channel);
250   NETLIB_NAME(sound_out) *snd_out;
251   pstring sname = pstring::sprintf("STREAM_OUT_%d", m_channel);
252252
253    snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.factory().new_device_by_classname("nld_sound_out", setup));
254    setup.register_dev(snd_out, sname);
253   snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.factory().new_device_by_classname("nld_sound_out", setup));
254   setup.register_dev(snd_out, sname);
255255
256    setup.register_param(sname + ".CHAN" , m_channel);
257    setup.register_param(sname + ".MULT",  m_mult);
258    setup.register_param(sname + ".OFFSET",  m_offset);
259    setup.register_link(sname + ".IN", m_out_name);
256   setup.register_param(sname + ".CHAN" , m_channel);
257   setup.register_param(sname + ".MULT",  m_mult);
258   setup.register_param(sname + ".OFFSET",  m_offset);
259   setup.register_link(sname + ".IN", m_out_name);
260260}
261261
262262
r29404r29405
266266
267267void netlist_mame_t::verror(const loglevel_e level, const char *format, va_list ap) const
268268{
269    pstring errstr = pstring(format).vprintf(ap);
269   pstring errstr = pstring(format).vprintf(ap);
270270
271    switch (level)
272    {
273        case NL_WARNING:
274            logerror("netlist WARNING: %s\n", errstr.cstr());
275            break;
276        case NL_LOG:
277            logerror("netlist LOG: %s\n", errstr.cstr());
278            break;
279        case NL_ERROR:
280            emu_fatalerror error("netlist ERROR: %s\n", errstr.cstr());
281            throw error;
282            break;
283    }
271   switch (level)
272   {
273      case NL_WARNING:
274         logerror("netlist WARNING: %s\n", errstr.cstr());
275         break;
276      case NL_LOG:
277         logerror("netlist LOG: %s\n", errstr.cstr());
278         break;
279      case NL_ERROR:
280         emu_fatalerror error("netlist ERROR: %s\n", errstr.cstr());
281         throw error;
282         break;
283   }
284284}
285285
286286// ----------------------------------------------------------------------------------------
r29404r29405
293293
294294netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
295295   : device_t(mconfig, NETLIST_CORE, "Netlist core device", tag, owner, clock, "netlist_core", __FILE__),
296       m_icount(0),
297        m_div(0),
298        m_rem(0),
299        m_old(netlist_time::zero),
300        m_netlist(NULL),
301        m_setup(NULL),
302        m_setup_func(NULL)
296      m_icount(0),
297      m_div(0),
298      m_rem(0),
299      m_old(netlist_time::zero),
300      m_netlist(NULL),
301      m_setup(NULL),
302      m_setup_func(NULL)
303303{
304304}
305305
306306netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file)
307    : device_t(mconfig, type, name, tag, owner, clock, shortname, file),
308        m_icount(0),
309        m_div(0),
310        m_rem(0),
311        m_old(netlist_time::zero),
312        m_netlist(NULL),
313        m_setup(NULL),
314        m_setup_func(NULL)
307   : device_t(mconfig, type, name, tag, owner, clock, shortname, file),
308      m_icount(0),
309      m_div(0),
310      m_rem(0),
311      m_old(netlist_time::zero),
312      m_netlist(NULL),
313      m_setup(NULL),
314      m_setup_func(NULL)
315315{
316316}
317317
r29404r29405
358358   m_setup->start_devices();
359359   m_setup->resolve_inputs();
360360
361    netlist().save(NAME(m_rem));
362    netlist().save(NAME(m_div));
363    netlist().save(NAME(m_old));
361   netlist().save(NAME(m_rem));
362   netlist().save(NAME(m_div));
363   netlist().save(NAME(m_old));
364364
365365   save_state();
366366
367    m_old = netlist_time::zero;
368    m_rem = 0;
367   m_old = netlist_time::zero;
368   m_rem = 0;
369369
370370}
371371
372372void netlist_mame_device_t::device_clock_changed()
373373{
374    //printf("device_clock_changed\n");
375    m_div = netlist_time::from_hz(clock()).as_raw();
376    //m_rem = 0;
377    NL_VERBOSE_OUT(("Setting clock %" I64FMT "d and divisor %d\n", clockfreq, m_div));
378    //printf("Setting clock %d and divisor %d\n", clock(), m_div);
374   //printf("device_clock_changed\n");
375   m_div = netlist_time::from_hz(clock()).as_raw();
376   //m_rem = 0;
377   NL_VERBOSE_OUT(("Setting clock %" I64FMT "d and divisor %d\n", clockfreq, m_div));
378   //printf("Setting clock %d and divisor %d\n", clock(), m_div);
379379}
380380
381381
382382void netlist_mame_device_t::device_reset()
383383{
384384   LOG_DEV_CALLS(("device_reset\n"));
385    m_old = netlist_time::zero;
386    m_rem = 0;
385   m_old = netlist_time::zero;
386   m_rem = 0;
387387   netlist().do_reset();
388388}
389389
r29404r29405
419419
420420ATTR_HOT ATTR_ALIGN void netlist_mame_device_t::update_time_x()
421421{
422    const netlist_time delta = netlist().time() - m_old + netlist_time::from_raw(m_rem);
423    m_old = netlist().time();
424    m_icount -= divu_64x32_rem(delta.as_raw(), m_div, &m_rem);
422   const netlist_time delta = netlist().time() - m_old + netlist_time::from_raw(m_rem);
423   m_old = netlist().time();
424   m_icount -= divu_64x32_rem(delta.as_raw(), m_div, &m_rem);
425425}
426426
427427ATTR_HOT ATTR_ALIGN void netlist_mame_device_t::check_mame_abort_slice()
428428{
429    if (m_icount <= 0)
430        netlist().abort_current_queue_slice();
429   if (m_icount <= 0)
430      netlist().abort_current_queue_slice();
431431}
432432
433433ATTR_COLD void netlist_mame_device_t::save_state()
r29404r29405
444444         case DT_INT64:
445445            save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
446446            break;
447            case DT_INT16:
448                save_pointer((INT16 *) s->m_ptr, s->m_name, s->m_count);
449                break;
447         case DT_INT16:
448            save_pointer((INT16 *) s->m_ptr, s->m_name, s->m_count);
449            break;
450450         case DT_INT8:
451451            save_pointer((INT8 *) s->m_ptr, s->m_name, s->m_count);
452452            break;
r29404r29405
457457            save_pointer((bool *) s->m_ptr, s->m_name, s->m_count);
458458            break;
459459         case DT_CUSTOM:
460             break;
460            break;
461461         case NOT_SUPPORTED:
462462         default:
463463            netlist().error("found unsupported save element %s\n", s->m_name.cstr());
r29404r29405
472472// ----------------------------------------------------------------------------------------
473473
474474netlist_mame_cpu_device_t::netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
475    : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist cpu device", tag, owner, clock, "netlist_cpu", __FILE__),
476        device_execute_interface(mconfig, *this),
477        device_state_interface(mconfig, *this),
478        device_disasm_interface(mconfig, *this),
479        device_memory_interface(mconfig, *this),
480        m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(program_dummy))
475   : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist cpu device", tag, owner, clock, "netlist_cpu", __FILE__),
476      device_execute_interface(mconfig, *this),
477      device_state_interface(mconfig, *this),
478      device_disasm_interface(mconfig, *this),
479      device_memory_interface(mconfig, *this),
480      m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(program_dummy))
481481{
482482}
483483
484484
485485void netlist_mame_cpu_device_t::device_start()
486486{
487    netlist_mame_device_t::device_start();
487   netlist_mame_device_t::device_start();
488488
489    LOG_DEV_CALLS(("device_start %s\n", tag()));
489   LOG_DEV_CALLS(("device_start %s\n", tag()));
490490
491    // State support
491   // State support
492492
493    state_add(STATE_GENPC, "curpc", m_genPC).noshow();
493   state_add(STATE_GENPC, "curpc", m_genPC).noshow();
494494
495    for (int i=0; i < netlist().m_nets.count(); i++)
496    {
497        netlist_net_t *n = netlist().m_nets[i];
498        if (n->isFamily(netlist_object_t::LOGIC))
499        {
500            state_add(i*2, n->name(), n->Q_state_ptr());
501        }
502        else
503        {
504            state_add(i*2+1, n->name(), n->Q_Analog_state_ptr()).formatstr("%20s");
505        }
506    }
495   for (int i=0; i < netlist().m_nets.count(); i++)
496   {
497      netlist_net_t *n = netlist().m_nets[i];
498      if (n->isFamily(netlist_object_t::LOGIC))
499      {
500         state_add(i*2, n->name(), n->Q_state_ptr());
501      }
502      else
503      {
504         state_add(i*2+1, n->name(), n->Q_Analog_state_ptr()).formatstr("%20s");
505      }
506   }
507507
508    // set our instruction counter
509    m_icountptr = &m_icount;
508   // set our instruction counter
509   m_icountptr = &m_icount;
510510}
511511
512512
513513void netlist_mame_cpu_device_t::nl_register_devices()
514514{
515    setup().factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback", "-");
515   setup().factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback", "-");
516516}
517517
518518ATTR_COLD UINT64 netlist_mame_cpu_device_t::execute_clocks_to_cycles(UINT64 clocks) const
r29404r29405
559559         m_genPC &= 255;
560560         debugger_instruction_hook(this, m_genPC);
561561         netlist().process_queue(netlist_time::from_raw(m_div));
562           update_time_x();
562         update_time_x();
563563      }
564564   }
565565   else
566566   {
567        netlist().process_queue(netlist_time::from_raw(m_div) * m_icount);
568        update_time_x();
567      netlist().process_queue(netlist_time::from_raw(m_div) * m_icount);
568      update_time_x();
569569   }
570570}
571571
r29404r29405
574574// ----------------------------------------------------------------------------------------
575575
576576netlist_mame_sound_device_t::netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
577    : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist sound device", tag, owner, clock, "netlist_sound", __FILE__),
578        device_sound_interface(mconfig, *this)
577   : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist sound device", tag, owner, clock, "netlist_sound", __FILE__),
578      device_sound_interface(mconfig, *this)
579579{
580580}
581581
582582
583583void netlist_mame_sound_device_t::device_start()
584584{
585    netlist_mame_device_t::device_start();
585   netlist_mame_device_t::device_start();
586586
587    LOG_DEV_CALLS(("device_start %s\n", tag()));
587   LOG_DEV_CALLS(("device_start %s\n", tag()));
588588
589    // Configure outputs
589   // Configure outputs
590590
591    netlist_list_t<nld_sound_out *> outdevs = netlist().get_device_list<nld_sound_out>();
592    if (outdevs.count() == 0)
593        fatalerror("No output devices");
591   netlist_list_t<nld_sound_out *> outdevs = netlist().get_device_list<nld_sound_out>();
592   if (outdevs.count() == 0)
593      fatalerror("No output devices");
594594
595    m_num_outputs = outdevs.count();
595   m_num_outputs = outdevs.count();
596596
597    /* resort channels */
598    for (int i=0; i < MAX_OUT; i++) m_out[i] = NULL;
599    for (int i=0; i < m_num_outputs; i++)
600    {
601        int chan = outdevs[i]->m_channel.Value();
597   /* resort channels */
598   for (int i=0; i < MAX_OUT; i++) m_out[i] = NULL;
599   for (int i=0; i < m_num_outputs; i++)
600   {
601      int chan = outdevs[i]->m_channel.Value();
602602
603        netlist().log("Output %d on channel %d", i, chan);
603      netlist().log("Output %d on channel %d", i, chan);
604604
605        if (chan < 0 || chan >= MAX_OUT || chan >= outdevs.count())
606            fatalerror("illegal channel number");
607        m_out[chan] = outdevs[i];
608        m_out[chan]->m_sample = netlist_time::from_hz(clock());
609        m_out[chan]->m_buffer = NULL;
610    }
605      if (chan < 0 || chan >= MAX_OUT || chan >= outdevs.count())
606         fatalerror("illegal channel number");
607      m_out[chan] = outdevs[i];
608      m_out[chan]->m_sample = netlist_time::from_hz(clock());
609      m_out[chan]->m_buffer = NULL;
610   }
611611
612    // Configure inputs
612   // Configure inputs
613613
614    m_num_inputs = 0;
615    m_in = NULL;
614   m_num_inputs = 0;
615   m_in = NULL;
616616
617    netlist_list_t<nld_sound_in *> indevs = netlist().get_device_list<nld_sound_in>();
618    if (indevs.count() > 1)
619        fatalerror("A maximum of one input device is allowed!");
620    if (indevs.count() == 1)
621    {
622        m_in = indevs[0];
623        m_num_inputs = m_in->resolve();
624        m_in->m_inc = netlist_time::from_hz(clock());
625    }
617   netlist_list_t<nld_sound_in *> indevs = netlist().get_device_list<nld_sound_in>();
618   if (indevs.count() > 1)
619      fatalerror("A maximum of one input device is allowed!");
620   if (indevs.count() == 1)
621   {
622      m_in = indevs[0];
623      m_num_inputs = m_in->resolve();
624      m_in->m_inc = netlist_time::from_hz(clock());
625   }
626626
627    /* initialize the stream(s) */
628    m_stream = machine().sound().stream_alloc(*this, m_num_inputs, m_num_outputs, clock());
627   /* initialize the stream(s) */
628   m_stream = machine().sound().stream_alloc(*this, m_num_inputs, m_num_outputs, clock());
629629
630630}
631631
632632void netlist_mame_sound_device_t::nl_register_devices()
633633{
634    setup().factory().register_device<nld_sound_out>("NETDEV_SOUND_OUT", "nld_sound_out", "+CHAN");
635    setup().factory().register_device<nld_sound_in>("NETDEV_SOUND_IN", "nld_sound_in", "-");
634   setup().factory().register_device<nld_sound_out>("NETDEV_SOUND_OUT", "nld_sound_out", "+CHAN");
635   setup().factory().register_device<nld_sound_in>("NETDEV_SOUND_IN", "nld_sound_in", "-");
636636}
637637
638638
639639void netlist_mame_sound_device_t::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
640640{
641    for (int i=0; i < m_num_outputs; i++)
642    {
643        m_out[i]->m_buffer = outputs[i];
644    }
641   for (int i=0; i < m_num_outputs; i++)
642   {
643      m_out[i]->m_buffer = outputs[i];
644   }
645645
646    if (m_num_inputs)
647        m_in->buffer_reset();
646   if (m_num_inputs)
647      m_in->buffer_reset();
648648
649    for (int i=0; i < m_num_inputs; i++)
650    {
651        m_in->m_buffer[i] = inputs[i];
652    }
649   for (int i=0; i < m_num_inputs; i++)
650   {
651      m_in->m_buffer[i] = inputs[i];
652   }
653653
654    netlist_time cur = netlist().time();
654   netlist_time cur = netlist().time();
655655
656    netlist().process_queue(netlist_time::from_raw(m_div) * samples);
656   netlist().process_queue(netlist_time::from_raw(m_div) * samples);
657657
658    cur += (netlist_time::from_raw(m_div) * samples);
658   cur += (netlist_time::from_raw(m_div) * samples);
659659
660    for (int i=0; i < m_num_outputs; i++)
661    {
662        m_out[i]->sound_update(cur);
663        m_out[i]->buffer_reset(cur);
664    }
660   for (int i=0; i < m_num_outputs; i++)
661   {
662      m_out[i]->sound_update(cur);
663      m_out[i]->buffer_reset(cur);
664   }
665665}
666
trunk/src/emu/machine/netlist.h
r29404r29405
6868   netlist_mame_analog_input_t::static_set_mult_offset(*device, _mult, _offset);
6969
7070#define MCFG_NETLIST_ANALOG_OUTPUT(_basetag, _tag, _IN, _class, _member, _class_tag) \
71    MCFG_DEVICE_ADD(_basetag ":" _tag, NETLIST_ANALOG_OUTPUT, 0)                    \
72    netlist_mame_analog_output_t::static_set_params(*device, _IN,                   \
73              netlist_analog_output_delegate(& _class :: _member,                 \
74                    # _class "::" # _member, _class_tag, (_class *) 0)   );
71   MCFG_DEVICE_ADD(_basetag ":" _tag, NETLIST_ANALOG_OUTPUT, 0)                    \
72   netlist_mame_analog_output_t::static_set_params(*device, _IN,                   \
73            netlist_analog_output_delegate(& _class :: _member,                 \
74                  # _class "::" # _member, _class_tag, (_class *) 0)   );
7575
7676#define MCFG_NETLIST_LOGIC_INPUT(_basetag, _tag, _name, _shift, _mask)              \
7777   MCFG_DEVICE_ADD(_basetag ":" _tag, NETLIST_LOGIC_INPUT, 0)                      \
7878   netlist_mame_logic_input_t::static_set_params(*device, _name, _mask, _shift);
7979
8080#define MCFG_NETLIST_STREAM_INPUT(_basetag, _chan, _name)                           \
81    MCFG_DEVICE_ADD(_basetag ":cin" # _chan, NETLIST_STREAM_INPUT, 0)               \
82    netlist_mame_stream_input_t::static_set_params(*device, _chan, _name);
81   MCFG_DEVICE_ADD(_basetag ":cin" # _chan, NETLIST_STREAM_INPUT, 0)               \
82   netlist_mame_stream_input_t::static_set_params(*device, _chan, _name);
8383
8484#define MCFG_NETLIST_STREAM_OUTPUT(_basetag, _chan, _name)                          \
85    MCFG_DEVICE_ADD(_basetag ":cout" # _chan, NETLIST_STREAM_OUTPUT, 0)             \
86    netlist_mame_stream_output_t::static_set_params(*device, _chan, _name);
85   MCFG_DEVICE_ADD(_basetag ":cout" # _chan, NETLIST_STREAM_OUTPUT, 0)             \
86   netlist_mame_stream_output_t::static_set_params(*device, _chan, _name);
8787
8888
8989#define NETLIST_LOGIC_PORT_CHANGED(_base, _tag)                                     \
9090   PORT_CHANGED_MEMBER(_base ":" _tag, netlist_mame_logic_input_t, input_changed, 0)
9191
9292#define NETLIST_ANALOG_PORT_CHANGED(_base, _tag)                                    \
93    PORT_CHANGED_MEMBER(_base ":" _tag, netlist_mame_analog_input_t, input_changed, 0)
93   PORT_CHANGED_MEMBER(_base ":" _tag, netlist_mame_analog_input_t, input_changed, 0)
9494
9595
9696// ----------------------------------------------------------------------------------------
r29404r29405
101101      setup.parse((char *)downcast<netlist_mame_t &>(setup.netlist()).machine().root_device().memregion(_name)->base());
102102
103103#define NETDEV_ANALOG_CALLBACK_MEMBER(_name) \
104    void _name(const double data, const attotime &time)
104   void _name(const double data, const attotime &time)
105105
106106
107107#if 0
r29404r29405
116116
117117#if 0
118118#define NETDEV_SOUND_OUT(_name, _v, _m)                                             \
119        NET_REGISTER_DEV(sound_out, _name)                                          \
120        PARAM(_name.CHAN, _v)                                                       \
121        PARAM(_name.MULT, _m)
119      NET_REGISTER_DEV(sound_out, _name)                                          \
120      PARAM(_name.CHAN, _v)                                                       \
121      PARAM(_name.MULT, _m)
122122
123123#define NETDEV_SOUND_IN(_name)                                                      \
124        NET_REGISTER_DEV(sound_in, _name)
124      NET_REGISTER_DEV(sound_in, _name)
125125#endif
126126
127127class netlist_mame_device_t;
r29404r29405
166166   ATTR_HOT inline netlist_setup_t &setup() { return *m_setup; }
167167   ATTR_HOT inline netlist_mame_t &netlist() { return *m_netlist; }
168168
169    ATTR_HOT inline netlist_time last_time_update() { return m_old; }
169   ATTR_HOT inline netlist_time last_time_update() { return m_old; }
170170   ATTR_HOT void update_time_x();
171171   ATTR_HOT void check_mame_abort_slice();
172172
173    int m_icount;
173   int m_icount;
174174
175175protected:
176    // Custom to netlist ...
176   // Custom to netlist ...
177177
178    virtual void nl_register_devices() { };
178   virtual void nl_register_devices() { };
179179
180    // device_t overrides
180   // device_t overrides
181181   virtual void device_config_complete();
182182   virtual void device_start();
183183   virtual void device_stop();
r29404r29405
185185   virtual void device_post_load();
186186   virtual void device_pre_save();
187187   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
188    //virtual void device_debug_setup();
189    virtual void device_clock_changed();
188   //virtual void device_debug_setup();
189   virtual void device_clock_changed();
190190
191    UINT32              m_div;
191   UINT32              m_div;
192192
193193private:
194    void save_state();
194   void save_state();
195195
196    /* timing support here - so sound can hijack it ... */
197    UINT32              m_rem;
198    netlist_time        m_old;
196   /* timing support here - so sound can hijack it ... */
197   UINT32              m_rem;
198   netlist_time        m_old;
199199
200200   netlist_mame_t *    m_netlist;
201    netlist_setup_t *   m_setup;
201   netlist_setup_t *   m_setup;
202202
203203   void (*m_setup_func)(netlist_setup_t &);
204204};
r29404r29405
213213// ----------------------------------------------------------------------------------------
214214
215215class netlist_mame_cpu_device_t : public netlist_mame_device_t,
216                                  public device_execute_interface,
217                                  public device_state_interface,
218                                  public device_disasm_interface,
219                                  public device_memory_interface
216                           public device_execute_interface,
217                           public device_state_interface,
218                           public device_disasm_interface,
219                           public device_memory_interface
220220{
221221public:
222222
223    // construction/destruction
224    netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
225    virtual ~netlist_mame_cpu_device_t() {}
223   // construction/destruction
224   netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
225   virtual ~netlist_mame_cpu_device_t() {}
226226
227    static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
227   static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
228228
229229protected:
230    // netlist_mame_device_t
231    virtual void nl_register_devices();
230   // netlist_mame_device_t
231   virtual void nl_register_devices();
232232
233    // device_t overrides
233   // device_t overrides
234234
235    //virtual void device_config_complete();
236    virtual void device_start();
237    //virtual void device_stop();
238    //virtual void device_reset();
239    //virtual void device_post_load();
240    //virtual void device_pre_save();
241    //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
235   //virtual void device_config_complete();
236   virtual void device_start();
237   //virtual void device_stop();
238   //virtual void device_reset();
239   //virtual void device_post_load();
240   //virtual void device_pre_save();
241   //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
242242
243    // device_execute_interface overrides
243   // device_execute_interface overrides
244244
245    virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
246    virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
245   virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
246   virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
247247
248    ATTR_HOT virtual void execute_run();
248   ATTR_HOT virtual void execute_run();
249249
250    // device_disasm_interface overrides
251    ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
252    ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const { return 1; }
253    ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
250   // device_disasm_interface overrides
251   ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
252   ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const { return 1; }
253   ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
254254
255    // device_memory_interface overrides
255   // device_memory_interface overrides
256256
257    address_space_config m_program_config;
257   address_space_config m_program_config;
258258
259    virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
260    {
261        switch (spacenum)
262        {
263            case AS_PROGRAM: return &m_program_config;
264            case AS_IO:      return NULL;
265            default:         return NULL;
266        }
267    }
259   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
260   {
261      switch (spacenum)
262      {
263         case AS_PROGRAM: return &m_program_config;
264         case AS_IO:      return NULL;
265         default:         return NULL;
266      }
267   }
268268
269    //  device_state_interface overrides
269   //  device_state_interface overrides
270270
271    virtual void state_string_export(const device_state_entry &entry, astring &string)
272    {
273        if (entry.index() >= 0)
274        {
275            if (entry.index() & 1)
276                string.format("%10.6f", *((double *) entry.dataptr()));
277            else
278                string.format("%d", *((netlist_sig_t *) entry.dataptr()));
279        }
280    }
271   virtual void state_string_export(const device_state_entry &entry, astring &string)
272   {
273      if (entry.index() >= 0)
274      {
275         if (entry.index() & 1)
276            string.format("%10.6f", *((double *) entry.dataptr()));
277         else
278            string.format("%d", *((netlist_sig_t *) entry.dataptr()));
279      }
280   }
281281
282282private:
283283
284    int m_genPC;
284   int m_genPC;
285285
286286};
287287
r29404r29405
293293// ----------------------------------------------------------------------------------------
294294
295295class netlist_mame_sound_device_t : public netlist_mame_device_t,
296                                    public device_sound_interface
296                           public device_sound_interface
297297{
298298public:
299299
300    // construction/destruction
301    netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
302    virtual ~netlist_mame_sound_device_t() {}
300   // construction/destruction
301   netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
302   virtual ~netlist_mame_sound_device_t() {}
303303
304    static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
304   static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
305305
306    inline sound_stream *get_stream() { return m_stream; }
306   inline sound_stream *get_stream() { return m_stream; }
307307
308308
309    // device_sound_interface overrides
309   // device_sound_interface overrides
310310
311    virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
311   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
312312
313313protected:
314    // netlist_mame_device_t
315    virtual void nl_register_devices();
314   // netlist_mame_device_t
315   virtual void nl_register_devices();
316316
317    // device_t overrides
317   // device_t overrides
318318
319    //virtual void device_config_complete();
320    virtual void device_start();
321    //virtual void device_stop();
322    //virtual void device_reset();
323    //virtual void device_post_load();
324    //virtual void device_pre_save();
325    //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
319   //virtual void device_config_complete();
320   virtual void device_start();
321   //virtual void device_stop();
322   //virtual void device_reset();
323   //virtual void device_post_load();
324   //virtual void device_pre_save();
325   //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
326326
327327private:
328328
329    static const int MAX_OUT = 10;
330    nld_sound_out *m_out[MAX_OUT];
331    nld_sound_in *m_in;
332    sound_stream *m_stream;
333    int m_num_inputs;
334    int m_num_outputs;
329   static const int MAX_OUT = 10;
330   nld_sound_out *m_out[MAX_OUT];
331   nld_sound_in *m_in;
332   sound_stream *m_stream;
333   int m_num_inputs;
334   int m_num_outputs;
335335
336336};
337337
r29404r29405
344344public:
345345   // construction/destruction
346346   netlist_mame_sub_interface(device_t &aowner)
347    : m_offset(0.0), m_mult(1.0)
348    {
349       m_owner = dynamic_cast<netlist_mame_device_t *>(&aowner);
350       m_sound = dynamic_cast<netlist_mame_sound_device_t *>(&aowner);
351    }
347   : m_offset(0.0), m_mult(1.0)
348   {
349      m_owner = dynamic_cast<netlist_mame_device_t *>(&aowner);
350      m_sound = dynamic_cast<netlist_mame_sound_device_t *>(&aowner);
351   }
352352   virtual ~netlist_mame_sub_interface() { }
353353
354354   virtual void custom_netlist_additions(netlist_setup_t &setup) { }
r29404r29405
359359
360360   inline void update_to_current_time()
361361   {
362       m_sound->get_stream()->update();
362      m_sound->get_stream()->update();
363363   }
364364
365    static void static_set_mult_offset(device_t &device, const double mult, const double offset);
365   static void static_set_mult_offset(device_t &device, const double mult, const double offset);
366366
367367protected:
368    double m_offset;
369    double m_mult;
368   double m_offset;
369   double m_mult;
370370
371371private:
372372   netlist_mame_device_t *m_owner;
r29404r29405
390390
391391   inline void write(const double val)
392392   {
393       if (is_sound_device())
394       {
395           update_to_current_time();
396           m_param->setTo(val * m_mult + m_offset);
397       }
398       else
399       {
400           // FIXME: use device timer ....
401           m_param->setTo(val * m_mult + m_offset);
402       }
393      if (is_sound_device())
394      {
395         update_to_current_time();
396         m_param->setTo(val * m_mult + m_offset);
397      }
398      else
399      {
400         // FIXME: use device timer ....
401         m_param->setTo(val * m_mult + m_offset);
402      }
403403   }
404404
405405   inline DECLARE_INPUT_CHANGED_MEMBER(input_changed)
r29404r29405
432432typedef device_delegate<void (const double, const attotime &)> netlist_analog_output_delegate;
433433
434434class netlist_mame_analog_output_t : public device_t,
435                                     public netlist_mame_sub_interface
435                              public netlist_mame_sub_interface
436436{
437437public:
438438
439    // construction/destruction
440    netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
441    virtual ~netlist_mame_analog_output_t() { }
439   // construction/destruction
440   netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
441   virtual ~netlist_mame_analog_output_t() { }
442442
443    static void static_set_params(device_t &device, const char *in_name, netlist_analog_output_delegate adelegate);
443   static void static_set_params(device_t &device, const char *in_name, netlist_analog_output_delegate adelegate);
444444
445445protected:
446    // device-level overrides
447    virtual void device_start();
448    virtual void custom_netlist_additions(netlist_setup_t &setup);
446   // device-level overrides
447   virtual void device_start();
448   virtual void custom_netlist_additions(netlist_setup_t &setup);
449449
450450private:
451    pstring m_in;
452    netlist_analog_output_delegate m_delegate;
451   pstring m_in;
452   netlist_analog_output_delegate m_delegate;
453453};
454454
455455
r29404r29405
470470
471471   inline void write(const UINT32 val)
472472   {
473        if (is_sound_device())
474        {
475            update_to_current_time();
476            m_param->setTo((val >> m_shift) & m_mask);
477        }
478        else
479        {
480            // FIXME: use device timer ....
481            m_param->setTo((val >> m_shift) & m_mask);
482        }
473      if (is_sound_device())
474      {
475         update_to_current_time();
476         m_param->setTo((val >> m_shift) & m_mask);
477      }
478      else
479      {
480         // FIXME: use device timer ....
481         m_param->setTo((val >> m_shift) & m_mask);
482      }
483483   }
484484
485485   inline DECLARE_INPUT_CHANGED_MEMBER(input_changed) { write(newval); }
r29404r29405
505505// ----------------------------------------------------------------------------------------
506506
507507class netlist_mame_stream_input_t :  public device_t,
508                                     public netlist_mame_sub_interface
508                              public netlist_mame_sub_interface
509509{
510510public:
511511
512    // construction/destruction
513    netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
514    virtual ~netlist_mame_stream_input_t() { }
512   // construction/destruction
513   netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
514   virtual ~netlist_mame_stream_input_t() { }
515515
516    static void static_set_params(device_t &device, int channel, const char *param_name);
516   static void static_set_params(device_t &device, int channel, const char *param_name);
517517
518518protected:
519    // device-level overrides
520    virtual void device_start();
521    virtual void custom_netlist_additions(netlist_setup_t &setup);
519   // device-level overrides
520   virtual void device_start();
521   virtual void custom_netlist_additions(netlist_setup_t &setup);
522522private:
523    UINT32 m_channel;
524    pstring m_param_name;
523   UINT32 m_channel;
524   pstring m_param_name;
525525};
526526
527527// ----------------------------------------------------------------------------------------
r29404r29405
529529// ----------------------------------------------------------------------------------------
530530
531531class netlist_mame_stream_output_t :  public device_t,
532                                     public netlist_mame_sub_interface
532                              public netlist_mame_sub_interface
533533{
534534public:
535535
536    // construction/destruction
537    netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
538    virtual ~netlist_mame_stream_output_t() { }
536   // construction/destruction
537   netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
538   virtual ~netlist_mame_stream_output_t() { }
539539
540    static void static_set_params(device_t &device, int channel, const char *out_name);
540   static void static_set_params(device_t &device, int channel, const char *out_name);
541541
542542protected:
543    // device-level overrides
544    virtual void device_start();
545    virtual void custom_netlist_additions(netlist_setup_t &setup);
543   // device-level overrides
544   virtual void device_start();
545   virtual void custom_netlist_additions(netlist_setup_t &setup);
546546private:
547    UINT32 m_channel;
548    pstring m_out_name;
547   UINT32 m_channel;
548   pstring m_out_name;
549549};
550550// ----------------------------------------------------------------------------------------
551551// netdev_callback
r29404r29405
563563      m_cpu_device = downcast<netlist_mame_cpu_device_t *>(&downcast<netlist_mame_t &>(netlist()).parent());
564564   }
565565
566    ATTR_COLD void reset()
567    {
568    }
566   ATTR_COLD void reset()
567   {
568   }
569569
570570   ATTR_COLD void register_callback(netlist_analog_output_delegate callback)
571571   {
r29404r29405
574574
575575   ATTR_HOT void update()
576576   {
577       m_cpu_device->update_time_x();
578        m_callback(INPANALOG(m_in), m_cpu_device->local_time());
579        m_cpu_device->check_mame_abort_slice();
577      m_cpu_device->update_time_x();
578      m_callback(INPANALOG(m_in), m_cpu_device->local_time());
579      m_cpu_device->check_mame_abort_slice();
580580   }
581581
582582private:
r29404r29405
601601   {
602602      register_input("IN", m_in);
603603      register_param("CHAN", m_channel, 0);
604        register_param("MULT", m_mult, 1000.0);
605        register_param("OFFSET", m_offset, 0.0);
606        m_sample = netlist_time::from_hz(1); //sufficiently big enough
607        save(NAME(m_last_buffer));
604      register_param("MULT", m_mult, 1000.0);
605      register_param("OFFSET", m_offset, 0.0);
606      m_sample = netlist_time::from_hz(1); //sufficiently big enough
607      save(NAME(m_last_buffer));
608608   }
609609
610    ATTR_COLD void reset()
611    {
612        m_cur = 0;
613        m_last_pos = 0;
614        m_last_buffer = netlist_time::zero;
615    }
610   ATTR_COLD void reset()
611   {
612      m_cur = 0;
613      m_last_pos = 0;
614      m_last_buffer = netlist_time::zero;
615   }
616616
617617   ATTR_HOT void sound_update(const netlist_time upto)
618618   {
r29404r29405
634634
635635   ATTR_HOT void buffer_reset(netlist_time upto)
636636   {
637       m_last_pos = 0;
638       m_last_buffer = upto;
637      m_last_pos = 0;
638      m_last_buffer = upto;
639639   }
640640
641641   netlist_param_int_t m_channel;
642    netlist_param_double_t m_mult;
643    netlist_param_double_t m_offset;
644    stream_sample_t *m_buffer;
645    netlist_time m_sample;
642   netlist_param_double_t m_mult;
643   netlist_param_double_t m_offset;
644   stream_sample_t *m_buffer;
645   netlist_time m_sample;
646646
647647private:
648648   netlist_analog_input_t m_in;
r29404r29405
658658class NETLIB_NAME(sound_in) : public netlist_device_t
659659{
660660public:
661    NETLIB_NAME(sound_in)()
662        : netlist_device_t() { }
661   NETLIB_NAME(sound_in)()
662      : netlist_device_t() { }
663663
664    static const int MAX_INPUT_CHANNELS = 10;
664   static const int MAX_INPUT_CHANNELS = 10;
665665
666    ATTR_COLD void start()
667    {
668        // clock part
669        register_output("Q", m_Q);
670        register_input("FB", m_feedback);
666   ATTR_COLD void start()
667   {
668      // clock part
669      register_output("Q", m_Q);
670      register_input("FB", m_feedback);
671671
672        connect(m_feedback, m_Q);
673        m_inc = netlist_time::from_nsec(1);
672      connect(m_feedback, m_Q);
673      m_inc = netlist_time::from_nsec(1);
674674
675675
676        for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
677        {
678            register_param(pstring::sprintf("CHAN%d", i), m_param_name[i], "");
679            register_param(pstring::sprintf("MULT%d", i), m_param_mult[i], 1.0);
680            register_param(pstring::sprintf("OFFSET%d", i), m_param_offset[i], 0.0);
681        }
682        m_num_channel = 0;
683    }
676      for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
677      {
678         register_param(pstring::sprintf("CHAN%d", i), m_param_name[i], "");
679         register_param(pstring::sprintf("MULT%d", i), m_param_mult[i], 1.0);
680         register_param(pstring::sprintf("OFFSET%d", i), m_param_offset[i], 0.0);
681      }
682      m_num_channel = 0;
683   }
684684
685    ATTR_COLD void reset()
686    {
687        m_pos = 0;
688        for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
689            m_buffer[i] = NULL;
690    }
685   ATTR_COLD void reset()
686   {
687      m_pos = 0;
688      for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
689         m_buffer[i] = NULL;
690   }
691691
692    ATTR_COLD int resolve()
693    {
694        m_pos = 0;
695        for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
696        {
697            if (m_param_name[i].Value() != "")
698            {
699                if (i != m_num_channel)
700                    netlist().error("sound input numbering has to be sequential!");
701                m_num_channel++;
702                m_param[i] = dynamic_cast<netlist_param_double_t *>(setup().find_param(m_param_name[i].Value(), true));
703            }
704        }
705        return m_num_channel;
706    }
692   ATTR_COLD int resolve()
693   {
694      m_pos = 0;
695      for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
696      {
697         if (m_param_name[i].Value() != "")
698         {
699            if (i != m_num_channel)
700               netlist().error("sound input numbering has to be sequential!");
701            m_num_channel++;
702            m_param[i] = dynamic_cast<netlist_param_double_t *>(setup().find_param(m_param_name[i].Value(), true));
703         }
704      }
705      return m_num_channel;
706   }
707707
708    ATTR_HOT void update()
709    {
710        for (int i=0; i<m_num_channel; i++)
711        {
712            if (m_buffer[i] == NULL)
713                break; // stop, called outside of stream_update
714            double v = m_buffer[i][m_pos];
715            m_param[i]->setTo(v * m_param_mult[i].Value() + m_param_offset[i].Value());
716        }
717        m_pos++;
718        OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
719    }
708   ATTR_HOT void update()
709   {
710      for (int i=0; i<m_num_channel; i++)
711      {
712         if (m_buffer[i] == NULL)
713            break; // stop, called outside of stream_update
714         double v = m_buffer[i][m_pos];
715         m_param[i]->setTo(v * m_param_mult[i].Value() + m_param_offset[i].Value());
716      }
717      m_pos++;
718      OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
719   }
720720
721    ATTR_HOT void buffer_reset()
722    {
723        m_pos = 0;
724    }
721   ATTR_HOT void buffer_reset()
722   {
723      m_pos = 0;
724   }
725725
726    netlist_param_str_t m_param_name[MAX_INPUT_CHANNELS];
727    netlist_param_double_t *m_param[MAX_INPUT_CHANNELS];
728    stream_sample_t *m_buffer[MAX_INPUT_CHANNELS];
729    netlist_param_double_t m_param_mult[MAX_INPUT_CHANNELS];
730    netlist_param_double_t m_param_offset[MAX_INPUT_CHANNELS];
731    netlist_time m_inc;
726   netlist_param_str_t m_param_name[MAX_INPUT_CHANNELS];
727   netlist_param_double_t *m_param[MAX_INPUT_CHANNELS];
728   stream_sample_t *m_buffer[MAX_INPUT_CHANNELS];
729   netlist_param_double_t m_param_mult[MAX_INPUT_CHANNELS];
730   netlist_param_double_t m_param_offset[MAX_INPUT_CHANNELS];
731   netlist_time m_inc;
732732
733733private:
734    netlist_ttl_input_t m_feedback;
735    netlist_ttl_output_t m_Q;
734   netlist_ttl_input_t m_feedback;
735   netlist_ttl_output_t m_Q;
736736
737    int m_pos;
738    int m_num_channel;
737   int m_pos;
738   int m_num_channel;
739739};
740740
741741// device type definition
trunk/src/emu/machine/terminal.c
r29404r29405
418418}
419419
420420const device_type GENERIC_TERMINAL = &device_creator<generic_terminal_device>;
421
trunk/src/emu/machine/pc_lpt.c
r29404r29405
167167   m_cent_status_in->write_bit6(state);
168168   update_irq();
169169}
170
trunk/src/emu/machine/6526cia.h
r29404r29405
11/**********************************************************************
2   
3   WARNING: DO NOT USE! WILL BE REMOVED IN FAVOR OF machine/mos6526.h
42
3    WARNING: DO NOT USE! WILL BE REMOVED IN FAVOR OF machine/mos6526.h
4
55**********************************************************************
66
77    MOS 6526/8520 Complex Interface Adapter emulation
trunk/src/emu/machine/saturn.c
r29404r29405
762762
763763   if (offset != 0)
764764   {
765      if (data == ASSERT_LINE) m_scsp_last_line = offset;     
765      if (data == ASSERT_LINE) m_scsp_last_line = offset;
766766      m_audiocpu->set_input_line(offset, data);
767   }   
767   }
768768   else
769769   {
770770      m_audiocpu->set_input_line(m_scsp_last_line, data);
trunk/src/emu/machine/seibu_cop.h
r29404r29405
11/***************************************************************************
22
3   Seibu COP device
3    Seibu COP device
44
55***************************************************************************/
66
r29404r29405
2020
2121#define MCFG_SEIBU_COP_IN_WORD_CB(_devcb) \
2222   devcb = &seibu_cop_device::set_in_word_callback(*device, DEVCB2_##_devcb);
23   
23
2424#define MCFG_SEIBU_COP_IN_DWORD_CB(_devcb) \
2525   devcb = &seibu_cop_device::set_in_dword_callback(*device, DEVCB2_##_devcb);
2626
r29404r29405
3232
3333#define MCFG_SEIBU_COP_OUT_DWORD_CB(_devcb) \
3434   devcb = &seibu_cop_device::set_out_dword_callback(*device, DEVCB2_##_devcb);
35   
3635
3736
37
3838//**************************************************************************
3939//  TYPE DEFINITIONS
4040//**************************************************************************
r29404r29405
4747public:
4848   // construction/destruction
4949   seibu_cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   
50
5151   template<class _Object> static devcb2_base &set_in_byte_callback(device_t &device, _Object object) { return downcast<seibu_cop_device &>(device).m_in_byte_cb.set_callback(object); }
5252   template<class _Object> static devcb2_base &set_in_word_callback(device_t &device, _Object object) { return downcast<seibu_cop_device &>(device).m_in_word_cb.set_callback(object); }
5353   template<class _Object> static devcb2_base &set_in_dword_callback(device_t &device, _Object object) { return downcast<seibu_cop_device &>(device).m_in_dword_cb.set_callback(object); }
trunk/src/emu/machine/mos6551.c
r29404r29405
577577               m_rx_counter = 0;
578578
579579               if (LOG) logerror("MOS6551 '%s': RX STOP BIT\n", tag());
580     
580
581581               if (!(m_status & SR_RDRF))
582582               {
583583                  if (!m_rxd)
trunk/src/emu/machine/i8355.h
r29404r29405
5757
5858#define MCFG_I8355_OUT_PA_CB(_devcb) \
5959   devcb = &i8355_device::set_out_pa_callback(*device, DEVCB2_##_devcb);
60   
60
6161#define MCFG_I8355_IN_PB_CB(_devcb) \
6262   devcb = &i8355_device::set_in_pb_callback(*device, DEVCB2_##_devcb);
63   
63
6464#define MCFG_I8355_OUT_PB_CB(_devcb) \
6565   devcb = &i8355_device::set_out_pb_callback(*device, DEVCB2_##_devcb);
66   
6766
67
6868///*************************************************************************
6969//  TYPE DEFINITIONS
7070///*************************************************************************
r29404r29405
8282   template<class _Object> static devcb2_base &set_out_pa_callback(device_t &device, _Object object) { return downcast<i8355_device &>(device).m_out_pa_cb.set_callback(object); }
8383   template<class _Object> static devcb2_base &set_in_pb_callback(device_t &device, _Object object) { return downcast<i8355_device &>(device).m_in_pb_cb.set_callback(object); }
8484   template<class _Object> static devcb2_base &set_out_pb_callback(device_t &device, _Object object) { return downcast<i8355_device &>(device).m_out_pb_cb.set_callback(object); }
85   
85
8686   DECLARE_READ8_MEMBER( io_r );
8787   DECLARE_WRITE8_MEMBER( io_w );
8888
trunk/src/emu/machine/mc6843.c
r29404r29405
144144      img->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0 );
145145      img->floppy_drive_set_rpm( 300. );
146146   }
147   
147
148148   /* reset registers */
149149   m_CMR &= 0xf0; /* zero only command */
150150   m_ISR = 0;
r29404r29405
464464            }
465465         }
466466         break;
467         
467
468468      default:
469469         break;
470470   }
trunk/src/emu/machine/8042kbdc.h
r29404r29405
101101   int m_offset1;
102102
103103   int m_poll_delay;
104   
104
105105   required_device<at_keyboard_device> m_keyboard_dev;
106106
107107   devcb_resolved_write_line   m_system_reset_func;
trunk/src/emu/machine/mc6843.h
r29404r29405
1919public:
2020   mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2121   ~mc6843_device() {}
22   
22
2323   template<class _Object> static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<mc6843_device &>(device).m_write_irq.set_callback(object); }
2424
2525   DECLARE_READ8_MEMBER(read);
r29404r29405
3434   virtual void device_start();
3535   virtual void device_reset();
3636   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
37   
37
3838private:
3939   enum
4040   {
4141      TIMER_CONT
4242   };
43   
43
4444   devcb2_write_line m_write_irq;
4545
4646   /* registers */
r29404r29405
6666
6767   /* trigger delayed actions (bottom halves) */
6868   emu_timer* m_timer_cont;
69   
69
7070   legacy_floppy_image_device* floppy_image(UINT8 drive);
7171   legacy_floppy_image_device* floppy_image();
7272   void status_update();
r29404r29405
7878   void finish_RCR();
7979   void cont_SR();
8080   void cont_SW();
81   
81
8282};
8383
8484extern const device_type MC6843;
trunk/src/emu/machine/68561mpcc.c
r29404r29405
160160void mpcc68561_t::device_start()
161161{
162162   intrq_cb.resolve_safe();
163   
163
164164   memset(channel, 0, sizeof(channel));
165165
166166   mode = 0;
trunk/src/emu/machine/s3c2400.c
r29404r29405
6767s3c2400_device::~s3c2400_device()
6868{
6969}
70
70
7171//-------------------------------------------------
7272//  static_set_palette_tag: Set the tag of the
7373//  palette device
r29404r29405
9999void s3c2400_device::device_start()
100100{
101101   s3c24xx_device_start();
102   
103   address_space &space = m_cpu->memory().space( AS_PROGRAM);   
102
103   address_space &space = m_cpu->memory().space( AS_PROGRAM);
104104   space.install_readwrite_handler(0x14000000, 0x1400003b, read32_delegate(FUNC(s3c2400_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_memcon_w), this));
105105   space.install_readwrite_handler(0x14200000, 0x1420005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_usb_host_w), this));
106106   space.install_readwrite_handler(0x14400000, 0x14400017, read32_delegate(FUNC(s3c2400_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_irq_w), this));
trunk/src/emu/machine/upd7002.c
r29404r29405
1717const device_type UPD7002 = &device_creator<upd7002_device>;
1818
1919upd7002_device::upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
20   : device_t(mconfig, UPD7002, "uPD7002", tag, owner, clock, "upd7002", __FILE__)   
20   : device_t(mconfig, UPD7002, "uPD7002", tag, owner, clock, "upd7002", __FILE__)
2121{
2222}
2323
trunk/src/emu/machine/s3c2400.h
r29404r29405
1616
1717#define MCFG_S3C2400_ADD(_tag, _clock, _config, _palette_tag) \
1818   MCFG_DEVICE_ADD(_tag, S3C2400, _clock) \
19   MCFG_DEVICE_CONFIG(_config)   \
19   MCFG_DEVICE_CONFIG(_config) \
2020   s3c2400_device::static_set_palette_tag(*device, "^" _palette_tag);
2121
2222#define S3C2400_INTERFACE(name) \
r29404r29405
369369#define S3C24XX_DMA_COUNT   4
370370#define S3C24XX_SPI_COUNT   1
371371
372class s3c2400_device : public device_t,
372class s3c2400_device : public device_t,
373373                        public s3c2400_interface
374374{
375375public:
r29404r29405
536536   void s3c24xx_spi_reset();
537537   UINT32 s3c24xx_spi_r(UINT32 ch, UINT32 offset);
538538   void s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask);
539   READ32_MEMBER( s3c24xx_spi_0_r );   
539   READ32_MEMBER( s3c24xx_spi_0_r );
540540   WRITE32_MEMBER( s3c24xx_spi_0_w );
541541   void s3c24xx_mmc_reset();
542542   READ32_MEMBER( s3c24xx_mmc_r );
543543   WRITE32_MEMBER( s3c24xx_mmc_w );
544544   void s3c24xx_device_reset();
545545   void s3c24xx_device_start();
546   
547546
547
548548   void s3c2400_uart_fifo_w(int uart, UINT8 data);
549549
550550   /*******************************************************************************
551      TYPE DEFINITIONS
551       TYPE DEFINITIONS
552552   *******************************************************************************/
553553
554554   struct s3c24xx_memcon_regs_t
r29404r29405
901901   devcb_resolved_write8 m_address_w;
902902   devcb_resolved_read8  m_nand_data_r;
903903   devcb_resolved_write8 m_nand_data_w;
904   
904
905905};
906906
907907extern const device_type S3C2400;
trunk/src/emu/machine/upd7002.h
r29404r29405
3333***************************************************************************/
3434
3535class upd7002_device : public device_t,
36                        public upd7002_interface                       
36                        public upd7002_interface
3737{
3838public:
3939   upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r29404r29405
4242   DECLARE_READ8_MEMBER ( eoc_r );
4343   DECLARE_READ8_MEMBER ( read );
4444   DECLARE_WRITE8_MEMBER ( write );
45   
45
4646protected:
4747   // device-level overrides
4848   virtual void device_config_complete();
4949   virtual void device_start();
5050   virtual void device_reset();
5151   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
52   
52
5353private:
5454   // internal state
55   
55
5656   /* Status Register
5757       D0 and D1 define the currently selected input channel
5858       D2 flag output
r29404r29405
8383   the counter at the end of the first conversion will not match and not be processed
8484   only then at the end of the second conversion will the conversion complete function run */
8585   int m_conversion_counter;
86   
86
8787   enum
8888   {
8989      TIMER_CONVERSION_COMPLETE
trunk/src/emu/machine/generic.c
r29404r29405
433433   const char *tag = (const char *)param;
434434   return ioport(tag)->read();
435435}
436
trunk/src/emu/machine/mm74c922.h
r29404r29405
106106   void clock_scan_counters();
107107   void detect_keypress();
108108
109   devcb2_write_line    m_write_da;
110   devcb2_read8       m_read_x1;
111   devcb2_read8       m_read_x2;
112   devcb2_read8       m_read_x3;
113   devcb2_read8       m_read_x4;
114   devcb2_read8       m_read_x5;
109   devcb2_write_line   m_write_da;
110   devcb2_read8        m_read_x1;
111   devcb2_read8        m_read_x2;
112   devcb2_read8        m_read_x3;
113   devcb2_read8        m_read_x4;
114   devcb2_read8        m_read_x5;
115115
116116   double              m_cap_osc;
117117   double              m_cap_debounce;
trunk/src/emu/machine/tc009xlvc.h
r29404r29405
2020   // static configuration
2121   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2222   static void static_set_palette_tag(device_t &device, const char *tag);
23   
23
2424   DECLARE_READ8_MEMBER( vregs_r );
2525   DECLARE_WRITE8_MEMBER( vregs_w );
2626
trunk/src/emu/machine/rtc65271.h
r29404r29405
3131public:
3232
3333   template<class _Object> static devcb2_base &set_interrupt_callback(device_t &device, _Object object) { return downcast<rtc65271_device &>(device).m_interrupt_cb.set_callback(object); }
34   
34
3535   DECLARE_READ8_MEMBER( rtc_r );
3636   DECLARE_READ8_MEMBER( xram_r );
3737   DECLARE_WRITE8_MEMBER( rtc_w );
trunk/src/emu/machine/rtc4543.c
r29404r29405
2929
3030rtc4543_device::rtc4543_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3131   : device_t(mconfig, RTC4543, "Epson R4543", tag, owner, clock, "rtc4543", __FILE__),
32     device_rtc_interface(mconfig, *this),
33     data_cb(*this)
32      device_rtc_interface(mconfig, *this),
33      data_cb(*this)
3434{
3535}
3636
trunk/src/emu/machine/pci.c
r29404r29405
287287   m_devicenum = -1;
288288   m_address = 0;
289289}
290
trunk/src/emu/machine/upd1990a.c
r29404r29405
171171         int max_shift = is_serial_mode() ? 6 : 5;
172172         m_data_out = (m_time_counter[max_shift - 1] == 0);
173173         m_write_data(get_data_out());
174         
174
175175         for (int i = 0; i < max_shift; i++)
176176         {
177177            m_time_counter[i]++;
r29404r29405
219219      {
220220         m_c = m_c_unlatched;
221221         if (m_c == 7)
222            m_c = MODE_TEST;         
222            m_c = MODE_TEST;
223223      }
224     
224
225225      if (LOG) logerror("uPD1990A '%s' Command %x\n", tag(), m_c);
226     
226
227227      // common functions
228228      if (m_c == MODE_REGISTER_HOLD || (m_c >= MODE_TP_64HZ && m_c < MODE_TEST))
229229      {
r29404r29405
234234         m_testmode = false;
235235         m_timer_test_mode->enable(0);
236236      }
237     
237
238238      switch (m_c)
239239      {
240240      case MODE_REGISTER_HOLD:
r29404r29405
285285            bcd_to_integer(m_time_counter[1]),
286286            bcd_to_integer(m_time_counter[0])
287287         );
288         
288
289289         // reset stage 10-15 of clock divider
290290         m_timer_clock->adjust(attotime::from_ticks(m_timer_clock->remaining().as_ticks(clock()) % (clock() / 512), clock()), 0, attotime::from_hz(clock() / 32768.0));
291         
291
292292         // disable(low) time pulse in testmode
293293         if (m_testmode)
294294         {
r29404r29405
336336         // set timer pulse
337337         const float div[4] = { 512.0, 128.0, 16.0, 8.0 };
338338         m_timer_tp->adjust(attotime::zero, 0, attotime::from_hz((clock() / div[m_c - MODE_TP_64HZ]) * 2.0));
339         
339
340340         break;
341341      }
342342
r29404r29405
349349         attotime one_second = attotime::from_hz(clock() / 32768.0);
350350         const float mul[4] = { 1.0, 10.0, 30.0, 60.0 };
351351         m_timer_tp->adjust(attotime::zero, 0, one_second * mul[m_c - MODE_TP_1S_INT] / 2.0);
352         
352
353353         break;
354354      }
355355
r29404r29405
374374         m_timer_test_mode->adjust(attotime::zero, 0, attotime::from_hz(clock() / div));
375375         break;
376376      }
377     
377
378378      default:
379379         break;
380380      }
r29404r29405
399399   if (!m_clk && state)
400400   {
401401      int in = m_data_in;
402     
402
403403      if (is_serial_mode())
404404      {
405405         // always clock serial command register
r29404r29405
407407         m_shift_reg[6] >>= 1;
408408         m_shift_reg[6] |= (m_data_in << 3);
409409      }
410     
410
411411      if (m_c == MODE_SHIFT)
412412      {
413413         // clock shift register
r29404r29405
420420            else
421421               m_shift_reg[i] |= (m_shift_reg[i + 1] << 7 & 0x80);
422422         }
423         
423
424424         // data out LSB of shift register
425425         m_data_out = m_shift_reg[0] & 1;
426426         m_write_data(get_data_out());
r29404r29405
449449
450450   int prev_oe = m_oe;
451451   m_oe = state;
452   
452
453453   if (m_oe != prev_oe && m_c != MODE_TEST)
454454      m_write_data(get_data_out());
455455}
trunk/src/emu/machine/upd1990a.h
r29404r29405
134134   bool m_testmode;            // testmode active
135135
136136   int m_variant;
137   
137
138138   // timers
139139   emu_timer *m_timer_clock;
140140   emu_timer *m_timer_tp;
trunk/src/emu/machine/im6402.h
r29404r29405
7878// ======================> im6402_device
7979
8080class im6402_device :  public device_t,
81                  public device_serial_interface
81                  public device_serial_interface
8282{
8383public:
8484   // construction/destruction
trunk/src/emu/machine/kb3600.c
r29404r29405
160160
161161            if (!found)
162162            {
163               ako = 1;
163               ako = 1;
164164
165165               if (m_b != b)
166166               {
r29404r29405
181181               }
182182            }
183183         }
184         else   // key released, unmark it from the keys_down table
184         else    // key released, unmark it from the keys_down table
185185         {
186186            for (int k = 0; k < MAX_KEYS_DOWN; k++)
187187            {
trunk/src/emu/machine/kb3600.h
r29404r29405
6565//  INTERFACE CONFIGURATION MACROS
6666//**************************************************************************
6767
68#define MCFG_AY3600_MATRIX_X0(_cb)   \
68#define MCFG_AY3600_MATRIX_X0(_cb)  \
6969   devcb = &ay3600_device::set_x0_cb(*device, DEVCB2_##_cb);
70#define MCFG_AY3600_MATRIX_X1(_cb)   \
70#define MCFG_AY3600_MATRIX_X1(_cb)  \
7171   devcb = &ay3600_device::set_x1_cb(*device, DEVCB2_##_cb);
72#define MCFG_AY3600_MATRIX_X2(_cb)   \
72#define MCFG_AY3600_MATRIX_X2(_cb)  \
7373   devcb = &ay3600_device::set_x2_cb(*device, DEVCB2_##_cb);
74#define MCFG_AY3600_MATRIX_X3(_cb)   \
74#define MCFG_AY3600_MATRIX_X3(_cb)  \
7575   devcb = &ay3600_device::set_x3_cb(*device, DEVCB2_##_cb);
76#define MCFG_AY3600_MATRIX_X4(_cb)   \
76#define MCFG_AY3600_MATRIX_X4(_cb)  \
7777   devcb = &ay3600_device::set_x4_cb(*device, DEVCB2_##_cb);
78#define MCFG_AY3600_MATRIX_X5(_cb)   \
78#define MCFG_AY3600_MATRIX_X5(_cb)  \
7979   devcb = &ay3600_device::set_x5_cb(*device, DEVCB2_##_cb);
80#define MCFG_AY3600_MATRIX_X6(_cb)   \
80#define MCFG_AY3600_MATRIX_X6(_cb)  \
8181   devcb = &ay3600_device::set_x6_cb(*device, DEVCB2_##_cb);
82#define MCFG_AY3600_MATRIX_X7(_cb)   \
82#define MCFG_AY3600_MATRIX_X7(_cb)  \
8383   devcb = &ay3600_device::set_x7_cb(*device, DEVCB2_##_cb);
84#define MCFG_AY3600_MATRIX_X8(_cb)   \
84#define MCFG_AY3600_MATRIX_X8(_cb)  \
8585   devcb = &ay3600_device::set_x8_cb(*device, DEVCB2_##_cb);
86#define MCFG_AY3600_SHIFT_CB(_cb)   \
86#define MCFG_AY3600_SHIFT_CB(_cb)   \
8787   devcb = &ay3600_device::set_shift_cb(*device, DEVCB2_##_cb);
88#define MCFG_AY3600_CONTROL_CB(_cb)   \
88#define MCFG_AY3600_CONTROL_CB(_cb) \
8989   devcb = &ay3600_device::set_control_cb(*device, DEVCB2_##_cb);
90#define MCFG_AY3600_DATA_READY_CB(_cb)   \
90#define MCFG_AY3600_DATA_READY_CB(_cb)  \
9191   devcb = &ay3600_device::set_data_ready_cb(*device, DEVCB2_##_cb);
92#define MCFG_AY3600_AKO_CB(_cb)   \
92#define MCFG_AY3600_AKO_CB(_cb) \
9393   devcb = &ay3600_device::set_ako_cb(*device, DEVCB2_##_cb);
9494
9595//**************************************************************************
trunk/src/emu/rendfont.h
r29404r29405
5252   public:
5353      glyph()
5454         : width(0),
55           xoffs(0), yoffs(0),
56           bmwidth(0), bmheight(0),
57           rawdata(NULL),
58           texture(NULL) { }
59   
55            xoffs(0), yoffs(0),
56            bmwidth(0), bmheight(0),
57            rawdata(NULL),
58            texture(NULL) { }
59
6060      INT32               width;              // width from this character to the next
6161      INT32               xoffs, yoffs;       // X and Y offset from baseline to top,left of bitmap
6262      INT32               bmwidth, bmheight;  // width and height of bitmap
trunk/src/emu/netlist/nl_parser.c
r29404r29405
1616
1717pstring ptokenizer::currentline_str()
1818{
19    char buf[300];
20    int bufp = 0;
21    const char *p = m_line_ptr;
22    while (*p && *p != 10)
23        buf[bufp++] = *p++;
24    buf[bufp] = 0;
25    return pstring(buf);
19   char buf[300];
20   int bufp = 0;
21   const char *p = m_line_ptr;
22   while (*p && *p != 10)
23      buf[bufp++] = *p++;
24   buf[bufp] = 0;
25   return pstring(buf);
2626}
2727
2828
2929void ptokenizer::skipeol()
3030{
31    char c = getc();
32    while (c)
33    {
34        if (c == 10)
35        {
36            c = getc();
37            if (c != 13)
38                ungetc();
39            return;
40        }
41        c = getc();
42    }
31   char c = getc();
32   while (c)
33   {
34      if (c == 10)
35      {
36         c = getc();
37         if (c != 13)
38            ungetc();
39         return;
40      }
41      c = getc();
42   }
4343}
4444
4545
4646unsigned char ptokenizer::getc()
4747{
48    if (*m_px == 10)
49    {
50        m_line++;
51        m_line_ptr = m_px + 1;
52    }
53    if (*m_px)
54        return *(m_px++);
55    else
56        return *m_px;
48   if (*m_px == 10)
49   {
50      m_line++;
51      m_line_ptr = m_px + 1;
52   }
53   if (*m_px)
54      return *(m_px++);
55   else
56      return *m_px;
5757}
5858
5959void ptokenizer::ungetc()
6060{
61    m_px--;
61   m_px--;
6262}
6363
6464void ptokenizer::require_token(const token_id_t &token_num)
6565{
66    require_token(get_token(), token_num);
66   require_token(get_token(), token_num);
6767}
6868
6969void ptokenizer::require_token(const token_t tok, const token_id_t &token_num)
7070{
71    if (!tok.is(token_num))
72    {
73        error("Error: expected token <%s> got <%s>\n", m_tokens[token_num.id()].cstr(), tok.str().cstr());
74    }
71   if (!tok.is(token_num))
72   {
73      error("Error: expected token <%s> got <%s>\n", m_tokens[token_num.id()].cstr(), tok.str().cstr());
74   }
7575}
7676
7777pstring ptokenizer::get_string()
7878{
79    token_t tok = get_token();
80    if (!tok.is_type(STRING))
81    {
82        error("Error: expected a string, got <%s>\n", tok.str().cstr());
83    }
84    return tok.str();
79   token_t tok = get_token();
80   if (!tok.is_type(STRING))
81   {
82      error("Error: expected a string, got <%s>\n", tok.str().cstr());
83   }
84   return tok.str();
8585}
8686
8787pstring ptokenizer::get_identifier()
8888{
89    token_t tok = get_token();
90    if (!tok.is_type(IDENTIFIER))
91    {
92        error("Error: expected an identifier, got <%s>\n", tok.str().cstr());
93    }
94    return tok.str();
89   token_t tok = get_token();
90   if (!tok.is_type(IDENTIFIER))
91   {
92      error("Error: expected an identifier, got <%s>\n", tok.str().cstr());
93   }
94   return tok.str();
9595}
9696
9797ptokenizer::token_t ptokenizer::get_token()
9898{
99    while (true)
100    {
101        token_t ret = get_token_internal();
102        if (ret.is_type(ENDOFFILE))
103            return ret;
99   while (true)
100   {
101      token_t ret = get_token_internal();
102      if (ret.is_type(ENDOFFILE))
103         return ret;
104104
105        if (ret.is(m_tok_comment_start))
106        {
107            do {
108                ret = get_token_internal();
109            } while (ret.is_not(m_tok_comment_end));
110        }
111        else if (ret.is(m_tok_line_comment))
112        {
113            skipeol();
114        }
115        else if (ret.str() == "#")
116        {
117            skipeol();
118        }
119        else
120            return ret;
121    }
105      if (ret.is(m_tok_comment_start))
106      {
107         do {
108            ret = get_token_internal();
109         } while (ret.is_not(m_tok_comment_end));
110      }
111      else if (ret.is(m_tok_line_comment))
112      {
113         skipeol();
114      }
115      else if (ret.str() == "#")
116      {
117         skipeol();
118      }
119      else
120         return ret;
121   }
122122}
123123
124124ptokenizer::token_t ptokenizer::get_token_internal()
125125{
126    /* skip ws */
127    char c = getc();
128    while (m_whitespace.find(c)>=0)
129    {
130        c = getc();
131        if (eof())
132        {
133            return token_t(ENDOFFILE);
134        }
135    }
136    if (m_identifier_chars.find(c)>=0)
137    {
138        /* read identifier till non identifier char */
139        pstring tokstr = "";
140        while (m_identifier_chars.find(c)>=0) {
141            tokstr += c;
142            c = getc();
143        }
144        ungetc();
145        token_id_t id = token_id_t(m_tokens.indexof(tokstr));
146        if (id.id() >= 0)
147            return token_t(id, tokstr);
148        else
149        {
150            return token_t(IDENTIFIER, tokstr);
151        }
152    }
153    else if (c == m_string)
154    {
155        pstring tokstr = "";
156        c = getc();
157        while (c != m_string)
158        {
159            tokstr += c;
160            c = getc();
161        }
162        return token_t(STRING, tokstr);
163    }
164    else
165    {
166        /* read identifier till first identifier char or ws */
167        pstring tokstr = "";
168        while ((m_identifier_chars.find(c)) < 0 && (m_whitespace.find(c) < 0)) {
169            tokstr += c;
170            /* expensive, check for single char tokens */
171            if (tokstr.len() == 1)
172            {
173                token_id_t id = token_id_t(m_tokens.indexof(tokstr));
174                if (id.id() >= 0)
175                    return token_t(id, tokstr);
176            }
177            c = getc();
178        }
179        ungetc();
180        token_id_t id = token_id_t(m_tokens.indexof(tokstr));
181        if (id.id() >= 0)
182            return token_t(id, tokstr);
183        else
184        {
185            return token_t(UNKNOWN, tokstr);
186        }
187    }
126   /* skip ws */
127   char c = getc();
128   while (m_whitespace.find(c)>=0)
129   {
130      c = getc();
131      if (eof())
132      {
133         return token_t(ENDOFFILE);
134      }
135   }
136   if (m_identifier_chars.find(c)>=0)
137   {
138      /* read identifier till non identifier char */
139      pstring tokstr = "";
140      while (m_identifier_chars.find(c)>=0) {
141         tokstr += c;
142         c = getc();
143      }
144      ungetc();
145      token_id_t id = token_id_t(m_tokens.indexof(tokstr));
146      if (id.id() >= 0)
147         return token_t(id, tokstr);
148      else
149      {
150         return token_t(IDENTIFIER, tokstr);
151      }
152   }
153   else if (c == m_string)
154   {
155      pstring tokstr = "";
156      c = getc();
157      while (c != m_string)
158      {
159         tokstr += c;
160         c = getc();
161      }
162      return token_t(STRING, tokstr);
163   }
164   else
165   {
166      /* read identifier till first identifier char or ws */
167      pstring tokstr = "";
168      while ((m_identifier_chars.find(c)) < 0 && (m_whitespace.find(c) < 0)) {
169         tokstr += c;
170         /* expensive, check for single char tokens */
171         if (tokstr.len() == 1)
172         {
173            token_id_t id = token_id_t(m_tokens.indexof(tokstr));
174            if (id.id() >= 0)
175               return token_t(id, tokstr);
176         }
177         c = getc();
178      }
179      ungetc();
180      token_id_t id = token_id_t(m_tokens.indexof(tokstr));
181      if (id.id() >= 0)
182         return token_t(id, tokstr);
183      else
184      {
185         return token_t(UNKNOWN, tokstr);
186      }
187   }
188188
189189}
190190
191191ATTR_COLD void ptokenizer::error(const char *format, ...)
192192{
193    va_list ap;
194    va_start(ap, format);
193   va_list ap;
194   va_start(ap, format);
195195
196    pstring errmsg1 =pstring(format).vprintf(ap);
197    va_end(ap);
196   pstring errmsg1 =pstring(format).vprintf(ap);
197   va_end(ap);
198198
199    verror(errmsg1, currentline_no(), currentline_str());
199   verror(errmsg1, currentline_no(), currentline_str());
200200
201    //throw error;
201   //throw error;
202202}
203203
204204// ----------------------------------------------------------------------------------------
r29404r29405
207207
208208ATTR_COLD void netlist_parser::verror(pstring msg, int line_num, pstring line)
209209{
210    m_setup.netlist().error("line %d: error: %s\n\t\t%s\n", line_num,
211            msg.cstr(), line.cstr());
210   m_setup.netlist().error("line %d: error: %s\n\t\t%s\n", line_num,
211         msg.cstr(), line.cstr());
212212
213    //throw error;
213   //throw error;
214214}
215215
216216
217217bool netlist_parser::parse(const char *buf, const pstring nlname)
218218{
219    m_buf = buf;
219   m_buf = buf;
220220
221    reset(buf);
222    set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-");
223    set_number_chars("01234567890eE-."); //FIXME: processing of numbers
224    char ws[5];
225    ws[0] = ' ';
226    ws[1] = 9;
227    ws[2] = 10;
228    ws[3] = 13;
229    ws[4] = 0;
230    set_whitespace(ws);
231    set_comment("/*", "*/", "//");
232    m_tok_param_left = register_token("(");
233    m_tok_param_right = register_token(")");
234    m_tok_comma = register_token(",");
221   reset(buf);
222   set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-");
223   set_number_chars("01234567890eE-."); //FIXME: processing of numbers
224   char ws[5];
225   ws[0] = ' ';
226   ws[1] = 9;
227   ws[2] = 10;
228   ws[3] = 13;
229   ws[4] = 0;
230   set_whitespace(ws);
231   set_comment("/*", "*/", "//");
232   m_tok_param_left = register_token("(");
233   m_tok_param_right = register_token(")");
234   m_tok_comma = register_token(",");
235235
236    m_tok_ALIAS = register_token("ALIAS");
237    m_tok_NET_C = register_token("NET_C");
238    m_tok_PARAM = register_token("PARAM");
239    m_tok_NET_MODEL = register_token("NET_MODEL");
240    m_tok_INCLUDE = register_token("INCLUDE");
241    m_tok_SUBMODEL = register_token("SUBMODEL");
242    m_tok_NETLIST_START = register_token("NETLIST_START");
243    m_tok_NETLIST_END = register_token("NETLIST_END");
236   m_tok_ALIAS = register_token("ALIAS");
237   m_tok_NET_C = register_token("NET_C");
238   m_tok_PARAM = register_token("PARAM");
239   m_tok_NET_MODEL = register_token("NET_MODEL");
240   m_tok_INCLUDE = register_token("INCLUDE");
241   m_tok_SUBMODEL = register_token("SUBMODEL");
242   m_tok_NETLIST_START = register_token("NETLIST_START");
243   m_tok_NETLIST_END = register_token("NETLIST_END");
244244
245    bool in_nl = false;
245   bool in_nl = false;
246246
247    while (true)
247   while (true)
248248   {
249        token_t token = get_token();
249      token_t token = get_token();
250250
251        if (token.is_type(ENDOFFILE))
252        {
253            return false;
254            //error("EOF while searching for <%s>", nlname.cstr());
255        }
251      if (token.is_type(ENDOFFILE))
252      {
253         return false;
254         //error("EOF while searching for <%s>", nlname.cstr());
255      }
256256
257        if (token.is(m_tok_NETLIST_END))
258        {
259            require_token(m_tok_param_left);
260            if (!in_nl)
261                error("Unexpected NETLIST_END");
262            else
263            {
264                in_nl = false;
265            }
266            require_token(m_tok_param_right);
267        }
268        else if (token.is(m_tok_NETLIST_START))
269        {
270            if (in_nl)
271                error("Unexpected NETLIST_START");
272            require_token(m_tok_param_left);
273            token_t name = get_token();
274            require_token(m_tok_param_right);
275            if (name.str() == nlname || nlname == "")
276            {
277                parse_netlist(name.str());
278                return true;
279            } else
280                in_nl = true;
281        }
257      if (token.is(m_tok_NETLIST_END))
258      {
259         require_token(m_tok_param_left);
260         if (!in_nl)
261            error("Unexpected NETLIST_END");
262         else
263         {
264            in_nl = false;
265         }
266         require_token(m_tok_param_right);
267      }
268      else if (token.is(m_tok_NETLIST_START))
269      {
270         if (in_nl)
271            error("Unexpected NETLIST_START");
272         require_token(m_tok_param_left);
273         token_t name = get_token();
274         require_token(m_tok_param_right);
275         if (name.str() == nlname || nlname == "")
276         {
277            parse_netlist(name.str());
278            return true;
279         } else
280            in_nl = true;
281      }
282282   }
283283}
284284
285285void netlist_parser::parse_netlist(const pstring &nlname)
286286{
287   while (true)
288   {
289      token_t token = get_token();
287290
288    while (true)
289    {
290        token_t token = get_token();
291      if (token.is_type(ENDOFFILE))
292         return;
291293
292        if (token.is_type(ENDOFFILE))
293            return;
294      require_token(m_tok_param_left);
295      NL_VERBOSE_OUT(("Parser: Device: %s\n", token.str().cstr()));
294296
295        require_token(m_tok_param_left);
296        NL_VERBOSE_OUT(("Parser: Device: %s\n", token.str().cstr()));
297
298        if (token.is(m_tok_ALIAS))
299            net_alias();
300        else if (token.is(m_tok_NET_C))
301            net_c();
302        else if (token.is(m_tok_PARAM))
303            netdev_param();
304        else if (token.is(m_tok_NET_MODEL))
305            net_model();
306        else if (token.is(m_tok_SUBMODEL))
307            net_submodel();
308        else if (token.is(m_tok_INCLUDE))
309            net_include();
310        else if (token.is(m_tok_NETLIST_END))
311        {
312            netdev_netlist_end();
313            return;
314        }
315        else
316            device(token.str());
317    }
297      if (token.is(m_tok_ALIAS))
298         net_alias();
299      else if (token.is(m_tok_NET_C))
300         net_c();
301      else if (token.is(m_tok_PARAM))
302         netdev_param();
303      else if (token.is(m_tok_NET_MODEL))
304         net_model();
305      else if (token.is(m_tok_SUBMODEL))
306         net_submodel();
307      else if (token.is(m_tok_INCLUDE))
308         net_include();
309      else if (token.is(m_tok_NETLIST_END))
310      {
311         netdev_netlist_end();
312         return;
313      }
314      else
315         device(token.str());
316   }
318317}
319318
320319
321320void netlist_parser::netdev_netlist_start()
322321{
323    // don't do much
324    token_t name = get_token();
325    require_token(m_tok_param_right);
322   // don't do much
323   token_t name = get_token();
324   require_token(m_tok_param_right);
326325}
327326
328327void netlist_parser::netdev_netlist_end()
329328{
330    // don't do much
331    require_token(m_tok_param_right);
329   // don't do much
330   require_token(m_tok_param_right);
332331}
333332
334333void netlist_parser::net_model()
335334{
336    // don't do much
337    pstring model = get_string();
338    m_setup.register_model(model);
339    require_token(m_tok_param_right);
335   // don't do much
336   pstring model = get_string();
337   m_setup.register_model(model);
338   require_token(m_tok_param_right);
340339}
341340
342341void netlist_parser::net_submodel()
343342{
344    // don't do much
345    pstring name = get_identifier();
346    require_token(m_tok_comma);
347    pstring model = get_identifier();
348    require_token(m_tok_param_right);
343   // don't do much
344   pstring name = get_identifier();
345   require_token(m_tok_comma);
346   pstring model = get_identifier();
347   require_token(m_tok_param_right);
349348
350    m_setup.namespace_push(name);
351    netlist_parser subparser(m_setup);
352    subparser.parse(m_buf, model);
353    m_setup.namespace_pop();
349   m_setup.namespace_push(name);
350   netlist_parser subparser(m_setup);
351   subparser.parse(m_buf, model);
352   m_setup.namespace_pop();
354353}
355354
356355void netlist_parser::net_include()
357356{
358    // don't do much
359    pstring name = get_identifier();
360    require_token(m_tok_param_right);
357   // don't do much
358   pstring name = get_identifier();
359   require_token(m_tok_param_right);
361360
362    netlist_parser subparser(m_setup);
363    subparser.parse(m_buf, name);
361   netlist_parser subparser(m_setup);
362   subparser.parse(m_buf, name);
364363}
365364
366365void netlist_parser::net_alias()
r29404r29405
380379void netlist_parser::net_c()
381380{
382381   pstring last = get_identifier();
383    require_token(m_tok_comma);
382   require_token(m_tok_comma);
384383
385384   while (true)
386385   {
387       pstring t1 = get_identifier();
388       m_setup.register_link(last , t1);
389       token_t n = get_token();
390       if (n.is(m_tok_param_right))
391           break;
392        if (!n.is(m_tok_comma))
393            error("expected a comma, found <%s>", n.str().cstr());
394        last = t1;
386      pstring t1 = get_identifier();
387      m_setup.register_link(last , t1);
388      token_t n = get_token();
389      if (n.is(m_tok_param_right))
390         break;
391      if (!n.is(m_tok_comma))
392         error("expected a comma, found <%s>", n.str().cstr());
393      last = t1;
395394   }
396395
397396   NL_VERBOSE_OUT(("Parser: Connect: %s %s\n", t1.cstr(), t2.cstr()));
r29404r29405
406405   val = eval_param(get_token());
407406   NL_VERBOSE_OUT(("Parser: Param: %s %f\n", param.cstr(), val));
408407   m_setup.register_param(param, val);
409    require_token(m_tok_param_right);
408   require_token(m_tok_param_right);
410409}
411410
412411void netlist_parser::device(const pstring &dev_type)
r29404r29405
427426
428427   NL_VERBOSE_OUT(("Parser: IC: %s\n", devname.cstr()));
429428
430    cnt = 0;
431    while (cnt < def_params.count())
432    {
433        pstring paramfq = devname + "." + def_params[cnt];
429   cnt = 0;
430   while (cnt < def_params.count())
431   {
432      pstring paramfq = devname + "." + def_params[cnt];
434433
435        NL_VERBOSE_OUT(("Defparam: %s\n", paramfq.cstr()));
436        require_token(m_tok_comma);
437        tok = get_token();
438        if (tok.is_type(STRING))
439        {
440            m_setup.register_param(paramfq, tok.str());
441        }
442        else
443        {
444            double val = eval_param(tok);
445            m_setup.register_param(paramfq, val);
446        }
447        cnt++;
448    }
434      NL_VERBOSE_OUT(("Defparam: %s\n", paramfq.cstr()));
435      require_token(m_tok_comma);
436      tok = get_token();
437      if (tok.is_type(STRING))
438      {
439         m_setup.register_param(paramfq, tok.str());
440      }
441      else
442      {
443         double val = eval_param(tok);
444         m_setup.register_param(paramfq, val);
445      }
446      cnt++;
447   }
449448
450449   tok = get_token();
451450   cnt = 0;
r29404r29405
456455      m_setup.register_link(devname + "." + termlist[cnt], output_name);
457456
458457      cnt++;
459       tok = get_token();
458      tok = get_token();
460459   }
461    if (cnt != termlist.count())
462        fatalerror("netlist: input count mismatch for %s - expected %d found %d\n", devname.cstr(), termlist.count(), cnt);
463    require_token(tok, m_tok_param_right);
460   if (cnt != termlist.count())
461      fatalerror("netlist: input count mismatch for %s - expected %d found %d\n", devname.cstr(), termlist.count(), cnt);
462   require_token(tok, m_tok_param_right);
464463}
465464
466465
r29404r29405
483482   for (i=1; i<6;i++)
484483      if (tok.str().equals(macs[i]))
485484         f = i;
486    if (f>0)
487    {
488        require_token(m_tok_param_left);
489        val = get_identifier();
490    }
491    else
492        val = tok.str();
485   if (f>0)
486   {
487      require_token(m_tok_param_left);
488      val = get_identifier();
489   }
490   else
491      val = tok.str();
493492
494    ret = val.as_double(&e);
493   ret = val.as_double(&e);
495494
496    if (e)
495   if (e)
497496      error("Error with parameter ...\n");
498497   if (f>0)
499       require_token(m_tok_param_right);
498      require_token(m_tok_param_right);
500499   return ret * facs[f];
501500}
502
trunk/src/emu/netlist/nl_setup.c
r29404r29405
1919   TTL_INPUT(ttllow, 0)
2020   NET_REGISTER_DEV(gnd, GND)
2121
22    INCLUDE(diode_models);
23    INCLUDE(bjt_models);
22   INCLUDE(diode_models);
23   INCLUDE(bjt_models);
2424
2525NETLIST_END()
2626
r29404r29405
5858
5959ATTR_COLD pstring netlist_setup_t::build_fqn(const pstring &obj_name) const
6060{
61    if (m_stack.empty())
62        return netlist().name() + "." + obj_name;
63    else
64        return m_stack.peek() + "." + obj_name;
61   if (m_stack.empty())
62      return netlist().name() + "." + obj_name;
63   else
64      return m_stack.peek() + "." + obj_name;
6565}
6666
6767void netlist_setup_t::namespace_push(const pstring &aname)
6868{
69    if (m_stack.empty())
70        m_stack.push(netlist().name() + "." + aname);
71    else
72        m_stack.push(m_stack.peek() + "." + aname);
69   if (m_stack.empty())
70      m_stack.push(netlist().name() + "." + aname);
71   else
72      m_stack.push(m_stack.peek() + "." + aname);
7373}
7474
7575void netlist_setup_t::namespace_pop()
7676{
77    m_stack.pop();
77   m_stack.pop();
7878}
7979
8080
8181netlist_device_t *netlist_setup_t::register_dev(netlist_device_t *dev, const pstring &name)
8282{
83    pstring fqn = build_fqn(name);
83   pstring fqn = build_fqn(name);
8484
85    dev->init(netlist(), fqn);
85   dev->init(netlist(), fqn);
8686
8787   if (!(netlist().m_devices.add(fqn, dev, false)==TMERR_NONE))
8888      netlist().error("Error adding %s to device list\n", name.cstr());
r29404r29405
120120   const link_t *p = m_links.first();
121121   while (p != NULL)
122122   {
123       const link_t *n = m_links.next(p);
123      const link_t *n = m_links.next(p);
124124      if (temp.equals(p->e1.substr(0,temp.len())) || temp.equals(p->e2.substr(0,temp.len())))
125125         m_links.remove(*p);
126126      p = n;
r29404r29405
135135
136136void netlist_setup_t::register_alias_nofqn(const pstring &alias, const pstring &out)
137137{
138    if (!(m_alias.add(alias, out, false)==TMERR_NONE))
139        netlist().error("Error adding alias %s to alias list\n", alias.cstr());
138   if (!(m_alias.add(alias, out, false)==TMERR_NONE))
139      netlist().error("Error adding alias %s to alias list\n", alias.cstr());
140140}
141141
142142void netlist_setup_t::register_alias(const pstring &alias, const pstring &out)
143143{
144    pstring alias_fqn = build_fqn(alias);
145    pstring out_fqn = build_fqn(out);
146    register_alias_nofqn(alias_fqn, out_fqn);
144   pstring alias_fqn = build_fqn(alias);
145   pstring out_fqn = build_fqn(out);
146   register_alias_nofqn(alias_fqn, out_fqn);
147147}
148148
149149pstring netlist_setup_t::objtype_as_astr(netlist_object_t &in) const
r29404r29405
241241                           //int pl=m_models[i].find("(");
242242                           //int pr=m_models[i].find(")");
243243                           //dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i].substr(pl+1,pr-pl-1));
244                                    dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i]);
244                           dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i]);
245245                           found = true;
246246                           break;
247247                        }
r29404r29405
269269
270270void netlist_setup_t::register_link_arr(const pstring &terms)
271271{
272    nl_util::pstring_list list = nl_util::split(terms,", ");
273    if (list.count() < 2)
274        netlist().error("You must pass at least 2 terminals to NET_C");
275    pstring last = list[0];
276    for (int i = 1; i < list.count(); i++)
277    {
278        register_link(last, list[i]);
279        last = list[i];
280    }
272   nl_util::pstring_list list = nl_util::split(terms,", ");
273   if (list.count() < 2)
274      netlist().error("You must pass at least 2 terminals to NET_C");
275   pstring last = list[0];
276   for (int i = 1; i < list.count(); i++)
277   {
278      register_link(last, list[i]);
279      last = list[i];
280   }
281281}
282282
283283
r29404r29405
298298
299299void netlist_setup_t::register_param(const pstring &param, const pstring &value)
300300{
301    pstring fqn = build_fqn(param);
301   pstring fqn = build_fqn(param);
302302
303303   if (!(m_params_temp.add(fqn, value, false)==TMERR_NONE))
304304      netlist().error("Error adding parameter %s to parameter list\n", param.cstr());
r29404r29405
368368
369369netlist_param_t *netlist_setup_t::find_param(const pstring &param_in, bool required)
370370{
371    const pstring param_in_fqn = build_fqn(param_in);
371   const pstring param_in_fqn = build_fqn(param_in);
372372
373373   const pstring &outname = resolve_alias(param_in_fqn);
374374   netlist_param_t *ret;
r29404r29405
383383
384384nld_base_d_to_a_proxy *netlist_setup_t::get_d_a_proxy(netlist_output_t &out)
385385{
386    assert(out.isFamily(netlist_terminal_t::LOGIC));
386   assert(out.isFamily(netlist_terminal_t::LOGIC));
387387
388    //printf("proxy for %s\n", out.name().cstr());;
389    netlist_logic_output_t &out_cast = dynamic_cast<netlist_logic_output_t &>(out);
390    nld_base_d_to_a_proxy *proxy = out_cast.get_proxy();
388   //printf("proxy for %s\n", out.name().cstr());;
389   netlist_logic_output_t &out_cast = dynamic_cast<netlist_logic_output_t &>(out);
390   nld_base_d_to_a_proxy *proxy = out_cast.get_proxy();
391391
392    if (proxy == NULL)
393    {
394        // create a new one ...
395        proxy = new nld_d_to_a_proxy(out);
396        pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
397        m_proxy_cnt++;
392   if (proxy == NULL)
393   {
394      // create a new one ...
395      proxy = new nld_d_to_a_proxy(out);
396      pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
397      m_proxy_cnt++;
398398
399        register_dev(proxy, x);
400        proxy->start_dev();
399      register_dev(proxy, x);
400      proxy->start_dev();
401401
402402#if 1
403        /* connect all existing terminals to new net */
403      /* connect all existing terminals to new net */
404404
405        netlist_core_terminal_t *p = out.net().m_list.first();
406        while (p != NULL)
407        {
408            netlist_core_terminal_t *np = out.net().m_list.next(p);
409            p->clear_net(); // de-link from all nets ...
410            connect(proxy->out(), *p);
411            p = np;
412        }
413        out.net().m_list.clear(); // clear the list
414        out.net().m_num_cons = 0;
405      netlist_core_terminal_t *p = out.net().m_list.first();
406      while (p != NULL)
407      {
408         netlist_core_terminal_t *np = out.net().m_list.next(p);
409         p->clear_net(); // de-link from all nets ...
410         connect(proxy->out(), *p);
411         p = np;
412      }
413      out.net().m_list.clear(); // clear the list
414      out.net().m_num_cons = 0;
415415#endif
416        out.net().register_con(proxy->m_I);
417        out_cast.set_proxy(proxy);
416      out.net().register_con(proxy->m_I);
417      out_cast.set_proxy(proxy);
418418
419    }
420    return proxy;
419   }
420   return proxy;
421421}
422422
423423void netlist_setup_t::connect_input_output(netlist_input_t &in, netlist_output_t &out)
r29404r29405
429429      m_proxy_cnt++;
430430
431431      register_dev(proxy, x);
432        proxy->start_dev();
432      proxy->start_dev();
433433
434434      proxy->m_Q.net().register_con(in);
435435      out.net().register_con(proxy->m_I);
r29404r29405
437437   }
438438   else if (out.isFamily(netlist_terminal_t::LOGIC) && in.isFamily(netlist_terminal_t::ANALOG))
439439   {
440        nld_base_d_to_a_proxy *proxy = get_d_a_proxy(out);
440      nld_base_d_to_a_proxy *proxy = get_d_a_proxy(out);
441441
442        connect_terminals(proxy->out(), in);
443        //proxy->out().net().register_con(in);
442      connect_terminals(proxy->out(), in);
443      //proxy->out().net().register_con(in);
444444   }
445445   else
446446   {
r29404r29405
462462      m_proxy_cnt++;
463463
464464      register_dev(proxy, x);
465        proxy->start_dev();
465      proxy->start_dev();
466466
467467      connect_terminals(term, proxy->m_I);
468468
r29404r29405
536536
537537static netlist_core_terminal_t &resolve_proxy(netlist_core_terminal_t &term)
538538{
539    if (term.isType(netlist_core_terminal_t::OUTPUT) && term.isFamily(netlist_core_terminal_t::LOGIC))
540    {
541        netlist_logic_output_t &out = dynamic_cast<netlist_logic_output_t &>(term);
542        if (out.has_proxy())
543            return out.get_proxy()->out();
544    }
545    return term;
539   if (term.isType(netlist_core_terminal_t::OUTPUT) && term.isFamily(netlist_core_terminal_t::LOGIC))
540   {
541      netlist_logic_output_t &out = dynamic_cast<netlist_logic_output_t &>(term);
542      if (out.has_proxy())
543         return out.get_proxy()->out();
544   }
545   return term;
546546}
547547
548548void netlist_setup_t::connect(netlist_core_terminal_t &t1_in, netlist_core_terminal_t &t2_in)
r29404r29405
560560   else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::OUTPUT))
561561   {
562562      if (t1.has_net()  && t1.net().isRailNet())
563          netlist().error("Input %s already connected\n", t1.name().cstr());
563         netlist().error("Input %s already connected\n", t1.name().cstr());
564564      connect_input_output(dynamic_cast<netlist_input_t &>(t1), dynamic_cast<netlist_output_t &>(t2));
565565   }
566566   else if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
r29404r29405
589589
590590void netlist_setup_t::resolve_inputs()
591591{
592    bool has_twoterms = false;
592   bool has_twoterms = false;
593593
594    netlist().log("Resolving inputs ...");
594   netlist().log("Resolving inputs ...");
595595
596596   for (const link_t *entry = m_links.first(); entry != NULL; entry = m_links.next(entry))
597597   {
r29404r29405
612612         //VERBOSE_OUT(("%s %d\n", out->netdev()->name(), *out->Q_ptr()));
613613   }
614614
615    netlist().log("deleting empty nets ...");
615   netlist().log("deleting empty nets ...");
616616
617617   // delete empty nets ... and save m_list ...
618618
619    netlist_net_t::list_t todelete;
619   netlist_net_t::list_t todelete;
620620
621621   for (netlist_net_t *const *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
622622   {
623623      if ((*pn)->m_list.is_empty())
624624      {
625          todelete.add(*pn);
625         todelete.add(*pn);
626626      }
627627      else
628628      {
629          for (netlist_core_terminal_t *p = (*pn)->m_list.first(); p != NULL; p = (*pn)->m_list.next(p))
630              (*pn)->m_registered.add(p);
629         for (netlist_core_terminal_t *p = (*pn)->m_list.first(); p != NULL; p = (*pn)->m_list.next(p))
630            (*pn)->m_registered.add(p);
631631      }
632632   }
633633
634    for (int i=0; i < todelete.count(); i++)
635    {
636        netlist().log("Deleting net %s ...", todelete[i]->name().cstr());
637        netlist().m_nets.remove(todelete[i]);
638        if (!todelete[i]->isRailNet())
639            delete todelete[i];
640    }
634   for (int i=0; i < todelete.count(); i++)
635   {
636      netlist().log("Deleting net %s ...", todelete[i]->name().cstr());
637      netlist().m_nets.remove(todelete[i]);
638      if (!todelete[i]->isRailNet())
639         delete todelete[i];
640   }
641641
642    pstring errstr("");
642   pstring errstr("");
643643
644    netlist().log("looking for terminals not connected ...");
645    for (tagmap_terminal_t::entry_t *entry = m_terminals.first(); entry != NULL; entry = m_terminals.next(entry))
646    {
647        if (!entry->object()->has_net())
648            errstr += pstring::sprintf("Found terminal %s without a net\n",
649                    entry->object()->name().cstr());
650        else if (entry->object()->net().num_cons() == 0)
651            netlist().warning("Found terminal %s without connections",
652                    entry->object()->name().cstr());
653    }
654    if (errstr != "")
655        netlist().error("%s", errstr.cstr());
644   netlist().log("looking for terminals not connected ...");
645   for (tagmap_terminal_t::entry_t *entry = m_terminals.first(); entry != NULL; entry = m_terminals.next(entry))
646   {
647      if (!entry->object()->has_net())
648         errstr += pstring::sprintf("Found terminal %s without a net\n",
649               entry->object()->name().cstr());
650      else if (entry->object()->net().num_cons() == 0)
651         netlist().warning("Found terminal %s without connections",
652               entry->object()->name().cstr());
653   }
654   if (errstr != "")
655      netlist().error("%s", errstr.cstr());
656656
657657
658    netlist().log("looking for two terms connected to rail nets ...\n");
659    for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
660    {
661        NETLIB_NAME(twoterm) *t = dynamic_cast<NETLIB_NAME(twoterm) *>(entry->object());
662        if (t != NULL)
663        {
664            has_twoterms = true;
665            if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
666                netlist().error("Found device %s connected only to railterminals %s/%s\n",
667                        t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
668        }
669    }
658   netlist().log("looking for two terms connected to rail nets ...\n");
659   for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
660   {
661      NETLIB_NAME(twoterm) *t = dynamic_cast<NETLIB_NAME(twoterm) *>(entry->object());
662      if (t != NULL)
663      {
664         has_twoterms = true;
665         if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
666            netlist().error("Found device %s connected only to railterminals %s/%s\n",
667                  t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
668      }
669   }
670670
671    netlist().log("initialize solver ...\n");
671   netlist().log("initialize solver ...\n");
672672
673673   if (m_netlist.solver() == NULL)
674674   {
675       if (has_twoterms)
676           netlist().error("No solver found for this net although analog elements are present\n");
675      if (has_twoterms)
676         netlist().error("No solver found for this net although analog elements are present\n");
677677   }
678678   else
679679      m_netlist.solver()->post_start();
trunk/src/emu/netlist/nl_parser.h
r29404r29405
1212
1313class ptokenizer
1414{
15    NETLIST_PREVENT_COPYING(ptokenizer)
15   NETLIST_PREVENT_COPYING(ptokenizer)
1616public:
17    virtual ~ptokenizer() {}
17   virtual ~ptokenizer() {}
1818
19    ptokenizer()
20    : m_line(1), m_line_ptr(NULL), m_px(NULL)
21    {}
19   ptokenizer()
20   : m_line(1), m_line_ptr(NULL), m_px(NULL)
21   {}
2222
23    enum token_type
24    {
25        IDENTIFIER,
26        NUMBER,
27        TOKEN,
28        STRING,
29        COMMENT,
30        UNKNOWN,
31        ENDOFFILE,
32    };
23   enum token_type
24   {
25      IDENTIFIER,
26      NUMBER,
27      TOKEN,
28      STRING,
29      COMMENT,
30      UNKNOWN,
31      ENDOFFILE,
32   };
3333
34    struct token_id_t
35    {
36    public:
37        token_id_t() : m_id(-2) {}
38        token_id_t(const int id) : m_id(id) {}
39        const int id() const { return m_id; }
40    private:
41        int m_id;
42    };
34   struct token_id_t
35   {
36   public:
37      token_id_t() : m_id(-2) {}
38      token_id_t(const int id) : m_id(id) {}
39      const int id() const { return m_id; }
40   private:
41      int m_id;
42   };
4343
44    struct token_t
45    {
46        token_t() {};
47        token_t(token_type type)
48        {
49            m_type = type;
50            m_id = token_id_t(-1);
51            m_token ="";
52        }
53        token_t(token_type type, const pstring str)
54        {
55            m_type = type;
56            m_id = token_id_t(-1);
57            m_token = str;
58        }
59        token_t(const token_id_t id, const pstring str)
60        {
61            m_type = TOKEN;
62            m_id = id;
63            m_token = str;
64        }
44   struct token_t
45   {
46      token_t() {};
47      token_t(token_type type)
48      {
49         m_type = type;
50         m_id = token_id_t(-1);
51         m_token ="";
52      }
53      token_t(token_type type, const pstring str)
54      {
55         m_type = type;
56         m_id = token_id_t(-1);
57         m_token = str;
58      }
59      token_t(const token_id_t id, const pstring str)
60      {
61         m_type = TOKEN;
62         m_id = id;
63         m_token = str;
64      }
6565
66        bool is(const token_id_t &tok_id) const { return m_id.id() == tok_id.id(); }
67        bool is_not(const token_id_t &tok_id) const { return !is(tok_id); }
66      bool is(const token_id_t &tok_id) const { return m_id.id() == tok_id.id(); }
67      bool is_not(const token_id_t &tok_id) const { return !is(tok_id); }
6868
69        bool is_type(const token_type type) const { return m_type == type; }
69      bool is_type(const token_type type) const { return m_type == type; }
7070
71        pstring str() const { return m_token; }
71      pstring str() const { return m_token; }
7272
73    private:
74        token_type m_type;
75        token_id_t m_id;
76        pstring m_token;
77    };
73   private:
74      token_type m_type;
75      token_id_t m_id;
76      pstring m_token;
77   };
7878
7979
80    int currentline_no() { return m_line; }
81    pstring currentline_str();
80   int currentline_no() { return m_line; }
81   pstring currentline_str();
8282
83    /* tokenizer stuff follows ... */
83   /* tokenizer stuff follows ... */
8484
85    token_t get_token();
86    pstring get_string();
87    pstring get_identifier();
85   token_t get_token();
86   pstring get_string();
87   pstring get_identifier();
8888
89    void require_token(const token_id_t &token_num);
90    void require_token(const token_t tok, const token_id_t &token_num);
89   void require_token(const token_id_t &token_num);
90   void require_token(const token_t tok, const token_id_t &token_num);
9191
92    token_id_t register_token(pstring token)
93    {
94        m_tokens.add(token);
95        return token_id_t(m_tokens.count() - 1);
96    }
92   token_id_t register_token(pstring token)
93   {
94      m_tokens.add(token);
95      return token_id_t(m_tokens.count() - 1);
96   }
9797
98    void set_identifier_chars(pstring s) { m_identifier_chars = s; }
99    void set_number_chars(pstring s) { m_number_chars = s; }
100    void set_whitespace(pstring s) { m_whitespace = s; }
101    void set_comment(pstring start, pstring end, pstring line)
102    {
103        m_tok_comment_start = register_token(start);
104        m_tok_comment_end = register_token(end);
105        m_tok_line_comment = register_token(line);
106        m_string = '"';
107    }
98   void set_identifier_chars(pstring s) { m_identifier_chars = s; }
99   void set_number_chars(pstring s) { m_number_chars = s; }
100   void set_whitespace(pstring s) { m_whitespace = s; }
101   void set_comment(pstring start, pstring end, pstring line)
102   {
103      m_tok_comment_start = register_token(start);
104      m_tok_comment_end = register_token(end);
105      m_tok_line_comment = register_token(line);
106      m_string = '"';
107   }
108108
109    token_t get_token_internal();
110    void error(const char *format, ...) ATTR_PRINTF(2,3);
109   token_t get_token_internal();
110   void error(const char *format, ...) ATTR_PRINTF(2,3);
111111
112112protected:
113    void reset(const char *p) { m_px = p; m_line = 1; m_line_ptr = p; }
114    virtual void verror(pstring msg, int line_num, pstring line) = 0;
113   void reset(const char *p) { m_px = p; m_line = 1; m_line_ptr = p; }
114   virtual void verror(pstring msg, int line_num, pstring line) = 0;
115115
116116private:
117    void skipeol();
117   void skipeol();
118118
119    unsigned char getc();
120    void ungetc();
121    bool eof() { return *m_px == 0; }
119   unsigned char getc();
120   void ungetc();
121   bool eof() { return *m_px == 0; }
122122
123    int m_line;
124    const char * m_line_ptr;
125    const char * m_px;
123   int m_line;
124   const char * m_line_ptr;
125   const char * m_px;
126126
127    /* tokenizer stuff follows ... */
127   /* tokenizer stuff follows ... */
128128
129    pstring m_identifier_chars;
130    pstring m_number_chars;
131    netlist_list_t<pstring> m_tokens;
132    pstring m_whitespace;
133    char  m_string;
129   pstring m_identifier_chars;
130   pstring m_number_chars;
131   netlist_list_t<pstring> m_tokens;
132   pstring m_whitespace;
133   char  m_string;
134134
135    token_id_t m_tok_comment_start;
136    token_id_t m_tok_comment_end;
137    token_id_t m_tok_line_comment;
135   token_id_t m_tok_comment_start;
136   token_id_t m_tok_comment_end;
137   token_id_t m_tok_line_comment;
138138};
139139
140140class netlist_parser : public ptokenizer
r29404r29405
146146
147147   bool parse(const char *buf, const pstring nlname = "");
148148
149    void parse_netlist(const pstring &nlname);
149   void parse_netlist(const pstring &nlname);
150150   void net_alias();
151151   void netdev_param();
152152   void net_c();
153153   void device(const pstring &dev_type);
154    void netdev_netlist_start();
155    void netdev_netlist_end();
156    void net_model();
157    void net_submodel();
158    void net_include();
154   void netdev_netlist_start();
155   void netdev_netlist_end();
156   void net_model();
157   void net_submodel();
158   void net_include();
159159
160160protected:
161    virtual void verror(pstring msg, int line_num, pstring line);
161   virtual void verror(pstring msg, int line_num, pstring line);
162162private:
163163
164    double eval_param(const token_t tok);
164   double eval_param(const token_t tok);
165165
166    token_id_t m_tok_param_left;
167    token_id_t m_tok_param_right;
168    token_id_t m_tok_comma;
169    token_id_t m_tok_ALIAS;
170    token_id_t m_tok_NET_C;
171    token_id_t m_tok_PARAM;
172    token_id_t m_tok_NET_MODEL;
173    token_id_t m_tok_NETLIST_START;
174    token_id_t m_tok_NETLIST_END;
175    token_id_t m_tok_SUBMODEL;
176    token_id_t m_tok_INCLUDE;
166   token_id_t m_tok_param_left;
167   token_id_t m_tok_param_right;
168   token_id_t m_tok_comma;
169   token_id_t m_tok_ALIAS;
170   token_id_t m_tok_NET_C;
171   token_id_t m_tok_PARAM;
172   token_id_t m_tok_NET_MODEL;
173   token_id_t m_tok_NETLIST_START;
174   token_id_t m_tok_NETLIST_END;
175   token_id_t m_tok_SUBMODEL;
176   token_id_t m_tok_INCLUDE;
177177
178    netlist_setup_t &m_setup;
178   netlist_setup_t &m_setup;
179179
180    const char *m_buf;
180   const char *m_buf;
181181};
182182
183183class netlist_source_t
184184{
185185public:
186    typedef netlist_list_t<netlist_source_t> list_t;
186   typedef netlist_list_t<netlist_source_t> list_t;
187187
188    enum source_e
189    {
190        EMPTY,
191        STRING,
192        PROC,
193        MEMORY
194    };
188   enum source_e
189   {
190      EMPTY,
191      STRING,
192      PROC,
193      MEMORY
194   };
195195
196    netlist_source_t()
197    : m_type(EMPTY),
198      m_setup_func(NULL),
199      m_setup_func_name(""),
200      m_mem(NULL)
201    {
202    }
196   netlist_source_t()
197   : m_type(EMPTY),
198      m_setup_func(NULL),
199      m_setup_func_name(""),
200      m_mem(NULL)
201   {
202   }
203203
204    netlist_source_t(pstring name, void (*setup_func)(netlist_setup_t &))
205    : m_type(PROC),
206      m_setup_func(setup_func),
207      m_setup_func_name(name),
208      m_mem(NULL)
209    {
210    }
204   netlist_source_t(pstring name, void (*setup_func)(netlist_setup_t &))
205   : m_type(PROC),
206      m_setup_func(setup_func),
207      m_setup_func_name(name),
208      m_mem(NULL)
209   {
210   }
211211
212    netlist_source_t(const char *mem)
213    : m_type(MEMORY),
214      m_setup_func(NULL),
215      m_setup_func_name(""),
216      m_mem(mem)
217    {
218    }
212   netlist_source_t(const char *mem)
213   : m_type(MEMORY),
214      m_setup_func(NULL),
215      m_setup_func_name(""),
216      m_mem(mem)
217   {
218   }
219219
220    ~netlist_source_t() { }
220   ~netlist_source_t() { }
221221
222    bool parse(netlist_setup_t &setup, const pstring name)
223    {
224        switch (m_type)
225        {
226            case PROC:
227                if (name == m_setup_func_name)
228                {
229                    m_setup_func(setup);
230                    return true;
231                }
232                break;
233            case MEMORY:
234                {
235                    netlist_parser p(setup);
236                    return p.parse(m_mem, name);
237                }
238                break;
239            case STRING:
240            case EMPTY:
241                break;
242        }
243        return false;
244    }
222   bool parse(netlist_setup_t &setup, const pstring name)
223   {
224      switch (m_type)
225      {
226         case PROC:
227            if (name == m_setup_func_name)
228            {
229               m_setup_func(setup);
230               return true;
231            }
232            break;
233         case MEMORY:
234            {
235               netlist_parser p(setup);
236               return p.parse(m_mem, name);
237            }
238            break;
239         case STRING:
240         case EMPTY:
241            break;
242      }
243      return false;
244   }
245245private:
246    source_e m_type;
246   source_e m_type;
247247
248    void (*m_setup_func)(netlist_setup_t &);
249    pstring m_setup_func_name;
250    const char *m_mem;
248   void (*m_setup_func)(netlist_setup_t &);
249   pstring m_setup_func_name;
250   const char *m_mem;
251251
252252};
253253
254254class netlist_sources_t
255255{
256256public:
257    void add(netlist_source_t src)
258    {
259        m_list.add(src);
260    }
257   void add(netlist_source_t src)
258   {
259      m_list.add(src);
260   }
261261
262    void parse(netlist_setup_t &setup, const pstring name)
263    {
264        for (int i=0; i < m_list.count(); i++)
265        {
266            if (m_list[i].parse(setup, name))
267                return;
268        }
269        setup.netlist().error("unable to find %s in source collection", name.cstr());
270    }
262   void parse(netlist_setup_t &setup, const pstring name)
263   {
264      for (int i=0; i < m_list.count(); i++)
265      {
266         if (m_list[i].parse(setup, name))
267            return;
268      }
269      setup.netlist().error("unable to find %s in source collection", name.cstr());
270   }
271271
272272private:
273    netlist_source_t::list_t m_list;
273   netlist_source_t::list_t m_list;
274274};
275275
276276#endif /* NL_PARSER_H_ */
trunk/src/emu/netlist/pstring.h
r29404r29405
9797   inline const char *cstr() const { return m_ptr->str(); }
9898
9999   // concatenation operators
100    pstring& operator+=(const char c) { char buf[2] = { c, 0 }; pcat(buf); return *this; }
100   pstring& operator+=(const char c) { char buf[2] = { c, 0 }; pcat(buf); return *this; }
101101   pstring& operator+=(const pstring &string) { pcat(string.cstr()); return *this; }
102102   friend pstring operator+(const pstring &lhs, const pstring &rhs) { return pstring(lhs) += rhs; }
103103   friend pstring operator+(const pstring &lhs, const char *rhs) { return pstring(lhs) += rhs; }
r29404r29405
133133      return (result != NULL) ? (result - cstr()) : -1;
134134   }
135135
136    inline int find(const char search, int start = 0) const
137    {
138        int alen = len();
139        const char *result = strchr(cstr() + MIN(start, alen), search);
140        return (result != NULL) ? (result - cstr()) : -1;
141    }
136   inline int find(const char search, int start = 0) const
137   {
138      int alen = len();
139      const char *result = strchr(cstr() + MIN(start, alen), search);
140      return (result != NULL) ? (result - cstr()) : -1;
141   }
142142
143143   // various
144144
r29404r29405
174174
175175   struct str_t
176176   {
177        str_t() : m_ref_count(1), m_len(0) { m_str[0] = 0; }
177      str_t() : m_ref_count(1), m_len(0) { m_str[0] = 0; }
178178      str_t(int alen) : m_ref_count(1), m_len(alen) { m_str[0] = 0; }
179179
180180      char *str() { return &m_str[0]; }
trunk/src/emu/netlist/nl_lists.h
r29404r29405
2222{
2323public:
2424
25    ATTR_COLD netlist_list_t(int numElements = _NumElem)
26    {
27        m_num_elements = numElements;
28        m_list = new _ListClass[m_num_elements];
29        m_count = 0;
30    }
25   ATTR_COLD netlist_list_t(int numElements = _NumElem)
26   {
27      m_num_elements = numElements;
28      m_list = new _ListClass[m_num_elements];
29      m_count = 0;
30   }
3131
32    ATTR_COLD netlist_list_t(const netlist_list_t &rhs)
33    {
34        m_num_elements = rhs.capacity();
35        m_list = new _ListClass[m_num_elements];
36        m_count = 0;
37        for (int i=0; i<rhs.count(); i++)
38        {
39            this->add(rhs[i]);
40        }
41    }
32   ATTR_COLD netlist_list_t(const netlist_list_t &rhs)
33   {
34      m_num_elements = rhs.capacity();
35      m_list = new _ListClass[m_num_elements];
36      m_count = 0;
37      for (int i=0; i<rhs.count(); i++)
38      {
39         this->add(rhs[i]);
40      }
41   }
4242
43    ATTR_COLD netlist_list_t &operator=(const netlist_list_t &rhs)
44    {
45        this->reset();
46        for (int i=0; i<rhs.count(); i++)
47        {
48            this->add(rhs[i]);
49        }
50        return *this;
51    }
43   ATTR_COLD netlist_list_t &operator=(const netlist_list_t &rhs)
44   {
45      this->reset();
46      for (int i=0; i<rhs.count(); i++)
47      {
48         this->add(rhs[i]);
49      }
50      return *this;
51   }
5252
5353
54    ATTR_COLD ~netlist_list_t()
55    {
56        delete[] m_list;
57    }
54   ATTR_COLD ~netlist_list_t()
55   {
56      delete[] m_list;
57   }
5858
59    ATTR_HOT inline void add(const _ListClass &elem)
60    {
61        if (m_count >= m_num_elements)
62            resize(m_num_elements * 2);
59   ATTR_HOT inline void add(const _ListClass &elem)
60   {
61      if (m_count >= m_num_elements)
62         resize(m_num_elements * 2);
6363
64        m_list[m_count++] = elem;
65    }
64      m_list[m_count++] = elem;
65   }
6666
67    ATTR_HOT inline void resize(const int new_size)
68    {
69        int cnt = count();
70        _ListClass *m_new = new _ListClass[new_size];
71        _ListClass *pd = m_new;
67   ATTR_HOT inline void resize(const int new_size)
68   {
69      int cnt = count();
70      _ListClass *m_new = new _ListClass[new_size];
71      _ListClass *pd = m_new;
7272
73        for (_ListClass *ps = m_list; ps < m_list + cnt; ps++, pd++)
74            *pd = *ps;
75        delete[] m_list;
76        m_list = m_new;
77        m_count = cnt;
78        m_num_elements = new_size;
79    }
73      for (_ListClass *ps = m_list; ps < m_list + cnt; ps++, pd++)
74         *pd = *ps;
75      delete[] m_list;
76      m_list = m_new;
77      m_count = cnt;
78      m_num_elements = new_size;
79   }
8080
81    ATTR_HOT inline void remove(const _ListClass &elem)
82    {
83        for (int i = 0; i < m_count; i++)
84        {
85            if (m_list[i] == elem)
86            {
87                m_count --;
88                while (i < m_count)
89                {
90                    m_list[i] = m_list[i+1];
91                    i++;
92                }
93                return;
94            }
95        }
96    }
81   ATTR_HOT inline void remove(const _ListClass &elem)
82   {
83      for (int i = 0; i < m_count; i++)
84      {
85         if (m_list[i] == elem)
86         {
87            m_count --;
88            while (i < m_count)
89            {
90               m_list[i] = m_list[i+1];
91               i++;
92            }
93            return;
94         }
95      }
96   }
9797
98    ATTR_HOT inline void remove_at(const int pos)
99    {
100        assert((pos>=0) && (pos<m_count));
101        m_count--;
102        for (int i = pos; i < m_count; i++)
103        {
104            m_list[i] = m_list[i+1];
105        }
106    }
98   ATTR_HOT inline void remove_at(const int pos)
99   {
100      assert((pos>=0) && (pos<m_count));
101      m_count--;
102      for (int i = pos; i < m_count; i++)
103      {
104         m_list[i] = m_list[i+1];
105      }
106   }
107107
108    ATTR_HOT inline bool contains(const _ListClass &elem) const
109    {
110        for (_ListClass *i = m_list; i < m_list + m_count; i++)
111        {
112            if (*i == elem)
113                return true;
114        }
115        return false;
116    }
108   ATTR_HOT inline bool contains(const _ListClass &elem) const
109   {
110      for (_ListClass *i = m_list; i < m_list + m_count; i++)
111      {
112         if (*i == elem)
113            return true;
114      }
115      return false;
116   }
117117
118    ATTR_HOT inline int indexof(const _ListClass &elem) const
119    {
120        for (int i = 0; i < m_count; i++)
121        {
122            if (m_list[i] == elem)
123                return i;
124        }
125        return -1;
126    }
118   ATTR_HOT inline int indexof(const _ListClass &elem) const
119   {
120      for (int i = 0; i < m_count; i++)
121      {
122         if (m_list[i] == elem)
123            return i;
124      }
125      return -1;
126   }
127127
128    ATTR_HOT inline const _ListClass *first() const { return ((m_count > 0) ? &m_list[0] : NULL ); }
129    ATTR_HOT inline const _ListClass *next(const _ListClass *lc) const { return ((lc < last()) ? lc + 1 : NULL ); }
130    ATTR_HOT inline const _ListClass *last() const { return &m_list[m_count -1]; }
131    ATTR_HOT inline int count() const { return m_count; }
132    ATTR_HOT inline bool empty() const { return (m_count == 0); }
133    ATTR_HOT inline void clear() { m_count = 0; }
134    ATTR_HOT inline int capacity() const { return m_num_elements; }
128   ATTR_HOT inline const _ListClass *first() const { return ((m_count > 0) ? &m_list[0] : NULL ); }
129   ATTR_HOT inline const _ListClass *next(const _ListClass *lc) const { return ((lc < last()) ? lc + 1 : NULL ); }
130   ATTR_HOT inline const _ListClass *last() const { return &m_list[m_count -1]; }
131   ATTR_HOT inline int count() const { return m_count; }
132   ATTR_HOT inline bool empty() const { return (m_count == 0); }
133   ATTR_HOT inline void clear() { m_count = 0; }
134   ATTR_HOT inline int capacity() const { return m_num_elements; }
135135
136    ATTR_COLD void clear_and_free()
137    {
138        for (_ListClass *i = m_list; i < m_list + m_count; i++)
139        {
140            delete *i;
141        }
142        clear();
143    }
136   ATTR_COLD void clear_and_free()
137   {
138      for (_ListClass *i = m_list; i < m_list + m_count; i++)
139      {
140         delete *i;
141      }
142      clear();
143   }
144144
145    ATTR_HOT inline _ListClass& operator[](const int & index) { return m_list[index]; }
146    ATTR_HOT inline const _ListClass& operator[](const int & index) const { return m_list[index]; }
145   ATTR_HOT inline _ListClass& operator[](const int & index) { return m_list[index]; }
146   ATTR_HOT inline const _ListClass& operator[](const int & index) const { return m_list[index]; }
147147
148148private:
149    int m_count;
150    _ListClass * m_list;
151    int m_num_elements;
149   int m_count;
150   _ListClass * m_list;
151   int m_num_elements;
152152};
153153
154154// ----------------------------------------------------------------------------------------
r29404r29405
158158template <class _Element, class _Time, int _Size>
159159class netlist_timed_queue
160160{
161    NETLIST_PREVENT_COPYING(netlist_timed_queue)
161   NETLIST_PREVENT_COPYING(netlist_timed_queue)
162162public:
163163
164    class entry_t
165    {
166    public:
167        ATTR_HOT inline entry_t()
168        : m_exec_time(), m_object() {}
169        ATTR_HOT inline entry_t(const _Time atime, const _Element elem) : m_exec_time(atime), m_object(elem) {}
170        ATTR_HOT inline const _Time exec_time() const { return m_exec_time; }
171        ATTR_HOT inline const _Element object() const { return m_object; }
164   class entry_t
165   {
166   public:
167      ATTR_HOT inline entry_t()
168      : m_exec_time(), m_object() {}
169      ATTR_HOT inline entry_t(const _Time atime, const _Element elem) : m_exec_time(atime), m_object(elem) {}
170      ATTR_HOT inline const _Time exec_time() const { return m_exec_time; }
171      ATTR_HOT inline const _Element object() const { return m_object; }
172172
173    private:
174        _Time m_exec_time;
175        _Element m_object;
176    };
173   private:
174      _Time m_exec_time;
175      _Element m_object;
176   };
177177
178    netlist_timed_queue()
179    {
180        //m_list = global_alloc_array(entry_t, SIZE);
181        clear();
182    }
178   netlist_timed_queue()
179   {
180      //m_list = global_alloc_array(entry_t, SIZE);
181      clear();
182   }
183183
184    ATTR_HOT inline int capacity() const { return _Size; }
185    ATTR_HOT inline bool is_empty() const { return (m_end == &m_list[0]); }
186    ATTR_HOT inline bool is_not_empty() const { return (m_end > &m_list[0]); }
184   ATTR_HOT inline int capacity() const { return _Size; }
185   ATTR_HOT inline bool is_empty() const { return (m_end == &m_list[0]); }
186   ATTR_HOT inline bool is_not_empty() const { return (m_end > &m_list[0]); }
187187
188    ATTR_HOT ATTR_ALIGN void push(const entry_t &e)
189    {
190        entry_t * i = m_end++;
191        const _Time e_time = e.exec_time();
192        while ((i > &m_list[0]) && (e_time > (i - 1)->exec_time()) )
193        {
194            *(i) = *(i-1);
195            i--;
196            inc_stat(m_prof_sortmove);
197        }
198        *i = e;
199        inc_stat(m_prof_sort);
200        assert(m_end - m_list < _Size);
201    }
188   ATTR_HOT ATTR_ALIGN void push(const entry_t &e)
189   {
190      entry_t * i = m_end++;
191      const _Time e_time = e.exec_time();
192      while ((i > &m_list[0]) && (e_time > (i - 1)->exec_time()) )
193      {
194         *(i) = *(i-1);
195         i--;
196         inc_stat(m_prof_sortmove);
197      }
198      *i = e;
199      inc_stat(m_prof_sort);
200      assert(m_end - m_list < _Size);
201   }
202202
203    ATTR_HOT inline const entry_t *pop()
204    {
205        return --m_end;
206    }
203   ATTR_HOT inline const entry_t *pop()
204   {
205      return --m_end;
206   }
207207
208    ATTR_HOT inline const entry_t *peek() const
209    {
210        return (m_end-1);
211    }
208   ATTR_HOT inline const entry_t *peek() const
209   {
210      return (m_end-1);
211   }
212212
213    ATTR_COLD void clear()
214    {
215        m_end = &m_list[0];
216    }
213   ATTR_COLD void clear()
214   {
215      m_end = &m_list[0];
216   }
217217
218    // save state support & mame disasm
218   // save state support & mame disasm
219219
220    ATTR_COLD inline const entry_t *listptr() const { return &m_list[0]; }
221    ATTR_HOT inline int count() const { return m_end - m_list; }
222    ATTR_HOT inline const entry_t & operator[](const int & index) const { return m_list[index]; }
220   ATTR_COLD inline const entry_t *listptr() const { return &m_list[0]; }
221   ATTR_HOT inline int count() const { return m_end - m_list; }
222   ATTR_HOT inline const entry_t & operator[](const int & index) const { return m_list[index]; }
223223
224224#if (NL_KEEP_STATISTICS)
225    // profiling
226    INT32   m_prof_start;
227    INT32   m_prof_end;
228    INT32   m_prof_sortmove;
229    INT32   m_prof_sort;
225   // profiling
226   INT32   m_prof_start;
227   INT32   m_prof_end;
228   INT32   m_prof_sortmove;
229   INT32   m_prof_sort;
230230#endif
231231
232232private:
233233
234    entry_t * m_end;
235    entry_t m_list[_Size];
234   entry_t * m_end;
235   entry_t m_list[_Size];
236236
237237};
238238
r29404r29405
246246{
247247public:
248248
249    ATTR_COLD netlist_stack_t(int numElements = _NumElem)
250    : m_list(numElements)
251    {
252    }
249   ATTR_COLD netlist_stack_t(int numElements = _NumElem)
250   : m_list(numElements)
251   {
252   }
253253
254    ATTR_COLD netlist_stack_t(const netlist_stack_t &rhs)
255    : m_list(rhs.m_list)
256    {
257    }
254   ATTR_COLD netlist_stack_t(const netlist_stack_t &rhs)
255   : m_list(rhs.m_list)
256   {
257   }
258258
259    ATTR_COLD netlist_stack_t &operator=(const netlist_stack_t &rhs)
260    {
261        m_list = rhs.m_list;
262        return *this;
263    }
259   ATTR_COLD netlist_stack_t &operator=(const netlist_stack_t &rhs)
260   {
261      m_list = rhs.m_list;
262      return *this;
263   }
264264
265265
266    ATTR_COLD ~netlist_stack_t()
267    {
268    }
266   ATTR_COLD ~netlist_stack_t()
267   {
268   }
269269
270    ATTR_HOT inline void push(const _StackClass &elem)
271    {
272        m_list.add(elem);
273    }
270   ATTR_HOT inline void push(const _StackClass &elem)
271   {
272      m_list.add(elem);
273   }
274274
275    ATTR_HOT inline _StackClass peek() const
276    {
277        return m_list[m_list.count() - 1];
278    }
275   ATTR_HOT inline _StackClass peek() const
276   {
277      return m_list[m_list.count() - 1];
278   }
279279
280    ATTR_HOT inline _StackClass pop()
281    {
282        _StackClass ret = peek();
283        m_list.remove_at(m_list.count() - 1);
284        return ret;
285    }
280   ATTR_HOT inline _StackClass pop()
281   {
282      _StackClass ret = peek();
283      m_list.remove_at(m_list.count() - 1);
284      return ret;
285   }
286286
287    ATTR_HOT inline int count() const { return m_list.count(); }
288    ATTR_HOT inline bool empty() const { return (m_list.count() == 0); }
289    ATTR_HOT inline void reset() { m_list.reset(); }
290    ATTR_HOT inline int capacity() const { return m_list.capacity(); }
287   ATTR_HOT inline int count() const { return m_list.count(); }
288   ATTR_HOT inline bool empty() const { return (m_list.count() == 0); }
289   ATTR_HOT inline void reset() { m_list.reset(); }
290   ATTR_HOT inline int capacity() const { return m_list.capacity(); }
291291
292292private:
293    netlist_list_t<_StackClass, _NumElem> m_list;
293   netlist_list_t<_StackClass, _NumElem> m_list;
294294};
295295
296296template <class _ListClass>
297297struct plinked_list_element
298298{
299    plinked_list_element() : m_next(NULL) {}
300    _ListClass * m_next;
299   plinked_list_element() : m_next(NULL) {}
300   _ListClass * m_next;
301301
302302};
303303
r29404r29405
306306{
307307public:
308308
309    plinked_list() : m_head(NULL) {}
309   plinked_list() : m_head(NULL) {}
310310
311    ATTR_HOT inline void insert(const _ListClass &before, _ListClass &elem)
312    {
313        if (m_head == &before)
314        {
315            elem.m_next = m_head;
316            m_head = elem;
317        }
318        else
319        {
320            _ListClass *p = m_head;
321            while (p != NULL)
322            {
323                if (p->m_next == &before)
324                {
325                    elem->m_next = &before;
326                    p->m_next = &elem;
327                    return;
328                }
329                p = p->m_next;
330            }
331            assert_always(false, "element not found");
332        }
333    }
311   ATTR_HOT inline void insert(const _ListClass &before, _ListClass &elem)
312   {
313      if (m_head == &before)
314      {
315         elem.m_next = m_head;
316         m_head = elem;
317      }
318      else
319      {
320         _ListClass *p = m_head;
321         while (p != NULL)
322         {
323            if (p->m_next == &before)
324            {
325               elem->m_next = &before;
326               p->m_next = &elem;
327               return;
328            }
329            p = p->m_next;
330         }
331         assert_always(false, "element not found");
332      }
333   }
334334
335    ATTR_HOT inline void insert(_ListClass &elem)
336    {
337        elem.m_next = m_head;
338        m_head = &elem;
339    }
335   ATTR_HOT inline void insert(_ListClass &elem)
336   {
337      elem.m_next = m_head;
338      m_head = &elem;
339   }
340340
341    ATTR_HOT inline void add(_ListClass &elem)
342    {
343        _ListClass **p = &m_head;
344        while (*p != NULL)
345        {
346            p = &((*p)->m_next);
347        }
348        *p = &elem;
349        elem.m_next = NULL;
350    }
341   ATTR_HOT inline void add(_ListClass &elem)
342   {
343      _ListClass **p = &m_head;
344      while (*p != NULL)
345      {
346         p = &((*p)->m_next);
347      }
348      *p = &elem;
349      elem.m_next = NULL;
350   }
351351
352    ATTR_HOT inline void remove(const _ListClass &elem)
353    {
354        _ListClass **p = &m_head;
355        while (*p != &elem)
356        {
357            assert(*p != NULL);
358            p = &((*p)->m_next);
359        }
360        (*p) = elem.m_next;
361    }
352   ATTR_HOT inline void remove(const _ListClass &elem)
353   {
354      _ListClass **p = &m_head;
355      while (*p != &elem)
356      {
357         assert(*p != NULL);
358         p = &((*p)->m_next);
359      }
360      (*p) = elem.m_next;
361   }
362362
363363
364    ATTR_HOT static inline _ListClass *next(const _ListClass &elem) { return elem.m_next; }
365    ATTR_HOT static inline _ListClass *next(const _ListClass *elem) { return elem->m_next; }
366    ATTR_HOT inline _ListClass *first() const { return m_head; }
367    ATTR_HOT inline void clear() { m_head = NULL; }
368    ATTR_HOT inline bool is_empty() const { return (m_head == NULL); }
364   ATTR_HOT static inline _ListClass *next(const _ListClass &elem) { return elem.m_next; }
365   ATTR_HOT static inline _ListClass *next(const _ListClass *elem) { return elem->m_next; }
366   ATTR_HOT inline _ListClass *first() const { return m_head; }
367   ATTR_HOT inline void clear() { m_head = NULL; }
368   ATTR_HOT inline bool is_empty() const { return (m_head == NULL); }
369369
370370private:
371    _ListClass *m_head;
371   _ListClass *m_head;
372372};
373373
374374#endif /* NLLISTS_H_ */
trunk/src/emu/netlist/nl_setup.h
r29404r29405
3939      setup.register_link(# _name "." # _input, # _output);
4040
4141#define NET_C(_term1, ...)                                                          \
42        setup.register_link_arr( #_term1 ", " # __VA_ARGS__);
42      setup.register_link_arr( #_term1 ", " # __VA_ARGS__);
4343
4444#define PARAM(_name, _val)                                                          \
4545      setup.register_param(# _name, _val);
r29404r29405
5555#define NETLIST_START(_name)                                                        \
5656ATTR_COLD void NETLIST_NAME(_name)(netlist_setup_t &setup)                          \
5757{
58
59
6058#define NETLIST_END()  }
6159
6260#define INCLUDE(_name)                                                              \
6361      NETLIST_NAME(_name)(setup);
6462
6563#define SUBMODEL(_name, _model)                                                     \
66        setup.namespace_push(# _name);                                              \
67        NETLIST_NAME(_model)(setup);                                                \
68        setup.namespace_pop();
64      setup.namespace_push(# _name);                                              \
65      NETLIST_NAME(_model)(setup);                                                \
66      setup.namespace_pop();
6967
7068// ----------------------------------------------------------------------------------------
7169// FIXME: Clean this up
r29404r29405
117115   netlist_base_t &netlist() { return m_netlist; }
118116   const netlist_base_t &netlist() const { return m_netlist; }
119117   netlist_factory_t &factory() { return m_factory; }
120    const netlist_factory_t &factory() const { return m_factory; }
118   const netlist_factory_t &factory() const { return m_factory; }
121119
122    pstring build_fqn(const pstring &obj_name) const;
120   pstring build_fqn(const pstring &obj_name) const;
123121
124122   netlist_device_t *register_dev(netlist_device_t *dev, const pstring &name);
125123   void remove_dev(const pstring &name);
r29404r29405
127125   void register_model(const pstring &model);
128126   void register_alias(const pstring &alias, const pstring &out);
129127   void register_alias_nofqn(const pstring &alias, const pstring &out);
130    void register_link_arr(const pstring &terms);
128   void register_link_arr(const pstring &terms);
131129   void register_link(const pstring &sin, const pstring &sout);
132130   void register_param(const pstring &param, const pstring &value);
133131   void register_param(const pstring &param, const double value);
r29404r29405
148146   /* handle namespace */
149147
150148   void namespace_push(const pstring &aname);
151    void namespace_pop();
149   void namespace_pop();
152150
153151   /* not ideal, but needed for save_state */
154152   tagmap_terminal_t  m_terminals;
r29404r29405
172170
173171   int m_proxy_cnt;
174172
175    netlist_stack_t<pstring> m_stack;
173   netlist_stack_t<pstring> m_stack;
176174
177175
178176   void connect_terminals(netlist_core_terminal_t &in, netlist_core_terminal_t &out);
trunk/src/emu/netlist/pstate.c
r29404r29405
1717   pstring fullname = stname;
1818   ATTR_UNUSED  pstring ts[] = {
1919         "NOT_SUPPORTED",
20            "DT_CUSTOM",
20         "DT_CUSTOM",
2121         "DT_DOUBLE",
2222         "DT_INT64",
23            "DT_INT16",
23         "DT_INT16",
2424         "DT_INT8",
2525         "DT_INT",
2626         "DT_BOOLEAN"
r29404r29405
3333
3434ATTR_COLD void pstate_manager_t::remove_save_items(const void *owner)
3535{
36    pstate_entry_t::list_t todelete;
36   pstate_entry_t::list_t todelete;
3737
38    for (int i=0; i < m_save.count(); i++)
39    {
40        if (m_save[i]->m_owner == owner)
41            todelete.add(m_save[i]);
42    }
43    for (int i=0; i < todelete.count(); i++)
44    {
45        m_save.remove(todelete[i]);
46    }
47    todelete.clear_and_free();
38   for (int i=0; i < m_save.count(); i++)
39   {
40      if (m_save[i]->m_owner == owner)
41         todelete.add(m_save[i]);
42   }
43   for (int i=0; i < todelete.count(); i++)
44   {
45      m_save.remove(todelete[i]);
46   }
47   todelete.clear_and_free();
4848}
4949
5050ATTR_COLD void pstate_manager_t::pre_save()
5151{
5252   for (int i=0; i < m_save.count(); i++)
53       if (m_save[i]->m_dt == DT_CUSTOM)
54           m_save[i]->m_callback->on_pre_save();
53      if (m_save[i]->m_dt == DT_CUSTOM)
54         m_save[i]->m_callback->on_pre_save();
5555}
5656
5757ATTR_COLD void pstate_manager_t::post_load()
5858{
59    for (int i=0; i < m_save.count(); i++)
60        if (m_save[i]->m_dt == DT_CUSTOM)
61            m_save[i]->m_callback->on_post_load();
59   for (int i=0; i < m_save.count(); i++)
60      if (m_save[i]->m_dt == DT_CUSTOM)
61         m_save[i]->m_callback->on_post_load();
6262}
trunk/src/emu/netlist/devices/nld_74107.c
r29404r29405
1818
1919NETLIB_RESET(74107Asub)
2020{
21    m_clk.set_state(netlist_input_t::STATE_INP_HL);
22    m_Q.initial(0);
23    m_QQ.initial(1);
21   m_clk.set_state(netlist_input_t::STATE_INP_HL);
22   m_Q.initial(0);
23   m_QQ.initial(1);
2424
25    m_Q1 = 0;
26    m_Q2 = 0;
27    m_F = 0;
25   m_Q1 = 0;
26   m_Q2 = 0;
27   m_F = 0;
2828}
2929
3030NETLIB_START(74107A)
r29404r29405
4242
4343NETLIB_RESET(74107A)
4444{
45    sub.reset();
45   sub.reset();
4646}
4747
4848ATTR_HOT inline void NETLIB_NAME(74107Asub)::newstate(const netlist_sig_t state)
r29404r29405
103103
104104NETLIB_START(74107_dip)
105105{
106    register_sub(m_1, "1");
107    register_sub(m_2, "2");
106   register_sub(m_1, "1");
107   register_sub(m_2, "2");
108108
109    register_subalias("1", m_1.m_J);
110    register_subalias("2", m_1.sub.m_QQ);
111    register_subalias("3", m_1.sub.m_Q);
109   register_subalias("1", m_1.m_J);
110   register_subalias("2", m_1.sub.m_QQ);
111   register_subalias("3", m_1.sub.m_Q);
112112
113    register_subalias("4", m_1.m_K);
114    register_subalias("5", m_2.sub.m_Q);
115    register_subalias("6", m_2.sub.m_QQ);
113   register_subalias("4", m_1.m_K);
114   register_subalias("5", m_2.sub.m_Q);
115   register_subalias("6", m_2.sub.m_QQ);
116116
117    // register_subalias("7", ); ==> GND
117   // register_subalias("7", ); ==> GND
118118
119    register_subalias("8", m_2.m_J);
120    register_subalias("9", m_2.sub.m_clk);
121    register_subalias("10", m_2.m_clrQ);
119   register_subalias("8", m_2.m_J);
120   register_subalias("9", m_2.sub.m_clk);
121   register_subalias("10", m_2.m_clrQ);
122122
123    register_subalias("11", m_2.m_K);
124    register_subalias("12", m_1.sub.m_clk);
125    register_subalias("13", m_1.m_clrQ);
123   register_subalias("11", m_2.m_K);
124   register_subalias("12", m_1.sub.m_clk);
125   register_subalias("13", m_1.m_clrQ);
126126
127    // register_subalias("14", ); ==> VCC
127   // register_subalias("14", ); ==> VCC
128128}
129129
130130NETLIB_RESET(74107_dip)
131131{
132    m_1.do_reset();
133    m_2.do_reset();
132   m_1.do_reset();
133   m_2.do_reset();
134134}
135135
136136NETLIB_UPDATE(74107_dip)
137137{
138    /* only called during startup */
139    m_1.update_dev();
140    m_2.update_dev();
138   /* only called during startup */
139   m_1.update_dev();
140   m_2.update_dev();
141141}
trunk/src/emu/netlist/devices/nld_signal.h
r29404r29405
4747
4848   ATTR_COLD void reset()
4949   {
50        m_Q.initial(1);
51        m_active = 1;
50      m_Q.initial(1);
51      m_active = 1;
5252   }
5353
5454#if (USE_DEACTIVE_DEVICE)
r29404r29405
9898      save(NAME(m_active));
9999   }
100100
101    ATTR_COLD void reset()
102    {
103        m_Q.initial(1);
104        m_active = 1;
105    }
101   ATTR_COLD void reset()
102   {
103      m_Q.initial(1);
104      m_active = 1;
105   }
106106
107107#if (USE_DEACTIVE_DEVICE)
108    ATTR_HOT void inc_active()
109    {
110        if (++m_active == 1)
111        {
112            update();
113        }
114    }
108   ATTR_HOT void inc_active()
109   {
110      if (++m_active == 1)
111      {
112         update();
113      }
114   }
115115
116    ATTR_HOT void dec_active()
117    {
118        if (--m_active == 0)
119        {
120            for (int i = 0; i< _numdev; i++)
121                m_i[i].inactivate();
122        }
123    }
116   ATTR_HOT void dec_active()
117   {
118      if (--m_active == 0)
119      {
120         for (int i = 0; i< _numdev; i++)
121            m_i[i].inactivate();
122      }
123   }
124124#endif
125125
126    virtual void update()
127    {
128        const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) };
126   virtual void update()
127   {
128      const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) };
129129
130        // FIXME: this check is needed because update is called during startup as well
131        if (UNEXPECTED(USE_DEACTIVE_DEVICE && m_active == 0))
132            return;
130      // FIXME: this check is needed because update is called during startup as well
131      if (UNEXPECTED(USE_DEACTIVE_DEVICE && m_active == 0))
132         return;
133133
134        for (int i = 0; i< _numdev; i++)
135        {
136            this->m_i[i].activate();
137            if (INPLOGIC(this->m_i[i]) == _check)
138            {
139                for (int j = 0; j < i; j++)
140                    this->m_i[j].inactivate();
141                for (int j = i + 1; j < _numdev; j++)
142                    this->m_i[j].inactivate();
134      for (int i = 0; i< _numdev; i++)
135      {
136         this->m_i[i].activate();
137         if (INPLOGIC(this->m_i[i]) == _check)
138         {
139            for (int j = 0; j < i; j++)
140               this->m_i[j].inactivate();
141            for (int j = i + 1; j < _numdev; j++)
142               this->m_i[j].inactivate();
143143
144                OUTLOGIC(this->m_Q, _check ^ (1 ^ _invert), times[_check]);// ? 15000 : 22000);
145                return;
146            }
147        }
148        OUTLOGIC(this->m_Q,_check ^ (_invert), times[1-_check]);// ? 22000 : 15000);
149    }
144            OUTLOGIC(this->m_Q, _check ^ (1 ^ _invert), times[_check]);// ? 15000 : 22000);
145            return;
146         }
147      }
148      OUTLOGIC(this->m_Q,_check ^ (_invert), times[1-_check]);// ? 22000 : 15000);
149   }
150150
151151public:
152152   netlist_ttl_input_t m_i[_numdev];
r29404r29405
166166   ATTR_COLD void start()
167167   {
168168      register_output("Q", m_Q);
169        register_input("A", m_i[0]);
170        register_input("B", m_i[1]);
169      register_input("A", m_i[0]);
170      register_input("B", m_i[1]);
171171
172        save(NAME(m_active));
172      save(NAME(m_active));
173173   }
174174
175    ATTR_COLD void reset()
176    {
177        m_Q.initial(1);
178        m_active = 1;
179    }
175   ATTR_COLD void reset()
176   {
177      m_Q.initial(1);
178      m_active = 1;
179   }
180180
181181#if (USE_DEACTIVE_DEVICE)
182    ATTR_HOT virtual void inc_active()
183    {
184        if (++m_active == 1)
185        {
186            update();
187        }
188    }
182   ATTR_HOT virtual void inc_active()
183   {
184      if (++m_active == 1)
185      {
186         update();
187      }
188   }
189189
190    ATTR_HOT virtual void dec_active()
191    {
192        if (--m_active == 0)
193        {
194            m_i[0].inactivate();
195            m_i[1].inactivate();
196        }
197    }
190   ATTR_HOT virtual void dec_active()
191   {
192      if (--m_active == 0)
193      {
194         m_i[0].inactivate();
195         m_i[1].inactivate();
196      }
197   }
198198#endif
199199
200200   ATTR_HOT ATTR_ALIGN void update()
r29404r29405
202202      const netlist_time times[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22)};
203203
204204      // FIXME: this check is needed because update is called during startup as well
205        if (UNEXPECTED(USE_DEACTIVE_DEVICE && m_active == 0))
206            return;
205      if (UNEXPECTED(USE_DEACTIVE_DEVICE && m_active == 0))
206         return;
207207
208208      m_i[0].activate();
209209      m_i[1].activate();
210210#if 0
211        UINT8 res = _invert ^ 1 ^_check;
211      UINT8 res = _invert ^ 1 ^_check;
212212      if (INPLOGIC(m_i[0]) ^ _check)
213213      {
214214         if (INPLOGIC(m_i[1]) ^ _check)
r29404r29405
221221         if (INPLOGIC(m_i[1]) ^ _check)
222222            m_i[1].inactivate();
223223      }
224        OUTLOGIC(m_Q, res, times[res & 1]);// ? 22000 : 15000);
224      OUTLOGIC(m_Q, res, times[res & 1]);// ? 22000 : 15000);
225225#else
226226      const UINT8 val = (INPLOGIC(m_i[0]) ^ _check) | ((INPLOGIC(m_i[1]) ^ _check) << 1);
227        UINT8 res = _invert ^ 1 ^_check;
227      UINT8 res = _invert ^ 1 ^_check;
228228      switch (val)
229229      {
230          case 1:
231                m_i[0].inactivate();
232                break;
233          case 2:
234              m_i[1].inactivate();
235              break;
236            case 3:
237                res = _invert ^ _check;
238                break;
230         case 1:
231            m_i[0].inactivate();
232            break;
233         case 2:
234            m_i[1].inactivate();
235            break;
236         case 3:
237            res = _invert ^ _check;
238            break;
239239      }
240        OUTLOGIC(m_Q, res, times[res]);// ? 22000 : 15000);
240      OUTLOGIC(m_Q, res, times[res]);// ? 22000 : 15000);
241241#endif
242242   }
243243
trunk/src/emu/netlist/devices/nld_74107.h
r29404r29405
7272      TTL_74107A(_name, _CLK, _J, _K, _CLRQ)
7373
7474#define TTL_74107_DIP(_name)                                                         \
75        NET_REGISTER_DEV(74107_dip, _name)
75      NET_REGISTER_DEV(74107_dip, _name)
7676
7777NETLIB_SUBDEVICE(74107Asub,
7878   netlist_ttl_input_t m_clk;
r29404r29405
108108
109109NETLIB_DEVICE(74107_dip,
110110
111    NETLIB_NAME(74107) m_1;
112    NETLIB_NAME(74107) m_2;
111   NETLIB_NAME(74107) m_1;
112   NETLIB_NAME(74107) m_2;
113113);
114114
115115#endif /* NLD_74107_H_ */
trunk/src/emu/netlist/devices/nld_7400.c
r29404r29405
77
88NETLIB_START(7400_dip)
99{
10    register_sub(m_1, "1");
11    register_sub(m_2, "2");
12    register_sub(m_3, "3");
13    register_sub(m_4, "4");
10   register_sub(m_1, "1");
11   register_sub(m_2, "2");
12   register_sub(m_3, "3");
13   register_sub(m_4, "4");
1414
15    register_subalias("1", m_1.m_i[0]);
16    register_subalias("2", m_1.m_i[1]);
17    register_subalias("3", m_1.m_Q);
15   register_subalias("1", m_1.m_i[0]);
16   register_subalias("2", m_1.m_i[1]);
17   register_subalias("3", m_1.m_Q);
1818
19    register_subalias("4", m_2.m_i[0]);
20    register_subalias("5", m_2.m_i[1]);
21    register_subalias("6", m_2.m_Q);
19   register_subalias("4", m_2.m_i[0]);
20   register_subalias("5", m_2.m_i[1]);
21   register_subalias("6", m_2.m_Q);
2222
23    register_subalias("9", m_3.m_i[0]);
24    register_subalias("10", m_3.m_i[1]);
25    register_subalias("8", m_3.m_Q);
23   register_subalias("9", m_3.m_i[0]);
24   register_subalias("10", m_3.m_i[1]);
25   register_subalias("8", m_3.m_Q);
2626
27    register_subalias("12", m_4.m_i[0]);
28    register_subalias("13", m_4.m_i[1]);
29    register_subalias("11", m_4.m_Q);
27   register_subalias("12", m_4.m_i[0]);
28   register_subalias("13", m_4.m_i[1]);
29   register_subalias("11", m_4.m_Q);
3030}
3131
3232NETLIB_UPDATE(7400_dip)
3333{
34    /* only called during startup */
35    m_1.update_dev();
36    m_2.update_dev();
37    m_3.update_dev();
38    m_4.update_dev();
34   /* only called during startup */
35   m_1.update_dev();
36   m_2.update_dev();
37   m_3.update_dev();
38   m_4.update_dev();
3939}
4040
4141NETLIB_RESET(7400_dip)
4242{
43    m_1.do_reset();
44    m_2.do_reset();
45    m_3.do_reset();
46    m_4.do_reset();
43   m_1.do_reset();
44   m_2.do_reset();
45   m_3.do_reset();
46   m_4.do_reset();
4747}
48
trunk/src/emu/netlist/devices/nld_74ls629.c
r29404r29405
5050   reset();
5151
5252   save(NAME(m_enableq));
53    save(NAME(m_inc));
53   save(NAME(m_inc));
5454}
5555
5656NETLIB_RESET(SN74LS629clk)
5757{
58    m_enableq = 1;
59    m_inc = netlist_time::zero;
58   m_enableq = 1;
59   m_inc = netlist_time::zero;
6060}
6161
6262NETLIB_UPDATE(SN74LS629clk)
6363{
64    if (!m_enableq)
65    {
66        OUTLOGIC(m_Y, !m_Y.net().new_Q(), m_inc);
67    }
68    else
69    {
70        OUTLOGIC(m_Y, 1, m_inc);
71    }
64   if (!m_enableq)
65   {
66      OUTLOGIC(m_Y, !m_Y.net().new_Q(), m_inc);
67   }
68   else
69   {
70      OUTLOGIC(m_Y, 1, m_inc);
71   }
7272}
7373
7474NETLIB_START(SN74LS629)
7575{
76    register_sub(m_clock, "OSC");
77    register_sub(m_R_FC,  "R_FC");
78    register_sub(m_R_RNG,  "R_RNG");
76   register_sub(m_clock, "OSC");
77   register_sub(m_R_FC,  "R_FC");
78   register_sub(m_R_RNG,  "R_RNG");
7979
80    register_input("ENQ", m_ENQ);
81    register_input("RNG",    m_RNG);
82    register_input("FC",     m_FC);
83    register_subalias("GND",    m_R_FC.m_N);
80   register_input("ENQ", m_ENQ);
81   register_input("RNG",    m_RNG);
82   register_input("FC",     m_FC);
83   register_subalias("GND",    m_R_FC.m_N);
8484
85    connect(m_FC, m_R_FC.m_P);
86    connect(m_RNG, m_R_RNG.m_P);
87    connect(m_R_FC.m_N, m_R_RNG.m_N);
85   connect(m_FC, m_R_FC.m_P);
86   connect(m_RNG, m_R_RNG.m_P);
87   connect(m_R_FC.m_N, m_R_RNG.m_N);
8888
89    register_subalias("Y", m_clock.m_Y);
90    register_param("CAP", m_CAP, 1e-6);
89   register_subalias("Y", m_clock.m_Y);
90   register_param("CAP", m_CAP, 1e-6);
9191}
9292
9393NETLIB_RESET(SN74LS629)
9494{
95    m_R_FC.set_R(90000.0);
96    m_R_RNG.set_R(90000.0);
97    m_clock.reset();
95   m_R_FC.set_R(90000.0);
96   m_R_RNG.set_R(90000.0);
97   m_clock.reset();
9898}
9999
100100NETLIB_UPDATE(SN74LS629)
101101{
102    {
103        // recompute
104        double  freq;
105        double  v_freq_2, v_freq_3, v_freq_4;
106        double  v_freq = INPANALOG(m_FC);
107        double  v_rng = INPANALOG(m_RNG);
102   {
103      // recompute
104      double  freq;
105      double  v_freq_2, v_freq_3, v_freq_4;
106      double  v_freq = INPANALOG(m_FC);
107      double  v_rng = INPANALOG(m_RNG);
108108
109        /* coefficients */
110        const double k1 = 1.9904769024796283E+03;
111        const double k2 = 1.2070059213983407E+03;
112        const double k3 = 1.3266985579561108E+03;
113        const double k4 = -1.5500979825922698E+02;
114        const double k5 = 2.8184536266938172E+00;
115        const double k6 = -2.3503421582744556E+02;
116        const double k7 = -3.3836786704527788E+02;
117        const double k8 = -1.3569136703258670E+02;
118        const double k9 = 2.9914575453819188E+00;
119        const double k10 = 1.6855569086173170E+00;
109      /* coefficients */
110      const double k1 = 1.9904769024796283E+03;
111      const double k2 = 1.2070059213983407E+03;
112      const double k3 = 1.3266985579561108E+03;
113      const double k4 = -1.5500979825922698E+02;
114      const double k5 = 2.8184536266938172E+00;
115      const double k6 = -2.3503421582744556E+02;
116      const double k7 = -3.3836786704527788E+02;
117      const double k8 = -1.3569136703258670E+02;
118      const double k9 = 2.9914575453819188E+00;
119      const double k10 = 1.6855569086173170E+00;
120120
121        /* scale due to input resistance */
121      /* scale due to input resistance */
122122
123        /* Polyfunctional3D_model created by zunzun.com using sum of squared absolute error */
124        v_freq_2 = v_freq * v_freq;
125        v_freq_3 = v_freq_2 * v_freq;
126        v_freq_4 = v_freq_3 * v_freq;
127        freq = k1;
128        freq += k2 * v_freq;
129        freq += k3 * v_freq_2;
130        freq += k4 * v_freq_3;
131        freq += k5 * v_freq_4;
132        freq += k6 * v_rng;
133        freq += k7 * v_rng * v_freq;
134        freq += k8 * v_rng * v_freq_2;
135        freq += k9 * v_rng * v_freq_3;
136        freq += k10 * v_rng * v_freq_4;
123      /* Polyfunctional3D_model created by zunzun.com using sum of squared absolute error */
124      v_freq_2 = v_freq * v_freq;
125      v_freq_3 = v_freq_2 * v_freq;
126      v_freq_4 = v_freq_3 * v_freq;
127      freq = k1;
128      freq += k2 * v_freq;
129      freq += k3 * v_freq_2;
130      freq += k4 * v_freq_3;
131      freq += k5 * v_freq_4;
132      freq += k6 * v_rng;
133      freq += k7 * v_rng * v_freq;
134      freq += k8 * v_rng * v_freq_2;
135      freq += k9 * v_rng * v_freq_3;
136      freq += k10 * v_rng * v_freq_4;
137137
138        freq *= 0.1e-6 / m_CAP.Value();
138      freq *= 0.1e-6 / m_CAP.Value();
139139
140        // FIXME: we need a possibility to remove entries from queue ...
141        //        or an exact model ...
142        m_clock.m_inc = netlist_time::from_double(0.5 / freq);
143        //m_clock.update();
144    }
140      // FIXME: we need a possibility to remove entries from queue ...
141      //        or an exact model ...
142      m_clock.m_inc = netlist_time::from_double(0.5 / freq);
143      //m_clock.update();
144   }
145145
146    if (!m_clock.m_enableq && INPLOGIC(m_ENQ))
147    {
148        m_clock.m_enableq = 1;
149        OUTLOGIC(m_clock.m_Y, !m_clock.m_Y.net().last_Q(), netlist_time::from_nsec(1));
150    }
151    else if (m_clock.m_enableq && !INPLOGIC(m_ENQ))
152    {
153        m_clock.m_enableq = 0;
154        OUTLOGIC(m_clock.m_Y, !m_clock.m_Y.net().last_Q(), netlist_time::from_nsec(1));
155    }
146   if (!m_clock.m_enableq && INPLOGIC(m_ENQ))
147   {
148      m_clock.m_enableq = 1;
149      OUTLOGIC(m_clock.m_Y, !m_clock.m_Y.net().last_Q(), netlist_time::from_nsec(1));
150   }
151   else if (m_clock.m_enableq && !INPLOGIC(m_ENQ))
152   {
153      m_clock.m_enableq = 0;
154      OUTLOGIC(m_clock.m_Y, !m_clock.m_Y.net().last_Q(), netlist_time::from_nsec(1));
155   }
156156}
157157
158158NETLIB_UPDATE_PARAM(SN74LS629)
159159{
160    //printf("updating %s to %f\n", name().cstr(), m_R.Value());
161    update_dev();
160   //printf("updating %s to %f\n", name().cstr(), m_R.Value());
161   update_dev();
162162}
163163
164164
165165
166166NETLIB_START(SN74LS629_dip)
167167{
168    register_sub(m_1, "1");
169    register_sub(m_2, "2");
168   register_sub(m_1, "1");
169   register_sub(m_2, "2");
170170
171    register_subalias("1",  m_2.m_FC);
172    register_subalias("2",  m_1.m_FC);
173    register_subalias("3",  m_1.m_RNG);
171   register_subalias("1",  m_2.m_FC);
172   register_subalias("2",  m_1.m_FC);
173   register_subalias("3",  m_1.m_RNG);
174174
175    register_subalias("6",  m_1.m_ENQ);
176    register_subalias("7",  m_1.m_clock.m_Y);
175   register_subalias("6",  m_1.m_ENQ);
176   register_subalias("7",  m_1.m_clock.m_Y);
177177
178    register_subalias("8",  m_1.m_R_FC.m_N);
179    register_subalias("9",  m_1.m_R_FC.m_N);
180    connect(m_1.m_R_FC.m_N, m_2.m_R_FC.m_N);
178   register_subalias("8",  m_1.m_R_FC.m_N);
179   register_subalias("9",  m_1.m_R_FC.m_N);
180   connect(m_1.m_R_FC.m_N, m_2.m_R_FC.m_N);
181181
182    register_subalias("10",  m_2.m_clock.m_Y);
182   register_subalias("10",  m_2.m_clock.m_Y);
183183
184    register_subalias("11",  m_2.m_ENQ);
185    register_subalias("14",  m_2.m_RNG);
184   register_subalias("11",  m_2.m_ENQ);
185   register_subalias("14",  m_2.m_RNG);
186186
187187}
188188
r29404r29405
192192
193193NETLIB_RESET(SN74LS629_dip)
194194{
195    m_1.do_reset();
196    m_2.do_reset();
195   m_1.do_reset();
196   m_2.do_reset();
197197}
trunk/src/emu/netlist/devices/nld_7420.c
r29404r29405
77
88NETLIB_START(7420_dip)
99{
10    register_sub(m_1, "1");
11    register_sub(m_2, "2");
10   register_sub(m_1, "1");
11   register_sub(m_2, "2");
1212
13    register_subalias("1", m_1.m_i[0]);
14    register_subalias("2", m_1.m_i[1]);
13   register_subalias("1", m_1.m_i[0]);
14   register_subalias("2", m_1.m_i[1]);
1515
16    register_subalias("4", m_1.m_i[2]);
17    register_subalias("5", m_1.m_i[3]);
18    register_subalias("6", m_1.m_Q);
16   register_subalias("4", m_1.m_i[2]);
17   register_subalias("5", m_1.m_i[3]);
18   register_subalias("6", m_1.m_Q);
1919
20    register_subalias("8", m_2.m_Q);
21    register_subalias("9", m_2.m_i[0]);
22    register_subalias("10", m_2.m_i[1]);
20   register_subalias("8", m_2.m_Q);
21   register_subalias("9", m_2.m_i[0]);
22   register_subalias("10", m_2.m_i[1]);
2323
24    register_subalias("12", m_2.m_i[2]);
25    register_subalias("13", m_2.m_i[3]);
24   register_subalias("12", m_2.m_i[2]);
25   register_subalias("13", m_2.m_i[3]);
2626
2727}
2828
2929NETLIB_UPDATE(7420_dip)
3030{
31    /* only called during startup */
32    m_1.update_dev();
33    m_2.update_dev();
31   /* only called during startup */
32   m_1.update_dev();
33   m_2.update_dev();
3434}
3535
3636NETLIB_RESET(7420_dip)
3737{
38    m_1.do_reset();
39    m_2.do_reset();
38   m_1.do_reset();
39   m_2.do_reset();
4040}
41
trunk/src/emu/netlist/devices/nld_7402.c
r29404r29405
77
88NETLIB_START(7402_dip)
99{
10    register_sub(m_1, "1");
11    register_sub(m_2, "2");
12    register_sub(m_3, "3");
13    register_sub(m_4, "4");
10   register_sub(m_1, "1");
11   register_sub(m_2, "2");
12   register_sub(m_3, "3");
13   register_sub(m_4, "4");
1414
15    register_subalias("1", m_1.m_Q);
16    register_subalias("2", m_1.m_i[0]);
17    register_subalias("3", m_1.m_i[1]);
15   register_subalias("1", m_1.m_Q);
16   register_subalias("2", m_1.m_i[0]);
17   register_subalias("3", m_1.m_i[1]);
1818
19    register_subalias("4", m_2.m_Q);
20    register_subalias("5", m_2.m_i[0]);
21    register_subalias("6", m_2.m_i[1]);
19   register_subalias("4", m_2.m_Q);
20   register_subalias("5", m_2.m_i[0]);
21   register_subalias("6", m_2.m_i[1]);
2222
23    register_subalias("8", m_3.m_i[0]);
24    register_subalias("9", m_3.m_i[1]);
25    register_subalias("10", m_3.m_Q);
23   register_subalias("8", m_3.m_i[0]);
24   register_subalias("9", m_3.m_i[1]);
25   register_subalias("10", m_3.m_Q);
2626
27    register_subalias("11", m_4.m_i[0]);
28    register_subalias("12", m_4.m_i[1]);
29    register_subalias("13", m_4.m_Q);
27   register_subalias("11", m_4.m_i[0]);
28   register_subalias("12", m_4.m_i[1]);
29   register_subalias("13", m_4.m_Q);
3030}
3131
3232NETLIB_UPDATE(7402_dip)
3333{
34    /* only called during startup */
35    m_1.update_dev();
36    m_2.update_dev();
37    m_3.update_dev();
38    m_4.update_dev();
34   /* only called during startup */
35   m_1.update_dev();
36   m_2.update_dev();
37   m_3.update_dev();
38   m_4.update_dev();
3939}
4040
4141NETLIB_RESET(7402_dip)
4242{
43    m_1.do_reset();
44    m_2.do_reset();
45    m_3.do_reset();
46    m_4.do_reset();
43   m_1.do_reset();
44   m_2.do_reset();
45   m_3.do_reset();
46   m_4.do_reset();
4747}
48
trunk/src/emu/netlist/devices/nld_7404.c
r29404r29405
2424
2525NETLIB_START(7404_dip)
2626{
27    register_sub(m_1, "1");
28    register_sub(m_2, "2");
29    register_sub(m_3, "3");
30    register_sub(m_4, "4");
31    register_sub(m_5, "5");
32    register_sub(m_6, "6");
27   register_sub(m_1, "1");
28   register_sub(m_2, "2");
29   register_sub(m_3, "3");
30   register_sub(m_4, "4");
31   register_sub(m_5, "5");
32   register_sub(m_6, "6");
3333
34    register_subalias("1", m_1.m_I);
35    register_subalias("2", m_1.m_Q);
34   register_subalias("1", m_1.m_I);
35   register_subalias("2", m_1.m_Q);
3636
37    register_subalias("3", m_2.m_I);
38    register_subalias("4", m_2.m_Q);
37   register_subalias("3", m_2.m_I);
38   register_subalias("4", m_2.m_Q);
3939
40    register_subalias("5", m_3.m_I);
41    register_subalias("6", m_3.m_Q);
40   register_subalias("5", m_3.m_I);
41   register_subalias("6", m_3.m_Q);
4242
43    register_subalias("8", m_4.m_Q);
44    register_subalias("9", m_4.m_I);
43   register_subalias("8", m_4.m_Q);
44   register_subalias("9", m_4.m_I);
4545
46    register_subalias("10", m_5.m_Q);
47    register_subalias("11", m_5.m_I);
46   register_subalias("10", m_5.m_Q);
47   register_subalias("11", m_5.m_I);
4848
49    register_subalias("12", m_6.m_Q);
50    register_subalias("13", m_6.m_I);
49   register_subalias("12", m_6.m_Q);
50   register_subalias("13", m_6.m_I);
5151}
5252
5353NETLIB_UPDATE(7404_dip)
5454{
55    /* only called during startup */
55   /* only called during startup */
5656
57    m_1.update_dev();
58    m_2.update_dev();
59    m_3.update_dev();
60    m_4.update_dev();
61    m_5.update_dev();
62    m_6.update_dev();
57   m_1.update_dev();
58   m_2.update_dev();
59   m_3.update_dev();
60   m_4.update_dev();
61   m_5.update_dev();
62   m_6.update_dev();
6363}
6464
6565NETLIB_RESET(7404_dip)
6666{
67    m_1.do_reset();
68    m_2.do_reset();
69    m_3.do_reset();
70    m_4.do_reset();
71    m_5.do_reset();
72    m_6.do_reset();
67   m_1.do_reset();
68   m_2.do_reset();
69   m_3.do_reset();
70   m_4.do_reset();
71   m_5.do_reset();
72   m_6.do_reset();
7373}
trunk/src/emu/netlist/devices/nld_7400.h
r29404r29405
4242NETLIB_SIGNAL(7400, 2, 0, 0);
4343
4444#define TTL_7400_DIP(_name)                                                         \
45        NET_REGISTER_DEV(7400_dip, _name)
45      NET_REGISTER_DEV(7400_dip, _name)
4646
4747NETLIB_DEVICE(7400_dip,
4848
trunk/src/emu/netlist/devices/nld_74ls629.h
r29404r29405
3333
3434#define SN74LS629(_name, _cap)                                                      \
3535      NET_REGISTER_DEV(SN74LS629, _name)                                          \
36        NETDEV_PARAMI(_name, CAP, _cap)
36      NETDEV_PARAMI(_name, CAP, _cap)
3737
3838NETLIB_SUBDEVICE(SN74LS629clk,
39    netlist_logic_input_t m_FB;
40    netlist_logic_output_t m_Y;
39   netlist_logic_input_t m_FB;
40   netlist_logic_output_t m_Y;
4141
42    netlist_time m_inc;
43    netlist_sig_t m_enableq;
42   netlist_time m_inc;
43   netlist_sig_t m_enableq;
4444);
4545
4646NETLIB_DEVICE_WITH_PARAMS(SN74LS629,
4747public:
4848   NETLIB_NAME(SN74LS629clk) m_clock;
49    NETLIB_NAME(R_base) m_R_FC;
50    NETLIB_NAME(R_base) m_R_RNG;
49   NETLIB_NAME(R_base) m_R_FC;
50   NETLIB_NAME(R_base) m_R_RNG;
5151
52    netlist_logic_input_t m_ENQ;
52   netlist_logic_input_t m_ENQ;
5353   netlist_analog_input_t m_RNG;
5454   netlist_analog_input_t m_FC;
5555
r29404r29405
5757);
5858
5959#define SN74LS629_DIP(_name, _cap1, _cap2)                                        \
60        NET_REGISTER_DEV(SN74LS629_dip, _name)                                    \
61        NETDEV_PARAMI(_name, 1.CAP, _cap1)                                        \
62        NETDEV_PARAMI(_name, 2.CAP, _cap2)
60      NET_REGISTER_DEV(SN74LS629_dip, _name)                                    \
61      NETDEV_PARAMI(_name, 1.CAP, _cap1)                                        \
62      NETDEV_PARAMI(_name, 2.CAP, _cap2)
6363
6464NETLIB_DEVICE(SN74LS629_dip,
65    NETLIB_NAME(SN74LS629) m_1;
66    NETLIB_NAME(SN74LS629) m_2;
65   NETLIB_NAME(SN74LS629) m_1;
66   NETLIB_NAME(SN74LS629) m_2;
6767);
6868
6969
trunk/src/emu/netlist/devices/nld_7425.c
r29404r29405
77
88NETLIB_START(7425_dip)
99{
10    register_sub(m_1, "1");
11    register_sub(m_2, "2");
10   register_sub(m_1, "1");
11   register_sub(m_2, "2");
1212
13    register_subalias("1", m_1.m_i[0]);
14    register_subalias("2", m_1.m_i[1]);
13   register_subalias("1", m_1.m_i[0]);
14   register_subalias("2", m_1.m_i[1]);
1515
16    //register_subalias("3", ); X1 ==> NC
16   //register_subalias("3", ); X1 ==> NC
1717
18    register_subalias("4", m_1.m_i[2]);
19    register_subalias("5", m_1.m_i[3]);
20    register_subalias("6", m_1.m_Q);
18   register_subalias("4", m_1.m_i[2]);
19   register_subalias("5", m_1.m_i[3]);
20   register_subalias("6", m_1.m_Q);
2121
22    register_subalias("8", m_2.m_Q);
23    register_subalias("9", m_2.m_i[0]);
24    register_subalias("10", m_2.m_i[1]);
22   register_subalias("8", m_2.m_Q);
23   register_subalias("9", m_2.m_i[0]);
24   register_subalias("10", m_2.m_i[1]);
2525
26    //register_subalias("11", ); X2 ==> NC
26   //register_subalias("11", ); X2 ==> NC
2727
28    register_subalias("12", m_2.m_i[2]);
29    register_subalias("13", m_2.m_i[3]);
28   register_subalias("12", m_2.m_i[2]);
29   register_subalias("13", m_2.m_i[3]);
3030
3131}
3232
3333NETLIB_UPDATE(7425_dip)
3434{
35    /* only called during startup */
36    m_1.update_dev();
37    m_2.update_dev();
35   /* only called during startup */
36   m_1.update_dev();
37   m_2.update_dev();
3838}
3939
4040NETLIB_RESET(7425_dip)
4141{
42    m_1.do_reset();
43    m_2.do_reset();
42   m_1.do_reset();
43   m_2.do_reset();
4444}
45
trunk/src/emu/netlist/devices/nld_7420.h
r29404r29405
4646NETLIB_SIGNAL(7420, 4, 0, 0);
4747
4848#define TTL_7420_DIP(_name)                                                         \
49        NET_REGISTER_DEV(7420_dip, _name)
49      NET_REGISTER_DEV(7420_dip, _name)
5050
5151NETLIB_DEVICE(7420_dip,
5252
53    NETLIB_NAME(7420) m_1;
54    NETLIB_NAME(7420) m_2;
53   NETLIB_NAME(7420) m_1;
54   NETLIB_NAME(7420) m_2;
5555);
5656
5757#endif /* NLD_7420_H_ */
trunk/src/emu/netlist/devices/nld_7402.h
r29404r29405
4040      NET_CONNECT(_name, B, _I2)
4141
4242#define TTL_7402_DIP(_name)                                                         \
43        NET_REGISTER_DEV(7402_dip, _name)
43      NET_REGISTER_DEV(7402_dip, _name)
4444
4545
4646NETLIB_SIGNAL(7402, 2, 1, 0);
4747
4848NETLIB_DEVICE(7402_dip,
4949
50    NETLIB_NAME(7402) m_1;
51    NETLIB_NAME(7402) m_2;
52    NETLIB_NAME(7402) m_3;
53    NETLIB_NAME(7402) m_4;
50   NETLIB_NAME(7402) m_1;
51   NETLIB_NAME(7402) m_2;
52   NETLIB_NAME(7402) m_3;
53   NETLIB_NAME(7402) m_4;
5454);
5555
5656#endif /* NLD_7402_H_ */
trunk/src/emu/netlist/devices/nld_7427.c
r29404r29405
77
88NETLIB_START(7427_dip)
99{
10    register_sub(m_1, "1");
11    register_sub(m_2, "2");
12    register_sub(m_3, "3");
10   register_sub(m_1, "1");
11   register_sub(m_2, "2");
12   register_sub(m_3, "3");
1313
14    register_subalias("1", m_1.m_i[0]);
15    register_subalias("2", m_1.m_i[1]);
16    register_subalias("3", m_2.m_i[0]);
17    register_subalias("4", m_2.m_i[1]);
18    register_subalias("5", m_2.m_i[2]);
19    register_subalias("6", m_2.m_Q);
14   register_subalias("1", m_1.m_i[0]);
15   register_subalias("2", m_1.m_i[1]);
16   register_subalias("3", m_2.m_i[0]);
17   register_subalias("4", m_2.m_i[1]);
18   register_subalias("5", m_2.m_i[2]);
19   register_subalias("6", m_2.m_Q);
2020
21    register_subalias("8", m_3.m_Q);
22    register_subalias("9", m_3.m_i[0]);
23    register_subalias("10", m_3.m_i[1]);
24    register_subalias("11", m_3.m_i[2]);
21   register_subalias("8", m_3.m_Q);
22   register_subalias("9", m_3.m_i[0]);
23   register_subalias("10", m_3.m_i[1]);
24   register_subalias("11", m_3.m_i[2]);
2525
26    register_subalias("12", m_1.m_Q);
27    register_subalias("13", m_1.m_i[2]);
26   register_subalias("12", m_1.m_Q);
27   register_subalias("13", m_1.m_i[2]);
2828}
2929
3030NETLIB_UPDATE(7427_dip)
3131{
32    /* only called during startup */
33    m_1.update_dev();
34    m_2.update_dev();
35    m_3.update_dev();
32   /* only called during startup */
33   m_1.update_dev();
34   m_2.update_dev();
35   m_3.update_dev();
3636}
3737
3838NETLIB_RESET(7427_dip)
3939{
40    m_1.do_reset();
41    m_2.do_reset();
42    m_3.do_reset();
40   m_1.do_reset();
41   m_2.do_reset();
42   m_3.do_reset();
4343}
44
trunk/src/emu/netlist/devices/nld_7404.h
r29404r29405
4343      NET_CONNECT(_name, A, _A)
4444
4545#define TTL_7404_DIP(_name)                                                         \
46        NET_REGISTER_DEV(7402_dip, _name)
46      NET_REGISTER_DEV(7402_dip, _name)
4747
4848NETLIB_DEVICE(7404_dip,
4949
50    NETLIB_NAME(7404) m_1;
51    NETLIB_NAME(7404) m_2;
52    NETLIB_NAME(7404) m_3;
53    NETLIB_NAME(7404) m_4;
54    NETLIB_NAME(7404) m_5;
55    NETLIB_NAME(7404) m_6;
50   NETLIB_NAME(7404) m_1;
51   NETLIB_NAME(7404) m_2;
52   NETLIB_NAME(7404) m_3;
53   NETLIB_NAME(7404) m_4;
54   NETLIB_NAME(7404) m_5;
55   NETLIB_NAME(7404) m_6;
5656);
5757#endif /* NLD_7404_H_ */
trunk/src/emu/netlist/devices/nld_legacy.c
r29404r29405
1616
1717NETLIB_RESET(nicRSFF)
1818{
19    m_Q.initial(0);
20    m_QQ.initial(1);
19   m_Q.initial(0);
20   m_QQ.initial(1);
2121}
2222
2323NETLIB_UPDATE(nicRSFF)
trunk/src/emu/netlist/devices/nld_7483.c
r29404r29405
2828
2929NETLIB_RESET(7483)
3030{
31    m_lastr = 0;
31   m_lastr = 0;
3232}
3333
3434NETLIB_UPDATE(7483)
r29404r29405
5151
5252NETLIB_START(7483_dip)
5353{
54    NETLIB_NAME(7483)::start();
55    register_subalias("1", m_A4);
56    register_subalias("2", m_S3);
57    register_subalias("3", m_A3);
58    register_subalias("4", m_B3);
59    // register_subalias("5", ); --> VCC
60    register_subalias("6", m_S2);
61    register_subalias("7", m_B2);
62    register_subalias("8", m_A2);
54   NETLIB_NAME(7483)::start();
55   register_subalias("1", m_A4);
56   register_subalias("2", m_S3);
57   register_subalias("3", m_A3);
58   register_subalias("4", m_B3);
59   // register_subalias("5", ); --> VCC
60   register_subalias("6", m_S2);
61   register_subalias("7", m_B2);
62   register_subalias("8", m_A2);
6363
64    register_subalias("9", m_S1);
65    register_subalias("10", m_A1);
66    register_subalias("11", m_B1);
67    // register_subalias("12", ); --> GND
68    register_subalias("13", m_C0);
69    register_subalias("14", m_C4);
70    register_subalias("15", m_S4);
71    register_subalias("16", m_B4);
64   register_subalias("9", m_S1);
65   register_subalias("10", m_A1);
66   register_subalias("11", m_B1);
67   // register_subalias("12", ); --> GND
68   register_subalias("13", m_C0);
69   register_subalias("14", m_C4);
70   register_subalias("15", m_S4);
71   register_subalias("16", m_B4);
7272
7373}
7474
7575NETLIB_UPDATE(7483_dip)
7676{
77    NETLIB_NAME(7483)::update();
77   NETLIB_NAME(7483)::update();
7878}
7979
8080NETLIB_RESET(7483_dip)
8181{
82    NETLIB_NAME(7483)::reset();
82   NETLIB_NAME(7483)::reset();
8383}
trunk/src/emu/netlist/devices/nld_7425.h
r29404r29405
4949NETLIB_SIGNAL(7425, 4, 1, 0);
5050
5151#define TTL_7425_DIP(_name)                                                         \
52        NET_REGISTER_DEV(7425_dip, _name)
52      NET_REGISTER_DEV(7425_dip, _name)
5353
5454NETLIB_DEVICE(7425_dip,
5555
56    NETLIB_NAME(7425) m_1;
57    NETLIB_NAME(7425) m_2;
56   NETLIB_NAME(7425) m_1;
57   NETLIB_NAME(7425) m_2;
5858);
5959#endif /* NLD_7425_H_ */
trunk/src/emu/netlist/devices/nld_7448.c
r29404r29405
99
1010NETLIB_START(7448)
1111{
12    register_sub(sub, "sub");
12   register_sub(sub, "sub");
1313
14    register_subalias("A", sub.m_A);
15    register_subalias("B", sub.m_B);
16    register_subalias("C", sub.m_C);
17    register_subalias("D", sub.m_D);
18    register_input("LTQ", m_LTQ);
19    register_input("BIQ", m_BIQ);
20    register_subalias("RBIQ",sub.m_RBIQ);
14   register_subalias("A", sub.m_A);
15   register_subalias("B", sub.m_B);
16   register_subalias("C", sub.m_C);
17   register_subalias("D", sub.m_D);
18   register_input("LTQ", m_LTQ);
19   register_input("BIQ", m_BIQ);
20   register_subalias("RBIQ",sub.m_RBIQ);
2121
22    register_subalias("a", sub.m_a);
23    register_subalias("b", sub.m_b);
24    register_subalias("c", sub.m_c);
25    register_subalias("d", sub.m_d);
26    register_subalias("e", sub.m_e);
27    register_subalias("f", sub.m_f);
28    register_subalias("g", sub.m_g);
22   register_subalias("a", sub.m_a);
23   register_subalias("b", sub.m_b);
24   register_subalias("c", sub.m_c);
25   register_subalias("d", sub.m_d);
26   register_subalias("e", sub.m_e);
27   register_subalias("f", sub.m_f);
28   register_subalias("g", sub.m_g);
2929}
3030
3131NETLIB_RESET(7448)
3232{
33    sub.do_reset();
33   sub.do_reset();
3434}
3535
3636NETLIB_UPDATE(7448)
3737{
38    if (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ))
39    {
40        sub.update_outputs(8);
41    }
42    else if (!INPLOGIC(m_BIQ))
43    {
44        sub.update_outputs(15);
45    }
38   if (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ))
39   {
40      sub.update_outputs(8);
41   }
42   else if (!INPLOGIC(m_BIQ))
43   {
44      sub.update_outputs(15);
45   }
4646
47    if (!INPLOGIC(m_BIQ) || (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ)))
48    {
49        sub.m_A.inactivate();
50        sub.m_B.inactivate();
51        sub.m_C.inactivate();
52        sub.m_D.inactivate();
53        sub.m_RBIQ.inactivate();
54    } else {
55        sub.m_RBIQ.activate();
56        sub.m_D.activate();
57        sub.m_C.activate();
58        sub.m_B.activate();
59        sub.m_A.activate();
60        sub.update();
61    }
47   if (!INPLOGIC(m_BIQ) || (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ)))
48   {
49      sub.m_A.inactivate();
50      sub.m_B.inactivate();
51      sub.m_C.inactivate();
52      sub.m_D.inactivate();
53      sub.m_RBIQ.inactivate();
54   } else {
55      sub.m_RBIQ.activate();
56      sub.m_D.activate();
57      sub.m_C.activate();
58      sub.m_B.activate();
59      sub.m_A.activate();
60      sub.update();
61   }
6262
6363}
6464
6565NETLIB_START(7448_sub)
6666{
67    register_input("A0", m_A);
68    register_input("A1", m_B);
69    register_input("A2", m_C);
70    register_input("A3", m_D);
71    register_input("RBIQ", m_RBIQ);
67   register_input("A0", m_A);
68   register_input("A1", m_B);
69   register_input("A2", m_C);
70   register_input("A3", m_D);
71   register_input("RBIQ", m_RBIQ);
7272
73    register_output("a", m_a);
74    register_output("b", m_b);
75    register_output("c", m_c);
76    register_output("d", m_d);
77    register_output("e", m_e);
78    register_output("f", m_f);
79    register_output("g", m_g);
73   register_output("a", m_a);
74   register_output("b", m_b);
75   register_output("c", m_c);
76   register_output("d", m_d);
77   register_output("e", m_e);
78   register_output("f", m_f);
79   register_output("g", m_g);
8080
81    save(NAME(m_state));
81   save(NAME(m_state));
8282}
8383
8484NETLIB_RESET(7448_sub)
8585{
86    m_state = 0;
86   m_state = 0;
8787}
8888
8989NETLIB_UPDATE(7448_sub)
9090{
91    UINT8 v;
91   UINT8 v;
9292
93    v = (INPLOGIC(m_A) << 0) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_D) << 3);
94    if ((!INPLOGIC(m_RBIQ) && (v==0)))
95            v = 15;
96    update_outputs(v);
93   v = (INPLOGIC(m_A) << 0) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_D) << 3);
94   if ((!INPLOGIC(m_RBIQ) && (v==0)))
95         v = 15;
96   update_outputs(v);
9797}
9898
9999NETLIB_FUNC_VOID(7448_sub, update_outputs, (UINT8 v))
100100{
101    assert(v<16);
102    if (v != m_state)
103    {
104        // max transfer time is 100 NS */
101   assert(v<16);
102   if (v != m_state)
103   {
104      // max transfer time is 100 NS */
105105
106        OUTLOGIC(m_a, tab7448[v][0], NLTIME_FROM_NS(100));
107        OUTLOGIC(m_b, tab7448[v][1], NLTIME_FROM_NS(100));
108        OUTLOGIC(m_c, tab7448[v][2], NLTIME_FROM_NS(100));
109        OUTLOGIC(m_d, tab7448[v][3], NLTIME_FROM_NS(100));
110        OUTLOGIC(m_e, tab7448[v][4], NLTIME_FROM_NS(100));
111        OUTLOGIC(m_f, tab7448[v][5], NLTIME_FROM_NS(100));
112        OUTLOGIC(m_g, tab7448[v][6], NLTIME_FROM_NS(100));
113        m_state = v;
114    }
106      OUTLOGIC(m_a, tab7448[v][0], NLTIME_FROM_NS(100));
107      OUTLOGIC(m_b, tab7448[v][1], NLTIME_FROM_NS(100));
108      OUTLOGIC(m_c, tab7448[v][2], NLTIME_FROM_NS(100));
109      OUTLOGIC(m_d, tab7448[v][3], NLTIME_FROM_NS(100));
110      OUTLOGIC(m_e, tab7448[v][4], NLTIME_FROM_NS(100));
111      OUTLOGIC(m_f, tab7448[v][5], NLTIME_FROM_NS(100));
112      OUTLOGIC(m_g, tab7448[v][6], NLTIME_FROM_NS(100));
113      m_state = v;
114   }
115115}
116116
117117const UINT8 NETLIB_NAME(7448_sub)::tab7448[16][7] =
118118{
119        {   1, 1, 1, 1, 1, 1, 0 },  /* 00 - not blanked ! */
120        {   0, 1, 1, 0, 0, 0, 0 },  /* 01 */
121        {   1, 1, 0, 1, 1, 0, 1 },  /* 02 */
122        {   1, 1, 1, 1, 0, 0, 1 },  /* 03 */
123        {   0, 1, 1, 0, 0, 1, 1 },  /* 04 */
124        {   1, 0, 1, 1, 0, 1, 1 },  /* 05 */
125        {   0, 0, 1, 1, 1, 1, 1 },  /* 06 */
126        {   1, 1, 1, 0, 0, 0, 0 },  /* 07 */
127        {   1, 1, 1, 1, 1, 1, 1 },  /* 08 */
128        {   1, 1, 1, 0, 0, 1, 1 },  /* 09 */
129        {   0, 0, 0, 1, 1, 0, 1 },  /* 10 */
130        {   0, 0, 1, 1, 0, 0, 1 },  /* 11 */
131        {   0, 1, 0, 0, 0, 1, 1 },  /* 12 */
132        {   1, 0, 0, 1, 0, 1, 1 },  /* 13 */
133        {   0, 0, 0, 1, 1, 1, 1 },  /* 14 */
134        {   0, 0, 0, 0, 0, 0, 0 },  /* 15 */
119      {   1, 1, 1, 1, 1, 1, 0 },  /* 00 - not blanked ! */
120      {   0, 1, 1, 0, 0, 0, 0 },  /* 01 */
121      {   1, 1, 0, 1, 1, 0, 1 },  /* 02 */
122      {   1, 1, 1, 1, 0, 0, 1 },  /* 03 */
123      {   0, 1, 1, 0, 0, 1, 1 },  /* 04 */
124      {   1, 0, 1, 1, 0, 1, 1 },  /* 05 */
125      {   0, 0, 1, 1, 1, 1, 1 },  /* 06 */
126      {   1, 1, 1, 0, 0, 0, 0 },  /* 07 */
127      {   1, 1, 1, 1, 1, 1, 1 },  /* 08 */
128      {   1, 1, 1, 0, 0, 1, 1 },  /* 09 */
129      {   0, 0, 0, 1, 1, 0, 1 },  /* 10 */
130      {   0, 0, 1, 1, 0, 0, 1 },  /* 11 */
131      {   0, 1, 0, 0, 0, 1, 1 },  /* 12 */
132      {   1, 0, 0, 1, 0, 1, 1 },  /* 13 */
133      {   0, 0, 0, 1, 1, 1, 1 },  /* 14 */
134      {   0, 0, 0, 0, 0, 0, 0 },  /* 15 */
135135};
136136
137137
138138NETLIB_START(7448_dip)
139139{
140    NETLIB_NAME(7448)::start();
140   NETLIB_NAME(7448)::start();
141141
142    register_subalias("1", sub.m_B);
143    register_subalias("2", sub.m_C);
144    register_subalias("3", m_LTQ);
145    register_subalias("4", m_BIQ);
146    register_subalias("5",sub.m_RBIQ);
147    register_subalias("6", sub.m_D);
148    register_subalias("7", sub.m_A);
142   register_subalias("1", sub.m_B);
143   register_subalias("2", sub.m_C);
144   register_subalias("3", m_LTQ);
145   register_subalias("4", m_BIQ);
146   register_subalias("5",sub.m_RBIQ);
147   register_subalias("6", sub.m_D);
148   register_subalias("7", sub.m_A);
149149
150    register_subalias("9", sub.m_e);
151    register_subalias("10", sub.m_d);
152    register_subalias("11", sub.m_c);
153    register_subalias("12", sub.m_b);
154    register_subalias("13", sub.m_a);
155    register_subalias("14", sub.m_g);
156    register_subalias("15", sub.m_f);
150   register_subalias("9", sub.m_e);
151   register_subalias("10", sub.m_d);
152   register_subalias("11", sub.m_c);
153   register_subalias("12", sub.m_b);
154   register_subalias("13", sub.m_a);
155   register_subalias("14", sub.m_g);
156   register_subalias("15", sub.m_f);
157157}
158158
159159NETLIB_UPDATE(7448_dip)
160160{
161    NETLIB_NAME(7448)::update();
161   NETLIB_NAME(7448)::update();
162162}
163163
164164NETLIB_RESET(7448_dip)
165165{
166    NETLIB_NAME(7448)::reset();
166   NETLIB_NAME(7448)::reset();
167167}
168
trunk/src/emu/netlist/devices/nld_7486.c
r29404r29405
2525
2626NETLIB_START(7486_dip)
2727{
28    register_sub(m_1, "1");
29    register_sub(m_2, "2");
30    register_sub(m_3, "3");
31    register_sub(m_4, "4");
28   register_sub(m_1, "1");
29   register_sub(m_2, "2");
30   register_sub(m_3, "3");
31   register_sub(m_4, "4");
3232
33    register_subalias("1", m_1.m_A);
34    register_subalias("2", m_1.m_B);
35    register_subalias("3", m_1.m_Q);
33   register_subalias("1", m_1.m_A);
34   register_subalias("2", m_1.m_B);
35   register_subalias("3", m_1.m_Q);
3636
37    register_subalias("4", m_2.m_A);
38    register_subalias("5", m_2.m_B);
39    register_subalias("6", m_2.m_Q);
37   register_subalias("4", m_2.m_A);
38   register_subalias("5", m_2.m_B);
39   register_subalias("6", m_2.m_Q);
4040
41    register_subalias("9", m_3.m_A);
42    register_subalias("10", m_3.m_B);
43    register_subalias("8", m_3.m_Q);
41   register_subalias("9", m_3.m_A);
42   register_subalias("10", m_3.m_B);
43   register_subalias("8", m_3.m_Q);
4444
45    register_subalias("12", m_4.m_A);
46    register_subalias("13", m_4.m_B);
47    register_subalias("11", m_4.m_Q);
45   register_subalias("12", m_4.m_A);
46   register_subalias("13", m_4.m_B);
47   register_subalias("11", m_4.m_Q);
4848}
4949
5050NETLIB_UPDATE(7486_dip)
5151{
52    /* only called during startup */
53    m_1.update_dev();
54    m_2.update_dev();
55    m_3.update_dev();
56    m_4.update_dev();
52   /* only called during startup */
53   m_1.update_dev();
54   m_2.update_dev();
55   m_3.update_dev();
56   m_4.update_dev();
5757}
5858
5959NETLIB_RESET(7486_dip)
6060{
61    m_1.do_reset();
62    m_2.do_reset();
63    m_3.do_reset();
64    m_4.do_reset();
61   m_1.do_reset();
62   m_2.do_reset();
63   m_3.do_reset();
64   m_4.do_reset();
6565}
66
trunk/src/emu/netlist/devices/nld_7427.h
r29404r29405
4343NETLIB_SIGNAL(7427, 3, 1, 0);
4444
4545#define TTL_7427_DIP(_name)                                                         \
46        NET_REGISTER_DEV(7427_dip, _name)
46      NET_REGISTER_DEV(7427_dip, _name)
4747
4848NETLIB_DEVICE(7427_dip,
4949
50    NETLIB_NAME(7427) m_1;
51    NETLIB_NAME(7427) m_2;
52    NETLIB_NAME(7427) m_3;
50   NETLIB_NAME(7427) m_1;
51   NETLIB_NAME(7427) m_2;
52   NETLIB_NAME(7427) m_3;
5353);
5454#endif /* NLD_7427_H_ */
trunk/src/emu/netlist/devices/nld_7483.h
r29404r29405
4242      NET_CONNECT(_name, C0, _CI)
4343
4444#define TTL_7483_DIP(_name)                                                         \
45        NET_REGISTER_DEV(7483_dip, _name)
45      NET_REGISTER_DEV(7483_dip, _name)
4646
4747NETLIB_DEVICE(7483,
4848   netlist_ttl_input_t m_C0;
trunk/src/emu/netlist/devices/nld_7448.h
r29404r29405
2727#include "../nl_base.h"
2828
2929#define TTL_7448(_name, _A0, _A1, _A2, _A3, _LTQ, _BIQ, _RBIQ)                      \
30        NET_REGISTER_DEV(7448, _name)                                               \
31        NET_CONNECT(_name, A, _A0)                                                  \
32        NET_CONNECT(_name, B, _A1)                                                  \
33        NET_CONNECT(_name, C, _A2)                                                  \
34        NET_CONNECT(_name, D, _A3)                                                  \
35        NET_CONNECT(_name, LTQ, _LTQ)                                               \
36        NET_CONNECT(_name, BIQ, _BIQ)                                               \
37        NET_CONNECT(_name, RBIQ, _RBIQ)
30      NET_REGISTER_DEV(7448, _name)                                               \
31      NET_CONNECT(_name, A, _A0)                                                  \
32      NET_CONNECT(_name, B, _A1)                                                  \
33      NET_CONNECT(_name, C, _A2)                                                  \
34      NET_CONNECT(_name, D, _A3)                                                  \
35      NET_CONNECT(_name, LTQ, _LTQ)                                               \
36      NET_CONNECT(_name, BIQ, _BIQ)                                               \
37      NET_CONNECT(_name, RBIQ, _RBIQ)
3838
3939#define TTL_7448_DIP(_name)                                                         \
40        NET_REGISTER_DEV(7448_dip, _name)
40      NET_REGISTER_DEV(7448_dip, _name)
4141
4242NETLIB_SUBDEVICE(7448_sub,
43    ATTR_HOT void update_outputs(UINT8 v);
44    static const UINT8 tab7448[16][7];
43   ATTR_HOT void update_outputs(UINT8 v);
44   static const UINT8 tab7448[16][7];
4545
46    netlist_ttl_input_t m_A;
47    netlist_ttl_input_t m_B;
48    netlist_ttl_input_t m_C;
49    netlist_ttl_input_t m_D;
50    netlist_ttl_input_t m_RBIQ;
46   netlist_ttl_input_t m_A;
47   netlist_ttl_input_t m_B;
48   netlist_ttl_input_t m_C;
49   netlist_ttl_input_t m_D;
50   netlist_ttl_input_t m_RBIQ;
5151
52    UINT8 m_state;
52   UINT8 m_state;
5353
54    netlist_ttl_output_t m_a;
55    netlist_ttl_output_t m_b;
56    netlist_ttl_output_t m_c;
57    netlist_ttl_output_t m_d;
58    netlist_ttl_output_t m_e;
59    netlist_ttl_output_t m_f;
60    netlist_ttl_output_t m_g;
54   netlist_ttl_output_t m_a;
55   netlist_ttl_output_t m_b;
56   netlist_ttl_output_t m_c;
57   netlist_ttl_output_t m_d;
58   netlist_ttl_output_t m_e;
59   netlist_ttl_output_t m_f;
60   netlist_ttl_output_t m_g;
6161);
6262
6363NETLIB_DEVICE(7448,
6464public:
65    NETLIB_NAME(7448_sub) sub;
65   NETLIB_NAME(7448_sub) sub;
6666
67    netlist_ttl_input_t m_LTQ;
68    netlist_ttl_input_t m_BIQ;
67   netlist_ttl_input_t m_LTQ;
68   netlist_ttl_input_t m_BIQ;
6969);
7070
7171NETLIB_DEVICE_DERIVED(7448_dip, 7448,
trunk/src/emu/netlist/devices/nld_7486.h
r29404r29405
4747);
4848
4949#define TTL_7486_DIP(_name)                                                         \
50        NET_REGISTER_DEV(7486_dip, _name)
50      NET_REGISTER_DEV(7486_dip, _name)
5151
5252NETLIB_DEVICE(7486_dip,
5353
54    NETLIB_NAME(7486) m_1;
55    NETLIB_NAME(7486) m_2;
56    NETLIB_NAME(7486) m_3;
57    NETLIB_NAME(7486) m_4;
54   NETLIB_NAME(7486) m_1;
55   NETLIB_NAME(7486) m_2;
56   NETLIB_NAME(7486) m_3;
57   NETLIB_NAME(7486) m_4;
5858);
5959
6060#endif /* NLD_7486_H_ */
trunk/src/emu/netlist/devices/nld_74153.c
r29404r29405
1212
1313NETLIB_START(74153sub)
1414{
15    register_input("C0", m_C[0]);
16    register_input("C1", m_C[1]);
17    register_input("C2", m_C[2]);
18    register_input("C3", m_C[3]);
19    register_input("G", m_G);
15   register_input("C0", m_C[0]);
16   register_input("C1", m_C[1]);
17   register_input("C2", m_C[2]);
18   register_input("C3", m_C[3]);
19   register_input("G", m_G);
2020
21    register_output("AY", m_Y); //FIXME: Change netlists
21   register_output("AY", m_Y); //FIXME: Change netlists
2222
23    m_chan = 0;
23   m_chan = 0;
2424
25    save(NAME(m_chan));
25   save(NAME(m_chan));
2626}
2727
2828NETLIB_RESET(74153sub)
2929{
30    m_chan = 0;
30   m_chan = 0;
3131}
3232
3333NETLIB_UPDATE(74153sub)
3434{
35    const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
36    if (!INPLOGIC(m_G))
37    {
38        UINT8 t = INPLOGIC(m_C[m_chan]);
39        OUTLOGIC(m_Y, t, delay[t] );
40    }
41    else
42    {
43        OUTLOGIC(m_Y, 0, delay[0]);
44    }
35   const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
36   if (!INPLOGIC(m_G))
37   {
38      UINT8 t = INPLOGIC(m_C[m_chan]);
39      OUTLOGIC(m_Y, t, delay[t] );
40   }
41   else
42   {
43      OUTLOGIC(m_Y, 0, delay[0]);
44   }
4545}
4646
4747
4848NETLIB_START(74153)
4949{
50    register_sub(m_sub, "SUB");
50   register_sub(m_sub, "SUB");
5151
5252   register_subalias("C0", m_sub.m_C[0]);
5353   register_subalias("C1",  m_sub.m_C[1]);
r29404r29405
6868
6969NETLIB_UPDATE(74153)
7070{
71    m_sub.m_chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
72    m_sub.update();
71   m_sub.m_chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
72   m_sub.update();
7373}
7474
7575
7676NETLIB_START(74153_dip)
7777{
78    register_sub(m_1, "1");
79    register_sub(m_2, "2");
78   register_sub(m_1, "1");
79   register_sub(m_2, "2");
8080
81    register_subalias("1", m_1.m_G);
82    register_input("2", m_B);    // m_2.m_B
83    register_subalias("3", m_1.m_C[3]);
84    register_subalias("4", m_1.m_C[2]);
85    register_subalias("5", m_1.m_C[1]);
86    register_subalias("6", m_1.m_C[0]);
87    register_subalias("7", m_1.m_Y);
81   register_subalias("1", m_1.m_G);
82   register_input("2", m_B);    // m_2.m_B
83   register_subalias("3", m_1.m_C[3]);
84   register_subalias("4", m_1.m_C[2]);
85   register_subalias("5", m_1.m_C[1]);
86   register_subalias("6", m_1.m_C[0]);
87   register_subalias("7", m_1.m_Y);
8888
89    register_subalias("9", m_2.m_Y);
90    register_subalias("10", m_2.m_C[0]);
91    register_subalias("11", m_2.m_C[1]);
92    register_subalias("12", m_2.m_C[2]);
93    register_subalias("13", m_2.m_C[3]);
89   register_subalias("9", m_2.m_Y);
90   register_subalias("10", m_2.m_C[0]);
91   register_subalias("11", m_2.m_C[1]);
92   register_subalias("12", m_2.m_C[2]);
93   register_subalias("13", m_2.m_C[3]);
9494
95    register_input("14", m_A);   // m_2.m_B
96    register_subalias("15", m_2.m_G);
95   register_input("14", m_A);   // m_2.m_B
96   register_subalias("15", m_2.m_G);
9797}
9898
9999NETLIB_UPDATE(74153_dip)
100100{
101    m_2.m_chan = m_1.m_chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
102    m_1.update();
103    m_2.update();
101   m_2.m_chan = m_1.m_chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
102   m_1.update();
103   m_2.update();
104104}
105105
106106NETLIB_RESET(74153_dip)
107107{
108    m_1.do_reset();
109    m_2.do_reset();
108   m_1.do_reset();
109   m_2.do_reset();
110110}
111
trunk/src/emu/netlist/devices/nld_system.c
r29404r29405
5151
5252NETLIB_UPDATE(ttl_input)
5353{
54    OUTLOGIC(m_Q, m_IN.Value() & 1, netlist_time::from_nsec(1));
54   OUTLOGIC(m_Q, m_IN.Value() & 1, netlist_time::from_nsec(1));
5555}
5656
5757NETLIB_UPDATE_PARAM(ttl_input)
5858{
59    update();
59   update();
6060}
6161
6262// ----------------------------------------------------------------------------------------
r29404r29405
6666NETLIB_START(analog_input)
6767{
6868   register_output("Q", m_Q);
69    register_param("IN", m_IN, 0.0);
69   register_param("IN", m_IN, 0.0);
7070}
7171
7272NETLIB_RESET(analog_input)
r29404r29405
7575
7676NETLIB_UPDATE(analog_input)
7777{
78    OUTANALOG(m_Q, m_IN.Value(), NLTIME_IMMEDIATE);
78   OUTANALOG(m_Q, m_IN.Value(), NLTIME_IMMEDIATE);
7979}
8080
8181NETLIB_UPDATE_PARAM(analog_input)
8282{
83    update();
83   update();
8484}
trunk/src/emu/netlist/devices/nld_74153.h
r29404r29405
5858      NET_CONNECT(_name, G, _G)
5959
6060#define TTL_74153_DIP(_name)                                                         \
61        NET_REGISTER_DEV(74153_dip, _name)
61      NET_REGISTER_DEV(74153_dip, _name)
6262
6363NETLIB_SUBDEVICE(74153sub,
64    netlist_ttl_input_t m_C[4];
65    netlist_ttl_input_t m_G;
64   netlist_ttl_input_t m_C[4];
65   netlist_ttl_input_t m_G;
6666
67    netlist_ttl_output_t m_Y;
67   netlist_ttl_output_t m_Y;
6868
69    int m_chan;
69   int m_chan;
7070);
7171
7272NETLIB_DEVICE(74153,
7373public:
74    NETLIB_NAME(74153sub) m_sub;
74   NETLIB_NAME(74153sub) m_sub;
7575   netlist_ttl_input_t m_A;
7676   netlist_ttl_input_t m_B;
7777);
7878
7979NETLIB_DEVICE(74153_dip,
8080
81    NETLIB_NAME(74153sub) m_1;
82    NETLIB_NAME(74153sub) m_2;
83    netlist_ttl_input_t m_A;
84    netlist_ttl_input_t m_B;
81   NETLIB_NAME(74153sub) m_1;
82   NETLIB_NAME(74153sub) m_2;
83   netlist_ttl_input_t m_A;
84   netlist_ttl_input_t m_B;
8585);
8686
8787#endif /* NLD_74153_H_ */
trunk/src/emu/netlist/devices/nld_system.h
r29404r29405
2727
2828#define MAINCLOCK(_name, _freq)                                              \
2929      NET_REGISTER_DEV(mainclock, _name)                                   \
30        PARAM(_name.FREQ, _freq)
30      PARAM(_name.FREQ, _freq)
3131
3232#define CLOCK(_name, _freq)                                                  \
3333      NET_REGISTER_DEV(clock, _name)                                       \
34        PARAM(_name.FREQ, _freq)
34      PARAM(_name.FREQ, _freq)
3535
3636#define GNDA()                                                                \
37        NET_REGISTER_DEV(gnd, GND)
37      NET_REGISTER_DEV(gnd, GND)
3838
3939// ----------------------------------------------------------------------------------------
4040// mainclock
r29404r29405
4747   netlist_param_double_t m_freq;
4848   netlist_time m_inc;
4949
50    ATTR_HOT inline static void mc_update(netlist_net_t &net);
50   ATTR_HOT inline static void mc_update(netlist_net_t &net);
5151);
5252
5353// ----------------------------------------------------------------------------------------
r29404r29405
7676NETLIB_DEVICE_WITH_PARAMS(analog_input,
7777   netlist_analog_output_t m_Q;
7878
79    netlist_param_double_t m_IN;
79   netlist_param_double_t m_IN;
8080);
8181
8282// ----------------------------------------------------------------------------------------
r29404r29405
8686class nld_gnd : public netlist_device_t
8787{
8888public:
89    ATTR_COLD nld_gnd()
90            : netlist_device_t(GND) { }
89   ATTR_COLD nld_gnd()
90         : netlist_device_t(GND) { }
9191
92    ATTR_COLD virtual ~nld_gnd() {}
92   ATTR_COLD virtual ~nld_gnd() {}
9393
9494protected:
9595
96    ATTR_COLD void start()
97    {
98        register_output("Q", m_Q);
99    }
96   ATTR_COLD void start()
97   {
98      register_output("Q", m_Q);
99   }
100100
101    ATTR_COLD void reset()
102    {
103    }
101   ATTR_COLD void reset()
102   {
103   }
104104
105    ATTR_HOT ATTR_ALIGN void update()
106    {
107        OUTANALOG(m_Q, 0.0, NLTIME_IMMEDIATE);
108    }
105   ATTR_HOT ATTR_ALIGN void update()
106   {
107      OUTANALOG(m_Q, 0.0, NLTIME_IMMEDIATE);
108   }
109109
110110private:
111    netlist_analog_output_t m_Q;
111   netlist_analog_output_t m_Q;
112112
113113};
114114
r29404r29405
120120class nld_a_to_d_proxy : public netlist_device_t
121121{
122122public:
123    ATTR_COLD nld_a_to_d_proxy(netlist_input_t &in_proxied)
124            : netlist_device_t()
125    {
126        assert(in_proxied.family() == LOGIC);
127        m_I.m_family_desc = in_proxied.m_family_desc;
128    }
123   ATTR_COLD nld_a_to_d_proxy(netlist_input_t &in_proxied)
124         : netlist_device_t()
125   {
126      assert(in_proxied.family() == LOGIC);
127      m_I.m_family_desc = in_proxied.m_family_desc;
128   }
129129
130    ATTR_COLD virtual ~nld_a_to_d_proxy() {}
130   ATTR_COLD virtual ~nld_a_to_d_proxy() {}
131131
132    netlist_analog_input_t m_I;
133    netlist_ttl_output_t m_Q;
132   netlist_analog_input_t m_I;
133   netlist_ttl_output_t m_Q;
134134
135135protected:
136    ATTR_COLD void start()
137    {
138        register_input("I", m_I);
139        register_output("Q", m_Q);
140    }
136   ATTR_COLD void start()
137   {
138      register_input("I", m_I);
139      register_output("Q", m_Q);
140   }
141141
142    ATTR_COLD void reset()
143    {
144    }
142   ATTR_COLD void reset()
143   {
144   }
145145
146    ATTR_HOT ATTR_ALIGN void update()
147    {
148        if (m_I.Q_Analog() > m_I.m_family_desc->m_high_thresh_V)
149            OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(1));
150        else if (m_I.Q_Analog() < m_I.m_family_desc->m_low_thresh_V)
151            OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(1));
152        //else
153        //  OUTLOGIC(m_Q, m_Q.net().last_Q(), NLTIME_FROM_NS(1));
154    }
146   ATTR_HOT ATTR_ALIGN void update()
147   {
148      if (m_I.Q_Analog() > m_I.m_family_desc->m_high_thresh_V)
149         OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(1));
150      else if (m_I.Q_Analog() < m_I.m_family_desc->m_low_thresh_V)
151         OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(1));
152      //else
153      //  OUTLOGIC(m_Q, m_Q.net().last_Q(), NLTIME_FROM_NS(1));
154   }
155155
156156};
157157
r29404r29405
162162class nld_base_d_to_a_proxy : public netlist_device_t
163163{
164164public:
165    ATTR_COLD nld_base_d_to_a_proxy(netlist_output_t &out_proxied)
166            : netlist_device_t()
167    {
168        assert(out_proxied.family() == LOGIC);
169        m_family_desc = out_proxied.m_family_desc;
170    }
165   ATTR_COLD nld_base_d_to_a_proxy(netlist_output_t &out_proxied)
166         : netlist_device_t()
167   {
168      assert(out_proxied.family() == LOGIC);
169      m_family_desc = out_proxied.m_family_desc;
170   }
171171
172    ATTR_COLD virtual ~nld_base_d_to_a_proxy() {}
172   ATTR_COLD virtual ~nld_base_d_to_a_proxy() {}
173173
174    ATTR_COLD virtual netlist_core_terminal_t &out() = 0;
174   ATTR_COLD virtual netlist_core_terminal_t &out() = 0;
175175
176    netlist_ttl_input_t m_I;
176   netlist_ttl_input_t m_I;
177177
178178protected:
179    ATTR_COLD void start()
180    {
181        register_input("I", m_I);
182    }
179   ATTR_COLD void start()
180   {
181      register_input("I", m_I);
182   }
183183
184184private:
185185};
r29404r29405
188188class nld_d_to_a_proxy : public nld_base_d_to_a_proxy
189189{
190190public:
191    ATTR_COLD nld_d_to_a_proxy(netlist_output_t &out_proxied)
192            : nld_base_d_to_a_proxy(out_proxied)
193    {
194    }
191   ATTR_COLD nld_d_to_a_proxy(netlist_output_t &out_proxied)
192         : nld_base_d_to_a_proxy(out_proxied)
193   {
194   }
195195
196    ATTR_COLD virtual ~nld_d_to_a_proxy() {}
196   ATTR_COLD virtual ~nld_d_to_a_proxy() {}
197197
198198protected:
199    ATTR_COLD void start()
200    {
201        nld_base_d_to_a_proxy::start();
202        register_output("Q", m_Q);
203    }
199   ATTR_COLD void start()
200   {
201      nld_base_d_to_a_proxy::start();
202      register_output("Q", m_Q);
203   }
204204
205    ATTR_COLD void reset()
206    {
207        //m_Q.initial(0);
208    }
205   ATTR_COLD void reset()
206   {
207      //m_Q.initial(0);
208   }
209209
210    ATTR_COLD virtual netlist_core_terminal_t &out()
211    {
212        return m_Q;
213    }
210   ATTR_COLD virtual netlist_core_terminal_t &out()
211   {
212      return m_Q;
213   }
214214
215    ATTR_HOT ATTR_ALIGN void update()
216    {
217        OUTANALOG(m_Q, INPLOGIC(m_I) ? m_family_desc->m_high_V : m_family_desc->m_low_V, NLTIME_FROM_NS(1));
218    }
215   ATTR_HOT ATTR_ALIGN void update()
216   {
217      OUTANALOG(m_Q, INPLOGIC(m_I) ? m_family_desc->m_high_V : m_family_desc->m_low_V, NLTIME_FROM_NS(1));
218   }
219219
220220private:
221    netlist_analog_output_t m_Q;
221   netlist_analog_output_t m_Q;
222222};
223223#else
224224class nld_d_to_a_proxy : public nld_base_d_to_a_proxy
225225{
226226public:
227    ATTR_COLD nld_d_to_a_proxy(netlist_output_t &out_proxied)
228            : nld_base_d_to_a_proxy(out_proxied)
229    {
230    }
227   ATTR_COLD nld_d_to_a_proxy(netlist_output_t &out_proxied)
228         : nld_base_d_to_a_proxy(out_proxied)
229   {
230   }
231231
232    ATTR_COLD virtual ~nld_d_to_a_proxy() {}
232   ATTR_COLD virtual ~nld_d_to_a_proxy() {}
233233
234234protected:
235    ATTR_COLD void start()
236    {
237        nld_base_d_to_a_proxy::start();
235   ATTR_COLD void start()
236   {
237      nld_base_d_to_a_proxy::start();
238238
239        register_sub(m_R, "R");
240        register_output("_Q", m_Q);
241        register_subalias("Q", m_R.m_N);
239      register_sub(m_R, "R");
240      register_output("_Q", m_Q);
241      register_subalias("Q", m_R.m_N);
242242
243        connect(m_R.m_P, m_Q);
243      connect(m_R.m_P, m_Q);
244244
245        //m_Q.initial(m_family_desc->m_low_V);
246        //m_R.set_R(m_family_desc->m_R_low);
247    }
245      //m_Q.initial(m_family_desc->m_low_V);
246      //m_R.set_R(m_family_desc->m_R_low);
247   }
248248
249    ATTR_COLD void reset()
250    {
251        //m_Q.initial(m_family_desc->m_low_V);
252        //m_R.set_R(m_family_desc->m_R_low);
253        m_R.do_reset();
254    }
249   ATTR_COLD void reset()
250   {
251      //m_Q.initial(m_family_desc->m_low_V);
252      //m_R.set_R(m_family_desc->m_R_low);
253      m_R.do_reset();
254   }
255255
256    ATTR_COLD virtual netlist_core_terminal_t &out()
257    {
258        return m_R.m_N;
259    }
256   ATTR_COLD virtual netlist_core_terminal_t &out()
257   {
258      return m_R.m_N;
259   }
260260
261    ATTR_HOT ATTR_ALIGN void update()
262    {
263        double R = INPLOGIC(m_I) ? m_family_desc->m_R_high : m_family_desc->m_R_low;
264        double V = INPLOGIC(m_I) ? m_family_desc->m_high_V : m_family_desc->m_low_V;
265        //printf("%f %f\n", R, V);
266        m_R.set_R(R);
267        OUTANALOG(m_Q, V, NLTIME_FROM_NS(0));
268    }
261   ATTR_HOT ATTR_ALIGN void update()
262   {
263      double R = INPLOGIC(m_I) ? m_family_desc->m_R_high : m_family_desc->m_R_low;
264      double V = INPLOGIC(m_I) ? m_family_desc->m_high_V : m_family_desc->m_low_V;
265      //printf("%f %f\n", R, V);
266      m_R.set_R(R);
267      OUTANALOG(m_Q, V, NLTIME_FROM_NS(0));
268   }
269269
270270private:
271    netlist_analog_output_t m_Q;
272    nld_R_base m_R;
271   netlist_analog_output_t m_Q;
272   nld_R_base m_R;
273273};
274274#endif
275275
trunk/src/emu/netlist/devices/nld_7410.c
r29404r29405
77
88NETLIB_START(7410_dip)
99{
10    register_sub(m_1, "1");
11    register_sub(m_2, "2");
12    register_sub(m_3, "3");
10   register_sub(m_1, "1");
11   register_sub(m_2, "2");
12   register_sub(m_3, "3");
1313
14    register_subalias("1", m_1.m_i[0]);
15    register_subalias("2", m_1.m_i[1]);
16    register_subalias("3", m_2.m_i[0]);
17    register_subalias("4", m_2.m_i[1]);
18    register_subalias("5", m_2.m_i[2]);
19    register_subalias("6", m_2.m_Q);
14   register_subalias("1", m_1.m_i[0]);
15   register_subalias("2", m_1.m_i[1]);
16   register_subalias("3", m_2.m_i[0]);
17   register_subalias("4", m_2.m_i[1]);
18   register_subalias("5", m_2.m_i[2]);
19   register_subalias("6", m_2.m_Q);
2020
21    register_subalias("8", m_3.m_Q);
22    register_subalias("9", m_3.m_i[0]);
23    register_subalias("10", m_3.m_i[1]);
24    register_subalias("11", m_3.m_i[2]);
21   register_subalias("8", m_3.m_Q);
22   register_subalias("9", m_3.m_i[0]);
23   register_subalias("10", m_3.m_i[1]);
24   register_subalias("11", m_3.m_i[2]);
2525
26    register_subalias("12", m_1.m_Q);
27    register_subalias("13", m_1.m_i[2]);
26   register_subalias("12", m_1.m_Q);
27   register_subalias("13", m_1.m_i[2]);
2828}
2929
3030NETLIB_UPDATE(7410_dip)
3131{
32    /* only called during startup */
33    m_1.update_dev();
34    m_2.update_dev();
35    m_3.update_dev();
32   /* only called during startup */
33   m_1.update_dev();
34   m_2.update_dev();
35   m_3.update_dev();
3636}
3737
3838NETLIB_RESET(7410_dip)
3939{
40    m_1.do_reset();
41    m_2.do_reset();
42    m_3.do_reset();
40   m_1.do_reset();
41   m_2.do_reset();
42   m_3.do_reset();
4343}
44
trunk/src/emu/netlist/devices/nld_7430.c
r29404r29405
77
88NETLIB_START(7430_dip)
99{
10    register_sub(m_1, "1");
10   register_sub(m_1, "1");
1111
12    register_subalias("1", m_1.m_i[0]);
13    register_subalias("2", m_1.m_i[1]);
14    register_subalias("3", m_1.m_i[2]);
15    register_subalias("4", m_1.m_i[3]);
16    register_subalias("5", m_1.m_i[4]);
17    register_subalias("6", m_1.m_i[5]);
12   register_subalias("1", m_1.m_i[0]);
13   register_subalias("2", m_1.m_i[1]);
14   register_subalias("3", m_1.m_i[2]);
15   register_subalias("4", m_1.m_i[3]);
16   register_subalias("5", m_1.m_i[4]);
17   register_subalias("6", m_1.m_i[5]);
1818
19    register_subalias("8", m_1.m_Q);
19   register_subalias("8", m_1.m_Q);
2020
21    register_subalias("11", m_1.m_i[6]);
22    register_subalias("12", m_1.m_i[7]);
21   register_subalias("11", m_1.m_i[6]);
22   register_subalias("12", m_1.m_i[7]);
2323}
2424
2525NETLIB_UPDATE(7430_dip)
2626{
27    /* only called during startup */
28    m_1.update_dev();
27   /* only called during startup */
28   m_1.update_dev();
2929}
3030
3131NETLIB_RESET(7430_dip)
3232{
33    m_1.do_reset();
33   m_1.do_reset();
3434}
35
trunk/src/emu/netlist/devices/nld_7450.c
r29404r29405
77
88NETLIB_START(7450)
99{
10    register_input("A", m_A);
11    register_input("B", m_B);
12    register_input("C", m_C);
13    register_input("D", m_D);
14    register_output("Q", m_Q);
10   register_input("A", m_A);
11   register_input("B", m_B);
12   register_input("C", m_C);
13   register_input("D", m_D);
14   register_output("Q", m_Q);
1515}
1616
1717NETLIB_RESET(7450)
r29404r29405
2020
2121NETLIB_UPDATE(7450)
2222{
23    m_A.activate();
24    m_B.activate();
25    m_C.activate();
26    m_D.activate();
27    UINT8 t1 = INPLOGIC(m_A) & INPLOGIC(m_B);
28    UINT8 t2 = INPLOGIC(m_C) & INPLOGIC(m_D);
23   m_A.activate();
24   m_B.activate();
25   m_C.activate();
26   m_D.activate();
27   UINT8 t1 = INPLOGIC(m_A) & INPLOGIC(m_B);
28   UINT8 t2 = INPLOGIC(m_C) & INPLOGIC(m_D);
2929
30    const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) };
30   const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) };
3131
32    UINT8 res = 0;
33    if (t1 ^ 1)
34    {
35        if (t2 ^ 1)
36        {
37            res = 1;
38        }
39        else
40        {
41            m_A.inactivate();
42            m_B.inactivate();
43        }
44    } else {
45        if (t2 ^ 1)
46        {
47            m_C.inactivate();
48            m_D.inactivate();
49        }
50    }
51    OUTLOGIC(m_Q, res, times[1 - res]);// ? 22000 : 15000);
32   UINT8 res = 0;
33   if (t1 ^ 1)
34   {
35      if (t2 ^ 1)
36      {
37         res = 1;
38      }
39      else
40      {
41         m_A.inactivate();
42         m_B.inactivate();
43      }
44   } else {
45      if (t2 ^ 1)
46      {
47         m_C.inactivate();
48         m_D.inactivate();
49      }
50   }
51   OUTLOGIC(m_Q, res, times[1 - res]);// ? 22000 : 15000);
5252}
5353
5454
5555NETLIB_START(7450_dip)
5656{
57    register_sub(m_1, "1");
58    register_sub(m_2, "2");
57   register_sub(m_1, "1");
58   register_sub(m_2, "2");
5959
60    register_subalias("1", m_1.m_A);
61    register_subalias("2", m_2.m_A);
62    register_subalias("3", m_2.m_B);
63    register_subalias("4", m_2.m_C);
64    register_subalias("5", m_2.m_D);
65    register_subalias("6", m_2.m_Q);
66    //register_subalias("7",);  GND
60   register_subalias("1", m_1.m_A);
61   register_subalias("2", m_2.m_A);
62   register_subalias("3", m_2.m_B);
63   register_subalias("4", m_2.m_C);
64   register_subalias("5", m_2.m_D);
65   register_subalias("6", m_2.m_Q);
66   //register_subalias("7",);  GND
6767
68    register_subalias("8", m_1.m_Q);
69    register_subalias("9", m_1.m_C);
70    register_subalias("10", m_1.m_D);
71    //register_subalias("11", m_1.m_X1);
72    //register_subalias("12", m_1.m_X1Q);
73    register_subalias("13", m_1.m_B);
74    //register_subalias("14",);  VCC
68   register_subalias("8", m_1.m_Q);
69   register_subalias("9", m_1.m_C);
70   register_subalias("10", m_1.m_D);
71   //register_subalias("11", m_1.m_X1);
72   //register_subalias("12", m_1.m_X1Q);
73   register_subalias("13", m_1.m_B);
74   //register_subalias("14",);  VCC
7575}
7676
7777NETLIB_UPDATE(7450_dip)
7878{
79    /* only called during startup */
80    m_1.update_dev();
81    m_2.update_dev();
79   /* only called during startup */
80   m_1.update_dev();
81   m_2.update_dev();
8282}
8383
8484NETLIB_RESET(7450_dip)
8585{
86    m_1.do_reset();
87    m_2.do_reset();
86   m_1.do_reset();
87   m_2.do_reset();
8888}
89
trunk/src/emu/netlist/devices/nld_4066.c
r29404r29405
2525
2626NETLIB_RESET(4066)
2727{
28    m_R.do_reset();
28   m_R.do_reset();
2929}
3030
3131NETLIB_UPDATE(4066)
3232{
33    double sup = (m_supply->vdd() - m_supply->vss());
34    double low = 0.45 * sup;
35    double high = 0.55 * sup;
36    double in = INPANALOG(m_control) - m_supply->vss();
37    double rON = 270.0 * 5.0 / sup;
33   double sup = (m_supply->vdd() - m_supply->vss());
34   double low = 0.45 * sup;
35   double high = 0.55 * sup;
36   double in = INPANALOG(m_control) - m_supply->vss();
37   double rON = 270.0 * 5.0 / sup;
3838
39    if (in < low)
40    {
41        m_R.set_R(1.0 / netlist().gmin());
42        m_R.update_dev();
43    }
44    else if (in > high)
45    {
46        m_R.set_R(rON);
47        m_R.update_dev();
48    }
39   if (in < low)
40   {
41      m_R.set_R(1.0 / netlist().gmin());
42      m_R.update_dev();
43   }
44   else if (in > high)
45   {
46      m_R.set_R(rON);
47      m_R.update_dev();
48   }
4949}
5050
5151
5252NETLIB_START(4066_dip)
5353{
54    register_sub(m_supply, "supply");
55    m_A.m_supply = m_B.m_supply = m_C.m_supply = m_D.m_supply = &m_supply;
56    register_sub(m_A, "A");
57    register_sub(m_B, "B");
58    register_sub(m_C, "C");
59    register_sub(m_D, "D");
54   register_sub(m_supply, "supply");
55   m_A.m_supply = m_B.m_supply = m_C.m_supply = m_D.m_supply = &m_supply;
56   register_sub(m_A, "A");
57   register_sub(m_B, "B");
58   register_sub(m_C, "C");
59   register_sub(m_D, "D");
6060
61    register_subalias("1", m_A.m_R.m_P);
62    register_subalias("2", m_A.m_R.m_N);
63    register_subalias("3", m_B.m_R.m_P);
64    register_subalias("4", m_B.m_R.m_N);
65    register_subalias("5", m_B.m_control);
66    register_subalias("6", m_C.m_control);
67    register_input("7", m_supply.m_vss);
61   register_subalias("1", m_A.m_R.m_P);
62   register_subalias("2", m_A.m_R.m_N);
63   register_subalias("3", m_B.m_R.m_P);
64   register_subalias("4", m_B.m_R.m_N);
65   register_subalias("5", m_B.m_control);
66   register_subalias("6", m_C.m_control);
67   register_input("7", m_supply.m_vss);
6868
69    register_subalias("8", m_C.m_R.m_P);
70    register_subalias("9", m_C.m_R.m_N);
71    register_subalias("10", m_D.m_R.m_P);
72    register_subalias("11", m_D.m_R.m_N);
73    register_subalias("12", m_D.m_control);
74    register_subalias("13", m_A.m_control);
75    register_input("14", m_supply.m_vdd);
69   register_subalias("8", m_C.m_R.m_P);
70   register_subalias("9", m_C.m_R.m_N);
71   register_subalias("10", m_D.m_R.m_P);
72   register_subalias("11", m_D.m_R.m_N);
73   register_subalias("12", m_D.m_control);
74   register_subalias("13", m_A.m_control);
75   register_input("14", m_supply.m_vdd);
7676
7777}
7878
7979NETLIB_RESET(4066_dip)
8080{
81    m_A.do_reset();
82    m_B.do_reset();
83    m_C.do_reset();
84    m_D.do_reset();
81   m_A.do_reset();
82   m_B.do_reset();
83   m_C.do_reset();
84   m_D.do_reset();
8585}
8686
8787NETLIB_UPDATE(4066_dip)
8888{
89    /* only called during startup */
90    m_A.update_dev();
91    m_B.update_dev();
92    m_C.update_dev();
93    m_D.update_dev();
89   /* only called during startup */
90   m_A.update_dev();
91   m_B.update_dev();
92   m_C.update_dev();
93   m_D.update_dev();
9494}
trunk/src/emu/netlist/devices/nld_7410.h
r29404r29405
4343NETLIB_SIGNAL(7410, 3, 0, 0);
4444
4545#define TTL_7410_DIP(_name)                                                         \
46        NET_REGISTER_DEV(7410_dip, _name)
46      NET_REGISTER_DEV(7410_dip, _name)
4747
4848NETLIB_DEVICE(7410_dip,
4949
50    NETLIB_NAME(7410) m_1;
51    NETLIB_NAME(7410) m_2;
52    NETLIB_NAME(7410) m_3;
50   NETLIB_NAME(7410) m_1;
51   NETLIB_NAME(7410) m_2;
52   NETLIB_NAME(7410) m_3;
5353);
5454
5555#endif /* NLD_7410_H_ */
trunk/src/emu/netlist/devices/nld_ne555.c
r29404r29405
4646
4747NETLIB_RESET(NE555)
4848{
49    m_R1.do_reset();
50    m_R2.do_reset();
51    m_R3.do_reset();
52    m_RDIS.do_reset();
49   m_R1.do_reset();
50   m_R2.do_reset();
51   m_R3.do_reset();
52   m_RDIS.do_reset();
5353
54    m_R1.set_R(5000);
55    m_R2.set_R(5000);
56    m_R3.set_R(5000);
57    m_RDIS.set_R(R_OFF);
54   m_R1.set_R(5000);
55   m_R2.set_R(5000);
56   m_R3.set_R(5000);
57   m_RDIS.set_R(R_OFF);
5858
59    m_last_out = false;
59   m_last_out = false;
6060}
6161
6262NETLIB_UPDATE(NE555)
r29404r29405
9393
9494NETLIB_START(NE555_dip)
9595{
96    NETLIB_NAME(NE555)::start();
96   NETLIB_NAME(NE555)::start();
9797
98    register_subalias("1",  m_R3.m_N);      // Pin 1
99    register_subalias("2",    m_TRIG);      // Pin 2
100    register_subalias("3",    m_OUT);       // Pin 3
101    register_subalias("4",   m_RESET);      // Pin 4
102    register_subalias("5", m_R1.m_N);       // Pin 5
103    register_subalias("6",  m_THRES);       // Pin 6
104    register_subalias("7", m_RDIS.m_P);     // Pin 7
105    register_subalias("8",  m_R1.m_P);      // Pin 8
98   register_subalias("1",  m_R3.m_N);      // Pin 1
99   register_subalias("2",    m_TRIG);      // Pin 2
100   register_subalias("3",    m_OUT);       // Pin 3
101   register_subalias("4",   m_RESET);      // Pin 4
102   register_subalias("5", m_R1.m_N);       // Pin 5
103   register_subalias("6",  m_THRES);       // Pin 6
104   register_subalias("7", m_RDIS.m_P);     // Pin 7
105   register_subalias("8",  m_R1.m_P);      // Pin 8
106106
107107}
108108
109109NETLIB_UPDATE(NE555_dip)
110110{
111    NETLIB_NAME(NE555)::update();
111   NETLIB_NAME(NE555)::update();
112112}
113113
114114NETLIB_RESET(NE555_dip)
115115{
116    NETLIB_NAME(NE555)::reset();
116   NETLIB_NAME(NE555)::reset();
117117}
trunk/src/emu/netlist/devices/nld_7430.h
r29404r29405
5454NETLIB_SIGNAL(7430, 8, 0, 0);
5555
5656#define TTL_7430_DIP(_name)                                                         \
57        NET_REGISTER_DEV(7430_dip, _name)
57      NET_REGISTER_DEV(7430_dip, _name)
5858
5959NETLIB_DEVICE(7430_dip,
6060
61    NETLIB_NAME(7430) m_1;
61   NETLIB_NAME(7430) m_1;
6262);
6363#endif /* NLD_7430_H_ */
trunk/src/emu/netlist/devices/nld_9316.c
r29404r29405
77
88NETLIB_START(9316)
99{
10    register_sub(subABCD, "subABCD");
11    sub.m_ABCD = &subABCD;
10   register_sub(subABCD, "subABCD");
11   sub.m_ABCD = &subABCD;
1212   register_sub(sub, "sub");
1313
1414   register_subalias("CLK", sub.m_CLK);
r29404r29405
3333
3434NETLIB_RESET(9316)
3535{
36    sub.do_reset();
37    subABCD.do_reset();
36   sub.do_reset();
37   subABCD.do_reset();
3838}
3939
4040NETLIB_START(9316_subABCD)
4141{
42    register_input("A", m_A);
43    register_input("B", m_B);
44    register_input("C", m_C);
45    register_input("D", m_D);
42   register_input("A", m_A);
43   register_input("B", m_B);
44   register_input("C", m_C);
45   register_input("D", m_D);
4646
4747}
4848
4949NETLIB_RESET(9316_subABCD)
5050{
51    if (1 || !USE_ADD_REMOVE_LIST)
52    {
53        m_A.inactivate();
54        m_B.inactivate();
55        m_C.inactivate();
56        m_D.inactivate();
57    }
51   if (1 || !USE_ADD_REMOVE_LIST)
52   {
53      m_A.inactivate();
54      m_B.inactivate();
55      m_C.inactivate();
56      m_D.inactivate();
57   }
5858}
5959
6060ATTR_HOT inline UINT8 NETLIB_NAME(9316_subABCD::read_ABCD)()
6161{
62    if (1 || !USE_ADD_REMOVE_LIST)
63        return (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0);
64    else
65        return (INPLOGIC(m_D) << 3) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_A) << 0);
62   if (1 || !USE_ADD_REMOVE_LIST)
63      return (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0);
64   else
65      return (INPLOGIC(m_D) << 3) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_A) << 0);
6666}
6767
6868NETLIB_UPDATE(9316_subABCD)
r29404r29405
8686
8787NETLIB_RESET(9316_sub)
8888{
89    m_CLK.set_state(netlist_input_t::STATE_INP_LH);
90    m_cnt = 0;
91    m_loadq = 1;
92    m_ent = 1;
89   m_CLK.set_state(netlist_input_t::STATE_INP_LH);
90   m_cnt = 0;
91   m_loadq = 1;
92   m_ent = 1;
9393}
9494
9595NETLIB_UPDATE(9316_sub)
r29404r29405
9999   {
100100      cnt = ( cnt + 1) & 0x0f;
101101      update_outputs(cnt);
102        OUTLOGIC(m_RC, m_ent & (cnt == 0x0f), NLTIME_FROM_NS(20));
102      OUTLOGIC(m_RC, m_ent & (cnt == 0x0f), NLTIME_FROM_NS(20));
103103#if 0
104104      if (cnt == 0x0f)
105105         OUTLOGIC(m_RC, m_ent, NLTIME_FROM_NS(20));
r29404r29405
128128   }
129129   else
130130   {
131       UINT8 cnt = sub.m_cnt;
131      UINT8 cnt = sub.m_cnt;
132132      sub.m_CLK.inactivate();
133133      if (!clrq & (cnt>0))
134134      {
r29404r29405
198198
199199NETLIB_START(9316_dip)
200200{
201    NETLIB_NAME(9316)::start();
201   NETLIB_NAME(9316)::start();
202202
203    register_subalias("1", m_CLRQ);
204    register_subalias("2", sub.m_CLK);
205    register_subalias("3", subABCD.m_A);
206    register_subalias("4", subABCD.m_B);
207    register_subalias("5", subABCD.m_C);
208    register_subalias("6", subABCD.m_D);
209    register_subalias("7", m_ENP);
210    // register_subalias("8", ); --> GND
203   register_subalias("1", m_CLRQ);
204   register_subalias("2", sub.m_CLK);
205   register_subalias("3", subABCD.m_A);
206   register_subalias("4", subABCD.m_B);
207   register_subalias("5", subABCD.m_C);
208   register_subalias("6", subABCD.m_D);
209   register_subalias("7", m_ENP);
210   // register_subalias("8", ); --> GND
211211
212    register_subalias("9", m_LOADQ);
213    register_subalias("10", m_ENT);
214    register_subalias("11", sub.m_QD);
215    register_subalias("12", sub.m_QC);
216    register_subalias("13", sub.m_QB);
217    register_subalias("14", sub.m_QA);
218    register_subalias("15", sub.m_RC);
219    // register_subalias("16", ); --> VCC
212   register_subalias("9", m_LOADQ);
213   register_subalias("10", m_ENT);
214   register_subalias("11", sub.m_QD);
215   register_subalias("12", sub.m_QC);
216   register_subalias("13", sub.m_QB);
217   register_subalias("14", sub.m_QA);
218   register_subalias("15", sub.m_RC);
219   // register_subalias("16", ); --> VCC
220220}
221221
222222NETLIB_UPDATE(9316_dip)
223223{
224    NETLIB_NAME(9316)::update();
224   NETLIB_NAME(9316)::update();
225225}
226226
227227NETLIB_RESET(9316_dip)
228228{
229    NETLIB_NAME(9316)::reset();
229   NETLIB_NAME(9316)::reset();
230230}
231
trunk/src/emu/netlist/devices/nld_7490.c
r29404r29405
77
88NETLIB_START(7490)
99{
10    register_input("A", m_A);
11    register_input("B", m_B);
10   register_input("A", m_A);
11   register_input("B", m_B);
1212   register_input("R1",  m_R1);
1313   register_input("R2",  m_R2);
1414   register_input("R91", m_R91);
r29404r29405
2525
2626NETLIB_RESET(7490)
2727{
28    m_cnt = 0;
28   m_cnt = 0;
2929}
3030
3131static const netlist_time delay[4] =
3232{
33        NLTIME_FROM_NS(18),
34        NLTIME_FROM_NS(36) - NLTIME_FROM_NS(18),
35        NLTIME_FROM_NS(54) - NLTIME_FROM_NS(18),
36        NLTIME_FROM_NS(72) - NLTIME_FROM_NS(18)};
33      NLTIME_FROM_NS(18),
34      NLTIME_FROM_NS(36) - NLTIME_FROM_NS(18),
35      NLTIME_FROM_NS(54) - NLTIME_FROM_NS(18),
36      NLTIME_FROM_NS(72) - NLTIME_FROM_NS(18)};
3737
3838NETLIB_UPDATE(7490)
3939{
r29404r29405
5050   else if (INP_HL(m_A))
5151   {
5252      m_cnt ^= 1;
53        OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]);
53      OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]);
5454   }
55    else if (INP_HL(m_B))
56    {
57        m_cnt += 2;
58        if (m_cnt >= 10)
59            m_cnt = 0;
60        update_outputs();
61    }
55   else if (INP_HL(m_B))
56   {
57      m_cnt += 2;
58      if (m_cnt >= 10)
59         m_cnt = 0;
60      update_outputs();
61   }
6262}
6363
6464NETLIB_FUNC_VOID(7490, update_outputs, (void))
6565{
66
6766   for (int i=0; i<4; i++)
6867      OUTLOGIC(m_Q[i], (m_cnt >> i) & 1, delay[i]);
6968}
7069
7170NETLIB_START(7490_dip)
7271{
73    NETLIB_NAME(7490)::start();
74    register_subalias("1", m_B);
75    register_subalias("2", m_R1);
76    register_subalias("3", m_R2);
72   NETLIB_NAME(7490)::start();
73   register_subalias("1", m_B);
74   register_subalias("2", m_R1);
75   register_subalias("3", m_R2);
7776
78    // register_subalias("4", ); --> NC
79    // register_subalias("5", ); --> VCC
80    register_subalias("6", m_R91);
81     register_subalias("7", m_R92);
77   // register_subalias("4", ); --> NC
78   // register_subalias("5", ); --> VCC
79   register_subalias("6", m_R91);
80      register_subalias("7", m_R92);
8281
83    register_subalias("8", m_Q[2]);
84    register_subalias("9", m_Q[1]);
85    // register_subalias("10", ); --> GND
86    register_subalias("11", m_Q[3]);
87    register_subalias("12", m_Q[0]);
88    // register_subalias("13", ); --> NC
89    register_subalias("14", m_A);
82   register_subalias("8", m_Q[2]);
83   register_subalias("9", m_Q[1]);
84   // register_subalias("10", ); --> GND
85   register_subalias("11", m_Q[3]);
86   register_subalias("12", m_Q[0]);
87   // register_subalias("13", ); --> NC
88   register_subalias("14", m_A);
9089
9190}
9291
9392NETLIB_UPDATE(7490_dip)
9493{
95    NETLIB_NAME(7490)::update();
94   NETLIB_NAME(7490)::update();
9695}
9796
9897NETLIB_RESET(7490_dip)
9998{
100    NETLIB_NAME(7490)::reset();
99   NETLIB_NAME(7490)::reset();
101100}
trunk/src/emu/netlist/devices/nld_7450.h
r29404r29405
2727#include "nld_signal.h"
2828
2929#define TTL_7450_ANDORINVERT(_name, _I1, _I2, _I3, _I4)                             \
30        NET_REGISTER_DEV(7450, _name)                                               \
31        NET_CONNECT(_name, A, _I1)                                                  \
32        NET_CONNECT(_name, B, _I2)                                                  \
33        NET_CONNECT(_name, C, _I3)                                                  \
34        NET_CONNECT(_name, D, _I4)
30      NET_REGISTER_DEV(7450, _name)                                               \
31      NET_CONNECT(_name, A, _I1)                                                  \
32      NET_CONNECT(_name, B, _I2)                                                  \
33      NET_CONNECT(_name, C, _I3)                                                  \
34      NET_CONNECT(_name, D, _I4)
3535
3636#define TTL_7450_DIP(_name)                                                         \
37        NET_REGISTER_DEV(7450_dip, _name)
37      NET_REGISTER_DEV(7450_dip, _name)
3838
3939NETLIB_DEVICE(7450,
4040public:
41    netlist_ttl_input_t m_A;
42    netlist_ttl_input_t m_B;
43    netlist_ttl_input_t m_C;
44    netlist_ttl_input_t m_D;
45    netlist_ttl_output_t m_Q;
41   netlist_ttl_input_t m_A;
42   netlist_ttl_input_t m_B;
43   netlist_ttl_input_t m_C;
44   netlist_ttl_input_t m_D;
45   netlist_ttl_output_t m_Q;
4646);
4747
4848NETLIB_DEVICE(7450_dip,
trunk/src/emu/netlist/devices/nld_4066.h
r29404r29405
2828#include "../analog/nld_twoterm.h"
2929
3030#define CD_4066_DIP(_name)                                                         \
31        NET_REGISTER_DEV(4066_dip, _name)
31      NET_REGISTER_DEV(4066_dip, _name)
3232
3333NETLIB_SUBDEVICE(vdd_vss,
3434   netlist_analog_input_t m_vdd;
35    netlist_analog_input_t m_vss;
35   netlist_analog_input_t m_vss;
3636
3737public:
38    ATTR_HOT inline double vdd() { return INPANALOG(m_vdd); }
39    ATTR_HOT inline double vss() { return INPANALOG(m_vss); }
38   ATTR_HOT inline double vdd() { return INPANALOG(m_vdd); }
39   ATTR_HOT inline double vss() { return INPANALOG(m_vss); }
4040);
4141
4242NETLIB_SUBDEVICE(4066,
r29404r29405
5050
5151NETLIB_DEVICE(4066_dip,
5252
53    NETLIB_NAME(4066) m_A;
54    NETLIB_NAME(4066) m_B;
55    NETLIB_NAME(4066) m_C;
56    NETLIB_NAME(4066) m_D;
57    NETLIB_NAME(vdd_vss) m_supply;
53   NETLIB_NAME(4066) m_A;
54   NETLIB_NAME(4066) m_B;
55   NETLIB_NAME(4066) m_C;
56   NETLIB_NAME(4066) m_D;
57   NETLIB_NAME(vdd_vss) m_supply;
5858);
5959
6060#endif /* NLD_4066_H_ */
trunk/src/emu/netlist/devices/nld_7474.c
r29404r29405
2323
2424NETLIB_UPDATE(7474)
2525{
26    if (!INPLOGIC(m_PREQ) && !INPLOGIC(m_CLRQ))
27    {
28        sub.newstate(1, 1);
29        sub.m_CLK.inactivate();
30    }
26   if (!INPLOGIC(m_PREQ) && !INPLOGIC(m_CLRQ))
27   {
28      sub.newstate(1, 1);
29      sub.m_CLK.inactivate();
30   }
3131   if (!INPLOGIC(m_PREQ))
3232   {
3333      sub.newstate(1, 0);
r29404r29405
6464
6565NETLIB_RESET(7474)
6666{
67    sub.do_reset();
67   sub.do_reset();
6868}
6969
7070NETLIB_START(7474sub)
r29404r29405
7979
8080NETLIB_RESET(7474sub)
8181{
82    m_CLK.set_state(netlist_input_t::STATE_INP_LH);
82   m_CLK.set_state(netlist_input_t::STATE_INP_LH);
8383
84    m_nextD = 0;
85    /* FIXME: required by pong doubles - need a mechanism to set this from netlist */
86    m_Q.initial(1);
87    m_QQ.initial(0);
84   m_nextD = 0;
85   /* FIXME: required by pong doubles - need a mechanism to set this from netlist */
86   m_Q.initial(1);
87   m_QQ.initial(0);
8888}
8989
9090NETLIB_START(7474_dip)
9191{
92    register_sub(m_1, "1");
93    register_sub(m_2, "2");
92   register_sub(m_1, "1");
93   register_sub(m_2, "2");
9494
95    register_subalias("1", m_1.m_CLRQ);
96    register_subalias("2", m_1.m_D);
97    register_subalias("3", m_1.sub.m_CLK);
98    register_subalias("4", m_1.m_PREQ);
99    register_subalias("5", m_1.sub.m_Q);
100    register_subalias("6", m_1.sub.m_QQ);
101    // register_subalias("7", ); ==> GND
95   register_subalias("1", m_1.m_CLRQ);
96   register_subalias("2", m_1.m_D);
97   register_subalias("3", m_1.sub.m_CLK);
98   register_subalias("4", m_1.m_PREQ);
99   register_subalias("5", m_1.sub.m_Q);
100   register_subalias("6", m_1.sub.m_QQ);
101   // register_subalias("7", ); ==> GND
102102
103    register_subalias("8", m_2.sub.m_QQ);
104    register_subalias("9", m_2.sub.m_Q);
105    register_subalias("10", m_2.m_PREQ);
106    register_subalias("11", m_2.sub.m_CLK);
107    register_subalias("12", m_2.m_D);
108    register_subalias("13", m_2.m_CLRQ);
109    // register_subalias("14", ); ==> VCC
103   register_subalias("8", m_2.sub.m_QQ);
104   register_subalias("9", m_2.sub.m_Q);
105   register_subalias("10", m_2.m_PREQ);
106   register_subalias("11", m_2.sub.m_CLK);
107   register_subalias("12", m_2.m_D);
108   register_subalias("13", m_2.m_CLRQ);
109   // register_subalias("14", ); ==> VCC
110110}
111111
112112NETLIB_RESET(7474_dip)
113113{
114    m_1.do_reset();
115    m_2.do_reset();
114   m_1.do_reset();
115   m_2.do_reset();
116116}
117117
118118NETLIB_UPDATE(7474_dip)
119119{
120    m_1.update_dev();
121    m_2.update_dev();
120   m_1.update_dev();
121   m_2.update_dev();
122122}
trunk/src/emu/netlist/devices/nld_ne555.h
r29404r29405
4444);
4545
4646#define NE555_DIP(_name)                                                         \
47        NET_REGISTER_DEV(NE555_dip, _name)
47      NET_REGISTER_DEV(NE555_dip, _name)
4848
4949NETLIB_DEVICE_DERIVED(NE555_dip, NE555,
5050);
trunk/src/emu/netlist/devices/nld_7493.c
r29404r29405
2929
3030NETLIB_RESET(7493)
3131{
32    A.do_reset();
33    B.do_reset();
34    C.do_reset();
35    D.do_reset();
32   A.do_reset();
33   B.do_reset();
34   C.do_reset();
35   D.do_reset();
3636}
3737
3838NETLIB_START(7493ff)
r29404r29405
4545
4646NETLIB_RESET(7493ff)
4747{
48    m_reset = 1;
49    m_I.set_state(netlist_input_t::STATE_INP_HL);
48   m_reset = 1;
49   m_I.set_state(netlist_input_t::STATE_INP_HL);
5050}
5151
5252NETLIB_UPDATE(7493ff)
5353{
54    const netlist_time out_delay = NLTIME_FROM_NS(18);
54   const netlist_time out_delay = NLTIME_FROM_NS(18);
5555   //if (m_reset == 0)
5656      OUTLOGIC(m_Q, (!m_Q.net().new_Q()) & m_reset, out_delay);
5757}
r29404r29405
6868      OUTLOGIC(B.m_Q, 0, NLTIME_FROM_NS(40));
6969      OUTLOGIC(C.m_Q, 0, NLTIME_FROM_NS(40));
7070      OUTLOGIC(D.m_Q, 0, NLTIME_FROM_NS(40));
71        A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0;
71      A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0;
7272   }
7373   else
7474   {
7575      A.m_I.activate_hl();
7676      B.m_I.activate_hl();
77        A.m_reset = B.m_reset = C.m_reset = D.m_reset = 1;
77      A.m_reset = B.m_reset = C.m_reset = D.m_reset = 1;
7878   }
7979}
8080
8181NETLIB_START(7493_dip)
8282{
83    NETLIB_NAME(7493)::start();
83   NETLIB_NAME(7493)::start();
8484
85    register_subalias("1", B.m_I);
86    register_subalias("2", m_R1);
87    register_subalias("3", m_R2);
85   register_subalias("1", B.m_I);
86   register_subalias("2", m_R1);
87   register_subalias("3", m_R2);
8888
89    // register_subalias("4", ); --> NC
90    // register_subalias("5", ); --> VCC
91    // register_subalias("6", ); --> NC
92    // register_subalias("7", ); --> NC
89   // register_subalias("4", ); --> NC
90   // register_subalias("5", ); --> VCC
91   // register_subalias("6", ); --> NC
92   // register_subalias("7", ); --> NC
9393
94    register_subalias("8", C.m_Q);
95    register_subalias("9", B.m_Q);
96    // register_subalias("10", ); --> GND
97    register_subalias("11", D.m_Q);
98    register_subalias("12", A.m_Q);
99    // register_subalias("13", ); --> NC
100    register_subalias("14", A.m_I);
94   register_subalias("8", C.m_Q);
95   register_subalias("9", B.m_Q);
96   // register_subalias("10", ); --> GND
97   register_subalias("11", D.m_Q);
98   register_subalias("12", A.m_Q);
99   // register_subalias("13", ); --> NC
100   register_subalias("14", A.m_I);
101101}
102102
103103
104104NETLIB_UPDATE(7493_dip)
105105{
106    NETLIB_NAME(7493)::update();
106   NETLIB_NAME(7493)::update();
107107}
108108
109109NETLIB_RESET(7493_dip)
110110{
111    NETLIB_NAME(7493)::reset();
111   NETLIB_NAME(7493)::reset();
112112}
trunk/src/emu/netlist/devices/nld_9316.h
r29404r29405
6464      NET_CONNECT(_name, D,    _D)
6565
6666#define TTL_9316_DIP(_name)                                                         \
67        NET_REGISTER_DEV(9316_dip, _name)
67      NET_REGISTER_DEV(9316_dip, _name)
6868
6969NETLIB_SUBDEVICE(9316_subABCD,
70    netlist_ttl_input_t m_A;
71    netlist_ttl_input_t m_B;
72    netlist_ttl_input_t m_C;
73    netlist_ttl_input_t m_D;
70   netlist_ttl_input_t m_A;
71   netlist_ttl_input_t m_B;
72   netlist_ttl_input_t m_C;
73   netlist_ttl_input_t m_D;
7474
75    ATTR_HOT inline UINT8 read_ABCD();
75   ATTR_HOT inline UINT8 read_ABCD();
7676);
7777
7878NETLIB_SUBDEVICE(9316_sub,
r29404r29405
9595
9696NETLIB_DEVICE(9316,
9797   NETLIB_NAME(9316_sub) sub;
98    NETLIB_NAME(9316_subABCD) subABCD;
98   NETLIB_NAME(9316_subABCD) subABCD;
9999   netlist_ttl_input_t m_ENP;
100100   netlist_ttl_input_t m_ENT;
101101   netlist_ttl_input_t m_CLRQ;
trunk/src/emu/netlist/devices/nld_7490.h
r29404r29405
6060#define TTL_7490(_name, _A, _B, _R1, _R2, _R91, _R92)                               \
6161      NET_REGISTER_DEV(7490, _name)                                               \
6262      NET_CONNECT(_name, A, _A)                                                   \
63        NET_CONNECT(_name, B, _B)                                                   \
63      NET_CONNECT(_name, B, _B)                                                   \
6464      NET_CONNECT(_name, R1,  _R1)                                                \
6565      NET_CONNECT(_name, R2,  _R2)                                                \
6666      NET_CONNECT(_name, R91, _R91)                                               \
6767      NET_CONNECT(_name, R92, _R92)
6868
6969#define TTL_7490_DIP(_name)                                                         \
70        NET_REGISTER_DEV(7490_dip, _name)
70      NET_REGISTER_DEV(7490_dip, _name)
7171
7272
7373NETLIB_DEVICE(7490,
r29404r29405
7878   netlist_ttl_input_t m_R91;
7979   netlist_ttl_input_t m_R92;
8080   netlist_ttl_input_t m_A;
81    netlist_ttl_input_t m_B;
81   netlist_ttl_input_t m_B;
8282
8383   UINT8 m_cnt;
8484
trunk/src/emu/netlist/devices/nld_7474.h
r29404r29405
5252      NET_CONNECT(_name, PREQ,  _PREQ)
5353
5454#define TTL_7474_DIP(_name)                                                         \
55        NET_REGISTER_DEV(7474_dip, _name)
55      NET_REGISTER_DEV(7474_dip, _name)
5656
5757NETLIB_SUBDEVICE(7474sub,
5858   netlist_ttl_input_t m_CLK;
r29404r29405
7575
7676NETLIB_DEVICE(7474_dip,
7777
78    NETLIB_NAME(7474) m_1;
79    NETLIB_NAME(7474) m_2;
78   NETLIB_NAME(7474) m_1;
79   NETLIB_NAME(7474) m_2;
8080);
8181
8282#endif /* NLD_7474_H_ */
trunk/src/emu/netlist/devices/nld_7493.h
r29404r29405
6767      NET_CONNECT(_name, R2,  _R2)
6868
6969#define TTL_7493_DIP(_name)                                                         \
70        NET_REGISTER_DEV(7493_dip, _name)
70      NET_REGISTER_DEV(7493_dip, _name)
7171
7272NETLIB_SUBDEVICE(7493ff,
7373   netlist_ttl_input_t m_I;
trunk/src/emu/netlist/devices/net_lib.c
r29404r29405
5151#include "nld_system.h"
5252
5353NETLIST_START(diode_models)
54    NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
55    NET_MODEL(".model 1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
54   NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
55   NET_MODEL(".model 1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
5656NETLIST_END()
5757
5858NETLIST_START(bjt_models)
59    NET_MODEL(".MODEL BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX)")
60    NET_MODEL(".model BC556B PNP(IS=3.83E-14 NF=1.008 ISE=1.22E-14 NE=1.528 BF=344.4 IKF=0.08039 VAF=21.11 NR=1.005 ISC=2.85E-13 NC=1.28 BR=14.84 IKR=0.047 VAR=32.02 RB=1 IRB=1.00E-06 RBM=1 RE=0.6202 RC=0.5713 XTB=0 EG=1.11 XTI=3 CJE=1.23E-11 VJE=0.6106 MJE=0.378 TF=5.60E-10 XTF=3.414 VTF=5.23 ITF=0.1483 PTF=0 CJC=1.08E-11 VJC=0.1022 MJC=0.3563 XCJC=0.6288 TR=1.00E-32 CJS=0 VJS=0.75 MJS=0.333 FC=0.8027 Vceo=65 Icrating=100m mfg=Philips)")
61    NET_MODEL(".model 2SA1015 PNP(Is=295.1E-18 Xti=3 Eg=1.11 Vaf=100 Bf=110 Xtb=1.5 Br=10.45 Rc=15 Cjc=66.2p Mjc=1.054 Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n Tf=1.661n VCEO=45V ICrating=150M MFG=Toshiba)")
62    NET_MODEL(".model 2SC1815 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)")
59   NET_MODEL(".MODEL BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX)")
60   NET_MODEL(".model BC556B PNP(IS=3.83E-14 NF=1.008 ISE=1.22E-14 NE=1.528 BF=344.4 IKF=0.08039 VAF=21.11 NR=1.005 ISC=2.85E-13 NC=1.28 BR=14.84 IKR=0.047 VAR=32.02 RB=1 IRB=1.00E-06 RBM=1 RE=0.6202 RC=0.5713 XTB=0 EG=1.11 XTI=3 CJE=1.23E-11 VJE=0.6106 MJE=0.378 TF=5.60E-10 XTF=3.414 VTF=5.23 ITF=0.1483 PTF=0 CJC=1.08E-11 VJC=0.1022 MJC=0.3563 XCJC=0.6288 TR=1.00E-32 CJS=0 VJS=0.75 MJS=0.333 FC=0.8027 Vceo=65 Icrating=100m mfg=Philips)")
61   NET_MODEL(".model 2SA1015 PNP(Is=295.1E-18 Xti=3 Eg=1.11 Vaf=100 Bf=110 Xtb=1.5 Br=10.45 Rc=15 Cjc=66.2p Mjc=1.054 Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n Tf=1.661n VCEO=45V ICrating=150M MFG=Toshiba)")
62   NET_MODEL(".model 2SC1815 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)")
6363NETLIST_END()
6464
6565
r29404r29405
8989   ENTRY(D,                    DIODE,                  "model")
9090   ENTRY(VCVS,                 VCVS,                   "-")        // FIXME: STD parameters ?
9191   ENTRY(VCCS,                 VCCS,                   "-")
92    ENTRY(QBJT_EB,              QBJT_EB,                "model")
92   ENTRY(QBJT_EB,              QBJT_EB,                "model")
9393   ENTRY(QBJT_switch,          QBJT_SW,                "model")
9494   ENTRY(ttl_input,            TTL_INPUT,              "IN")
9595   ENTRY(analog_input,         ANALOG_INPUT,           "IN")
r29404r29405
9898   ENTRY(clock,                CLOCK,                  "FREQ")
9999   ENTRY(mainclock,            MAINCLOCK,              "FREQ")
100100   ENTRY(solver,               SOLVER,                 "FREQ")
101    ENTRY(gnd,                  GND,                    "-")
101   ENTRY(gnd,                  GND,                    "-")
102102   ENTRY(switch2,              SWITCH2,                "-")
103103   ENTRY(nicRSFF,              NETDEV_RSFF,            "+S,R")
104104   ENTRY(7400,                 TTL_7400_NAND,          "+A,B")
r29404r29405
119119   ENTRY(74107,                TTL_74107,              "+CLK,J,K,CLRQ")
120120   ENTRY(74107A,               TTL_74107A,             "+CLK,J,K,CLRQ")
121121   ENTRY(74153,                TTL_74153,              "+C0,C1,C2,C3,A,B,G")
122    ENTRY(SN74LS629,            SN74LS629,              "CAP")
122   ENTRY(SN74LS629,            SN74LS629,              "CAP")
123123   ENTRY(9316,                 TTL_9316,               "+CLK,ENP,ENT,CLRQ,LOADQ,A,B,C,D")
124124   ENTRY(NE555,                NE555,                  "-")
125    ENTRY(4066_dip,             CD_4066_DIP,            "-")
126    ENTRY(7400_dip,             TTL_7400_DIP,           "-")
127    ENTRY(7402_dip,             TTL_7402_DIP,           "-")
128    ENTRY(7404_dip,             TTL_7404_DIP,           "-")
129    ENTRY(7410_dip,             TTL_7410_DIP,           "-")
130    ENTRY(7420_dip,             TTL_7420_DIP,           "-")
131    ENTRY(7425_dip,             TTL_7425_DIP,           "-")
132    ENTRY(7427_dip,             TTL_7427_DIP,           "-")
133    ENTRY(7430_dip,             TTL_7430_DIP,           "-")
134    ENTRY(7448_dip,             TTL_7448_DIP,           "-")
135    ENTRY(7450_dip,             TTL_7450_DIP,           "-")
136    ENTRY(7474_dip,             TTL_7474_DIP,           "-")
137    ENTRY(7483_dip,             TTL_7483_DIP,           "-")
138    ENTRY(7486_dip,             TTL_7486_DIP,           "-")
139    ENTRY(7490_dip,             TTL_7490_DIP,           "-")
140    ENTRY(7493_dip,             TTL_7493_DIP,           "-")
141    ENTRY(74107_dip,            TTL_74107_DIP,          "-")
142    ENTRY(74153_dip,            TTL_74153_DIP,          "-")
143    ENTRY(9316_dip,             TTL_9316_DIP,           "-")
144    ENTRY(SN74LS629_dip,        SN74LS629_DIP,          "1.CAP1,2.CAP2")
145    ENTRY(NE555_dip,            NE555_DIP,              "-")
125   ENTRY(4066_dip,             CD_4066_DIP,            "-")
126   ENTRY(7400_dip,             TTL_7400_DIP,           "-")
127   ENTRY(7402_dip,             TTL_7402_DIP,           "-")
128   ENTRY(7404_dip,             TTL_7404_DIP,           "-")
129   ENTRY(7410_dip,             TTL_7410_DIP,           "-")
130   ENTRY(7420_dip,             TTL_7420_DIP,           "-")
131   ENTRY(7425_dip,             TTL_7425_DIP,           "-")
132   ENTRY(7427_dip,             TTL_7427_DIP,           "-")
133   ENTRY(7430_dip,             TTL_7430_DIP,           "-")
134   ENTRY(7448_dip,             TTL_7448_DIP,           "-")
135   ENTRY(7450_dip,             TTL_7450_DIP,           "-")
136   ENTRY(7474_dip,             TTL_7474_DIP,           "-")
137   ENTRY(7483_dip,             TTL_7483_DIP,           "-")
138   ENTRY(7486_dip,             TTL_7486_DIP,           "-")
139   ENTRY(7490_dip,             TTL_7490_DIP,           "-")
140   ENTRY(7493_dip,             TTL_7493_DIP,           "-")
141   ENTRY(74107_dip,            TTL_74107_DIP,          "-")
142   ENTRY(74153_dip,            TTL_74153_DIP,          "-")
143   ENTRY(9316_dip,             TTL_9316_DIP,           "-")
144   ENTRY(SN74LS629_dip,        SN74LS629_DIP,          "1.CAP1,2.CAP2")
145   ENTRY(NE555_dip,            NE555_DIP,              "-")
146146}
147147
148148netlist_device_t *netlist_factory_t::new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const
r29404r29405
163163
164164netlist_device_t *netlist_factory_t::new_device_by_name(const pstring &name, netlist_setup_t &setup) const
165165{
166    net_device_t_base_factory *f = factory_by_name(name, setup);
167    return f->Create();
166   net_device_t_base_factory *f = factory_by_name(name, setup);
167   return f->Create();
168168}
169169
170170net_device_t_base_factory * netlist_factory_t::factory_by_name(const pstring &name, netlist_setup_t &setup) const
171171{
172    for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
173    {
174        net_device_t_base_factory *p = *e;
175        if (strcmp(p->name(), name) == 0)
176        {
177            return p;
178        }
179        p++;
180    }
181    setup.netlist().error("Class %s not found!\n", name.cstr());
182    return NULL; // appease code analysis
172   for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e))
173   {
174      net_device_t_base_factory *p = *e;
175      if (strcmp(p->name(), name) == 0)
176      {
177         return p;
178      }
179      p++;
180   }
181   setup.netlist().error("Class %s not found!\n", name.cstr());
182   return NULL; // appease code analysis
183183}
trunk/src/emu/netlist/nl_base.c
r29404r29405
1313
1414netlist_logic_family_desc_t netlist_family_ttl =
1515{
16        0.8, // m_low_thresh_V
17        2.0, // m_high_thresh_V
18        0.3, // m_low_V  - these depend on sinked/sourced current. Values should be suitable for typical applications.
19        3.7, // m_high_V
20        1.0, // m_R_low;
21        130.0, //  m_R_high;
16      0.8, // m_low_thresh_V
17      2.0, // m_high_thresh_V
18      0.3, // m_low_V  - these depend on sinked/sourced current. Values should be suitable for typical applications.
19      3.7, // m_high_V
20      1.0, // m_R_low;
21      130.0, //  m_R_high;
2222};
2323
2424// ----------------------------------------------------------------------------------------
r29404r29405
9494{
9595   if (m_name == "")
9696      netlist().error("object not initialized");
97    return m_name;
97   return m_name;
9898}
9999
100100// ----------------------------------------------------------------------------------------
r29404r29405
142142{
143143   for (int i=0; i < m_nets.count(); i++)
144144   {
145        if (!m_nets[i]->isRailNet())
146        {
147            delete m_nets[i];
148        }
145      if (!m_nets[i]->isRailNet())
146      {
147         delete m_nets[i];
148      }
149149   }
150150
151151   m_nets.clear();
r29404r29405
157157
158158ATTR_COLD void netlist_base_t::save_register()
159159{
160    save(NAME(m_queue.callback()));
161    save(NAME(m_time));
162    netlist_object_t::save_register();
160   save(NAME(m_queue.callback()));
161   save(NAME(m_time));
162   netlist_object_t::save_register();
163163}
164164
165165ATTR_HOT const double netlist_base_t::gmin() const
166166{
167    return solver()->gmin();
167   return solver()->gmin();
168168}
169169
170170ATTR_COLD void netlist_base_t::start()
171171{
172    /* find the main clock and solver ... */
172   /* find the main clock and solver ... */
173173
174    m_mainclock = get_single_device<NETLIB_NAME(mainclock)>("mainclock");
175    m_solver = get_single_device<NETLIB_NAME(solver)>("solver");
176    m_gnd = get_single_device<NETLIB_NAME(gnd)>("gnd");
174   m_mainclock = get_single_device<NETLIB_NAME(mainclock)>("mainclock");
175   m_solver = get_single_device<NETLIB_NAME(solver)>("solver");
176   m_gnd = get_single_device<NETLIB_NAME(gnd)>("gnd");
177177
178    /* make sure the solver is started first! */
178   /* make sure the solver is started first! */
179179
180    if (m_solver != NULL)
181        m_solver->start_dev();
180   if (m_solver != NULL)
181      m_solver->start_dev();
182182
183    NL_VERBOSE_OUT(("Initializing devices ...\n"));
184    for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
185    {
186        netlist_device_t *dev = entry->object();
187        if (dev != m_solver)
188            dev->start_dev();
189    }
183   NL_VERBOSE_OUT(("Initializing devices ...\n"));
184   for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
185   {
186      netlist_device_t *dev = entry->object();
187      if (dev != m_solver)
188         dev->start_dev();
189   }
190190
191191}
192192
r29404r29405
202202
203203ATTR_COLD void netlist_base_t::rebuild_lists()
204204{
205    for (int i = 0; i < m_nets.count(); i++)
206        m_nets[i]->rebuild_list();
205   for (int i = 0; i < m_nets.count(); i++)
206      m_nets[i]->rebuild_list();
207207}
208208
209209
r29404r29405
213213   m_queue.clear();
214214   if (m_mainclock != NULL)
215215      m_mainclock->m_Q.net().set_time(netlist_time::zero);
216    if (m_solver != NULL)
217        m_solver->do_reset();
216   if (m_solver != NULL)
217      m_solver->do_reset();
218218
219    // Reset all nets once !
220    for (int i = 0; i < m_nets.count(); i++)
221        m_nets[i]->do_reset();
219   // Reset all nets once !
220   for (int i = 0; i < m_nets.count(); i++)
221      m_nets[i]->do_reset();
222222
223    // Reset all devices once !
224    for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
225    {
226        netlist_device_t *dev = entry->object();
227        dev->do_reset();
228    }
223   // Reset all devices once !
224   for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
225   {
226      netlist_device_t *dev = entry->object();
227      dev->do_reset();
228   }
229229
230230   // Step all devices once !
231231   for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
r29404r29405
235235   }
236236
237237   // FIXME: some const devices rely on this
238    /* make sure params are set now .. */
239    for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
240    {
241        entry->object()->update_param();
242    }
238   /* make sure params are set now .. */
239   for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
240   {
241      entry->object()->update_param();
242   }
243243}
244244
245245
246246ATTR_HOT ATTR_ALIGN void netlist_base_t::process_queue(const netlist_time delta)
247247{
248    m_stop = m_time + delta;
248   m_stop = m_time + delta;
249249
250    if (m_mainclock == NULL)
251    {
252        while ( (m_time < m_stop) && (m_queue.is_not_empty()))
253        {
254            const netlist_queue_t::entry_t *e = m_queue.pop();
255            m_time = e->exec_time();
256            e->object()->update_devs();
250   if (m_mainclock == NULL)
251   {
252      while ( (m_time < m_stop) && (m_queue.is_not_empty()))
253      {
254         const netlist_queue_t::entry_t *e = m_queue.pop();
255         m_time = e->exec_time();
256         e->object()->update_devs();
257257
258            add_to_stat(m_perf_out_processed, 1);
259            if (FATAL_ERROR_AFTER_NS)
260                if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
261                    error("Stopped");
262        }
263        if (m_queue.is_empty())
264            m_time = m_stop;
258         add_to_stat(m_perf_out_processed, 1);
259         if (FATAL_ERROR_AFTER_NS)
260            if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
261               error("Stopped");
262      }
263      if (m_queue.is_empty())
264         m_time = m_stop;
265265
266    } else {
267        netlist_net_t &mc_net = m_mainclock->m_Q.net();
268        const netlist_time inc = m_mainclock->m_inc;
269        netlist_time mc_time = mc_net.time();
266   } else {
267      netlist_net_t &mc_net = m_mainclock->m_Q.net();
268      const netlist_time inc = m_mainclock->m_inc;
269      netlist_time mc_time = mc_net.time();
270270
271        while (m_time < m_stop)
272        {
273            if (m_queue.is_not_empty())
274            {
275                while (m_queue.peek()->exec_time() > mc_time)
276                {
277                    m_time = mc_time;
278                    mc_time += inc;
279                    NETLIB_NAME(mainclock)::mc_update(mc_net);
280                }
271      while (m_time < m_stop)
272      {
273         if (m_queue.is_not_empty())
274         {
275            while (m_queue.peek()->exec_time() > mc_time)
276            {
277               m_time = mc_time;
278               mc_time += inc;
279               NETLIB_NAME(mainclock)::mc_update(mc_net);
280            }
281281
282                const netlist_queue_t::entry_t *e = m_queue.pop();
283                m_time = e->exec_time();
284                e->object()->update_devs();
282            const netlist_queue_t::entry_t *e = m_queue.pop();
283            m_time = e->exec_time();
284            e->object()->update_devs();
285285
286            } else {
287                m_time = mc_time;
288                mc_time += inc;
289                NETLIB_NAME(mainclock)::mc_update(mc_net);
290            }
291            if (FATAL_ERROR_AFTER_NS)
292                if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
293                    error("Stopped");
286         } else {
287            m_time = mc_time;
288            mc_time += inc;
289            NETLIB_NAME(mainclock)::mc_update(mc_net);
290         }
291         if (FATAL_ERROR_AFTER_NS)
292            if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
293               error("Stopped");
294294
295            add_to_stat(m_perf_out_processed, 1);
296        }
297        mc_net.set_time(mc_time);
298    }
295         add_to_stat(m_perf_out_processed, 1);
296      }
297      mc_net.set_time(mc_time);
298   }
299299}
300300
301301ATTR_COLD void netlist_base_t::error(const char *format, ...) const
r29404r29405
308308
309309ATTR_COLD void netlist_base_t::warning(const char *format, ...) const
310310{
311    va_list ap;
312    va_start(ap, format);
313    verror(NL_WARNING, format, ap);
314    va_end(ap);
311   va_list ap;
312   va_start(ap, format);
313   verror(NL_WARNING, format, ap);
314   va_end(ap);
315315}
316316
317317ATTR_COLD void netlist_base_t::log(const char *format, ...) const
318318{
319    va_list ap;
320    va_start(ap, format);
321    verror(NL_LOG, format, ap);
322    va_end(ap);
319   va_list ap;
320   va_start(ap, format);
321   verror(NL_LOG, format, ap);
322   va_end(ap);
323323}
324324
325325
r29404r29405
361361ATTR_HOT ATTR_ALIGN const netlist_sig_t netlist_core_device_t::INPLOGIC_PASSIVE(netlist_logic_input_t &inp)
362362{
363363   if (inp.state() != netlist_input_t::STATE_INP_PASSIVE)
364        return inp.Q();
364      return inp.Q();
365365   else
366    {
367        inp.activate();
368        const netlist_sig_t ret = inp.Q();
369        inp.inactivate();
370        return ret;
371    }
366   {
367      inp.activate();
368      const netlist_sig_t ret = inp.Q();
369      inp.inactivate();
370      return ret;
371   }
372372}
373373
374374
r29404r29405
424424ATTR_COLD void netlist_device_t::register_terminal(const pstring &name, netlist_terminal_t &port)
425425{
426426   setup().register_object(*this, name, port);
427    if (port.isType(netlist_terminal_t::INPUT) || port.isType(netlist_terminal_t::TERMINAL))
428        m_terminals.add(port.name());
427   if (port.isType(netlist_terminal_t::INPUT) || port.isType(netlist_terminal_t::TERMINAL))
428      m_terminals.add(port.name());
429429}
430430
431431ATTR_COLD void netlist_device_t::register_output(const pstring &name, netlist_output_t &port)
432432{
433    port.m_family_desc = this->m_family_desc;
433   port.m_family_desc = this->m_family_desc;
434434   setup().register_object(*this, name, port);
435435}
436436
437437ATTR_COLD void netlist_device_t::register_input(const pstring &name, netlist_input_t &inp)
438438{
439    inp.m_family_desc = this->m_family_desc;
439   inp.m_family_desc = this->m_family_desc;
440440   setup().register_object(*this, name, inp);
441    m_terminals.add(inp.name());
441   m_terminals.add(inp.name());
442442}
443443
444444ATTR_COLD void netlist_device_t::connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
445445{
446    setup().connect(t1, t2);
446   setup().connect(t1, t2);
447447}
448448
449449
r29404r29405
470470
471471ATTR_COLD netlist_net_t::netlist_net_t(const type_t atype, const family_t afamily)
472472   : netlist_object_t(atype, afamily)
473    , m_solver(NULL)
474    , m_railterminal(NULL)
473   , m_solver(NULL)
474   , m_railterminal(NULL)
475475   , m_num_cons(0)
476476   , m_time(netlist_time::zero)
477477   , m_active(0)
478478   , m_in_queue(2)
479479{
480    m_last_Q = 0;
481    m_new_Q = 0;
482    m_cur_Q = 0;
483    m_last_Analog = 0.0;
484    m_new_Analog = 0.0;
485    m_cur_Analog = 0.0;
480   m_last_Q = 0;
481   m_new_Q = 0;
482   m_cur_Q = 0;
483   m_last_Analog = 0.0;
484   m_new_Analog = 0.0;
485   m_cur_Analog = 0.0;
486486};
487487
488488ATTR_COLD netlist_net_t::~netlist_net_t()
489489{
490    netlist().remove_save_items(this);
490   netlist().remove_save_items(this);
491491}
492492
493493ATTR_HOT void netlist_net_t::inc_active(netlist_core_terminal_t &term)
494494{
495    m_active++;
495   m_active++;
496496
497    if (USE_ADD_REMOVE_LIST)
498    {
499        m_list.insert(term);
500        //m_list.add(term);
501    }
497   if (USE_ADD_REMOVE_LIST)
498   {
499      m_list.insert(term);
500      //m_list.add(term);
501   }
502502
503    if (USE_DEACTIVE_DEVICE)
504    {
505        if (m_active == 1 && m_in_queue > 0)
506        {
507            m_last_Q = m_cur_Q;
508            m_last_Analog = m_cur_Analog; // FIXME: Needed here ?
509            railterminal().netdev().inc_active();
510            m_cur_Q = m_new_Q;
511            m_cur_Analog = m_new_Analog;
512        }
513    }
503   if (USE_DEACTIVE_DEVICE)
504   {
505      if (m_active == 1 && m_in_queue > 0)
506      {
507         m_last_Q = m_cur_Q;
508         m_last_Analog = m_cur_Analog; // FIXME: Needed here ?
509         railterminal().netdev().inc_active();
510         m_cur_Q = m_new_Q;
511         m_cur_Analog = m_new_Analog;
512      }
513   }
514514
515    if (m_active == 1 && m_in_queue == 0)
516    {
517        if (m_time > netlist().time())
518        {
519            m_in_queue = 1;     /* pending */
520            netlist().push_to_queue(this, m_time);
521        }
522        else
523        {
524            m_cur_Q = m_last_Q = m_new_Q;
525            m_cur_Analog = m_last_Analog = m_new_Analog;  // FIXME: Needed here?
526            m_in_queue = 2;
527        }
528    }
515   if (m_active == 1 && m_in_queue == 0)
516   {
517      if (m_time > netlist().time())
518      {
519         m_in_queue = 1;     /* pending */
520         netlist().push_to_queue(this, m_time);
521      }
522      else
523      {
524         m_cur_Q = m_last_Q = m_new_Q;
525         m_cur_Analog = m_last_Analog = m_new_Analog;  // FIXME: Needed here?
526         m_in_queue = 2;
527      }
528   }
529529}
530530
531531ATTR_HOT void netlist_net_t::dec_active(netlist_core_terminal_t &term)
532532{
533    m_active--;
533   m_active--;
534534
535    if (USE_ADD_REMOVE_LIST)
536    {
537        m_list.remove(term);
538    }
535   if (USE_ADD_REMOVE_LIST)
536   {
537      m_list.remove(term);
538   }
539539
540    if (USE_DEACTIVE_DEVICE)
541    {
542        if (m_active == 0)
543            railterminal().netdev().dec_active();
544    }
540   if (USE_DEACTIVE_DEVICE)
541   {
542      if (m_active == 0)
543         railterminal().netdev().dec_active();
544   }
545545}
546546
547547ATTR_COLD void netlist_net_t::rebuild_list()
548548{
549    /* rebuild m_list */
549   /* rebuild m_list */
550550
551    m_list.clear();
552    for (int i=0; i < m_registered.count(); i++)
553        if (m_registered[i]->state() != netlist_input_t::STATE_INP_PASSIVE)
554            m_list.add(*m_registered[i]);
551   m_list.clear();
552   for (int i=0; i < m_registered.count(); i++)
553      if (m_registered[i]->state() != netlist_input_t::STATE_INP_PASSIVE)
554         m_list.add(*m_registered[i]);
555555}
556556
557557ATTR_COLD void netlist_net_t::reset()
558558{
559    m_last_Analog = 0.0;
560    m_cur_Analog = 0.0;
561    m_new_Analog = 0.0;
562    m_last_Q = 0; // set to something we will never hit.
563    m_new_Q = 0;
564    m_cur_Q = 0;
565    m_time = netlist_time::zero;
566    m_active = 0;
567    m_in_queue = 2;
559   m_last_Analog = 0.0;
560   m_cur_Analog = 0.0;
561   m_new_Analog = 0.0;
562   m_last_Q = 0; // set to something we will never hit.
563   m_new_Q = 0;
564   m_cur_Q = 0;
565   m_time = netlist_time::zero;
566   m_active = 0;
567   m_in_queue = 2;
568568
569    /* rebuild m_list */
569   /* rebuild m_list */
570570
571    m_list.clear();
572    for (int i=0; i < m_registered.count(); i++)
573        m_list.add(*m_registered[i]);
571   m_list.clear();
572   for (int i=0; i < m_registered.count(); i++)
573      m_list.add(*m_registered[i]);
574574
575    for (netlist_core_terminal_t *t = m_list.first(); t != NULL; t = m_list.next(t))
576    {
577        t->do_reset();
578    }
579    for (netlist_core_terminal_t *t = m_list.first(); t != NULL; t = m_list.next(t))
580    {
581        if (t->state() != netlist_input_t::STATE_INP_PASSIVE)
582            m_active++;
583    }
575   for (netlist_core_terminal_t *t = m_list.first(); t != NULL; t = m_list.next(t))
576   {
577      t->do_reset();
578   }
579   for (netlist_core_terminal_t *t = m_list.first(); t != NULL; t = m_list.next(t))
580   {
581      if (t->state() != netlist_input_t::STATE_INP_PASSIVE)
582         m_active++;
583   }
584584}
585585
586586ATTR_COLD void netlist_net_t::init_object(netlist_base_t &nl, const pstring &aname)
r29404r29405
591591
592592ATTR_COLD void netlist_net_t::save_register()
593593{
594    save(NAME(m_last_Analog));
595    save(NAME(m_cur_Analog));
596    save(NAME(m_new_Analog));
597    save(NAME(m_last_Q));
598    save(NAME(m_cur_Q));
599    save(NAME(m_new_Q));
600    save(NAME(m_time));
601    save(NAME(m_active));
602    save(NAME(m_in_queue));
603    netlist_object_t::save_register();
594   save(NAME(m_last_Analog));
595   save(NAME(m_cur_Analog));
596   save(NAME(m_new_Analog));
597   save(NAME(m_last_Q));
598   save(NAME(m_cur_Q));
599   save(NAME(m_new_Q));
600   save(NAME(m_time));
601   save(NAME(m_active));
602   save(NAME(m_in_queue));
603   netlist_object_t::save_register();
604604}
605605
606606ATTR_COLD void netlist_net_t::register_railterminal(netlist_output_t &mr)
r29404r29405
666666   assert(this->isRailNet());
667667
668668   const UINT32 masks[4] = { 1, 5, 3, 1 };
669    const UINT32 mask = masks[ (m_last_Q  << 1) | m_new_Q ];
670    netlist_core_terminal_t *p = m_list.first();
669   const UINT32 mask = masks[ (m_last_Q  << 1) | m_new_Q ];
670   netlist_core_terminal_t *p = m_list.first();
671671
672    m_in_queue = 2; /* mark as taken ... */
673    m_cur_Q = m_new_Q;
672   m_in_queue = 2; /* mark as taken ... */
673   m_cur_Q = m_new_Q;
674674
675    m_cur_Analog = m_new_Analog;
675   m_cur_Analog = m_new_Analog;
676676
677    if (USE_ADD_REMOVE_LIST)
678    {
679        switch (m_active)
680        {
681        case 2:
682            update_dev(p, mask);
683            p = m_list.next(p);
684            if (p == NULL) break;
685        case 1:
686            update_dev(p, mask);
687            break;
688        default:
689            while (p != NULL)
690            {
691                update_dev(p, mask);
692                p = m_list.next(p);
693            }
694            break;
695        }
696    }
697    else
698    {
699        switch (m_num_cons)
700        {
701        case 2:
702            update_dev(p, mask);
703            p = m_list.next(p);
704        case 1:
705            update_dev(p, mask);
706            break;
707        default:
708            do
709            {
710                update_dev(p, mask);
711                p = m_list.next(p);
712            } while (p != NULL);
713            break;
714        }
715    }
716    m_last_Q = m_cur_Q;
717    m_last_Analog = m_cur_Analog;
677   if (USE_ADD_REMOVE_LIST)
678   {
679      switch (m_active)
680      {
681      case 2:
682         update_dev(p, mask);
683         p = m_list.next(p);
684         if (p == NULL) break;
685      case 1:
686         update_dev(p, mask);
687         break;
688      default:
689         while (p != NULL)
690         {
691            update_dev(p, mask);
692            p = m_list.next(p);
693         }
694         break;
695      }
696   }
697   else
698   {
699      switch (m_num_cons)
700      {
701      case 2:
702         update_dev(p, mask);
703         p = m_list.next(p);
704      case 1:
705         update_dev(p, mask);
706         break;
707      default:
708         do
709         {
710            update_dev(p, mask);
711            p = m_list.next(p);
712         } while (p != NULL);
713         break;
714      }
715   }
716   m_last_Q = m_cur_Q;
717   m_last_Analog = m_cur_Analog;
718718}
719719
720720ATTR_HOT void netlist_net_t::solve()
721721{
722    if (m_solver != NULL)
723        m_solver->schedule();
722   if (m_solver != NULL)
723      m_solver->schedule();
724724}
725725
726726// ----------------------------------------------------------------------------------------
r29404r29405
748748
749749ATTR_COLD void netlist_terminal_t::reset()
750750{
751    //netlist_terminal_core_terminal_t::reset();
752    set_state(STATE_INP_ACTIVE);
753    m_Idr = 0.0;
754    m_go = netlist().gmin();
755    m_gt = netlist().gmin();
751   //netlist_terminal_core_terminal_t::reset();
752   set_state(STATE_INP_ACTIVE);
753   m_Idr = 0.0;
754   m_go = netlist().gmin();
755   m_gt = netlist().gmin();
756756}
757757
758758ATTR_COLD void netlist_terminal_t::save_register()
759759{
760    save(NAME(m_Idr));
761    save(NAME(m_go));
762    save(NAME(m_gt));
763    netlist_core_terminal_t::save_register();
760   save(NAME(m_Idr));
761   save(NAME(m_go));
762   save(NAME(m_gt));
763   netlist_core_terminal_t::save_register();
764764}
765765
766766
r29404r29405
782782   , m_my_net(NET, afamily)
783783{
784784   //m_net = new net_net_t(NET_DIGITAL);
785    set_state(STATE_OUT);
785   set_state(STATE_OUT);
786786   this->set_net(m_my_net);
787787}
788788
r29404r29405
798798// ----------------------------------------------------------------------------------------
799799
800800ATTR_COLD netlist_logic_output_t::netlist_logic_output_t()
801    : netlist_output_t(OUTPUT, LOGIC), m_proxy(NULL)
801   : netlist_output_t(OUTPUT, LOGIC), m_proxy(NULL)
802802{
803803}
804804
r29404r29405
806806{
807807   net().m_cur_Q = val;
808808   net().m_new_Q = val;
809    net().m_last_Q = val;
809   net().m_last_Q = val;
810810}
811811
812812// ----------------------------------------------------------------------------------------
r29404r29405
825825ATTR_COLD netlist_analog_output_t::netlist_analog_output_t()
826826   : netlist_output_t(OUTPUT, ANALOG)
827827{
828    net().m_last_Analog = 0.97;
828   net().m_last_Analog = 0.97;
829829   net().m_cur_Analog = 0.98;
830830   net().m_new_Analog = 0.99;
831831}
832832
833833ATTR_COLD void netlist_analog_output_t::initial(const double val)
834834{
835    net().m_cur_Analog = val * 0.98;
835   net().m_cur_Analog = val * 0.98;
836836   net().m_cur_Analog = val * 0.99;
837837   net().m_new_Analog = val * 1.0;
838838}
r29404r29405
878878
879879ATTR_COLD const pstring netlist_param_model_t::model_type() const
880880{
881    pstring tmp = this->Value();
882    // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
883    int p = tmp.find("(");
884    int p1 = p;
885    while (--p >= 0 && tmp[p] != ' ')
886        ;
881   pstring tmp = this->Value();
882   // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
883   int p = tmp.find("(");
884   int p1 = p;
885   while (--p >= 0 && tmp[p] != ' ')
886      ;
887887
888    return tmp.substr(p+1, p1-p-1).ucase();
888   return tmp.substr(p+1, p1-p-1).ucase();
889889}
890890
891891
r29404r29405
929929
930930ATTR_HOT inline void NETLIB_NAME(mainclock)::mc_update(netlist_net_t &net)
931931{
932    net.m_new_Q ^= 1;
933    net.update_devs();
932   net.m_new_Q ^= 1;
933   net.update_devs();
934934}
935935
936936NETLIB_START(mainclock)
r29404r29405
943943
944944NETLIB_RESET(mainclock)
945945{
946    m_Q.net().set_time(netlist_time::zero);
946   m_Q.net().set_time(netlist_time::zero);
947947}
948948
949949NETLIB_UPDATE_PARAM(mainclock)
r29404r29405
965965
966966ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::term_param_list()
967967{
968    if (m_def_param.startsWith("+"))
969        return nl_util::split(m_def_param.substr(1), ",");
970    else
971        return nl_util::pstring_list();
968   if (m_def_param.startsWith("+"))
969      return nl_util::split(m_def_param.substr(1), ",");
970   else
971      return nl_util::pstring_list();
972972}
973973
974974ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::def_params()
975975{
976    if (m_def_param.startsWith("+") || m_def_param.equals("-"))
977        return nl_util::pstring_list();
978    else
979        return nl_util::split(m_def_param, ",");
976   if (m_def_param.startsWith("+") || m_def_param.equals("-"))
977      return nl_util::pstring_list();
978   else
979      return nl_util::split(m_def_param, ",");
980980}
trunk/src/emu/netlist/nl_dice_compat.h
r29404r29405
2929struct Mono555Desc
3030{
3131public:
32        double r, c;
32      double r, c;
3333
34        Mono555Desc(double res, double cap) : r(res), c(cap) { }
34      Mono555Desc(double res, double cap) : r(res), c(cap) { }
3535};
3636
3737struct SeriesRCDesc
3838{
3939public:
40        double r, c;
40      double r, c;
4141
42        SeriesRCDesc(double res, double cap) : r(res), c(cap) { }
42      SeriesRCDesc(double res, double cap) : r(res), c(cap) { }
4343};
4444
4545#define CHIP_555_Mono(_name,  _pdesc)   \
46    CHIP(# _name, NE555) \
47    NET_C(_name.6, _name.7) \
48    RES(_name ## _R, (_pdesc)->r) \
49    CAP(_name ## _C, (_pdesc)->c) \
50    NET_C(_name.6, _name ## _R.1) \
51    NET_C(_name.6, _name ## _C.1) \
52    NET_C(_name ## _R.2, V5) \
53    NET_CSTR(# _name "_C.2", "GND") \
54    NET_C(_name.8, V5) \
55    NET_CSTR(# _name ".1", "GND")
46   CHIP(# _name, NE555) \
47   NET_C(_name.6, _name.7) \
48   RES(_name ## _R, (_pdesc)->r) \
49   CAP(_name ## _C, (_pdesc)->c) \
50   NET_C(_name.6, _name ## _R.1) \
51   NET_C(_name.6, _name ## _C.1) \
52   NET_C(_name ## _R.2, V5) \
53   NET_CSTR(# _name "_C.2", "GND") \
54   NET_C(_name.8, V5) \
55   NET_CSTR(# _name ".1", "GND")
5656
5757#define CHIP_SERIES_RC(_name,  _pdesc)   \
58    RES(_name ## _R, (_pdesc)->r) \
59    CAP(_name ## _C, (_pdesc)->c) \
60    NET_C(_name ## _R.1, _name ## _C.2) \
61    ALIAS(_name.3, _name ## _R.1) \
62    ALIAS(_name.2, _name ## _R.2) \
63    ALIAS(_name.1, _name ## _C.1)
58   RES(_name ## _R, (_pdesc)->r) \
59   CAP(_name ## _C, (_pdesc)->c) \
60   NET_C(_name ## _R.1, _name ## _C.2) \
61   ALIAS(_name.3, _name ## _R.1) \
62   ALIAS(_name.2, _name ## _R.2) \
63   ALIAS(_name.1, _name ## _C.1)
6464
6565#define CHIP_INPUT(_name)   \
6666   SWITCH2(_name ## _SW) \
67    NET_C(_name ## _SW.2, V5) \
68    NET_CSTR(# _name "_SW.1", "GND") \
69    ALIAS(_name.1, _name ## _SW.Q)
67   NET_C(_name ## _SW.2, V5) \
68   NET_CSTR(# _name "_SW.1", "GND") \
69   ALIAS(_name.1, _name ## _SW.Q)
7070
7171#define CHIP_LATCH(_name)   \
7272   NETDEV_RSFF(_name) \
73    ALIAS(_name.1, _name.S) \
74    ALIAS(_name.2, _name.R) \
75    ALIAS(_name.3, _name.QQ)
73   ALIAS(_name.1, _name.S) \
74   ALIAS(_name.2, _name.R) \
75   ALIAS(_name.3, _name.QQ)
7676
7777
7878
trunk/src/emu/netlist/pstate.h
r29404r29405
2929   DT_CUSTOM,
3030   DT_DOUBLE,
3131   DT_INT64,
32    DT_INT16,
32   DT_INT16,
3333   DT_INT8,
3434   DT_INT,
3535   DT_BOOLEAN
r29404r29405
7070
7171struct pstate_entry_t
7272{
73    typedef netlist_list_t<pstate_entry_t *> list_t;
73   typedef netlist_list_t<pstate_entry_t *> list_t;
7474
75    pstate_entry_t(const pstring &stname, const pstate_data_type_e dt, const void *owner,
76            const int size, const int count, void *ptr)
77    : m_name(stname), m_dt(dt), m_owner(owner), m_callback(NULL), m_size(size), m_count(count), m_ptr(ptr) { }
75   pstate_entry_t(const pstring &stname, const pstate_data_type_e dt, const void *owner,
76         const int size, const int count, void *ptr)
77   : m_name(stname), m_dt(dt), m_owner(owner), m_callback(NULL), m_size(size), m_count(count), m_ptr(ptr) { }
7878
79    pstate_entry_t(const pstring &stname, const void *owner, pstate_callback_t *callback)
80    : m_name(stname), m_dt(DT_CUSTOM), m_owner(owner), m_callback(callback), m_size(0), m_count(0), m_ptr(NULL) { }
79   pstate_entry_t(const pstring &stname, const void *owner, pstate_callback_t *callback)
80   : m_name(stname), m_dt(DT_CUSTOM), m_owner(owner), m_callback(callback), m_size(0), m_count(0), m_ptr(NULL) { }
8181
82    pstring m_name;
83    const pstate_data_type_e m_dt;
84    const void *m_owner;
85    pstate_callback_t *m_callback;
86    const int m_size;
87    const int m_count;
88    void *m_ptr;
82   pstring m_name;
83   const pstate_data_type_e m_dt;
84   const void *m_owner;
85   pstate_callback_t *m_callback;
86   const int m_size;
87   const int m_count;
88   void *m_ptr;
8989};
9090
9191class pstate_manager_t
r29404r29405
125125template<> ATTR_COLD inline void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname)
126126{
127127   //save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
128    pstate_entry_t *p = new pstate_entry_t(stname, owner, &state);
129    m_save.add(p);
128   pstate_entry_t *p = new pstate_entry_t(stname, owner, &state);
129   m_save.add(p);
130130   state.register_state(*this, stname);
131131}
132132
trunk/src/emu/netlist/nl_base.h
r29404r29405
190190#define NETLIB_UPDATEI() ATTR_HOT ATTR_ALIGN inline void update(void)
191191
192192#define NETLIB_DEVICE_BASE(_name, _pclass, _extra, _priv)                           \
193    class _name : public _pclass                                                    \
194    {                                                                               \
195    public:                                                                         \
196        _name()                                                                     \
197        : _pclass()    { }                                                          \
198    protected:                                                                      \
199        _extra                                                                      \
200        ATTR_HOT void update();                                                     \
201        ATTR_HOT void start();                                                      \
202        ATTR_HOT void reset();                                                      \
203        _priv                                                                       \
204    }
193   class _name : public _pclass                                                    \
194   {                                                                               \
195   public:                                                                         \
196      _name()                                                                     \
197      : _pclass()    { }                                                          \
198   protected:                                                                      \
199      _extra                                                                      \
200      ATTR_HOT void update();                                                     \
201      ATTR_HOT void start();                                                      \
202      ATTR_HOT void reset();                                                      \
203      _priv                                                                       \
204   }
205205
206206#define NETLIB_DEVICE_DERIVED(_name, _pclass, _priv)                                \
207        NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass), , _priv)
207      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass), , _priv)
208208
209209#define NETLIB_DEVICE(_name, _priv)                                                 \
210        NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t, , _priv)
210      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t, , _priv)
211211
212212#define NETLIB_SUBDEVICE(_name, _priv)                                             \
213    class NETLIB_NAME(_name) : public netlist_device_t                              \
214    {                                                                               \
215    public:                                                                         \
216        NETLIB_NAME(_name) ()                                                       \
217        : netlist_device_t()                                                        \
218            { }                                                                     \
219    /*protected:*/                                                                  \
220        ATTR_HOT void update();                                                     \
221        ATTR_HOT void start();                                                      \
222        ATTR_HOT void reset();                                                      \
223    public:                                                                         \
224        _priv                                                                       \
225    }
213   class NETLIB_NAME(_name) : public netlist_device_t                              \
214   {                                                                               \
215   public:                                                                         \
216      NETLIB_NAME(_name) ()                                                       \
217      : netlist_device_t()                                                        \
218         { }                                                                     \
219   /*protected:*/                                                                  \
220      ATTR_HOT void update();                                                     \
221      ATTR_HOT void start();                                                      \
222      ATTR_HOT void reset();                                                      \
223   public:                                                                         \
224      _priv                                                                       \
225   }
226226
227227#define NETLIB_DEVICE_WITH_PARAMS(_name, _priv)                                     \
228        NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t,                    \
229            ATTR_HOT void update_param();                                           \
230        , _priv)
228      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t,                    \
229         ATTR_HOT void update_param();                                           \
230      , _priv)
231231
232232#define NETLIB_DEVICE_WITH_PARAMS_DERIVED(_name, _pclass, _priv)                    \
233        NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass),                \
234            ATTR_HOT void update_param();                                           \
235        , _priv)
233      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass),                \
234         ATTR_HOT void update_param();                                           \
235      , _priv)
236236
237237// ----------------------------------------------------------------------------------------
238238// forward definitions
r29404r29405
255255
256256struct netlist_logic_family_desc_t
257257{
258    double m_low_thresh_V;
259    double m_high_thresh_V;
260    double m_low_V;
261    double m_high_V;
262    double m_R_low;
263    double m_R_high;
258   double m_low_thresh_V;
259   double m_high_thresh_V;
260   double m_low_V;
261   double m_high_V;
262   double m_R_low;
263   double m_R_high;
264264};
265265
266266/* Terminals inherit the family description from the netlist_device
r29404r29405
278278
279279class netlist_object_t
280280{
281    NETLIST_PREVENT_COPYING(netlist_object_t)
281   NETLIST_PREVENT_COPYING(netlist_object_t)
282282public:
283    enum type_t {
284        TERMINAL = 0,
285        INPUT    = 1,
286        OUTPUT   = 2,
287        PARAM    = 3,
288        NET      = 4,
289        DEVICE   = 5,
290        NETLIST   = 6,
291    };
292    enum family_t {
293        // Terminal families
294        LOGIC     = 1,
295        ANALOG    = 2,
296        // Device families
297        GENERIC   = 3,   // <== devices usually fall into this category
298        RESISTOR  = 4,   // Resistor
299        CAPACITOR = 5,   // Capacitor
300        DIODE     = 6,   // Diode
301        BJT_SWITCH = 7,  // BJT(Switch)
302        VCVS       = 8,  // Voltage controlled voltage source
303        VCCS       = 9,  // Voltage controlled voltage source
304        BJT_EB     = 10, // BJT(Ebers-Moll)
305        GND        = 11, // BJT(Ebers-Moll)
306    };
283   enum type_t {
284      TERMINAL = 0,
285      INPUT    = 1,
286      OUTPUT   = 2,
287      PARAM    = 3,
288      NET      = 4,
289      DEVICE   = 5,
290      NETLIST   = 6,
291   };
292   enum family_t {
293      // Terminal families
294      LOGIC     = 1,
295      ANALOG    = 2,
296      // Device families
297      GENERIC   = 3,   // <== devices usually fall into this category
298      RESISTOR  = 4,   // Resistor
299      CAPACITOR = 5,   // Capacitor
300      DIODE     = 6,   // Diode
301      BJT_SWITCH = 7,  // BJT(Switch)
302      VCVS       = 8,  // Voltage controlled voltage source
303      VCCS       = 9,  // Voltage controlled voltage source
304      BJT_EB     = 10, // BJT(Ebers-Moll)
305      GND        = 11, // BJT(Ebers-Moll)
306   };
307307
308    ATTR_COLD netlist_object_t(const type_t atype, const family_t afamily);
308   ATTR_COLD netlist_object_t(const type_t atype, const family_t afamily);
309309
310    virtual ~netlist_object_t();
310   virtual ~netlist_object_t();
311311
312    ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
313    ATTR_COLD bool isInitalized() { return (m_netlist != NULL); }
312   ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
313   ATTR_COLD bool isInitalized() { return (m_netlist != NULL); }
314314
315    ATTR_COLD const pstring name() const;
315   ATTR_COLD const pstring name() const;
316316
317    PSTATE_INTERFACE_DECL()
317   PSTATE_INTERFACE_DECL()
318318
319    ATTR_HOT inline const type_t type() const { return m_objtype; }
320    ATTR_HOT inline const family_t family() const { return m_family; }
319   ATTR_HOT inline const type_t type() const { return m_objtype; }
320   ATTR_HOT inline const family_t family() const { return m_family; }
321321
322    ATTR_HOT inline const bool isType(const type_t atype) const { return (m_objtype == atype); }
323    ATTR_HOT inline const bool isFamily(const family_t afamily) const { return (m_family == afamily); }
322   ATTR_HOT inline const bool isType(const type_t atype) const { return (m_objtype == atype); }
323   ATTR_HOT inline const bool isFamily(const family_t afamily) const { return (m_family == afamily); }
324324
325    ATTR_HOT inline netlist_base_t & RESTRICT netlist() { return *m_netlist; }
326    ATTR_HOT inline const netlist_base_t & RESTRICT netlist() const { return *m_netlist; }
325   ATTR_HOT inline netlist_base_t & RESTRICT netlist() { return *m_netlist; }
326   ATTR_HOT inline const netlist_base_t & RESTRICT netlist() const { return *m_netlist; }
327327
328    ATTR_COLD void inline do_reset()
329    {
330        reset();
331    }
328   ATTR_COLD void inline do_reset()
329   {
330      reset();
331   }
332332
333333protected:
334334
335    ATTR_COLD virtual void reset() = 0;
336    // must call parent save_register !
337    ATTR_COLD virtual void save_register() { };
335   ATTR_COLD virtual void reset() = 0;
336   // must call parent save_register !
337   ATTR_COLD virtual void save_register() { };
338338
339339private:
340    pstring m_name;
341    const type_t m_objtype;
342    const family_t m_family;
343    netlist_base_t * RESTRICT m_netlist;
340   pstring m_name;
341   const type_t m_objtype;
342   const family_t m_family;
343   netlist_base_t * RESTRICT m_netlist;
344344};
345345
346346// ----------------------------------------------------------------------------------------
r29404r29405
349349
350350class netlist_owned_object_t : public netlist_object_t
351351{
352    NETLIST_PREVENT_COPYING(netlist_owned_object_t)
352   NETLIST_PREVENT_COPYING(netlist_owned_object_t)
353353public:
354    ATTR_COLD netlist_owned_object_t(const type_t atype, const family_t afamily);
354   ATTR_COLD netlist_owned_object_t(const type_t atype, const family_t afamily);
355355
356    ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
356   ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
357357
358    ATTR_HOT inline netlist_core_device_t & RESTRICT netdev() const { return *m_netdev; }
358   ATTR_HOT inline netlist_core_device_t & RESTRICT netdev() const { return *m_netdev; }
359359private:
360    netlist_core_device_t * RESTRICT m_netdev;
360   netlist_core_device_t * RESTRICT m_netdev;
361361};
362362
363363// ----------------------------------------------------------------------------------------
r29404r29405
366366
367367class netlist_core_terminal_t : public netlist_owned_object_t, public plinked_list_element<netlist_core_terminal_t>
368368{
369    NETLIST_PREVENT_COPYING(netlist_core_terminal_t)
369   NETLIST_PREVENT_COPYING(netlist_core_terminal_t)
370370public:
371371
372    typedef netlist_list_t<netlist_core_terminal_t *> list_t;
372   typedef netlist_list_t<netlist_core_terminal_t *> list_t;
373373
374    /* needed here ... */
374   /* needed here ... */
375375
376    enum state_e {
377        STATE_INP_PASSIVE = 0,
378        STATE_INP_ACTIVE = 1,
379        STATE_INP_HL = 2,
380        STATE_INP_LH = 4,
381        STATE_OUT = 128,
382        STATE_NONEX = 256
383    };
376   enum state_e {
377      STATE_INP_PASSIVE = 0,
378      STATE_INP_ACTIVE = 1,
379      STATE_INP_HL = 2,
380      STATE_INP_LH = 4,
381      STATE_OUT = 128,
382      STATE_NONEX = 256
383   };
384384
385385
386    ATTR_COLD netlist_core_terminal_t(const type_t atype, const family_t afamily);
386   ATTR_COLD netlist_core_terminal_t(const type_t atype, const family_t afamily);
387387
388    //ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
388   //ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
389389
390    ATTR_COLD void set_net(netlist_net_t &anet);
391    ATTR_COLD inline void clear_net() { m_net = NULL; }
392    ATTR_HOT inline bool has_net() const { return (m_net != NULL); }
393    ATTR_HOT inline const netlist_net_t & RESTRICT net() const { return *m_net;}
394    ATTR_HOT inline netlist_net_t & RESTRICT net() { return *m_net;}
390   ATTR_COLD void set_net(netlist_net_t &anet);
391   ATTR_COLD inline void clear_net() { m_net = NULL; }
392   ATTR_HOT inline bool has_net() const { return (m_net != NULL); }
393   ATTR_HOT inline const netlist_net_t & RESTRICT net() const { return *m_net;}
394   ATTR_HOT inline netlist_net_t & RESTRICT net() { return *m_net;}
395395
396    ATTR_HOT inline const bool is_state(const state_e astate) const { return (m_state == astate); }
397    ATTR_HOT inline const state_e state() const { return m_state; }
398    ATTR_HOT inline void set_state(const state_e astate)
399    {
400        assert(astate != STATE_NONEX);
401        m_state = astate;
402    }
396   ATTR_HOT inline const bool is_state(const state_e astate) const { return (m_state == astate); }
397   ATTR_HOT inline const state_e state() const { return m_state; }
398   ATTR_HOT inline void set_state(const state_e astate)
399   {
400      assert(astate != STATE_NONEX);
401      m_state = astate;
402   }
403403
404    const netlist_logic_family_desc_t *m_family_desc;
404   const netlist_logic_family_desc_t *m_family_desc;
405405
406406protected:
407    ATTR_COLD virtual void save_register()
408    {
409        save(NAME(m_state));
410        netlist_owned_object_t::save_register();
411    }
407   ATTR_COLD virtual void save_register()
408   {
409      save(NAME(m_state));
410      netlist_owned_object_t::save_register();
411   }
412412
413413private:
414    netlist_net_t * RESTRICT m_net;
415    state_e m_state;
414   netlist_net_t * RESTRICT m_net;
415   state_e m_state;
416416};
417417
418418NETLIST_SAVE_TYPE(netlist_core_terminal_t::state_e, DT_INT);
r29404r29405
420420
421421class netlist_terminal_t : public netlist_core_terminal_t
422422{
423    NETLIST_PREVENT_COPYING(netlist_terminal_t)
423   NETLIST_PREVENT_COPYING(netlist_terminal_t)
424424public:
425    ATTR_COLD netlist_terminal_t();
425   ATTR_COLD netlist_terminal_t();
426426
427    double m_Idr; // drive current
428    double m_go;  // conductance for Voltage from other term
429    double m_gt;  // conductance for total conductance
427   double m_Idr; // drive current
428   double m_go;  // conductance for Voltage from other term
429   double m_gt;  // conductance for total conductance
430430
431    ATTR_HOT inline void set(const double G)
432    {
433        m_Idr = 0;
434        m_go = m_gt = G;
435    }
431   ATTR_HOT inline void set(const double G)
432   {
433      m_Idr = 0;
434      m_go = m_gt = G;
435   }
436436
437    ATTR_HOT inline void set(const double GO, const double GT)
438    {
439        m_Idr = 0;
440        m_go = GO;
441        m_gt = GT;
442    }
437   ATTR_HOT inline void set(const double GO, const double GT)
438   {
439      m_Idr = 0;
440      m_go = GO;
441      m_gt = GT;
442   }
443443
444    ATTR_HOT inline void set(const double GO, const double GT, const double I)
445    {
446        m_Idr = I;
447        m_go = GO;
448        m_gt = GT;
449    }
444   ATTR_HOT inline void set(const double GO, const double GT, const double I)
445   {
446      m_Idr = I;
447      m_go = GO;
448      m_gt = GT;
449   }
450450
451451
452    netlist_terminal_t *m_otherterm;
452   netlist_terminal_t *m_otherterm;
453453
454454protected:
455    ATTR_COLD virtual void save_register();
455   ATTR_COLD virtual void save_register();
456456
457    ATTR_COLD virtual void reset();
457   ATTR_COLD virtual void reset();
458458};
459459
460460
r29404r29405
467467public:
468468
469469
470    ATTR_COLD netlist_input_t(const type_t atype, const family_t afamily)
471        : netlist_core_terminal_t(atype, afamily)
472    {
473        set_state(STATE_INP_ACTIVE);
474    }
470   ATTR_COLD netlist_input_t(const type_t atype, const family_t afamily)
471      : netlist_core_terminal_t(atype, afamily)
472   {
473      set_state(STATE_INP_ACTIVE);
474   }
475475
476    ATTR_HOT inline void inactivate();
477    ATTR_HOT inline void activate();
478    ATTR_HOT inline void activate_hl();
479    ATTR_HOT inline void activate_lh();
476   ATTR_HOT inline void inactivate();
477   ATTR_HOT inline void activate();
478   ATTR_HOT inline void activate_hl();
479   ATTR_HOT inline void activate_lh();
480480
481481protected:
482    ATTR_COLD virtual void reset()
483    {
484        //netlist_core_terminal_t::reset();
485        set_state(STATE_INP_ACTIVE);
486    }
482   ATTR_COLD virtual void reset()
483   {
484      //netlist_core_terminal_t::reset();
485      set_state(STATE_INP_ACTIVE);
486   }
487487
488488private:
489489};
r29404r29405
495495class netlist_logic_input_t : public netlist_input_t
496496{
497497public:
498    ATTR_COLD netlist_logic_input_t()
499        : netlist_input_t(INPUT, LOGIC)
500    {
501    }
498   ATTR_COLD netlist_logic_input_t()
499      : netlist_input_t(INPUT, LOGIC)
500   {
501   }
502502
503    ATTR_HOT inline const netlist_sig_t Q() const;
504    ATTR_HOT inline const netlist_sig_t last_Q() const;
503   ATTR_HOT inline const netlist_sig_t Q() const;
504   ATTR_HOT inline const netlist_sig_t last_Q() const;
505505
506506};
507507
r29404r29405
512512class netlist_ttl_input_t : public netlist_logic_input_t
513513{
514514public:
515    ATTR_COLD netlist_ttl_input_t()
516        : netlist_logic_input_t() { }
515   ATTR_COLD netlist_ttl_input_t()
516      : netlist_logic_input_t() { }
517517};
518518
519519// ----------------------------------------------------------------------------------------
r29404r29405
523523class netlist_analog_input_t : public netlist_input_t
524524{
525525public:
526    ATTR_COLD netlist_analog_input_t()
527        : netlist_input_t(INPUT, ANALOG) { }
526   ATTR_COLD netlist_analog_input_t()
527      : netlist_input_t(INPUT, ANALOG) { }
528528
529    ATTR_HOT inline const double Q_Analog() const;
529   ATTR_HOT inline const double Q_Analog() const;
530530};
531531
532532//#define INPVAL(_x) (_x).Q()
r29404r29405
537537
538538class netlist_net_t : public netlist_object_t
539539{
540    NETLIST_PREVENT_COPYING(netlist_net_t)
540   NETLIST_PREVENT_COPYING(netlist_net_t)
541541public:
542542
543    typedef netlist_list_t<netlist_net_t *> list_t;
543   typedef netlist_list_t<netlist_net_t *> list_t;
544544
545    friend class NETLIB_NAME(mainclock);
546    friend class netlist_matrix_solver_t;
547    friend class netlist_logic_output_t;
548    friend class netlist_analog_output_t;
549    friend class netlist_setup_t;
545   friend class NETLIB_NAME(mainclock);
546   friend class netlist_matrix_solver_t;
547   friend class netlist_logic_output_t;
548   friend class netlist_analog_output_t;
549   friend class netlist_setup_t;
550550
551    ATTR_COLD netlist_net_t(const type_t atype, const family_t afamily);
552    ATTR_COLD virtual ~netlist_net_t();
551   ATTR_COLD netlist_net_t(const type_t atype, const family_t afamily);
552   ATTR_COLD virtual ~netlist_net_t();
553553
554    ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
554   ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
555555
556    ATTR_COLD void register_con(netlist_core_terminal_t &terminal);
557    ATTR_COLD void merge_net(netlist_net_t *othernet);
558    ATTR_COLD void register_railterminal(netlist_output_t &mr);
556   ATTR_COLD void register_con(netlist_core_terminal_t &terminal);
557   ATTR_COLD void merge_net(netlist_net_t *othernet);
558   ATTR_COLD void register_railterminal(netlist_output_t &mr);
559559
560    ATTR_HOT inline void update_devs();
560   ATTR_HOT inline void update_devs();
561561
562    ATTR_HOT inline const netlist_time time() const { return m_time; }
563    ATTR_HOT inline void set_time(const netlist_time ntime) { m_time = ntime; }
562   ATTR_HOT inline const netlist_time time() const { return m_time; }
563   ATTR_HOT inline void set_time(const netlist_time ntime) { m_time = ntime; }
564564
565    ATTR_HOT inline bool isRailNet() const { return !(m_railterminal == NULL); }
566    ATTR_HOT inline const netlist_core_terminal_t & RESTRICT  railterminal() const { return *m_railterminal; }
565   ATTR_HOT inline bool isRailNet() const { return !(m_railterminal == NULL); }
566   ATTR_HOT inline const netlist_core_terminal_t & RESTRICT  railterminal() const { return *m_railterminal; }
567567
568    /* Everything below is used by the logic subsystem */
569    ATTR_HOT void inc_active(netlist_core_terminal_t &term);
570    ATTR_HOT void dec_active(netlist_core_terminal_t &term);
568   /* Everything below is used by the logic subsystem */
569   ATTR_HOT void inc_active(netlist_core_terminal_t &term);
570   ATTR_HOT void dec_active(netlist_core_terminal_t &term);
571571
572    ATTR_HOT inline const netlist_sig_t Q() const
573    {
574        assert(family() == LOGIC);
575        return m_cur_Q;
576    }
572   ATTR_HOT inline const netlist_sig_t Q() const
573   {
574      assert(family() == LOGIC);
575      return m_cur_Q;
576   }
577577
578    ATTR_HOT inline const netlist_sig_t last_Q() const
579    {
580        assert(family() == LOGIC);
581        return m_last_Q;
582    }
578   ATTR_HOT inline const netlist_sig_t last_Q() const
579   {
580      assert(family() == LOGIC);
581      return m_last_Q;
582   }
583583
584    ATTR_HOT inline const netlist_sig_t new_Q() const
585    {
586        assert(family() == LOGIC);
587        return m_new_Q;
588    }
584   ATTR_HOT inline const netlist_sig_t new_Q() const
585   {
586      assert(family() == LOGIC);
587      return m_new_Q;
588   }
589589
590    ATTR_HOT inline const double Q_Analog() const
591    {
592        //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
593        assert(family() == ANALOG);
594        return m_cur_Analog;
595    }
590   ATTR_HOT inline const double Q_Analog() const
591   {
592      //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
593      assert(family() == ANALOG);
594      return m_cur_Analog;
595   }
596596
597    ATTR_HOT inline void push_to_queue(const netlist_time delay);
598    ATTR_HOT bool inline is_queued() const { return m_in_queue == 1; }
597   ATTR_HOT inline void push_to_queue(const netlist_time delay);
598   ATTR_HOT bool inline is_queued() const { return m_in_queue == 1; }
599599
600    /* internal state support
601     * FIXME: get rid of this and implement export/import in MAME
602     */
603    ATTR_COLD inline netlist_sig_t &Q_state_ptr()
604    {
605        assert(family() == LOGIC);
606        return m_cur_Q;
607    }
600   /* internal state support
601    * FIXME: get rid of this and implement export/import in MAME
602    */
603   ATTR_COLD inline netlist_sig_t &Q_state_ptr()
604   {
605      assert(family() == LOGIC);
606      return m_cur_Q;
607   }
608608
609    ATTR_COLD inline double &Q_Analog_state_ptr()
610    {
611        //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
612        assert(family() == ANALOG);
613        return m_cur_Analog;
614    }
609   ATTR_COLD inline double &Q_Analog_state_ptr()
610   {
611      //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
612      assert(family() == ANALOG);
613      return m_cur_Analog;
614   }
615615
616    ATTR_HOT inline int num_cons() const { return m_num_cons; }
616   ATTR_HOT inline int num_cons() const { return m_num_cons; }
617617
618    // m_terms is only used by analog subsystem
619    typedef netlist_list_t<netlist_terminal_t *> terminal_list_t;
618   // m_terms is only used by analog subsystem
619   typedef netlist_list_t<netlist_terminal_t *> terminal_list_t;
620620
621    terminal_list_t m_terms;
622    terminal_list_t m_rails;
623    netlist_matrix_solver_t *m_solver;
624    netlist_core_terminal_t * RESTRICT m_railterminal;
621   terminal_list_t m_terms;
622   terminal_list_t m_rails;
623   netlist_matrix_solver_t *m_solver;
624   netlist_core_terminal_t * RESTRICT m_railterminal;
625625
626    ATTR_HOT void solve();
626   ATTR_HOT void solve();
627627
628    netlist_list_t<netlist_core_terminal_t *> m_registered; // save post-start m_list ...
629    plinked_list<netlist_core_terminal_t> m_list;
628   netlist_list_t<netlist_core_terminal_t *> m_registered; // save post-start m_list ...
629   plinked_list<netlist_core_terminal_t> m_list;
630630
631    ATTR_COLD void rebuild_list();     /* rebuild m_list after a load */
631   ATTR_COLD void rebuild_list();     /* rebuild m_list after a load */
632632
633633protected:  //FIXME: needed by current solver code
634634
635    UINT16 m_num_cons;
635   UINT16 m_num_cons;
636636
637    ATTR_COLD virtual void save_register();
638    ATTR_COLD virtual void reset();
637   ATTR_COLD virtual void save_register();
638   ATTR_COLD virtual void reset();
639639
640640
641641private:
642    netlist_sig_t m_new_Q;
643    netlist_sig_t m_cur_Q;
644    netlist_sig_t m_last_Q;
642   netlist_sig_t m_new_Q;
643   netlist_sig_t m_cur_Q;
644   netlist_sig_t m_last_Q;
645645
646    netlist_time m_time;
647    INT32        m_active;
648    UINT8        m_in_queue;    /* 0: not in queue, 1: in queue, 2: last was taken */
646   netlist_time m_time;
647   INT32        m_active;
648   UINT8        m_in_queue;    /* 0: not in queue, 1: in queue, 2: last was taken */
649649
650650public:
651    double m_last_Analog;
652    double m_cur_Analog;
653    double m_new_Analog;
651   double m_last_Analog;
652   double m_cur_Analog;
653   double m_new_Analog;
654654
655655};
656656
r29404r29405
661661
662662class netlist_output_t : public netlist_core_terminal_t
663663{
664    NETLIST_PREVENT_COPYING(netlist_output_t)
664   NETLIST_PREVENT_COPYING(netlist_output_t)
665665public:
666666
667    ATTR_COLD netlist_output_t(const type_t atype, const family_t afamily);
668    ATTR_COLD virtual ~netlist_output_t() {}
667   ATTR_COLD netlist_output_t(const type_t atype, const family_t afamily);
668   ATTR_COLD virtual ~netlist_output_t() {}
669669
670    ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
671    ATTR_COLD virtual void reset()
672    {
673        //netlist_core_terminal_t::reset();
674        set_state(STATE_OUT);
675    }
670   ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
671   ATTR_COLD virtual void reset()
672   {
673      //netlist_core_terminal_t::reset();
674      set_state(STATE_OUT);
675   }
676676
677677private:
678    netlist_net_t m_my_net;
678   netlist_net_t m_my_net;
679679};
680680
681681
682682class netlist_logic_output_t : public netlist_output_t
683683{
684    NETLIST_PREVENT_COPYING(netlist_logic_output_t)
684   NETLIST_PREVENT_COPYING(netlist_logic_output_t)
685685public:
686686
687    ATTR_COLD netlist_logic_output_t();
687   ATTR_COLD netlist_logic_output_t();
688688
689    ATTR_COLD void initial(const netlist_sig_t val);
689   ATTR_COLD void initial(const netlist_sig_t val);
690690
691    ATTR_COLD bool has_proxy() const { return (m_proxy != NULL); }
692    ATTR_COLD nld_base_d_to_a_proxy *get_proxy() const  { return m_proxy; }
693    ATTR_COLD void set_proxy(nld_base_d_to_a_proxy *proxy) { m_proxy = proxy; }
691   ATTR_COLD bool has_proxy() const { return (m_proxy != NULL); }
692   ATTR_COLD nld_base_d_to_a_proxy *get_proxy() const  { return m_proxy; }
693   ATTR_COLD void set_proxy(nld_base_d_to_a_proxy *proxy) { m_proxy = proxy; }
694694
695    ATTR_HOT inline void set_Q(const netlist_sig_t newQ, const netlist_time delay)
696    {
697        if (EXPECTED(newQ !=  net().m_new_Q))
698        {
699            net().m_new_Q = newQ;
700            net().push_to_queue(delay);
701        }
702    }
695   ATTR_HOT inline void set_Q(const netlist_sig_t newQ, const netlist_time delay)
696   {
697      if (EXPECTED(newQ !=  net().m_new_Q))
698      {
699         net().m_new_Q = newQ;
700         net().push_to_queue(delay);
701      }
702   }
703703private:
704    nld_base_d_to_a_proxy *m_proxy;
704   nld_base_d_to_a_proxy *m_proxy;
705705};
706706
707707class netlist_ttl_output_t : public netlist_logic_output_t
708708{
709709public:
710710
711    ATTR_COLD netlist_ttl_output_t();
711   ATTR_COLD netlist_ttl_output_t();
712712
713713};
714714
715715class netlist_analog_output_t : public netlist_output_t
716716{
717    NETLIST_PREVENT_COPYING(netlist_analog_output_t)
717   NETLIST_PREVENT_COPYING(netlist_analog_output_t)
718718public:
719719
720    ATTR_COLD netlist_analog_output_t();
720   ATTR_COLD netlist_analog_output_t();
721721
722    ATTR_COLD void initial(const double val);
722   ATTR_COLD void initial(const double val);
723723
724    ATTR_HOT inline void set_Q(const double newQ, const netlist_time delay)
725    {
726        if (newQ != net().m_new_Analog)
727        {
728            net().m_new_Analog = newQ;
729            net().push_to_queue(delay);
730        }
731    }
724   ATTR_HOT inline void set_Q(const double newQ, const netlist_time delay)
725   {
726      if (newQ != net().m_new_Analog)
727      {
728         net().m_new_Analog = newQ;
729         net().push_to_queue(delay);
730      }
731   }
732732
733733};
734734
r29404r29405
738738
739739class netlist_param_t : public netlist_owned_object_t
740740{
741    NETLIST_PREVENT_COPYING(netlist_param_t)
741   NETLIST_PREVENT_COPYING(netlist_param_t)
742742public:
743743
744    enum param_type_t {
745        MODEL,
746        STRING,
747        DOUBLE,
748        INTEGER,
749        LOGIC
750    };
744   enum param_type_t {
745      MODEL,
746      STRING,
747      DOUBLE,
748      INTEGER,
749      LOGIC
750   };
751751
752    ATTR_COLD netlist_param_t(const param_type_t atype);
752   ATTR_COLD netlist_param_t(const param_type_t atype);
753753
754    ATTR_HOT inline const param_type_t param_type() const { return m_param_type; }
754   ATTR_HOT inline const param_type_t param_type() const { return m_param_type; }
755755
756756protected:
757757
758    ATTR_COLD virtual void reset() { }
758   ATTR_COLD virtual void reset() { }
759759
760760private:
761    const param_type_t m_param_type;
761   const param_type_t m_param_type;
762762};
763763
764764class netlist_param_double_t : public netlist_param_t
765765{
766    NETLIST_PREVENT_COPYING(netlist_param_double_t)
766   NETLIST_PREVENT_COPYING(netlist_param_double_t)
767767public:
768    ATTR_COLD netlist_param_double_t();
768   ATTR_COLD netlist_param_double_t();
769769
770    ATTR_HOT inline void setTo(const double param);
771    ATTR_COLD inline void initial(const double val) { m_param = val; }
772    ATTR_HOT inline const double Value() const        { return m_param;   }
770   ATTR_HOT inline void setTo(const double param);
771   ATTR_COLD inline void initial(const double val) { m_param = val; }
772   ATTR_HOT inline const double Value() const        { return m_param;   }
773773
774774protected:
775    ATTR_COLD virtual void save_register()
776    {
777        save(NAME(m_param));
778        netlist_param_t::save_register();
779    }
775   ATTR_COLD virtual void save_register()
776   {
777      save(NAME(m_param));
778      netlist_param_t::save_register();
779   }
780780
781781private:
782    double m_param;
782   double m_param;
783783};
784784
785785class netlist_param_int_t : public netlist_param_t
786786{
787    NETLIST_PREVENT_COPYING(netlist_param_int_t)
787   NETLIST_PREVENT_COPYING(netlist_param_int_t)
788788public:
789    ATTR_COLD netlist_param_int_t();
789   ATTR_COLD netlist_param_int_t();
790790
791    ATTR_HOT inline void setTo(const int param);
792    ATTR_COLD inline void initial(const int val) { m_param = val; }
791   ATTR_HOT inline void setTo(const int param);
792   ATTR_COLD inline void initial(const int val) { m_param = val; }
793793
794    ATTR_HOT inline const int Value() const     { return m_param;     }
794   ATTR_HOT inline const int Value() const     { return m_param;     }
795795
796796protected:
797    ATTR_COLD virtual void save_register()
798    {
799        save(NAME(m_param));
800        netlist_param_t::save_register();
801    }
797   ATTR_COLD virtual void save_register()
798   {
799      save(NAME(m_param));
800      netlist_param_t::save_register();
801   }
802802
803803private:
804    int m_param;
804   int m_param;
805805};
806806
807807class netlist_param_logic_t : public netlist_param_int_t
808808{
809    NETLIST_PREVENT_COPYING(netlist_param_logic_t)
809   NETLIST_PREVENT_COPYING(netlist_param_logic_t)
810810public:
811    ATTR_COLD netlist_param_logic_t();
811   ATTR_COLD netlist_param_logic_t();
812812};
813813
814814class netlist_param_str_t : public netlist_param_t
815815{
816    NETLIST_PREVENT_COPYING(netlist_param_str_t)
816   NETLIST_PREVENT_COPYING(netlist_param_str_t)
817817public:
818    ATTR_COLD netlist_param_str_t();
818   ATTR_COLD netlist_param_str_t();
819819
820    ATTR_HOT inline void setTo(const pstring &param);
821    ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
820   ATTR_HOT inline void setTo(const pstring &param);
821   ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
822822
823    ATTR_HOT inline const pstring &Value() const     { return m_param;     }
823   ATTR_HOT inline const pstring &Value() const     { return m_param;     }
824824
825825private:
826    pstring m_param;
826   pstring m_param;
827827};
828828
829829class netlist_param_model_t : public netlist_param_t
830830{
831    NETLIST_PREVENT_COPYING(netlist_param_model_t)
831   NETLIST_PREVENT_COPYING(netlist_param_model_t)
832832public:
833    ATTR_COLD netlist_param_model_t();
833   ATTR_COLD netlist_param_model_t();
834834
835    ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
835   ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
836836
837    ATTR_HOT inline const pstring &Value() const     { return m_param;     }
837   ATTR_HOT inline const pstring &Value() const     { return m_param;     }
838838
839    /* these should be cached! */
840    ATTR_COLD double model_value(const pstring &entity, const double defval = 0.0) const;
841    ATTR_COLD const pstring model_type() const;
839   /* these should be cached! */
840   ATTR_COLD double model_value(const pstring &entity, const double defval = 0.0) const;
841   ATTR_COLD const pstring model_type() const;
842842
843843private:
844    pstring m_param;
844   pstring m_param;
845845};
846846
847847// ----------------------------------------------------------------------------------------
r29404r29405
850850
851851class netlist_core_device_t : public netlist_object_t
852852{
853    NETLIST_PREVENT_COPYING(netlist_core_device_t)
853   NETLIST_PREVENT_COPYING(netlist_core_device_t)
854854public:
855855
856    typedef netlist_list_t<netlist_core_device_t *> list_t;
856   typedef netlist_list_t<netlist_core_device_t *> list_t;
857857
858    //ATTR_COLD netlist_core_device_t();
859    ATTR_COLD netlist_core_device_t(const family_t afamily);
860    ATTR_COLD netlist_core_device_t(const netlist_logic_family_desc_t *family_desc);
858   //ATTR_COLD netlist_core_device_t();
859   ATTR_COLD netlist_core_device_t(const family_t afamily);
860   ATTR_COLD netlist_core_device_t(const netlist_logic_family_desc_t *family_desc);
861861
862    ATTR_COLD virtual ~netlist_core_device_t();
862   ATTR_COLD virtual ~netlist_core_device_t();
863863
864    ATTR_COLD virtual void init(netlist_base_t &anetlist, const pstring &name);
865    ATTR_HOT virtual void update_param() {}
864   ATTR_COLD virtual void init(netlist_base_t &anetlist, const pstring &name);
865   ATTR_HOT virtual void update_param() {}
866866
867    ATTR_HOT inline void update_dev()
868    {
867   ATTR_HOT inline void update_dev()
868   {
869869#if USE_PMFDELEGATES
870        static_update(this);
870      static_update(this);
871871#else
872        update();
872      update();
873873#endif
874    }
875    ATTR_HOT inline void start_dev()
876    {
877        start();
878    }
874   }
875   ATTR_HOT inline void start_dev()
876   {
877      start();
878   }
879879
880    ATTR_HOT const netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp);
880   ATTR_HOT const netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp);
881881
882    ATTR_HOT inline const netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const
883    {
884        assert(inp.state() != netlist_input_t::STATE_INP_PASSIVE);
885        return inp.Q();
886    }
882   ATTR_HOT inline const netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const
883   {
884      assert(inp.state() != netlist_input_t::STATE_INP_PASSIVE);
885      return inp.Q();
886   }
887887
888    ATTR_HOT inline void OUTLOGIC(netlist_logic_output_t &out, const netlist_sig_t val, const netlist_time delay)
889    {
890        out.set_Q(val, delay);
891    }
888   ATTR_HOT inline void OUTLOGIC(netlist_logic_output_t &out, const netlist_sig_t val, const netlist_time delay)
889   {
890      out.set_Q(val, delay);
891   }
892892
893    ATTR_HOT inline bool INP_HL(const netlist_logic_input_t &inp) const
894    {
895        return ((inp.last_Q() & !inp.Q()) == 1);
896    }
893   ATTR_HOT inline bool INP_HL(const netlist_logic_input_t &inp) const
894   {
895      return ((inp.last_Q() & !inp.Q()) == 1);
896   }
897897
898    ATTR_HOT inline bool INP_LH(const netlist_logic_input_t &inp) const
899    {
900        return ((!inp.last_Q() & inp.Q()) == 1);
901    }
898   ATTR_HOT inline bool INP_LH(const netlist_logic_input_t &inp) const
899   {
900      return ((!inp.last_Q() & inp.Q()) == 1);
901   }
902902
903    ATTR_HOT inline const double INPANALOG(const netlist_analog_input_t &inp) const { return inp.Q_Analog(); }
903   ATTR_HOT inline const double INPANALOG(const netlist_analog_input_t &inp) const { return inp.Q_Analog(); }
904904
905    ATTR_HOT inline const double TERMANALOG(const netlist_terminal_t &term) const { return term.net().Q_Analog(); }
905   ATTR_HOT inline const double TERMANALOG(const netlist_terminal_t &term) const { return term.net().Q_Analog(); }
906906
907    ATTR_HOT inline void OUTANALOG(netlist_analog_output_t &out, const double val, const netlist_time delay)
908    {
909        out.set_Q(val, delay);
910    }
907   ATTR_HOT inline void OUTANALOG(netlist_analog_output_t &out, const double val, const netlist_time delay)
908   {
909      out.set_Q(val, delay);
910   }
911911
912    ATTR_HOT virtual void inc_active() {  }
912   ATTR_HOT virtual void inc_active() {  }
913913
914    ATTR_HOT virtual void dec_active() {  }
914   ATTR_HOT virtual void dec_active() {  }
915915
916    ATTR_HOT virtual void step_time(const double st) { }
917    ATTR_HOT virtual void update_terminals() { }
916   ATTR_HOT virtual void step_time(const double st) { }
917   ATTR_HOT virtual void update_terminals() { }
918918
919919
920920
921921#if (NL_KEEP_STATISTICS)
922    /* stats */
923    osd_ticks_t total_time;
924    INT32 stat_count;
922   /* stats */
923   osd_ticks_t total_time;
924   INT32 stat_count;
925925#endif
926926
927927#if USE_PMFDELEGATES
928    net_update_delegate static_update;
928   net_update_delegate static_update;
929929#endif
930930
931    const netlist_logic_family_desc_t *m_family_desc;
931   const netlist_logic_family_desc_t *m_family_desc;
932932
933933protected:
934934
935    ATTR_HOT virtual void update() { }
936    ATTR_COLD virtual void start() { }
935   ATTR_HOT virtual void update() { }
936   ATTR_COLD virtual void start() { }
937937
938938private:
939939};
r29404r29405
941941
942942class netlist_device_t : public netlist_core_device_t
943943{
944    NETLIST_PREVENT_COPYING(netlist_device_t)
944   NETLIST_PREVENT_COPYING(netlist_device_t)
945945public:
946946
947    ATTR_COLD netlist_device_t();
948    ATTR_COLD netlist_device_t(const family_t afamily);
947   ATTR_COLD netlist_device_t();
948   ATTR_COLD netlist_device_t(const family_t afamily);
949949
950    ATTR_COLD virtual ~netlist_device_t();
950   ATTR_COLD virtual ~netlist_device_t();
951951
952    ATTR_COLD virtual void init(netlist_base_t &anetlist, const pstring &name);
952   ATTR_COLD virtual void init(netlist_base_t &anetlist, const pstring &name);
953953
954    ATTR_COLD netlist_setup_t &setup();
954   ATTR_COLD netlist_setup_t &setup();
955955
956    ATTR_COLD void register_sub(netlist_device_t &dev, const pstring &name);
957    ATTR_COLD void register_subalias(const pstring &name, netlist_core_terminal_t &term);
958    ATTR_COLD void register_terminal(const pstring &name, netlist_terminal_t &port);
959    ATTR_COLD void register_output(const pstring &name, netlist_output_t &out);
960    ATTR_COLD void register_input(const pstring &name, netlist_input_t &in);
956   ATTR_COLD void register_sub(netlist_device_t &dev, const pstring &name);
957   ATTR_COLD void register_subalias(const pstring &name, netlist_core_terminal_t &term);
958   ATTR_COLD void register_terminal(const pstring &name, netlist_terminal_t &port);
959   ATTR_COLD void register_output(const pstring &name, netlist_output_t &out);
960   ATTR_COLD void register_input(const pstring &name, netlist_input_t &in);
961961
962    ATTR_COLD void connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
962   ATTR_COLD void connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
963963
964    netlist_list_t<pstring, 20> m_terminals;
964   netlist_list_t<pstring, 20> m_terminals;
965965
966966protected:
967967
968    ATTR_HOT virtual void update() { }
969    ATTR_HOT virtual void start() { }
970    ATTR_HOT virtual void update_terminals() { }
968   ATTR_HOT virtual void update() { }
969   ATTR_HOT virtual void start() { }
970   ATTR_HOT virtual void update_terminals() { }
971971
972    template <class C, class T>
973    ATTR_COLD void register_param(const pstring &sname, C &param, const T initialVal);
972   template <class C, class T>
973   ATTR_COLD void register_param(const pstring &sname, C &param, const T initialVal);
974974
975975private:
976976};
r29404r29405
981981// ----------------------------------------------------------------------------------------
982982
983983class netlist_queue_t : public netlist_timed_queue<netlist_net_t *, netlist_time, 512>,
984                        public pstate_callback_t
984                  public pstate_callback_t
985985{
986986public:
987987
988    netlist_queue_t(netlist_base_t &nl);
988   netlist_queue_t(netlist_base_t &nl);
989989
990    void register_state(pstate_manager_t &manager, const pstring &module);
991    void on_pre_save();
992    void on_post_load();
990   void register_state(pstate_manager_t &manager, const pstring &module);
991   void on_pre_save();
992   void on_post_load();
993993
994    pstate_callback_t &callback() { return *this; }
994   pstate_callback_t &callback() { return *this; }
995995
996996private:
997    netlist_base_t &m_netlist;
998    int m_qsize;
999    netlist_time::INTERNALTYPE m_times[512];
1000    char m_name[512][64];
997   netlist_base_t &m_netlist;
998   int m_qsize;
999   netlist_time::INTERNALTYPE m_times[512];
1000   char m_name[512][64];
10011001};
10021002
10031003// ----------------------------------------------------------------------------------------
r29404r29405
10091009
10101010class netlist_base_t : public netlist_object_t, public pstate_manager_t
10111011{
1012    NETLIST_PREVENT_COPYING(netlist_base_t)
1012   NETLIST_PREVENT_COPYING(netlist_base_t)
10131013public:
10141014
1015    netlist_base_t();
1016    virtual ~netlist_base_t();
1015   netlist_base_t();
1016   virtual ~netlist_base_t();
10171017
1018    ATTR_COLD void start();
1018   ATTR_COLD void start();
10191019
1020    ATTR_HOT inline const netlist_queue_t &queue() const { return m_queue; }
1021    ATTR_HOT inline netlist_queue_t &queue() { return m_queue; }
1022    ATTR_HOT inline const netlist_time time() const { return m_time; }
1023    ATTR_HOT inline NETLIB_NAME(solver) *solver() const { return m_solver; }
1024    ATTR_HOT inline NETLIB_NAME(gnd) *gnd() const { return m_gnd; }
1025    ATTR_HOT const double gmin() const;
1020   ATTR_HOT inline const netlist_queue_t &queue() const { return m_queue; }
1021   ATTR_HOT inline netlist_queue_t &queue() { return m_queue; }
1022   ATTR_HOT inline const netlist_time time() const { return m_time; }
1023   ATTR_HOT inline NETLIB_NAME(solver) *solver() const { return m_solver; }
1024   ATTR_HOT inline NETLIB_NAME(gnd) *gnd() const { return m_gnd; }
1025   ATTR_HOT const double gmin() const;
10261026
1027    ATTR_HOT inline void push_to_queue(netlist_net_t *out, const netlist_time attime)
1028    {
1029        m_queue.push(netlist_queue_t::entry_t(attime, out));
1030    }
1027   ATTR_HOT inline void push_to_queue(netlist_net_t *out, const netlist_time attime)
1028   {
1029      m_queue.push(netlist_queue_t::entry_t(attime, out));
1030   }
10311031
1032    ATTR_HOT void process_queue(const netlist_time delta);
1033    ATTR_HOT inline void abort_current_queue_slice() { m_stop = netlist_time::zero; }
1032   ATTR_HOT void process_queue(const netlist_time delta);
1033   ATTR_HOT inline void abort_current_queue_slice() { m_stop = netlist_time::zero; }
10341034
1035    ATTR_COLD void rebuild_lists(); /* must be called after post_load ! */
1035   ATTR_COLD void rebuild_lists(); /* must be called after post_load ! */
10361036
1037    ATTR_COLD void set_setup(netlist_setup_t *asetup) { m_setup = asetup;  }
1038    ATTR_COLD netlist_setup_t &setup() { return *m_setup; }
1037   ATTR_COLD void set_setup(netlist_setup_t *asetup) { m_setup = asetup;  }
1038   ATTR_COLD netlist_setup_t &setup() { return *m_setup; }
10391039
1040    ATTR_COLD netlist_net_t *find_net(const pstring &name);
1040   ATTR_COLD netlist_net_t *find_net(const pstring &name);
10411041
1042    ATTR_COLD void error(const char *format, ...) const ATTR_PRINTF(2,3);
1043    ATTR_COLD void warning(const char *format, ...) const ATTR_PRINTF(2,3);
1044    ATTR_COLD void log(const char *format, ...) const ATTR_PRINTF(2,3);
1042   ATTR_COLD void error(const char *format, ...) const ATTR_PRINTF(2,3);
1043   ATTR_COLD void warning(const char *format, ...) const ATTR_PRINTF(2,3);
1044   ATTR_COLD void log(const char *format, ...) const ATTR_PRINTF(2,3);
10451045
1046    template<class _C>
1047    netlist_list_t<_C *> get_device_list()
1048    {
1049        netlist_list_t<_C *> tmp;
1050        for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
1051        {
1052            _C *dev = dynamic_cast<_C *>(entry->object());
1053            if (dev != NULL)
1054                tmp.add(dev);
1055        }
1056        return tmp;
1057    }
1046   template<class _C>
1047   netlist_list_t<_C *> get_device_list()
1048   {
1049      netlist_list_t<_C *> tmp;
1050      for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
1051      {
1052         _C *dev = dynamic_cast<_C *>(entry->object());
1053         if (dev != NULL)
1054            tmp.add(dev);
1055      }
1056      return tmp;
1057   }
10581058
1059    template<class _C>
1060    _C *get_first_device()
1061    {
1062        for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
1063        {
1064            _C *dev = dynamic_cast<_C *>(entry->object());
1065            if (dev != NULL)
1066                return dev;
1067        }
1068        return NULL;
1069    }
1059   template<class _C>
1060   _C *get_first_device()
1061   {
1062      for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
1063      {
1064         _C *dev = dynamic_cast<_C *>(entry->object());
1065         if (dev != NULL)
1066            return dev;
1067      }
1068      return NULL;
1069   }
10701070
1071    template<class _C>
1072    _C *get_single_device(const char *classname)
1073    {
1074        _C *ret = NULL;
1075        for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
1076        {
1077            _C *dev = dynamic_cast<_C *>(entry->object());
1078            if (dev != NULL)
1079            {
1080                if (ret != NULL)
1081                    this->error("more than one %s device found", classname);
1082                else
1083                    ret = dev;
1084            }
1085        }
1086        return ret;
1087    }
1071   template<class _C>
1072   _C *get_single_device(const char *classname)
1073   {
1074      _C *ret = NULL;
1075      for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
1076      {
1077         _C *dev = dynamic_cast<_C *>(entry->object());
1078         if (dev != NULL)
1079         {
1080            if (ret != NULL)
1081               this->error("more than one %s device found", classname);
1082            else
1083               ret = dev;
1084         }
1085      }
1086      return ret;
1087   }
10881088
1089    tagmap_devices_t m_devices;
1090    netlist_net_t::list_t m_nets;
1089   tagmap_devices_t m_devices;
1090   netlist_net_t::list_t m_nets;
10911091
10921092protected:
10931093
1094    enum loglevel_e
1095    {
1096        NL_ERROR,
1097        NL_WARNING,
1098        NL_LOG,
1099    };
1094   enum loglevel_e
1095   {
1096      NL_ERROR,
1097      NL_WARNING,
1098      NL_LOG,
1099   };
11001100
1101    // any derived netlist must override this ...
1102    ATTR_COLD virtual void verror(const loglevel_e level,
1103            const char *format, va_list ap) const = 0;
1101   // any derived netlist must override this ...
1102   ATTR_COLD virtual void verror(const loglevel_e level,
1103         const char *format, va_list ap) const = 0;
11041104
1105    /* from netlist_object */
1106    ATTR_COLD virtual void reset();
1107    ATTR_COLD virtual void save_register();
1105   /* from netlist_object */
1106   ATTR_COLD virtual void reset();
1107   ATTR_COLD virtual void save_register();
11081108
11091109#if (NL_KEEP_STATISTICS)
1110    // performance
1111    int m_perf_out_processed;
1112    int m_perf_inp_processed;
1113    int m_perf_inp_active;
1110   // performance
1111   int m_perf_out_processed;
1112   int m_perf_inp_processed;
1113   int m_perf_inp_active;
11141114#endif
11151115
11161116private:
1117    netlist_time                m_stop;     // target time for current queue processing
1117   netlist_time                m_stop;     // target time for current queue processing
11181118
1119    netlist_time                m_time;
1120    netlist_queue_t             m_queue;
1119   netlist_time                m_time;
1120   netlist_queue_t             m_queue;
11211121
1122    NETLIB_NAME(mainclock) *    m_mainclock;
1123    NETLIB_NAME(solver) *       m_solver;
1124    NETLIB_NAME(gnd) *          m_gnd;
1122   NETLIB_NAME(mainclock) *    m_mainclock;
1123   NETLIB_NAME(solver) *       m_solver;
1124   NETLIB_NAME(gnd) *          m_gnd;
11251125
1126    netlist_setup_t *m_setup;
1126   netlist_setup_t *m_setup;
11271127};
11281128
11291129// ----------------------------------------------------------------------------------------
r29404r29405
11341134
11351135ATTR_HOT inline void netlist_param_str_t::setTo(const pstring &param)
11361136{
1137    m_param = param;
1138    netdev().update_param();
1137   m_param = param;
1138   netdev().update_param();
11391139}
11401140
11411141ATTR_HOT inline void netlist_param_int_t::setTo(const int param)
11421142{
1143    if (m_param != param)
1144    {
1145        m_param = param;
1146        netdev().update_param();
1147    }
1143   if (m_param != param)
1144   {
1145      m_param = param;
1146      netdev().update_param();
1147   }
11481148}
11491149
11501150ATTR_HOT inline void netlist_param_double_t::setTo(const double param)
11511151{
1152    if (m_param != param)
1153    {
1154        m_param = param;
1155        netdev().update_param();
1156    }
1152   if (m_param != param)
1153   {
1154      m_param = param;
1155      netdev().update_param();
1156   }
11571157}
11581158
11591159
11601160ATTR_HOT inline void netlist_input_t::inactivate()
11611161{
1162    if (EXPECTED(!is_state(STATE_INP_PASSIVE)))
1163    {
1164        set_state(STATE_INP_PASSIVE);
1165        net().dec_active(*this);
1166    }
1162   if (EXPECTED(!is_state(STATE_INP_PASSIVE)))
1163   {
1164      set_state(STATE_INP_PASSIVE);
1165      net().dec_active(*this);
1166   }
11671167}
11681168
11691169ATTR_HOT inline void netlist_input_t::activate()
11701170{
1171    if (is_state(STATE_INP_PASSIVE))
1172    {
1173        net().inc_active(*this);
1174        set_state(STATE_INP_ACTIVE);
1175    }
1171   if (is_state(STATE_INP_PASSIVE))
1172   {
1173      net().inc_active(*this);
1174      set_state(STATE_INP_ACTIVE);
1175   }
11761176}
11771177
11781178ATTR_HOT inline void netlist_input_t::activate_hl()
11791179{
1180    if (is_state(STATE_INP_PASSIVE))
1181    {
1182        net().inc_active(*this);
1183        set_state(STATE_INP_HL);
1184    }
1180   if (is_state(STATE_INP_PASSIVE))
1181   {
1182      net().inc_active(*this);
1183      set_state(STATE_INP_HL);
1184   }
11851185}
11861186
11871187ATTR_HOT inline void netlist_input_t::activate_lh()
11881188{
1189    if (is_state(STATE_INP_PASSIVE))
1190    {
1191        net().inc_active(*this);
1192        set_state(STATE_INP_LH);
1193    }
1189   if (is_state(STATE_INP_PASSIVE))
1190   {
1191      net().inc_active(*this);
1192      set_state(STATE_INP_LH);
1193   }
11941194}
11951195
11961196
11971197ATTR_HOT inline void netlist_net_t::push_to_queue(const netlist_time delay)
11981198{
1199    //if (UNEXPECTED(m_num_cons == 0 || is_queued()))
1200    if (!is_queued())
1201    {
1202        m_time = netlist().time() + delay;
1203        m_in_queue = (m_active > 0);     /* queued ? */
1204        if (EXPECTED(m_in_queue))
1205        {
1206            netlist().push_to_queue(this, m_time);
1207        }
1208    }
1199   //if (UNEXPECTED(m_num_cons == 0 || is_queued()))
1200   if (!is_queued())
1201   {
1202      m_time = netlist().time() + delay;
1203      m_in_queue = (m_active > 0);     /* queued ? */
1204      if (EXPECTED(m_in_queue))
1205      {
1206         netlist().push_to_queue(this, m_time);
1207      }
1208   }
12091209}
12101210
12111211
12121212ATTR_HOT inline const netlist_sig_t netlist_logic_input_t::Q() const
12131213{
1214    return net().Q();
1214   return net().Q();
12151215}
12161216
12171217ATTR_HOT inline const netlist_sig_t netlist_logic_input_t::last_Q() const
12181218{
1219    return net().last_Q();
1219   return net().last_Q();
12201220}
12211221
12221222ATTR_HOT inline const double netlist_analog_input_t::Q_Analog() const
12231223{
1224    return net().Q_Analog();
1224   return net().Q_Analog();
12251225}
12261226
12271227
r29404r29405
12311231
12321232class net_device_t_base_factory
12331233{
1234    NETLIST_PREVENT_COPYING(net_device_t_base_factory)
1234   NETLIST_PREVENT_COPYING(net_device_t_base_factory)
12351235public:
1236    ATTR_COLD net_device_t_base_factory(const pstring &name, const pstring &classname,
1237            const pstring &def_param)
1238    : m_name(name), m_classname(classname), m_def_param(def_param)
1239    {}
1236   ATTR_COLD net_device_t_base_factory(const pstring &name, const pstring &classname,
1237         const pstring &def_param)
1238   : m_name(name), m_classname(classname), m_def_param(def_param)
1239   {}
12401240
1241    ATTR_COLD virtual ~net_device_t_base_factory() {}
1241   ATTR_COLD virtual ~net_device_t_base_factory() {}
12421242
1243    ATTR_COLD virtual netlist_device_t *Create() const = 0;
1243   ATTR_COLD virtual netlist_device_t *Create() const = 0;
12441244
1245    ATTR_COLD const pstring &name() const { return m_name; }
1246    ATTR_COLD const pstring &classname() const { return m_classname; }
1247    ATTR_COLD const pstring &param_desc() const { return m_def_param; }
1248    ATTR_COLD const nl_util::pstring_list term_param_list();
1249    ATTR_COLD const nl_util::pstring_list def_params();
1245   ATTR_COLD const pstring &name() const { return m_name; }
1246   ATTR_COLD const pstring &classname() const { return m_classname; }
1247   ATTR_COLD const pstring &param_desc() const { return m_def_param; }
1248   ATTR_COLD const nl_util::pstring_list term_param_list();
1249   ATTR_COLD const nl_util::pstring_list def_params();
12501250
12511251protected:
1252    pstring m_name;                             /* device name */
1253    pstring m_classname;                        /* device class name */
1254    pstring m_def_param;                        /* default parameter */
1252   pstring m_name;                             /* device name */
1253   pstring m_classname;                        /* device class name */
1254   pstring m_def_param;                        /* default parameter */
12551255};
12561256
12571257template <class C>
12581258class net_device_t_factory : public net_device_t_base_factory
12591259{
1260    NETLIST_PREVENT_COPYING(net_device_t_factory)
1260   NETLIST_PREVENT_COPYING(net_device_t_factory)
12611261public:
1262    ATTR_COLD net_device_t_factory(const pstring &name, const pstring &classname,
1263            const pstring &def_param)
1264    : net_device_t_base_factory(name, classname, def_param) { }
1262   ATTR_COLD net_device_t_factory(const pstring &name, const pstring &classname,
1263         const pstring &def_param)
1264   : net_device_t_base_factory(name, classname, def_param) { }
12651265
1266    ATTR_COLD netlist_device_t *Create() const
1267    {
1268        netlist_device_t *r = new C();
1269        //r->init(setup, name);
1270        return r;
1271    }
1266   ATTR_COLD netlist_device_t *Create() const
1267   {
1268      netlist_device_t *r = new C();
1269      //r->init(setup, name);
1270      return r;
1271   }
12721272};
12731273
12741274class netlist_factory_t
12751275{
12761276public:
1277    typedef netlist_list_t<net_device_t_base_factory *> list_t;
1277   typedef netlist_list_t<net_device_t_base_factory *> list_t;
12781278
1279    ATTR_COLD netlist_factory_t();
1280    ATTR_COLD ~netlist_factory_t();
1279   ATTR_COLD netlist_factory_t();
1280   ATTR_COLD ~netlist_factory_t();
12811281
1282    ATTR_COLD void initialize();
1282   ATTR_COLD void initialize();
12831283
1284    template<class _C>
1285    ATTR_COLD void register_device(const pstring &name, const pstring &classname,
1286            const pstring &def_param)
1287    {
1288        m_list.add(new net_device_t_factory< _C >(name, classname, def_param) );
1289    }
1284   template<class _C>
1285   ATTR_COLD void register_device(const pstring &name, const pstring &classname,
1286         const pstring &def_param)
1287   {
1288      m_list.add(new net_device_t_factory< _C >(name, classname, def_param) );
1289   }
12901290
1291    ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
1292    ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
1293    ATTR_COLD net_device_t_base_factory * factory_by_name(const pstring &name, netlist_setup_t &setup) const;
1291   ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
1292   ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
1293   ATTR_COLD net_device_t_base_factory * factory_by_name(const pstring &name, netlist_setup_t &setup) const;
12941294
1295    const list_t &list() { return m_list; }
1295   const list_t &list() { return m_list; }
12961296
12971297private:
1298    list_t m_list;
1298   list_t m_list;
12991299
13001300};
13011301
trunk/src/emu/netlist/analog/nld_switches.c
r29404r29405
1111
1212NETLIB_START(switch2)
1313{
14    register_sub(m_R[0], "R1");
15    register_sub(m_R[1], "R2");
14   register_sub(m_R[0], "R1");
15   register_sub(m_R[1], "R2");
1616
17    register_param("POS", m_POS, 0);
17   register_param("POS", m_POS, 0);
1818
19    connect(m_R[0].m_N, m_R[1].m_N);
19   connect(m_R[0].m_N, m_R[1].m_N);
2020
21    register_subalias("1", m_R[0].m_P);
22    register_subalias("2", m_R[1].m_P);
21   register_subalias("1", m_R[0].m_P);
22   register_subalias("2", m_R[1].m_P);
2323
24    register_subalias("Q", m_R[0].m_N);
24   register_subalias("Q", m_R[0].m_N);
2525}
2626
2727NETLIB_RESET(switch2)
2828{
29    m_R[0].do_reset();
30    m_R[1].do_reset();
29   m_R[0].do_reset();
30   m_R[1].do_reset();
3131
32    m_R[0].set_R(R_ON);
33    m_R[1].set_R(R_OFF);
32   m_R[0].set_R(R_ON);
33   m_R[1].set_R(R_OFF);
3434}
3535
3636NETLIB_UPDATE(switch2)
3737{
38    if (m_POS.Value() == 0)
39    {
40        m_R[0].set_R(R_ON);
41        m_R[1].set_R(R_OFF);
42    }
43    else
44    {
45        m_R[0].set_R(R_OFF);
46        m_R[1].set_R(R_ON);
47    }
38   if (m_POS.Value() == 0)
39   {
40      m_R[0].set_R(R_ON);
41      m_R[1].set_R(R_OFF);
42   }
43   else
44   {
45      m_R[0].set_R(R_OFF);
46      m_R[1].set_R(R_ON);
47   }
4848
49    m_R[0].update_dev();
50    m_R[1].update_dev();
49   m_R[0].update_dev();
50   m_R[1].update_dev();
5151}
5252
5353NETLIB_UPDATE_PARAM(switch2)
5454{
55    update();
55   update();
5656}
trunk/src/emu/netlist/analog/nld_solver.c
r29404r29405
2020
2121ATTR_COLD void netlist_matrix_solver_t::setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &aowner)
2222{
23    m_owner = &aowner;
23   m_owner = &aowner;
2424
25    NL_VERBOSE_OUT(("New solver setup\n"));
25   NL_VERBOSE_OUT(("New solver setup\n"));
2626
27    for (netlist_net_t * const * pn = nets.first(); pn != NULL; pn = nets.next(pn))
28    {
29        NL_VERBOSE_OUT(("setting up net\n"));
27   for (netlist_net_t * const * pn = nets.first(); pn != NULL; pn = nets.next(pn))
28   {
29      NL_VERBOSE_OUT(("setting up net\n"));
3030
31        m_nets.add(*pn);
31      m_nets.add(*pn);
3232
33        (*pn)->m_solver = this;
33      (*pn)->m_solver = this;
3434
35        for (netlist_core_terminal_t *p = (*pn)->m_list.first(); p != NULL; p = (*pn)->m_list.next(p))
36        {
37            NL_VERBOSE_OUT(("%s %s %d\n", p->name().cstr(), (*pn)->name().cstr(), (int) (*pn)->isRailNet()));
38            switch (p->type())
39            {
40                case netlist_terminal_t::TERMINAL:
41                    switch (p->netdev().family())
42                    {
43                        case netlist_device_t::CAPACITOR:
44                            if (!m_steps.contains(&p->netdev()))
45                                m_steps.add(&p->netdev());
46                            break;
47                        case netlist_device_t::BJT_EB:
48                        case netlist_device_t::DIODE:
49                        //case netlist_device_t::VCVS:
50                        case netlist_device_t::BJT_SWITCH:
51                            NL_VERBOSE_OUT(("found BJT/Diode\n"));
52                            if (!m_dynamic.contains(&p->netdev()))
53                                m_dynamic.add(&p->netdev());
54                            break;
55                        default:
56                            break;
57                    }
58                    {
59                        netlist_terminal_t *pterm = static_cast<netlist_terminal_t *>(p);
60                        if (pterm->m_otherterm->net().isRailNet())
61                            (*pn)->m_rails.add(pterm);
62                        else
63                            (*pn)->m_terms.add(pterm);
64                    }
65                    NL_VERBOSE_OUT(("Added terminal\n"));
66                    break;
67                case netlist_terminal_t::INPUT:
68                    if (!m_inps.contains(p))
69                        m_inps.add(p);
70                    NL_VERBOSE_OUT(("Added input\n"));
71                    break;
72                default:
73                    owner().netlist().error("unhandled element found\n");
74                    break;
75            }
76        }
77        NL_VERBOSE_OUT(("added net with %d populated connections (%d railnets)\n", (*pn)->m_terms.count(), (*pn)->m_rails.count()));
78    }
35      for (netlist_core_terminal_t *p = (*pn)->m_list.first(); p != NULL; p = (*pn)->m_list.next(p))
36      {
37         NL_VERBOSE_OUT(("%s %s %d\n", p->name().cstr(), (*pn)->name().cstr(), (int) (*pn)->isRailNet()));
38         switch (p->type())
39         {
40            case netlist_terminal_t::TERMINAL:
41               switch (p->netdev().family())
42               {
43                  case netlist_device_t::CAPACITOR:
44                     if (!m_steps.contains(&p->netdev()))
45                        m_steps.add(&p->netdev());
46                     break;
47                  case netlist_device_t::BJT_EB:
48                  case netlist_device_t::DIODE:
49                  //case netlist_device_t::VCVS:
50                  case netlist_device_t::BJT_SWITCH:
51                     NL_VERBOSE_OUT(("found BJT/Diode\n"));
52                     if (!m_dynamic.contains(&p->netdev()))
53                        m_dynamic.add(&p->netdev());
54                     break;
55                  default:
56                     break;
57               }
58               {
59                  netlist_terminal_t *pterm = static_cast<netlist_terminal_t *>(p);
60                  if (pterm->m_otherterm->net().isRailNet())
61                     (*pn)->m_rails.add(pterm);
62                  else
63                     (*pn)->m_terms.add(pterm);
64               }
65               NL_VERBOSE_OUT(("Added terminal\n"));
66               break;
67            case netlist_terminal_t::INPUT:
68               if (!m_inps.contains(p))
69                  m_inps.add(p);
70               NL_VERBOSE_OUT(("Added input\n"));
71               break;
72            default:
73               owner().netlist().error("unhandled element found\n");
74               break;
75         }
76      }
77      NL_VERBOSE_OUT(("added net with %d populated connections (%d railnets)\n", (*pn)->m_terms.count(), (*pn)->m_rails.count()));
78   }
7979}
8080
8181ATTR_HOT void netlist_matrix_solver_t::update_inputs()
8282{
83    for (netlist_core_terminal_t * const *p = m_inps.first(); p != NULL; p = m_inps.next(p))
84    {
85        if ((*p)->net().m_last_Analog != (*p)->net().m_cur_Analog)
86        {
87            (*p)->netdev().update_dev();
88        }
89    }
90    for (netlist_core_terminal_t * const *p = m_inps.first(); p != NULL; p = m_inps.next(p))
91    {
92        (*p)->net().m_last_Analog = (*p)->net().m_cur_Analog;
93    }
83   for (netlist_core_terminal_t * const *p = m_inps.first(); p != NULL; p = m_inps.next(p))
84   {
85      if ((*p)->net().m_last_Analog != (*p)->net().m_cur_Analog)
86      {
87         (*p)->netdev().update_dev();
88      }
89   }
90   for (netlist_core_terminal_t * const *p = m_inps.first(); p != NULL; p = m_inps.next(p))
91   {
92      (*p)->net().m_last_Analog = (*p)->net().m_cur_Analog;
93   }
9494
9595}
9696
9797
9898ATTR_HOT void netlist_matrix_solver_t::update_dynamic()
9999{
100    /* update all non-linear devices  */
101    for (netlist_core_device_t * const *p = m_dynamic.first(); p != NULL; p = m_dynamic.next(p))
102        switch ((*p)->family())
103        {
104            case netlist_device_t::DIODE:
105                static_cast<NETLIB_NAME(D) *>((*p))->update_terminals();
106                break;
107            default:
108                (*p)->update_terminals();
109                break;
110        }
100   /* update all non-linear devices  */
101   for (netlist_core_device_t * const *p = m_dynamic.first(); p != NULL; p = m_dynamic.next(p))
102      switch ((*p)->family())
103      {
104         case netlist_device_t::DIODE:
105            static_cast<NETLIB_NAME(D) *>((*p))->update_terminals();
106            break;
107         default:
108            (*p)->update_terminals();
109            break;
110      }
111111}
112112
113113ATTR_HOT void netlist_matrix_solver_t::schedule()
114114{
115    if (!solve())
116    {
117       // NL_VERBOSE_OUT(("update_inputs\n");
118        update_inputs();
119    }
120    else
121    {
122        m_owner->netlist().warning("Matrix solver reschedule .. Consider increasing RESCHED_LOOPS");
123        if (m_owner != NULL)
124            this->m_owner->schedule();
125    }
126    //solve();
127    //    update_inputs();
115   if (!solve())
116   {
117      // NL_VERBOSE_OUT(("update_inputs\n");
118      update_inputs();
119   }
120   else
121   {
122      m_owner->netlist().warning("Matrix solver reschedule .. Consider increasing RESCHED_LOOPS");
123      if (m_owner != NULL)
124         this->m_owner->schedule();
125   }
126   //solve();
127   //    update_inputs();
128128}
129129
130130ATTR_COLD void netlist_matrix_solver_t::reset()
131131{
132    m_last_step = netlist_time::zero;
132   m_last_step = netlist_time::zero;
133133}
134134
135135ATTR_HOT void netlist_matrix_solver_t::step(const netlist_time delta)
136136{
137    const double dd = delta.as_double();
138    for (int k=0; k < m_steps.count(); k++)
139        m_steps[k]->step_time(dd);
137   const double dd = delta.as_double();
138   for (int k=0; k < m_steps.count(); k++)
139      m_steps[k]->step_time(dd);
140140}
141141
142142ATTR_HOT bool netlist_matrix_solver_t::solve()
143143{
144    int  resched_cnt = 0;
144   int  resched_cnt = 0;
145145
146    netlist_time now = owner().netlist().time();
147    netlist_time delta = now - m_last_step;
146   netlist_time now = owner().netlist().time();
147   netlist_time delta = now - m_last_step;
148148
149    if (delta < netlist_time::from_nsec(1)) // always update capacitors
150        delta = netlist_time::from_nsec(1);
151    {
152        NL_VERBOSE_OUT(("Step!\n"));
153        /* update all terminals for new time step */
154        m_last_step = now;
155        step(delta);
156    }
149   if (delta < netlist_time::from_nsec(1)) // always update capacitors
150      delta = netlist_time::from_nsec(1);
151   {
152      NL_VERBOSE_OUT(("Step!\n"));
153      /* update all terminals for new time step */
154      m_last_step = now;
155      step(delta);
156   }
157157
158    if (is_dynamic())
159    {
160        int this_resched;
161        do
162        {
163            update_dynamic();
164            this_resched = solve_non_dynamic();
165            resched_cnt += this_resched;
166        } while (this_resched > 1 && resched_cnt < m_params.m_resched_loops);
167    }
168    else
169    {
170        resched_cnt = solve_non_dynamic();
171        //printf("resched_cnt %d %d\n", resched_cnt, m_resched_loops);
172    }
173    return (resched_cnt >= m_params.m_resched_loops);
158   if (is_dynamic())
159   {
160      int this_resched;
161      do
162      {
163         update_dynamic();
164         this_resched = solve_non_dynamic();
165         resched_cnt += this_resched;
166      } while (this_resched > 1 && resched_cnt < m_params.m_resched_loops);
167   }
168   else
169   {
170      resched_cnt = solve_non_dynamic();
171      //printf("resched_cnt %d %d\n", resched_cnt, m_resched_loops);
172   }
173   return (resched_cnt >= m_params.m_resched_loops);
174174}
175175
176176// ----------------------------------------------------------------------------------------
r29404r29405
181181template <int m_N, int _storage_N>
182182ATTR_COLD int netlist_matrix_solver_direct_t<m_N, _storage_N>::get_net_idx(netlist_net_t *net)
183183{
184    for (int k = 0; k < N(); k++)
185        if (m_nets[k] == net)
186            return k;
187    return -1;
184   for (int k = 0; k < N(); k++)
185      if (m_nets[k] == net)
186         return k;
187   return -1;
188188}
189189
190190template <int m_N, int _storage_N>
191191ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner)
192192{
193    netlist_matrix_solver_t::setup(nets, owner);
193   netlist_matrix_solver_t::setup(nets, owner);
194194
195    m_term_num = 0;
196    m_rail_start = 0;
197    for (int k = 0; k < N(); k++)
198    {
199        netlist_net_t *net = m_nets[k];
200        const netlist_net_t::terminal_list_t &terms = net->m_terms;
201        for (int i = 0; i < terms.count(); i++)
202        {
203            m_terms[m_term_num].net_this = k;
204            int ot = get_net_idx(&terms[i]->m_otherterm->net());
205            m_terms[m_term_num].net_other = ot;
206            m_terms[m_term_num].term = terms[i];
207            if (ot>=0)
208            {
209                m_term_num++;
210                SOLVER_VERBOSE_OUT(("Net %d Term %s %f %f\n", k, terms[i]->name().cstr(), terms[i]->m_gt, terms[i]->m_go));
211            }
212        }
213    }
214    m_rail_start = m_term_num;
215    for (int k = 0; k < N(); k++)
216    {
217        netlist_net_t *net = m_nets[k];
218        const netlist_net_t::terminal_list_t &terms = net->m_terms;
219        const netlist_net_t::terminal_list_t &rails = net->m_rails;
220        for (int i = 0; i < terms.count(); i++)
221        {
222            m_terms[m_term_num].net_this = k;
223            int ot = get_net_idx(&terms[i]->m_otherterm->net());
224            m_terms[m_term_num].net_other = ot;
225            m_terms[m_term_num].term = terms[i];
226            if (ot<0)
227            {
228                m_term_num++;
229                SOLVER_VERBOSE_OUT(("found term with missing othernet %s\n", terms[i]->name().cstr()));
230            }
231        }
232        for (int i = 0; i < rails.count(); i++)
233        {
234            m_terms[m_term_num].net_this = k;
235            m_terms[m_term_num].net_other = -1; //get_net_idx(&rails[i]->m_otherterm->net());
236            m_terms[m_term_num].term = rails[i];
237            m_term_num++;
238            SOLVER_VERBOSE_OUT(("Net %d Rail %s %f %f\n", k, rails[i]->name().cstr(), rails[i]->m_gt, rails[i]->m_go));
239        }
240    }
195   m_term_num = 0;
196   m_rail_start = 0;
197   for (int k = 0; k < N(); k++)
198   {
199      netlist_net_t *net = m_nets[k];
200      const netlist_net_t::terminal_list_t &terms = net->m_terms;
201      for (int i = 0; i < terms.count(); i++)
202      {
203         m_terms[m_term_num].net_this = k;
204         int ot = get_net_idx(&terms[i]->m_otherterm->net());
205         m_terms[m_term_num].net_other = ot;
206         m_terms[m_term_num].term = terms[i];
207         if (ot>=0)
208         {
209            m_term_num++;
210            SOLVER_VERBOSE_OUT(("Net %d Term %s %f %f\n", k, terms[i]->name().cstr(), terms[i]->m_gt, terms[i]->m_go));
211         }
212      }
213   }
214   m_rail_start = m_term_num;
215   for (int k = 0; k < N(); k++)
216   {
217      netlist_net_t *net = m_nets[k];
218      const netlist_net_t::terminal_list_t &terms = net->m_terms;
219      const netlist_net_t::terminal_list_t &rails = net->m_rails;
220      for (int i = 0; i < terms.count(); i++)
221      {
222         m_terms[m_term_num].net_this = k;
223         int ot = get_net_idx(&terms[i]->m_otherterm->net());
224         m_terms[m_term_num].net_other = ot;
225         m_terms[m_term_num].term = terms[i];
226         if (ot<0)
227         {
228            m_term_num++;
229            SOLVER_VERBOSE_OUT(("found term with missing othernet %s\n", terms[i]->name().cstr()));
230         }
231      }
232      for (int i = 0; i < rails.count(); i++)
233      {
234         m_terms[m_term_num].net_this = k;
235         m_terms[m_term_num].net_other = -1; //get_net_idx(&rails[i]->m_otherterm->net());
236         m_terms[m_term_num].term = rails[i];
237         m_term_num++;
238         SOLVER_VERBOSE_OUT(("Net %d Rail %s %f %f\n", k, rails[i]->name().cstr(), rails[i]->m_gt, rails[i]->m_go));
239      }
240   }
241241}
242242
243243template <int m_N, int _storage_N>
244244ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::build_LE(
245        double (* RESTRICT A)[_storage_N],
246        double (* RESTRICT RHS))
245      double (* RESTRICT A)[_storage_N],
246      double (* RESTRICT RHS))
247247{
248
249248#if 0
250    for (int i = 0; i < m_term_num; i++)
251    {
252        terms_t &t = m_terms[i];
253        m_RHS[t.net_this] += t.term->m_Idr;
254        m_A[t.net_this][t.net_this] += t.term->m_gt;
255        if (t.net_other >= 0)
256        {
257            //m_A[t.net_other][t.net_other] += t.term->m_otherterm->m_gt;
258            m_A[t.net_this][t.net_other] += -t.term->m_go;
259            //m_A[t.net_other][t.net_this] += -t.term->m_otherterm->m_go;
260        }
261        else
262            m_RHS[t.net_this] += t.term->m_go * t.term->m_otherterm->net().Q_Analog();
263    }
249   for (int i = 0; i < m_term_num; i++)
250   {
251      terms_t &t = m_terms[i];
252      m_RHS[t.net_this] += t.term->m_Idr;
253      m_A[t.net_this][t.net_this] += t.term->m_gt;
254      if (t.net_other >= 0)
255      {
256         //m_A[t.net_other][t.net_other] += t.term->m_otherterm->m_gt;
257         m_A[t.net_this][t.net_other] += -t.term->m_go;
258         //m_A[t.net_other][t.net_this] += -t.term->m_otherterm->m_go;
259      }
260      else
261         m_RHS[t.net_this] += t.term->m_go * t.term->m_otherterm->net().Q_Analog();
262   }
264263#else
265    for (int i = 0; i < m_rail_start; i++)
266    {
267        terms_t &t = m_terms[i];
268        //printf("A %d %d %s %f %f\n",t.net_this, t.net_other, t.term->name().cstr(), t.term->m_gt, t.term->m_go);
269        RHS[t.net_this] += t.term->m_Idr;
270        A[t.net_this][t.net_this] += t.term->m_gt;
264   for (int i = 0; i < m_rail_start; i++)
265   {
266      terms_t &t = m_terms[i];
267      //printf("A %d %d %s %f %f\n",t.net_this, t.net_other, t.term->name().cstr(), t.term->m_gt, t.term->m_go);
268      RHS[t.net_this] += t.term->m_Idr;
269      A[t.net_this][t.net_this] += t.term->m_gt;
271270
272        A[t.net_this][t.net_other] += -t.term->m_go;
273    }
274    for (int i = m_rail_start; i < m_term_num; i++)
275    {
276        terms_t &t = m_terms[i];
277        RHS[t.net_this] += t.term->m_Idr;
278        A[t.net_this][t.net_this] += t.term->m_gt;
271      A[t.net_this][t.net_other] += -t.term->m_go;
272   }
273   for (int i = m_rail_start; i < m_term_num; i++)
274   {
275      terms_t &t = m_terms[i];
276      RHS[t.net_this] += t.term->m_Idr;
277      A[t.net_this][t.net_this] += t.term->m_gt;
279278
280        RHS[t.net_this] += t.term->m_go * t.term->m_otherterm->net().Q_Analog();
281    }
279      RHS[t.net_this] += t.term->m_go * t.term->m_otherterm->net().Q_Analog();
280   }
282281#endif
283282}
284283
285284template <int m_N, int _storage_N>
286285ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::gauss_LE(
287        double (* RESTRICT A)[_storage_N],
288        double (* RESTRICT RHS),
289        double (* RESTRICT x))
286      double (* RESTRICT A)[_storage_N],
287      double (* RESTRICT RHS),
288      double (* RESTRICT x))
290289{
291290#if 0
292    for (int i = 0; i < N(); i++)
293    {
294        for (int k = 0; k < N(); k++)
295            printf("%f ", A[i][k]);
296        printf("| %f = %f \n", x[i], RHS[i]);
297    }
298    printf("\n");
291   for (int i = 0; i < N(); i++)
292   {
293      for (int k = 0; k < N(); k++)
294         printf("%f ", A[i][k]);
295      printf("| %f = %f \n", x[i], RHS[i]);
296   }
297   printf("\n");
299298#endif
300299
301    for (int i = 0; i < N(); i++) {
302
300   for (int i = 0; i < N(); i++) {
303301#if 0
304       /* Find the row with the largest first value */
305       maxrow = i;
306       for (j=i+1;j<n;j++) {
307          if (ABS(a[i][j]) > ABS(a[i][maxrow]))
308             maxrow = j;
309       }
302      /* Find the row with the largest first value */
303      maxrow = i;
304      for (j=i+1;j<n;j++) {
305         if (ABS(a[i][j]) > ABS(a[i][maxrow]))
306            maxrow = j;
307      }
310308
311       /* Swap the maxrow and ith row */
312       for (k=i;k<n+1;k++) {
313          tmp = a[k][i];
314          a[k][i] = a[k][maxrow];
315          a[k][maxrow] = tmp;
316       }
309      /* Swap the maxrow and ith row */
310      for (k=i;k<n+1;k++) {
311         tmp = a[k][i];
312         a[k][i] = a[k][maxrow];
313         a[k][maxrow] = tmp;
314      }
317315#endif
318       /* Singular matrix? */
319       double f = A[i][i];
320       //if (fabs(f) < 1e-20) printf("Singular!");
321       f = 1.0 / f;
316      /* Singular matrix? */
317      double f = A[i][i];
318      //if (fabs(f) < 1e-20) printf("Singular!");
319      f = 1.0 / f;
322320
323       /* Eliminate column i from row j */
324       for (int j = i + 1; j < N(); j++)
325       {
326           double f1 = A[j][i] * f;
321      /* Eliminate column i from row j */
322      for (int j = i + 1; j < N(); j++)
323      {
324         double f1 = A[j][i] * f;
327325
328           if (f1 != 0.0)
329           {
330               for (int k = i; k < N(); k++)
331               {
332                   A[j][k] -= A[i][k] * f1;
333               }
334               RHS[j] -= RHS[i] * f1;
335           }
336       }
337    }
338    /* back substitution */
339    for (int j = N() - 1; j >= 0; j--)
340    {
341        double tmp = 0;
342        for (int k = j + 1; k < N(); k++)
343            tmp += A[j][k] * x[k];
344        x[j] = (RHS[j] - tmp) / A[j][j];
345    }
326         if (f1 != 0.0)
327         {
328            for (int k = i; k < N(); k++)
329            {
330               A[j][k] -= A[i][k] * f1;
331            }
332            RHS[j] -= RHS[i] * f1;
333         }
334      }
335   }
336   /* back substitution */
337   for (int j = N() - 1; j >= 0; j--)
338   {
339      double tmp = 0;
340      for (int k = j + 1; k < N(); k++)
341         tmp += A[j][k] * x[k];
342      x[j] = (RHS[j] - tmp) / A[j][j];
343   }
346344#if 0
347    printf("Solution:\n");
348    for (int i = 0; i < N(); i++)
349    {
350        for (int k = 0; k < N(); k++)
351            printf("%f ", A[i][k]);
352        printf("| %f = %f \n", x[i], RHS[i]);
353    }
354    printf("\n");
345   printf("Solution:\n");
346   for (int i = 0; i < N(); i++)
347   {
348      for (int k = 0; k < N(); k++)
349         printf("%f ", A[i][k]);
350      printf("| %f = %f \n", x[i], RHS[i]);
351   }
352   printf("\n");
355353#endif
356354
357355}
358356
359357template <int m_N, int _storage_N>
360358ATTR_HOT double netlist_matrix_solver_direct_t<m_N, _storage_N>::delta(
361        const double (* RESTRICT RHS),
362        const double (* RESTRICT V))
359      const double (* RESTRICT RHS),
360      const double (* RESTRICT V))
363361{
364    double cerr = 0;
365    double cerr2 = 0;
366    for (int i = 0; i < this->N(); i++)
367    {
368        double e = (V[i] - this->m_nets[i]->m_cur_Analog);
369        double e2 = (RHS[i] - this->m_RHS[i]);
370        cerr += e * e;
371        cerr2 += e2 * e2;
372    }
373    return (cerr + cerr2*(100000.0 * 100000.0)) / this->N();
362   double cerr = 0;
363   double cerr2 = 0;
364   for (int i = 0; i < this->N(); i++)
365   {
366      double e = (V[i] - this->m_nets[i]->m_cur_Analog);
367      double e2 = (RHS[i] - this->m_RHS[i]);
368      cerr += e * e;
369      cerr2 += e2 * e2;
370   }
371   return (cerr + cerr2*(100000.0 * 100000.0)) / this->N();
374372}
375373
376374template <int m_N, int _storage_N>
377375ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::store(
378        const double (* RESTRICT RHS),
379        const double (* RESTRICT V))
376      const double (* RESTRICT RHS),
377      const double (* RESTRICT V))
380378{
381    for (int i = 0; i < this->N(); i++)
382    {
383        this->m_nets[i]->m_cur_Analog = this->m_nets[i]->m_new_Analog = V[i];
384    }
385    if (RHS != NULL)
386    {
387        for (int i = 0; i < this->N(); i++)
388        {
389            this->m_RHS[i] = RHS[i];
390        }
391    }
379   for (int i = 0; i < this->N(); i++)
380   {
381      this->m_nets[i]->m_cur_Analog = this->m_nets[i]->m_new_Analog = V[i];
382   }
383   if (RHS != NULL)
384   {
385      for (int i = 0; i < this->N(); i++)
386      {
387         this->m_RHS[i] = RHS[i];
388      }
389   }
392390}
393391
394392template <int m_N, int _storage_N>
395393ATTR_HOT int netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic()
396394{
397    double A[_storage_N][_storage_N] = { { 0.0 } };
398    double RHS[_storage_N] = { 0.0 };
399    double new_v[_storage_N] = { 0.0 };
395   double A[_storage_N][_storage_N] = { { 0.0 } };
396   double RHS[_storage_N] = { 0.0 };
397   double new_v[_storage_N] = { 0.0 };
400398
401    this->build_LE(A, RHS);
399   this->build_LE(A, RHS);
402400
403    this->gauss_LE(A, RHS, new_v);
401   this->gauss_LE(A, RHS, new_v);
404402
405    if (this->is_dynamic())
406    {
407        double err = delta(RHS, new_v);
403   if (this->is_dynamic())
404   {
405      double err = delta(RHS, new_v);
408406
409        store(RHS, new_v);
407      store(RHS, new_v);
410408
411        if (err > this->m_params.m_accuracy * this->m_params.m_accuracy)
412        {
413            return 2;
414        }
415        return 1;
416    }
417    store(NULL, new_v);  // ==> No need to store RHS
418    return 1;
409      if (err > this->m_params.m_accuracy * this->m_params.m_accuracy)
410      {
411         return 2;
412      }
413      return 1;
414   }
415   store(NULL, new_v);  // ==> No need to store RHS
416   return 1;
419417}
420418
421419
r29404r29405
427425{
428426#if 1
429427
430    double gtot_t = 0.0;
431    double RHS_t = 0.0;
428   double gtot_t = 0.0;
429   double RHS_t = 0.0;
432430
433    netlist_net_t *net = m_nets[0];
434    const netlist_net_t::terminal_list_t &rails = net->m_rails;
435    int rail_count = rails.count();
431   netlist_net_t *net = m_nets[0];
432   const netlist_net_t::terminal_list_t &rails = net->m_rails;
433   int rail_count = rails.count();
436434
437    for (int i = 0; i < rail_count; i++)
438    {
439        gtot_t += rails[i]->m_gt;
440        RHS_t += rails[i]->m_Idr;
441        RHS_t += rails[i]->m_go * rails[i]->m_otherterm->net().Q_Analog();
442    }
435   for (int i = 0; i < rail_count; i++)
436   {
437      gtot_t += rails[i]->m_gt;
438      RHS_t += rails[i]->m_Idr;
439      RHS_t += rails[i]->m_go * rails[i]->m_otherterm->net().Q_Analog();
440   }
443441
444    double iIdr = RHS_t;
445    double new_val = iIdr / gtot_t;
442   double iIdr = RHS_t;
443   double new_val = iIdr / gtot_t;
446444
447445#else
448    netlist_net_t *net = m_nets[0];
449    double m_A[1][1] = { {0.0} };
450    double m_RHS[1] = { 0.0 };
451    build_LE(m_A, m_RHS);
452    //NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]);
446   netlist_net_t *net = m_nets[0];
447   double m_A[1][1] = { {0.0} };
448   double m_RHS[1] = { 0.0 };
449   build_LE(m_A, m_RHS);
450   //NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]);
453451
454    double new_val =  m_RHS[0] / m_A[0][0];
452   double new_val =  m_RHS[0] / m_A[0][0];
455453#endif
456    double e = (new_val - net->m_cur_Analog);
457    double cerr = e * e;
454   double e = (new_val - net->m_cur_Analog);
455   double cerr = e * e;
458456
459    net->m_cur_Analog = net->m_new_Analog = new_val;
457   net->m_cur_Analog = net->m_new_Analog = new_val;
460458
461    if (is_dynamic() && (cerr  > m_params.m_accuracy * m_params.m_accuracy))
462    {
463        return 2;
464    }
465    else
466        return 1;
459   if (is_dynamic() && (cerr  > m_params.m_accuracy * m_params.m_accuracy))
460   {
461      return 2;
462   }
463   else
464      return 1;
467465
468466}
469467
r29404r29405
475473
476474ATTR_HOT int netlist_matrix_solver_direct2_t::solve_non_dynamic()
477475{
478    double A[2][2] = { { 0.0 } };
479    double RHS[2] = { 0.0 };
476   double A[2][2] = { { 0.0 } };
477   double RHS[2] = { 0.0 };
480478
481    build_LE(A, RHS);
479   build_LE(A, RHS);
482480
483    //NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]);
481   //NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]);
484482
485    const double a = A[0][0];
486    const double b = A[0][1];
487    const double c = A[1][0];
488    const double d = A[1][1];
483   const double a = A[0][0];
484   const double b = A[0][1];
485   const double c = A[1][0];
486   const double d = A[1][1];
489487
490    double new_val[2];
491    new_val[1] = a / (a*d - b*c) * (RHS[1] - c / a * RHS[0]);
492    new_val[0] = (RHS[0] - b * new_val[1]) / a;
488   double new_val[2];
489   new_val[1] = a / (a*d - b*c) * (RHS[1] - c / a * RHS[0]);
490   new_val[0] = (RHS[0] - b * new_val[1]) / a;
493491
494    if (is_dynamic())
495    {
496        double err = delta(RHS, new_val);
497        store(RHS, new_val);
498        if (err > m_params.m_accuracy * m_params.m_accuracy)
499            return 2;
500        else
501            return 1;
502    }
503    store(NULL, new_val);
504    return 1;
492   if (is_dynamic())
493   {
494      double err = delta(RHS, new_val);
495      store(RHS, new_val);
496      if (err > m_params.m_accuracy * m_params.m_accuracy)
497         return 2;
498      else
499         return 1;
500   }
501   store(NULL, new_val);
502   return 1;
505503}
506504
507505// ----------------------------------------------------------------------------------------
r29404r29405
511509template <int m_N, int _storage_N>
512510ATTR_HOT int netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::solve_non_dynamic()
513511{
514    bool resched = false;
512   bool resched = false;
515513
516    int  resched_cnt = 0;
517    ATTR_UNUSED netlist_net_t *last_resched_net = NULL;
514   int  resched_cnt = 0;
515   ATTR_UNUSED netlist_net_t *last_resched_net = NULL;
518516
519    /* over-relaxation not really works on these matrices */
520    //const double w = 1.0; //2.0 / (1.0 + sin(3.14159 / (m_nets.count()+1)));
521    //const double w1 = 1.0 - w;
517   /* over-relaxation not really works on these matrices */
518   //const double w = 1.0; //2.0 / (1.0 + sin(3.14159 / (m_nets.count()+1)));
519   //const double w1 = 1.0 - w;
522520
523    double w[_storage_N];
524    double one_m_w[_storage_N];
525    double RHS[_storage_N];
521   double w[_storage_N];
522   double one_m_w[_storage_N];
523   double RHS[_storage_N];
526524
527    for (int k = 0; k < N(); k++)
528    {
529        double gtot_t = 0.0;
530        double gabs_t = 0.0;
531        double RHS_t = 0.0;
525   for (int k = 0; k < N(); k++)
526   {
527      double gtot_t = 0.0;
528      double gabs_t = 0.0;
529      double RHS_t = 0.0;
532530
533        netlist_net_t *net = m_nets[k];
534        const netlist_net_t::terminal_list_t &terms = net->m_terms;
535        const netlist_net_t::terminal_list_t &rails = net->m_rails;
536        const int term_count = terms.count();
537        const int rail_count = rails.count();
531      netlist_net_t *net = m_nets[k];
532      const netlist_net_t::terminal_list_t &terms = net->m_terms;
533      const netlist_net_t::terminal_list_t &rails = net->m_rails;
534      const int term_count = terms.count();
535      const int rail_count = rails.count();
538536
539        for (int i = 0; i < rail_count; i++)
540        {
541            gtot_t += rails[i]->m_gt;
542            gabs_t += fabs(rails[i]->m_go);
543            RHS_t += rails[i]->m_Idr;
544            RHS_t += rails[i]->m_go * rails[i]->m_otherterm->net().Q_Analog();
545        }
537      for (int i = 0; i < rail_count; i++)
538      {
539         gtot_t += rails[i]->m_gt;
540         gabs_t += fabs(rails[i]->m_go);
541         RHS_t += rails[i]->m_Idr;
542         RHS_t += rails[i]->m_go * rails[i]->m_otherterm->net().Q_Analog();
543      }
546544
547        for (int i = 0; i < term_count; i++)
548        {
549            gtot_t += terms[i]->m_gt;
550            gabs_t += fabs(terms[i]->m_go);
551            RHS_t += terms[i]->m_Idr;
552        }
545      for (int i = 0; i < term_count; i++)
546      {
547         gtot_t += terms[i]->m_gt;
548         gabs_t += fabs(terms[i]->m_go);
549         RHS_t += terms[i]->m_Idr;
550      }
553551
554        gabs_t *= m_params.m_convergence_factor;
555        if (gabs_t > gtot_t)
556        {
557            // Actually 1.0 / g_tot  * g_tot / (gtot_t + gabs_t)
558            w[k] = 1.0 / (gtot_t + gabs_t);
559            one_m_w[k] = gabs_t / (gtot_t + gabs_t);
560        }
561        else
562        {
563            w[k] = 1.0 / gtot_t;
564            one_m_w[k] = 0.0;
565        }
552      gabs_t *= m_params.m_convergence_factor;
553      if (gabs_t > gtot_t)
554      {
555         // Actually 1.0 / g_tot  * g_tot / (gtot_t + gabs_t)
556         w[k] = 1.0 / (gtot_t + gabs_t);
557         one_m_w[k] = gabs_t / (gtot_t + gabs_t);
558      }
559      else
560      {
561         w[k] = 1.0 / gtot_t;
562         one_m_w[k] = 0.0;
563      }
566564
567        RHS[k] = RHS_t;
568    }
565      RHS[k] = RHS_t;
566   }
569567
570    //NL_VERBOSE_OUT(("%f %d\n", w, m_nets.count());
571    do {
572        resched = false;
573        double cerr = 0.0;
568   //NL_VERBOSE_OUT(("%f %d\n", w, m_nets.count());
569   do {
570      resched = false;
571      double cerr = 0.0;
574572
575        for (int k = 0; k < N(); k++)
576        {
577            netlist_net_t *net = m_nets[k];
578            const netlist_net_t::terminal_list_t &terms = net->m_terms;
579            const int term_count = terms.count();
573      for (int k = 0; k < N(); k++)
574      {
575         netlist_net_t *net = m_nets[k];
576         const netlist_net_t::terminal_list_t &terms = net->m_terms;
577         const int term_count = terms.count();
580578
581            double iIdr = RHS[k];
579         double iIdr = RHS[k];
582580
583            for (int i = 0; i < term_count; i++)
584            {
585                iIdr += terms[i]->m_go * terms[i]->m_otherterm->net().Q_Analog();
586            }
581         for (int i = 0; i < term_count; i++)
582         {
583            iIdr += terms[i]->m_go * terms[i]->m_otherterm->net().Q_Analog();
584         }
587585
588            //double new_val = (net->m_cur_Analog * gabs[k] + iIdr) / (gtot[k]);
589            double new_val = net->m_cur_Analog * one_m_w[k] + iIdr * w[k];
586         //double new_val = (net->m_cur_Analog * gabs[k] + iIdr) / (gtot[k]);
587         double new_val = net->m_cur_Analog * one_m_w[k] + iIdr * w[k];
590588
591            double e = (new_val - net->m_cur_Analog);
592            cerr += e * e;
589         double e = (new_val - net->m_cur_Analog);
590         cerr += e * e;
593591
594            net->m_cur_Analog = net->m_new_Analog = new_val;
595        }
596        if (resched || cerr / m_nets.count() > m_params.m_accuracy * m_params.m_accuracy)
597        {
598            resched = true;
599            //last_resched_net = net;
600        }
601        resched_cnt++;
602    } while (resched && (resched_cnt < m_params.m_resched_loops / 3 ));
592         net->m_cur_Analog = net->m_new_Analog = new_val;
593      }
594      if (resched || cerr / m_nets.count() > m_params.m_accuracy * m_params.m_accuracy)
595      {
596         resched = true;
597         //last_resched_net = net;
598      }
599      resched_cnt++;
600   } while (resched && (resched_cnt < m_params.m_resched_loops / 3 ));
603601
604    if (resched)
605        return m_fallback.solve_non_dynamic();
602   if (resched)
603      return m_fallback.solve_non_dynamic();
606604
607    return resched_cnt;
605   return resched_cnt;
608606}
609607
610608// ----------------------------------------------------------------------------------------
r29404r29405
615613
616614ATTR_COLD static bool already_processed(net_groups_t groups, int &cur_group, netlist_net_t *net)
617615{
618    if (net->isRailNet())
619        return true;
620    for (int i = 0; i <= cur_group; i++)
621    {
622        if (groups[i].contains(net))
623            return true;
624    }
625    return false;
616   if (net->isRailNet())
617      return true;
618   for (int i = 0; i <= cur_group; i++)
619   {
620      if (groups[i].contains(net))
621         return true;
622   }
623   return false;
626624}
627625
628626ATTR_COLD static void process_net(net_groups_t groups, int &cur_group, netlist_net_t *net)
629627{
630    if (net->m_list.is_empty())
631        return;
632    /* add the net */
633    SOLVER_VERBOSE_OUT(("add %d - %s\n", cur_group, net->name().cstr()));
634    groups[cur_group].add(net);
635    for (netlist_core_terminal_t *p = net->m_list.first(); p != NULL; p = net->m_list.next(p))
636    {
637        SOLVER_VERBOSE_OUT(("terminal %s\n", p->name().cstr()));
638        if (p->isType(netlist_terminal_t::TERMINAL))
639        {
640            SOLVER_VERBOSE_OUT(("isterminal\n"));
641            netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
642            netlist_net_t *other_net = &pt->m_otherterm->net();
643            if (!already_processed(groups, cur_group, other_net))
644                process_net(groups, cur_group, other_net);
645        }
646    }
628   if (net->m_list.is_empty())
629      return;
630   /* add the net */
631   SOLVER_VERBOSE_OUT(("add %d - %s\n", cur_group, net->name().cstr()));
632   groups[cur_group].add(net);
633   for (netlist_core_terminal_t *p = net->m_list.first(); p != NULL; p = net->m_list.next(p))
634   {
635      SOLVER_VERBOSE_OUT(("terminal %s\n", p->name().cstr()));
636      if (p->isType(netlist_terminal_t::TERMINAL))
637      {
638         SOLVER_VERBOSE_OUT(("isterminal\n"));
639         netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
640         netlist_net_t *other_net = &pt->m_otherterm->net();
641         if (!already_processed(groups, cur_group, other_net))
642            process_net(groups, cur_group, other_net);
643      }
644   }
647645}
648646
649647
650648NETLIB_START(solver)
651649{
652    register_output("Q_sync", m_Q_sync);
653    register_output("Q_step", m_Q_step);
654    //register_input("FB", m_feedback);
650   register_output("Q_sync", m_Q_sync);
651   register_output("Q_step", m_Q_step);
652   //register_input("FB", m_feedback);
655653
656    register_param("SYNC_DELAY", m_sync_delay, NLTIME_FROM_NS(5).as_double());
657    m_nt_sync_delay = m_sync_delay.Value();
654   register_param("SYNC_DELAY", m_sync_delay, NLTIME_FROM_NS(5).as_double());
655   m_nt_sync_delay = m_sync_delay.Value();
658656
659    register_param("FREQ", m_freq, 48000.0);
660    m_inc = netlist_time::from_hz(m_freq.Value());
657   register_param("FREQ", m_freq, 48000.0);
658   m_inc = netlist_time::from_hz(m_freq.Value());
661659
662    register_param("ACCURACY", m_accuracy, 1e-7);
663    register_param("CONVERG", m_convergence, 0.3);
664    register_param("RESCHED_LOOPS", m_resched_loops, 35);
665    register_param("PARALLEL", m_parallel, 0);
666    register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT);
660   register_param("ACCURACY", m_accuracy, 1e-7);
661   register_param("CONVERG", m_convergence, 0.3);
662   register_param("RESCHED_LOOPS", m_resched_loops, 35);
663   register_param("PARALLEL", m_parallel, 0);
664   register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT);
667665
668    // internal staff
666   // internal staff
669667
670    register_input("FB_sync", m_fb_sync);
671    register_input("FB_step", m_fb_step);
668   register_input("FB_sync", m_fb_sync);
669   register_input("FB_step", m_fb_step);
672670
673    connect(m_fb_sync, m_Q_sync);
674    connect(m_fb_step, m_Q_step);
671   connect(m_fb_sync, m_Q_sync);
672   connect(m_fb_step, m_Q_step);
675673
676    save(NAME(m_last_step));
674   save(NAME(m_last_step));
677675
678676}
679677
680678NETLIB_RESET(solver)
681679{
682    m_last_step = netlist_time::zero;
683    for (int i = 0; i < m_mat_solvers.count(); i++)
684        m_mat_solvers[i]->reset();
680   m_last_step = netlist_time::zero;
681   for (int i = 0; i < m_mat_solvers.count(); i++)
682      m_mat_solvers[i]->reset();
685683}
686684
687685
688686NETLIB_UPDATE_PARAM(solver)
689687{
690    m_inc = netlist_time::from_hz(m_freq.Value());
688   m_inc = netlist_time::from_hz(m_freq.Value());
691689}
692690
693691NETLIB_NAME(solver)::~NETLIB_NAME(solver)()
694692{
695    netlist_matrix_solver_t * const *e = m_mat_solvers.first();
696    while (e != NULL)
697    {
698        netlist_matrix_solver_t * const *en = m_mat_solvers.next(e);
699        delete *e;
700        e = en;
701    }
693   netlist_matrix_solver_t * const *e = m_mat_solvers.first();
694   while (e != NULL)
695   {
696      netlist_matrix_solver_t * const *en = m_mat_solvers.next(e);
697      delete *e;
698      e = en;
699   }
702700
703701}
704702
705703NETLIB_UPDATE(solver)
706704{
707    netlist_time now = netlist().time();
708    netlist_time delta = now - m_last_step;
709    bool do_full = false;
710    bool global_resched = false;
711    bool this_resched[100];
712    int t_cnt = m_mat_solvers.count();
705   netlist_time now = netlist().time();
706   netlist_time delta = now - m_last_step;
707   bool do_full = false;
708   bool global_resched = false;
709   bool this_resched[100];
710   int t_cnt = m_mat_solvers.count();
713711
714    if (delta < m_inc)
715        do_full = true; // we have been called between updates
712   if (delta < m_inc)
713      do_full = true; // we have been called between updates
716714
717    m_last_step = now;
715   m_last_step = now;
718716
719717#if HAS_OPENMP && USE_OPENMP
720    if (m_parallel.Value())
721    {
722        omp_set_num_threads(4);
723        omp_set_dynamic(0);
724        #pragma omp parallel
725        {
726            #pragma omp for nowait
727            for (int i = 0; i <  t_cnt; i++)
728            {
729                this_resched[i] = m_mat_solvers[i]->solve();
730            }
731        }
732    }
733    else
734        for (int i = 0; i < t_cnt; i++)
735        {
736            if (do_full || (m_mat_solvers[i]->is_timestep()))
737                this_resched[i] = m_mat_solvers[i]->solve();
738        }
718   if (m_parallel.Value())
719   {
720      omp_set_num_threads(4);
721      omp_set_dynamic(0);
722      #pragma omp parallel
723      {
724         #pragma omp for nowait
725         for (int i = 0; i <  t_cnt; i++)
726         {
727            this_resched[i] = m_mat_solvers[i]->solve();
728         }
729      }
730   }
731   else
732      for (int i = 0; i < t_cnt; i++)
733      {
734         if (do_full || (m_mat_solvers[i]->is_timestep()))
735            this_resched[i] = m_mat_solvers[i]->solve();
736      }
739737#else
740    for (int i = 0; i < t_cnt; i++)
741    {
742        if (do_full || (m_mat_solvers[i]->is_timestep()))
743            this_resched[i] = m_mat_solvers[i]->solve();
744    }
738   for (int i = 0; i < t_cnt; i++)
739   {
740      if (do_full || (m_mat_solvers[i]->is_timestep()))
741         this_resched[i] = m_mat_solvers[i]->solve();
742   }
745743#endif
746744
747    for (int i = 0; i < t_cnt; i++)
748    {
749        if (do_full || m_mat_solvers[i]->is_timestep())
750        {
751            global_resched = global_resched || this_resched[i];
752            if (!this_resched[i])
753                m_mat_solvers[i]->update_inputs();
754        }
755    }
745   for (int i = 0; i < t_cnt; i++)
746   {
747      if (do_full || m_mat_solvers[i]->is_timestep())
748      {
749         global_resched = global_resched || this_resched[i];
750         if (!this_resched[i])
751            m_mat_solvers[i]->update_inputs();
752      }
753   }
756754
757    if (global_resched)
758    {
759        netlist().warning("Gobal reschedule .. Consider increasing RESCHED_LOOPS");
760        schedule();
761    }
762    else
763    {
764        /* step circuit */
765        if (!m_Q_step.net().is_queued())
766            m_Q_step.net().push_to_queue(m_inc);
767    }
755   if (global_resched)
756   {
757      netlist().warning("Gobal reschedule .. Consider increasing RESCHED_LOOPS");
758      schedule();
759   }
760   else
761   {
762      /* step circuit */
763      if (!m_Q_step.net().is_queued())
764         m_Q_step.net().push_to_queue(m_inc);
765   }
768766
769767}
770768
771769ATTR_COLD void NETLIB_NAME(solver)::post_start()
772770{
773    netlist_net_t::list_t groups[100];
774    int cur_group = -1;
771   netlist_net_t::list_t groups[100];
772   int cur_group = -1;
775773
776    SOLVER_VERBOSE_OUT(("Scanning net groups ...\n"));
777    // determine net groups
778    for (netlist_net_t * const *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
779    {
780        NL_VERBOSE_OUT(("proc %s\n", (*pn)->name().cstr()));
781        if (!already_processed(groups, cur_group, *pn))
782        {
783            cur_group++;
784            process_net(groups, cur_group, *pn);
785        }
786    }
774   SOLVER_VERBOSE_OUT(("Scanning net groups ...\n"));
775   // determine net groups
776   for (netlist_net_t * const *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
777   {
778      NL_VERBOSE_OUT(("proc %s\n", (*pn)->name().cstr()));
779      if (!already_processed(groups, cur_group, *pn))
780      {
781         cur_group++;
782         process_net(groups, cur_group, *pn);
783      }
784   }
787785
788    // setup the solvers
789    SOLVER_VERBOSE_OUT(("Found %d net groups in %d nets\n", cur_group + 1, netlist().m_nets.count()));
790    for (int i = 0; i <= cur_group; i++)
791    {
792        netlist_matrix_solver_t *ms;
793        int net_count = groups[i].count();
786   // setup the solvers
787   SOLVER_VERBOSE_OUT(("Found %d net groups in %d nets\n", cur_group + 1, netlist().m_nets.count()));
788   for (int i = 0; i <= cur_group; i++)
789   {
790      netlist_matrix_solver_t *ms;
791      int net_count = groups[i].count();
794792
795        switch (net_count)
796        {
797            case 1:
798                ms = new netlist_matrix_solver_direct1_t();
799                break;
800            case 2:
801                ms = new netlist_matrix_solver_direct2_t();
802                break;
803            case 3:
804                ms = new netlist_matrix_solver_direct_t<3,3>();
805                //ms = new netlist_matrix_solver_gauss_seidel_t<3,3>();
806                break;
807            case 4:
808                ms = new netlist_matrix_solver_direct_t<4,4>();
809                //ms = new netlist_matrix_solver_gauss_seidel_t<4,4>();
810                break;
793      switch (net_count)
794      {
795         case 1:
796            ms = new netlist_matrix_solver_direct1_t();
797            break;
798         case 2:
799            ms = new netlist_matrix_solver_direct2_t();
800            break;
801         case 3:
802            ms = new netlist_matrix_solver_direct_t<3,3>();
803            //ms = new netlist_matrix_solver_gauss_seidel_t<3,3>();
804            break;
805         case 4:
806            ms = new netlist_matrix_solver_direct_t<4,4>();
807            //ms = new netlist_matrix_solver_gauss_seidel_t<4,4>();
808            break;
811809#if 0
812            case 5:
813                //ms = new netlist_matrix_solver_direct_t<5,5>();
814                ms = new netlist_matrix_solver_gauss_seidel_t<5,5>();
815                break;
816            case 6:
817                //ms = new netlist_matrix_solver_direct_t<6,6>();
818                ms = new netlist_matrix_solver_gauss_seidel_t<6,6>();
819                break;
810         case 5:
811            //ms = new netlist_matrix_solver_direct_t<5,5>();
812            ms = new netlist_matrix_solver_gauss_seidel_t<5,5>();
813            break;
814         case 6:
815            //ms = new netlist_matrix_solver_direct_t<6,6>();
816            ms = new netlist_matrix_solver_gauss_seidel_t<6,6>();
817            break;
820818#endif
821            default:
822                if (net_count <= 16)
823                {
824                    //ms = new netlist_matrix_solver_direct_t<0,16>();
825                    ms = new netlist_matrix_solver_gauss_seidel_t<0,16>();
826                }
827                else if (net_count <= 32)
828                {
829                    //ms = new netlist_matrix_solver_direct_t<0,16>();
830                    ms = new netlist_matrix_solver_gauss_seidel_t<0,32>();
831                }
832                else if (net_count <= 64)
833                {
834                    //ms = new netlist_matrix_solver_direct_t<0,16>();
835                    ms = new netlist_matrix_solver_gauss_seidel_t<0,64>();
836                }
837                else
838                {
839                    netlist().error("Encountered netgroup with > 64 nets");
840                    ms = NULL; /* tease compilers */
841                }
819         default:
820            if (net_count <= 16)
821            {
822               //ms = new netlist_matrix_solver_direct_t<0,16>();
823               ms = new netlist_matrix_solver_gauss_seidel_t<0,16>();
824            }
825            else if (net_count <= 32)
826            {
827               //ms = new netlist_matrix_solver_direct_t<0,16>();
828               ms = new netlist_matrix_solver_gauss_seidel_t<0,32>();
829            }
830            else if (net_count <= 64)
831            {
832               //ms = new netlist_matrix_solver_direct_t<0,16>();
833               ms = new netlist_matrix_solver_gauss_seidel_t<0,64>();
834            }
835            else
836            {
837               netlist().error("Encountered netgroup with > 64 nets");
838               ms = NULL; /* tease compilers */
839            }
842840
843                break;
844        }
841            break;
842      }
845843
846        ms->m_params.m_accuracy = m_accuracy.Value();
847        ms->m_params.m_convergence_factor = m_convergence.Value();
848        ms->m_params.m_resched_loops = m_resched_loops.Value();
849        ms->setup(groups[i], *this);
850        m_mat_solvers.add(ms);
851        SOLVER_VERBOSE_OUT(("%d ==> %d nets %s\n", i, groups[i].count(), (*groups[i].first())->m_head->name().cstr()));
852        SOLVER_VERBOSE_OUT(("       has %s elements\n", ms->is_dynamic() ? "dynamic" : "no dynamic"));
853        SOLVER_VERBOSE_OUT(("       has %s elements\n", ms->is_timestep() ? "timestep" : "no timestep"));
854        for (int j=0; j<groups[i].count(); j++)
855        {
856            SOLVER_VERBOSE_OUT(("Net %d: %s\n", j, groups[i][j]->name().cstr()));
857            netlist_net_t *n = groups[i][j];
858            for (netlist_core_terminal_t *p = n->m_list.first(); p != NULL; p = n->m_list.next(p))
859            {
860                SOLVER_VERBOSE_OUT(("   %s\n", p->name().cstr()));
861            }
862        }
863    }
844      ms->m_params.m_accuracy = m_accuracy.Value();
845      ms->m_params.m_convergence_factor = m_convergence.Value();
846      ms->m_params.m_resched_loops = m_resched_loops.Value();
847      ms->setup(groups[i], *this);
848      m_mat_solvers.add(ms);
849      SOLVER_VERBOSE_OUT(("%d ==> %d nets %s\n", i, groups[i].count(), (*groups[i].first())->m_head->name().cstr()));
850      SOLVER_VERBOSE_OUT(("       has %s elements\n", ms->is_dynamic() ? "dynamic" : "no dynamic"));
851      SOLVER_VERBOSE_OUT(("       has %s elements\n", ms->is_timestep() ? "timestep" : "no timestep"));
852      for (int j=0; j<groups[i].count(); j++)
853      {
854         SOLVER_VERBOSE_OUT(("Net %d: %s\n", j, groups[i][j]->name().cstr()));
855         netlist_net_t *n = groups[i][j];
856         for (netlist_core_terminal_t *p = n->m_list.first(); p != NULL; p = n->m_list.next(p))
857         {
858            SOLVER_VERBOSE_OUT(("   %s\n", p->name().cstr()));
859         }
860      }
861   }
864862
865863}
trunk/src/emu/netlist/analog/nld_switches.h
r29404r29405
2525// ----------------------------------------------------------------------------------------
2626
2727NETLIB_DEVICE_WITH_PARAMS(switch2,
28    NETLIB_NAME(R_base) m_R[2];
28   NETLIB_NAME(R_base) m_R[2];
2929
3030   netlist_param_int_t m_POS;
3131);
trunk/src/emu/netlist/analog/nld_bjt.c
r29404r29405
1010class diode
1111{
1212public:
13    diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {}
14    diode(const double Is, const double n)
15    {
16        m_Is = Is;
17        m_VT = 0.0258 * n;
18        m_VT_inv = 1.0 / m_VT;
19    }
20    void set(const double Is, const double n)
21    {
22        m_Is = Is;
23        m_VT = 0.0258 * n;
24        m_VT_inv = 1.0 / m_VT;
25    }
26    double I(const double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; }
27    double g(const double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); }
28    double V(const double I) const { return log(1.0 + I / m_Is) * m_VT; }
29    double gI(const double I) const { return m_VT_inv * (I + m_Is); }
13   diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {}
14   diode(const double Is, const double n)
15   {
16      m_Is = Is;
17      m_VT = 0.0258 * n;
18      m_VT_inv = 1.0 / m_VT;
19   }
20   void set(const double Is, const double n)
21   {
22      m_Is = Is;
23      m_VT = 0.0258 * n;
24      m_VT_inv = 1.0 / m_VT;
25   }
26   double I(const double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; }
27   double g(const double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); }
28   double V(const double I) const { return log(1.0 + I / m_Is) * m_VT; }
29   double gI(const double I) const { return m_VT_inv * (I + m_Is); }
3030
3131private:
32    double m_Is;
33    double m_VT;
34    double m_VT_inv;
32   double m_Is;
33   double m_VT;
34   double m_VT_inv;
3535};
3636
3737
r29404r29405
4242
4343NETLIB_START(Q)
4444{
45    register_param("model", m_model, "");
45   register_param("model", m_model, "");
4646}
4747
4848NETLIB_RESET(Q)
r29404r29405
6060
6161NETLIB_START(QBJT_switch)
6262{
63    NETLIB_NAME(Q)::start();
63   NETLIB_NAME(Q)::start();
6464
65    register_terminal("B", m_RB.m_P);
66    register_terminal("E", m_RB.m_N);
67    register_terminal("C", m_RC.m_P);
68    register_terminal("_E1", m_RC.m_N);
65   register_terminal("B", m_RB.m_P);
66   register_terminal("E", m_RB.m_N);
67   register_terminal("C", m_RC.m_P);
68   register_terminal("_E1", m_RC.m_N);
6969
70    register_terminal("_B1", m_BC_dummy.m_P);
71    register_terminal("_C1", m_BC_dummy.m_N);
70   register_terminal("_B1", m_BC_dummy.m_P);
71   register_terminal("_C1", m_BC_dummy.m_N);
7272
73    connect(m_RB.m_N, m_RC.m_N);
73   connect(m_RB.m_N, m_RC.m_N);
7474
75    connect(m_RB.m_P, m_BC_dummy.m_P);
76    connect(m_RC.m_P, m_BC_dummy.m_N);
75   connect(m_RB.m_P, m_BC_dummy.m_P);
76   connect(m_RC.m_P, m_BC_dummy.m_N);
7777
78    save(NAME(m_state_on));
78   save(NAME(m_state_on));
7979
80    m_RB.set(netlist().gmin(), 0.0, 0.0);
81    m_RC.set(netlist().gmin(), 0.0, 0.0);
80   m_RB.set(netlist().gmin(), 0.0, 0.0);
81   m_RC.set(netlist().gmin(), 0.0, 0.0);
8282
83    m_BC_dummy.set(netlist().gmin(), 0.0, 0.0);
83   m_BC_dummy.set(netlist().gmin(), 0.0, 0.0);
8484
85    m_state_on = 0;
85   m_state_on = 0;
8686
87    {
88        double IS = m_model.model_value("IS", 1e-15);
89        double BF = m_model.model_value("BF", 100);
90        double NF = m_model.model_value("NF", 1);
91        //double VJE = m_model.dValue("VJE", 0.75);
87   {
88      double IS = m_model.model_value("IS", 1e-15);
89      double BF = m_model.model_value("BF", 100);
90      double NF = m_model.model_value("NF", 1);
91      //double VJE = m_model.dValue("VJE", 0.75);
9292
93        set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
93      set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
9494
95        double alpha = BF / (1.0 + BF);
95      double alpha = BF / (1.0 + BF);
9696
97        diode d(IS, NF);
97      diode d(IS, NF);
9898
99        // Assume 5mA Collector current for switch operation
99      // Assume 5mA Collector current for switch operation
100100
101        m_V = d.V(0.005 / alpha);
101      m_V = d.V(0.005 / alpha);
102102
103        /* Base current is 0.005 / beta
104         * as a rough estimate, we just scale the conductance down */
103      /* Base current is 0.005 / beta
104       * as a rough estimate, we just scale the conductance down */
105105
106        m_gB = d.gI(0.005 / alpha);
106      m_gB = d.gI(0.005 / alpha);
107107
108        if (m_gB < netlist().gmin())
109            m_gB = netlist().gmin();
110        m_gC =  d.gI(0.005); // very rough estimate
111        //printf("%f %f \n", m_V, m_gB);
112    }
108      if (m_gB < netlist().gmin())
109         m_gB = netlist().gmin();
110      m_gC =  d.gI(0.005); // very rough estimate
111      //printf("%f %f \n", m_V, m_gB);
112   }
113113
114114}
115115
r29404r29405
125125
126126NETLIB_START(QBJT_EB)
127127{
128    NETLIB_NAME(Q)::start();
128   NETLIB_NAME(Q)::start();
129129
130    register_terminal("E", m_D_EB.m_P);   // Cathode
131    register_terminal("B", m_D_EB.m_N);   // Anode
130   register_terminal("E", m_D_EB.m_P);   // Cathode
131   register_terminal("B", m_D_EB.m_N);   // Anode
132132
133    register_terminal("C", m_D_CB.m_P);   // Cathode
134    register_terminal("_B1", m_D_CB.m_N); // Anode
133   register_terminal("C", m_D_CB.m_P);   // Cathode
134   register_terminal("_B1", m_D_CB.m_N); // Anode
135135
136    register_terminal("_E1", m_D_EC.m_P);
137    register_terminal("_C1", m_D_EC.m_N);
136   register_terminal("_E1", m_D_EC.m_P);
137   register_terminal("_C1", m_D_EC.m_N);
138138
139    connect(m_D_EB.m_P, m_D_EC.m_P);
140    connect(m_D_EB.m_N, m_D_CB.m_N);
141    connect(m_D_CB.m_P, m_D_EC.m_N);
139   connect(m_D_EB.m_P, m_D_EC.m_P);
140   connect(m_D_EB.m_N, m_D_CB.m_N);
141   connect(m_D_CB.m_P, m_D_EC.m_N);
142142
143    m_gD_BE.save("m_D_BE", *this);
144    m_gD_BC.save("m_D_BC", *this);
143   m_gD_BE.save("m_D_BE", *this);
144   m_gD_BC.save("m_D_BC", *this);
145145
146    {
147        double IS = m_model.model_value("IS", 1e-15);
148        double BF = m_model.model_value("BF", 100);
149        double NF = m_model.model_value("NF", 1);
150        double BR = m_model.model_value("BR", 1);
151        double NR = m_model.model_value("NR", 1);
152        //double VJE = m_model.dValue("VJE", 0.75);
146   {
147      double IS = m_model.model_value("IS", 1e-15);
148      double BF = m_model.model_value("BF", 100);
149      double NF = m_model.model_value("NF", 1);
150      double BR = m_model.model_value("BR", 1);
151      double NR = m_model.model_value("NR", 1);
152      //double VJE = m_model.dValue("VJE", 0.75);
153153
154        set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
155        //printf("type %s\n", m_model.model_type().cstr());
154      set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
155      //printf("type %s\n", m_model.model_type().cstr());
156156
157        m_alpha_f = BF / (1.0 + BF);
158        m_alpha_r = BR / (1.0 + BR);
157      m_alpha_f = BF / (1.0 + BF);
158      m_alpha_r = BR / (1.0 + BR);
159159
160        m_gD_BE.set_param(IS / m_alpha_f, NF, netlist().gmin());
161        m_gD_BC.set_param(IS / m_alpha_r, NR, netlist().gmin());
162    }
160      m_gD_BE.set_param(IS / m_alpha_f, NF, netlist().gmin());
161      m_gD_BC.set_param(IS / m_alpha_r, NR, netlist().gmin());
162   }
163163}
164164
165165NETLIB_UPDATE(QBJT_EB)
166166{
167    if (!m_D_EB.m_P.net().isRailNet())
168        m_D_EB.m_P.net().solve();   // Basis
169    else if (!m_D_EB.m_N.net().isRailNet())
170        m_D_EB.m_N.net().solve();   // Emitter
171    else
172        m_D_CB.m_N.net().solve();   // Collector
167   if (!m_D_EB.m_P.net().isRailNet())
168      m_D_EB.m_P.net().solve();   // Basis
169   else if (!m_D_EB.m_N.net().isRailNet())
170      m_D_EB.m_N.net().solve();   // Emitter
171   else
172      m_D_CB.m_N.net().solve();   // Collector
173173}
174174
175175NETLIB_RESET(QBJT_EB)
176176{
177    NETLIB_NAME(Q)::reset();
177   NETLIB_NAME(Q)::reset();
178178}
179179
180180
r29404r29405
182182NETLIB_UPDATE_PARAM(QBJT_EB)
183183{
184184}
185
trunk/src/emu/netlist/analog/nld_solver.h
r29404r29405
1515
1616#define SOLVER(_name, _freq)                                                 \
1717      NET_REGISTER_DEV(solver, _name)                                      \
18        PARAM(_name.FREQ, _freq)
18      PARAM(_name.FREQ, _freq)
1919
2020// ----------------------------------------------------------------------------------------
2121// solver
r29404r29405
2727
2828struct netlist_solver_parameters_t
2929{
30    double m_accuracy;
31    double m_convergence_factor;
32    int m_resched_loops;
30   double m_accuracy;
31   double m_convergence_factor;
32   int m_resched_loops;
3333};
3434
3535class netlist_matrix_solver_t
r29404r29405
3939   typedef netlist_core_device_t::list_t dev_list_t;
4040
4141   netlist_matrix_solver_t() : m_owner(NULL) {}
42    virtual ~netlist_matrix_solver_t() {}
42   virtual ~netlist_matrix_solver_t() {}
4343
4444   ATTR_COLD virtual void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner);
4545
4646   // return true if a reschedule is needed ...
47    ATTR_HOT virtual int solve_non_dynamic() = 0;
47   ATTR_HOT virtual int solve_non_dynamic() = 0;
4848   ATTR_HOT virtual void step(const netlist_time delta);
4949
50    ATTR_HOT bool solve();
50   ATTR_HOT bool solve();
5151
5252   ATTR_HOT void update_inputs();
53    ATTR_HOT void update_dynamic();
53   ATTR_HOT void update_dynamic();
5454
5555   ATTR_HOT void schedule();
5656
5757   ATTR_HOT inline bool is_dynamic() { return m_dynamic.count() > 0; }
58    ATTR_HOT inline bool is_timestep() { return m_steps.count() > 0; }
58   ATTR_HOT inline bool is_timestep() { return m_steps.count() > 0; }
5959
6060   ATTR_HOT inline const NETLIB_NAME(solver) &owner() const;
6161   ATTR_COLD virtual void reset();
r29404r29405
6767   dev_list_t m_dynamic;
6868   netlist_core_terminal_t::list_t m_inps;
6969   dev_list_t m_steps;
70    netlist_time m_last_step;
70   netlist_time m_last_step;
7171
72    NETLIB_NAME(solver) *m_owner;
72   NETLIB_NAME(solver) *m_owner;
7373};
7474
7575template <int m_N, int _storage_N>
r29404r29405
7777{
7878public:
7979
80    netlist_matrix_solver_direct_t() : netlist_matrix_solver_t() {}
80   netlist_matrix_solver_direct_t() : netlist_matrix_solver_t() {}
8181
82    virtual ~netlist_matrix_solver_direct_t() {}
82   virtual ~netlist_matrix_solver_direct_t() {}
8383
84    ATTR_COLD virtual void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner);
85    ATTR_COLD virtual void reset() { netlist_matrix_solver_t::reset(); }
86    ATTR_HOT virtual int solve_non_dynamic();
84   ATTR_COLD virtual void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner);
85   ATTR_COLD virtual void reset() { netlist_matrix_solver_t::reset(); }
86   ATTR_HOT virtual int solve_non_dynamic();
8787
88    ATTR_HOT inline const int N() const { return (m_N == 0) ? m_nets.count() : m_N; }
88   ATTR_HOT inline const int N() const { return (m_N == 0) ? m_nets.count() : m_N; }
8989
9090protected:
91    ATTR_HOT inline void build_LE(double (* RESTRICT A)[_storage_N], double (* RESTRICT RHS));
92    ATTR_HOT inline void gauss_LE(double (* RESTRICT A)[_storage_N],
93            double (* RESTRICT RHS),
94            double (* RESTRICT x));
95    ATTR_HOT inline double delta(
96            const double (* RESTRICT RHS),
97            const double (* RESTRICT V));
98    ATTR_HOT inline void store(const double (* RESTRICT RHS), const double (* RESTRICT V));
91   ATTR_HOT inline void build_LE(double (* RESTRICT A)[_storage_N], double (* RESTRICT RHS));
92   ATTR_HOT inline void gauss_LE(double (* RESTRICT A)[_storage_N],
93         double (* RESTRICT RHS),
94         double (* RESTRICT x));
95   ATTR_HOT inline double delta(
96         const double (* RESTRICT RHS),
97         const double (* RESTRICT V));
98   ATTR_HOT inline void store(const double (* RESTRICT RHS), const double (* RESTRICT V));
9999
100    double m_RHS[_storage_N]; // right hand side - contains currents
100   double m_RHS[_storage_N]; // right hand side - contains currents
101101
102102private:
103103
104    ATTR_COLD int get_net_idx(netlist_net_t *net);
104   ATTR_COLD int get_net_idx(netlist_net_t *net);
105105
106    struct terms_t{
107        int net_this;
108        int net_other;
109        netlist_terminal_t *term;
110    };
111    int m_term_num;
112    int m_rail_start;
113    terms_t m_terms[100];
106   struct terms_t{
107      int net_this;
108      int net_other;
109      netlist_terminal_t *term;
110   };
111   int m_term_num;
112   int m_rail_start;
113   terms_t m_terms[100];
114114};
115115
116116template <int m_N, int _storage_N>
r29404r29405
118118{
119119public:
120120
121    netlist_matrix_solver_gauss_seidel_t() : netlist_matrix_solver_t() {}
121   netlist_matrix_solver_gauss_seidel_t() : netlist_matrix_solver_t() {}
122122
123    virtual ~netlist_matrix_solver_gauss_seidel_t() {}
123   virtual ~netlist_matrix_solver_gauss_seidel_t() {}
124124
125    ATTR_COLD virtual void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner)
126    {
127        netlist_matrix_solver_t::setup(nets, owner);
128        m_fallback.m_params = m_params;
129        m_fallback.setup(nets, owner);
130    }
125   ATTR_COLD virtual void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner)
126   {
127      netlist_matrix_solver_t::setup(nets, owner);
128      m_fallback.m_params = m_params;
129      m_fallback.setup(nets, owner);
130   }
131131
132    ATTR_HOT int solve_non_dynamic();
132   ATTR_HOT int solve_non_dynamic();
133133
134    ATTR_HOT inline const int N() const { if (m_N == 0) return m_nets.count(); else return m_N; }
134   ATTR_HOT inline const int N() const { if (m_N == 0) return m_nets.count(); else return m_N; }
135135
136    ATTR_COLD virtual void reset()
137    {
138        netlist_matrix_solver_t::reset();
139        m_fallback.reset();
140    }
136   ATTR_COLD virtual void reset()
137   {
138      netlist_matrix_solver_t::reset();
139      m_fallback.reset();
140   }
141141
142142private:
143    netlist_matrix_solver_direct_t<m_N, _storage_N> m_fallback;
143   netlist_matrix_solver_direct_t<m_N, _storage_N> m_fallback;
144144};
145145
146146class netlist_matrix_solver_direct1_t: public netlist_matrix_solver_direct_t<1,1>
147147{
148148public:
149    ATTR_HOT int solve_non_dynamic();
149   ATTR_HOT int solve_non_dynamic();
150150private:
151151};
152152
153153class netlist_matrix_solver_direct2_t: public netlist_matrix_solver_direct_t<2,2>
154154{
155155public:
156    ATTR_HOT int solve_non_dynamic();
156   ATTR_HOT int solve_non_dynamic();
157157private:
158158};
159159
r29404r29405
170170      netlist_param_double_t m_sync_delay;
171171      netlist_param_double_t m_accuracy;
172172      netlist_param_double_t m_convergence;
173        netlist_param_double_t m_gmin;
174        netlist_param_int_t m_resched_loops;
175        netlist_param_int_t m_parallel;
173      netlist_param_double_t m_gmin;
174      netlist_param_int_t m_resched_loops;
175      netlist_param_int_t m_parallel;
176176
177177      netlist_time m_inc;
178178      netlist_time m_last_step;
trunk/src/emu/netlist/analog/nld_twoterm.c
r29404r29405
1212
1313ATTR_COLD netlist_generic_diode::netlist_generic_diode()
1414{
15    m_Vd = 0.7;
15   m_Vd = 0.7;
1616}
1717
1818ATTR_COLD void netlist_generic_diode::set_param(const double Is, const double n, double gmin)
1919{
20    m_Is = Is;
21    m_n = n;
22    m_gmin = gmin;
20   m_Is = Is;
21   m_n = n;
22   m_gmin = gmin;
2323
24    m_Vt = 0.0258 * m_n;
24   m_Vt = 0.0258 * m_n;
2525
26    m_Vcrit = m_Vt * log(m_Vt / m_Is / sqrt(2.0));
27    m_VtInv = 1.0 / m_Vt;
26   m_Vcrit = m_Vt * log(m_Vt / m_Is / sqrt(2.0));
27   m_VtInv = 1.0 / m_Vt;
2828}
2929
3030ATTR_COLD void netlist_generic_diode::save(pstring name, netlist_object_t &parent)
3131{
32    parent.save(m_Vd, name + ".m_Vd");
33    parent.save(m_Id, name + ".m_Id");
34    parent.save(m_G, name + ".m_G");
32   parent.save(m_Vd, name + ".m_Vd");
33   parent.save(m_Id, name + ".m_Id");
34   parent.save(m_G, name + ".m_G");
3535}
3636
3737// ----------------------------------------------------------------------------------------
r29404r29405
5757NETLIB_UPDATE(twoterm)
5858{
5959   /* only called if connected to a rail net ==> notify the solver to recalculate */
60    /* we only need to call the non-rail terminal */
61    if (!m_P.net().isRailNet())
62        m_P.net().solve();
63    else
64        m_N.net().solve();
60   /* we only need to call the non-rail terminal */
61   if (!m_P.net().isRailNet())
62      m_P.net().solve();
63   else
64      m_N.net().solve();
6565}
6666
6767// ----------------------------------------------------------------------------------------
r29404r29405
7676
7777NETLIB_RESET(R_base)
7878{
79    NETLIB_NAME(twoterm)::reset();
80    set_R(1.0 / netlist().gmin());
79   NETLIB_NAME(twoterm)::reset();
80   set_R(1.0 / netlist().gmin());
8181}
8282
8383NETLIB_UPDATE(R_base)
r29404r29405
9393
9494NETLIB_RESET(R)
9595{
96    NETLIB_NAME(R_base)::reset();
96   NETLIB_NAME(R_base)::reset();
9797}
9898
9999NETLIB_UPDATE(R)
r29404r29405
105105{
106106   //printf("updating %s to %f\n", name().cstr(), m_R.Value());
107107   if (m_R.Value() > 1e-9)
108       set_R(m_R.Value());
108      set_R(m_R.Value());
109109   else
110       set_R(1e-9);
111    update_dev();
110      set_R(1e-9);
111   update_dev();
112112}
113113
114114// ----------------------------------------------------------------------------------------
r29404r29405
134134
135135NETLIB_RESET(POT)
136136{
137    m_R1.do_reset();
138    m_R2.do_reset();
137   m_R1.do_reset();
138   m_R2.do_reset();
139139}
140140
141141NETLIB_UPDATE(POT)
r29404r29405
152152   m_R1.set_R(MAX(m_R.Value() * v, netlist().gmin()));
153153   m_R2.set_R(MAX(m_R.Value() * (1.0 - v), netlist().gmin()));
154154   // force a schedule all
155    m_R1.update_dev();
156    m_R2.update_dev();
155   m_R1.update_dev();
156   m_R2.update_dev();
157157}
158158
159159// ----------------------------------------------------------------------------------------
r29404r29405
168168   register_param("C", m_C, 1e-6);
169169
170170   // set up the element
171    set(netlist().gmin(), 0.0, -5.0 / netlist().gmin());
172    //set(1.0/NETLIST_GMIN, 0.0, -5.0 * NETLIST_GMIN);
171   set(netlist().gmin(), 0.0, -5.0 / netlist().gmin());
172   //set(1.0/NETLIST_GMIN, 0.0, -5.0 * NETLIST_GMIN);
173173}
174174
175175NETLIB_RESET(C)
176176{
177    set(netlist().gmin(), 0.0, -5.0 / netlist().gmin());
178    //set(1.0/NETLIST_GMIN, 0.0, -5.0 * NETLIST_GMIN);
177   set(netlist().gmin(), 0.0, -5.0 / netlist().gmin());
178   //set(1.0/NETLIST_GMIN, 0.0, -5.0 * NETLIST_GMIN);
179179}
180180
181181NETLIB_UPDATE_PARAM(C)
r29404r29405
215215{
216216   NETLIB_NAME(twoterm)::update();
217217}
218
219
trunk/src/emu/netlist/analog/nld_fourterm.c
r29404r29405
1313
1414NETLIB_START(VCCS)
1515{
16    register_param("G", m_G, 1.0);
17    register_param("RI", m_RI, 1.0 / netlist().gmin());
16   register_param("G", m_G, 1.0);
17   register_param("RI", m_RI, 1.0 / netlist().gmin());
1818
19    register_terminal("IP", m_IP);
20    register_terminal("IN", m_IN);
21    register_terminal("OP", m_OP);
22    register_terminal("ON", m_ON);
19   register_terminal("IP", m_IP);
20   register_terminal("IN", m_IN);
21   register_terminal("OP", m_OP);
22   register_terminal("ON", m_ON);
2323
24    register_terminal("_OP1", m_OP1);
25    register_terminal("_ON1", m_ON1);
24   register_terminal("_OP1", m_OP1);
25   register_terminal("_ON1", m_ON1);
2626
27    m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving...
28    m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving...
27   m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving...
28   m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving...
2929
30    m_OP.m_otherterm = &m_IP;
31    m_OP1.m_otherterm = &m_IN;
30   m_OP.m_otherterm = &m_IP;
31   m_OP1.m_otherterm = &m_IN;
3232
33    m_ON.m_otherterm = &m_IP;
34    m_ON1.m_otherterm = &m_IN;
33   m_ON.m_otherterm = &m_IP;
34   m_ON1.m_otherterm = &m_IN;
3535
36    connect(m_OP, m_OP1);
37    connect(m_ON, m_ON1);
36   connect(m_OP, m_OP1);
37   connect(m_ON, m_ON1);
3838
39    m_gfac = 1.0;
39   m_gfac = 1.0;
4040}
4141
4242NETLIB_RESET(VCCS)
4343{
44    const double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A
45    const double GI = 1.0 / m_RI.Value();
44   const double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A
45   const double GI = 1.0 / m_RI.Value();
4646
47    m_IP.set(GI);
48    m_IN.set(GI);
47   m_IP.set(GI);
48   m_IN.set(GI);
4949
50    m_OP.set(m_mult, 0.0);
51    m_OP1.set(-m_mult, 0.0);
50   m_OP.set(m_mult, 0.0);
51   m_OP1.set(-m_mult, 0.0);
5252
53    m_ON.set(-m_mult, 0.0);
54    m_ON1.set(m_mult, 0.0);
53   m_ON.set(-m_mult, 0.0);
54   m_ON1.set(m_mult, 0.0);
5555}
5656
5757NETLIB_UPDATE_PARAM(VCCS)
r29404r29405
6060
6161NETLIB_UPDATE(VCCS)
6262{
63    /* only called if connected to a rail net ==> notify the solver to recalculate */
64    /* Big FIXME ... */
65    if (!m_IP.net().isRailNet())
66        m_IP.net().solve();
67    else if (!m_IN.net().isRailNet())
68        m_IN.net().solve();
69    else if (!m_OP.net().isRailNet())
70        m_OP.net().solve();
71    else if (!m_ON.net().isRailNet())
72        m_ON.net().solve();
63   /* only called if connected to a rail net ==> notify the solver to recalculate */
64   /* Big FIXME ... */
65   if (!m_IP.net().isRailNet())
66      m_IP.net().solve();
67   else if (!m_IN.net().isRailNet())
68      m_IN.net().solve();
69   else if (!m_OP.net().isRailNet())
70      m_OP.net().solve();
71   else if (!m_ON.net().isRailNet())
72      m_ON.net().solve();
7373}
7474
7575// ----------------------------------------------------------------------------------------
r29404r29405
7878
7979NETLIB_START(VCVS)
8080{
81    NETLIB_NAME(VCCS)::start();
81   NETLIB_NAME(VCCS)::start();
8282
83    register_param("RO", m_RO, 1.0);
83   register_param("RO", m_RO, 1.0);
8484
85    register_terminal("_OP2", m_OP2);
86    register_terminal("_ON2", m_ON2);
85   register_terminal("_OP2", m_OP2);
86   register_terminal("_ON2", m_ON2);
8787
88    m_OP2.m_otherterm = &m_ON2;
89    m_ON2.m_otherterm = &m_OP2;
88   m_OP2.m_otherterm = &m_ON2;
89   m_ON2.m_otherterm = &m_OP2;
9090
91    connect(m_OP2, m_OP1);
92    connect(m_ON2, m_ON1);
91   connect(m_OP2, m_OP1);
92   connect(m_ON2, m_ON1);
9393}
9494
9595NETLIB_RESET(VCVS)
9696{
97    m_gfac = 1.0 / m_RO.Value();
98    NETLIB_NAME(VCCS)::reset();
97   m_gfac = 1.0 / m_RO.Value();
98   NETLIB_NAME(VCCS)::reset();
9999
100    m_OP2.set(1.0 / m_RO.Value());
101    m_ON2.set(1.0 / m_RO.Value());
100   m_OP2.set(1.0 / m_RO.Value());
101   m_ON2.set(1.0 / m_RO.Value());
102102}
103103
104104NETLIB_UPDATE_PARAM(VCVS)
105105{
106106}
107
trunk/src/emu/netlist/analog/nld_bjt.h
r29404r29405
1414// ----------------------------------------------------------------------------------------
1515
1616#define QBJT_SW(_name, _model)                                           \
17        NET_REGISTER_DEV(QBJT_switch, _name)                             \
18        NETDEV_PARAMI(_name,  model,   _model)
17      NET_REGISTER_DEV(QBJT_switch, _name)                             \
18      NETDEV_PARAMI(_name,  model,   _model)
1919
2020#define QBJT_EB(_name, _model)                                           \
21        NET_REGISTER_DEV(QBJT_EB, _name)                                 \
22        NETDEV_PARAMI(_name,  model,   _model)
21      NET_REGISTER_DEV(QBJT_EB, _name)                                 \
22      NETDEV_PARAMI(_name,  model,   _model)
2323
2424
2525// ----------------------------------------------------------------------------------------
r29404r29405
3131class NETLIB_NAME(Q) : public netlist_device_t
3232{
3333public:
34    enum q_type {
35        BJT_NPN,
36        BJT_PNP
37    };
34   enum q_type {
35      BJT_NPN,
36      BJT_PNP
37   };
3838
39    ATTR_COLD NETLIB_NAME(Q)(const family_t afamily)
40    : netlist_device_t(afamily)
41    , m_qtype(BJT_NPN) { }
39   ATTR_COLD NETLIB_NAME(Q)(const family_t afamily)
40   : netlist_device_t(afamily)
41   , m_qtype(BJT_NPN) { }
4242
43    inline q_type qtype() const { return m_qtype; }
44    inline bool is_qtype(q_type atype) const { return m_qtype == atype; }
45    inline void set_qtype(q_type atype) { m_qtype = atype; }
43   inline q_type qtype() const { return m_qtype; }
44   inline bool is_qtype(q_type atype) const { return m_qtype == atype; }
45   inline void set_qtype(q_type atype) { m_qtype = atype; }
4646protected:
47    ATTR_COLD virtual void start();
48    ATTR_COLD virtual void reset();
49    ATTR_HOT ATTR_ALIGN void update();
47   ATTR_COLD virtual void start();
48   ATTR_COLD virtual void reset();
49   ATTR_HOT ATTR_ALIGN void update();
5050
51    netlist_param_model_t m_model;
51   netlist_param_model_t m_model;
5252private:
53    q_type m_qtype;
53   q_type m_qtype;
5454};
5555
5656class NETLIB_NAME(QBJT) : public NETLIB_NAME(Q)
5757{
5858public:
5959
60    ATTR_COLD NETLIB_NAME(QBJT)(const family_t afamily)
61    : NETLIB_NAME(Q)(afamily) { }
60   ATTR_COLD NETLIB_NAME(QBJT)(const family_t afamily)
61   : NETLIB_NAME(Q)(afamily) { }
6262
6363protected:
6464
r29404r29405
8989class NETLIB_NAME(QBJT_switch) : public NETLIB_NAME(QBJT)
9090{
9191public:
92    ATTR_COLD NETLIB_NAME(QBJT_switch)()
93    : NETLIB_NAME(QBJT)(BJT_SWITCH),
94      m_RB(netlist_object_t::ANALOG),
95      m_RC(netlist_object_t::ANALOG),
96      m_BC_dummy(netlist_object_t::ANALOG),
97      m_gB(NETLIST_GMIN_DEFAULT), m_gC(NETLIST_GMIN_DEFAULT), m_V(0.0), m_state_on(0) { }
92   ATTR_COLD NETLIB_NAME(QBJT_switch)()
93   : NETLIB_NAME(QBJT)(BJT_SWITCH),
94      m_RB(netlist_object_t::ANALOG),
95      m_RC(netlist_object_t::ANALOG),
96      m_BC_dummy(netlist_object_t::ANALOG),
97      m_gB(NETLIST_GMIN_DEFAULT), m_gC(NETLIST_GMIN_DEFAULT), m_V(0.0), m_state_on(0) { }
9898
99    NETLIB_UPDATE_TERMINALS()
100    {
101        double m = (is_qtype( BJT_NPN) ? 1 : -1);
99   NETLIB_UPDATE_TERMINALS()
100   {
101      double m = (is_qtype( BJT_NPN) ? 1 : -1);
102102
103        int new_state = (m_RB.deltaV() * m > m_V ) ? 1 : 0;
104        if (m_state_on ^ new_state)
105        {
106            double gb = m_gB;
107            double gc = m_gC;
108            double v  = m_V * m;
109            if (!new_state )
110            {
111                // not conducting
112                gb = netlist().gmin();
113                v = 0;
114                gc = netlist().gmin();
115            }
116            m_RB.set(gb, v,   0.0);
117            m_RC.set(gc, 0.0, 0.0);
118            m_state_on = new_state;
119        }
120    }
103      int new_state = (m_RB.deltaV() * m > m_V ) ? 1 : 0;
104      if (m_state_on ^ new_state)
105      {
106         double gb = m_gB;
107         double gc = m_gC;
108         double v  = m_V * m;
109         if (!new_state )
110         {
111            // not conducting
112            gb = netlist().gmin();
113            v = 0;
114            gc = netlist().gmin();
115         }
116         m_RB.set(gb, v,   0.0);
117         m_RC.set(gc, 0.0, 0.0);
118         m_state_on = new_state;
119      }
120   }
121121
122    ATTR_HOT ATTR_ALIGN void virtual update()
123    {
124        if (!m_RB.m_P.net().isRailNet())
125            m_RB.m_P.net().solve();   // Basis
126        else if (!m_RB.m_N.net().isRailNet())
127            m_RB.m_N.net().solve();   // Emitter
128        else if (!m_RC.m_P.net().isRailNet())
129            m_RB.m_P.net().solve();   // Collector
130    }
122   ATTR_HOT ATTR_ALIGN void virtual update()
123   {
124      if (!m_RB.m_P.net().isRailNet())
125         m_RB.m_P.net().solve();   // Basis
126      else if (!m_RB.m_N.net().isRailNet())
127         m_RB.m_N.net().solve();   // Emitter
128      else if (!m_RC.m_P.net().isRailNet())
129         m_RB.m_P.net().solve();   // Collector
130   }
131131
132    nld_twoterm m_RB;
133    nld_twoterm m_RC;
132   nld_twoterm m_RB;
133   nld_twoterm m_RC;
134134
135    // FIXME: the matrix solvers should be devices so we can properly
136    //        schedule them. This is a workaround and blows netgroup size
135   // FIXME: the matrix solvers should be devices so we can properly
136   //        schedule them. This is a workaround and blows netgroup size
137137
138    nld_twoterm m_BC_dummy;
138   nld_twoterm m_BC_dummy;
139139
140140protected:
141141
142    ATTR_COLD virtual void start();
143    ATTR_HOT void update_param();
142   ATTR_COLD virtual void start();
143   ATTR_HOT void update_param();
144144
145    double m_gB; // base conductance / switch on
146    double m_gC; // collector conductance / switch on
147    double m_V; // internal voltage source
148    UINT8 m_state_on;
145   double m_gB; // base conductance / switch on
146   double m_gC; // collector conductance / switch on
147   double m_V; // internal voltage source
148   UINT8 m_state_on;
149149
150150private:
151151};
r29404r29405
158158class NETLIB_NAME(QBJT_EB) : public NETLIB_NAME(QBJT)
159159{
160160public:
161    ATTR_COLD NETLIB_NAME(QBJT_EB)()
162    : NETLIB_NAME(QBJT)(BJT_EB),
163      m_D_CB(netlist_object_t::ANALOG),
164      m_D_EB(netlist_object_t::ANALOG),
165      m_D_EC(netlist_object_t::ANALOG)
166      { }
161   ATTR_COLD NETLIB_NAME(QBJT_EB)()
162   : NETLIB_NAME(QBJT)(BJT_EB),
163      m_D_CB(netlist_object_t::ANALOG),
164      m_D_EB(netlist_object_t::ANALOG),
165      m_D_EC(netlist_object_t::ANALOG)
166      { }
167167
168    NETLIB_UPDATE_TERMINALS()
169    {
170        double polarity = (qtype() == BJT_NPN ? 1.0 : -1.0);
168   NETLIB_UPDATE_TERMINALS()
169   {
170      double polarity = (qtype() == BJT_NPN ? 1.0 : -1.0);
171171
172        m_gD_BE.update_diode(-m_D_EB.deltaV() * polarity);
173        m_gD_BC.update_diode(-m_D_CB.deltaV() * polarity);
172      m_gD_BE.update_diode(-m_D_EB.deltaV() * polarity);
173      m_gD_BC.update_diode(-m_D_CB.deltaV() * polarity);
174174
175        double gee = m_gD_BE.G();
176        double gcc = m_gD_BC.G();
177        double gec =  m_alpha_r * gcc;
178        double gce =  m_alpha_f * gee;
179        double sIe = -m_gD_BE.I() + m_alpha_r * m_gD_BC.I();
180        double sIc = m_alpha_f * m_gD_BE.I() - m_gD_BC.I();
181        double Ie = (sIe + gee * m_gD_BE.Vd() - gec * m_gD_BC.Vd()) * polarity;
182        double Ic = (sIc - gce * m_gD_BE.Vd() + gcc * m_gD_BC.Vd()) * polarity;
183        //double Ie = sIe + gee * -m_D_EB.deltaV() - gec * -m_D_CB.deltaV();
184        //double Ic = sIc - gce * -m_D_EB.deltaV() + gcc * -m_D_CB.deltaV();
185        //printf("EB %f sIe %f sIc %f\n", m_D_BE.deltaV(), sIe, sIc);
175      double gee = m_gD_BE.G();
176      double gcc = m_gD_BC.G();
177      double gec =  m_alpha_r * gcc;
178      double gce =  m_alpha_f * gee;
179      double sIe = -m_gD_BE.I() + m_alpha_r * m_gD_BC.I();
180      double sIc = m_alpha_f * m_gD_BE.I() - m_gD_BC.I();
181      double Ie = (sIe + gee * m_gD_BE.Vd() - gec * m_gD_BC.Vd()) * polarity;
182      double Ic = (sIc - gce * m_gD_BE.Vd() + gcc * m_gD_BC.Vd()) * polarity;
183      //double Ie = sIe + gee * -m_D_EB.deltaV() - gec * -m_D_CB.deltaV();
184      //double Ic = sIc - gce * -m_D_EB.deltaV() + gcc * -m_D_CB.deltaV();
185      //printf("EB %f sIe %f sIc %f\n", m_D_BE.deltaV(), sIe, sIc);
186186
187        m_D_EB.set_mat(gee, gec - gee, gce - gee, gee - gec, Ie, -Ie);
188        m_D_CB.set_mat(gcc, gce - gcc, gec - gcc, gcc - gce, Ic, -Ic);
189        m_D_EC.set_mat( 0,    -gec,      -gce,        0,       0,   0);
190    }
187      m_D_EB.set_mat(gee, gec - gee, gce - gee, gee - gec, Ie, -Ie);
188      m_D_CB.set_mat(gcc, gce - gcc, gec - gcc, gcc - gce, Ic, -Ic);
189      m_D_EC.set_mat( 0,    -gec,      -gce,        0,       0,   0);
190   }
191191
192192protected:
193193
194    ATTR_COLD virtual void start();
195    ATTR_COLD virtual void reset();
196    ATTR_HOT void update_param();
197    ATTR_HOT ATTR_ALIGN void virtual update();
194   ATTR_COLD virtual void start();
195   ATTR_COLD virtual void reset();
196   ATTR_HOT void update_param();
197   ATTR_HOT ATTR_ALIGN void virtual update();
198198
199    netlist_generic_diode m_gD_BC;
200    netlist_generic_diode m_gD_BE;
199   netlist_generic_diode m_gD_BC;
200   netlist_generic_diode m_gD_BE;
201201
202    nld_twoterm m_D_CB;  // gcc, gce - gcc, gec - gcc, gcc - gce | Ic
203    nld_twoterm m_D_EB;  // gee, gec - gee, gce - gee, gee - gec | Ie
204    nld_twoterm m_D_EC;  // 0, -gec, -gcc, 0 | 0
202   nld_twoterm m_D_CB;  // gcc, gce - gcc, gec - gcc, gcc - gce | Ic
203   nld_twoterm m_D_EB;  // gee, gec - gee, gce - gee, gee - gec | Ie
204   nld_twoterm m_D_EC;  // 0, -gec, -gcc, 0 | 0
205205
206    double m_alpha_f;
207    double m_alpha_r;
206   double m_alpha_f;
207   double m_alpha_r;
208208
209209private:
210210};
trunk/src/emu/netlist/analog/nld_twoterm.h
r29404r29405
8484      m_P.m_Idr = (  V) * G - I;
8585   }
8686
87    ATTR_HOT inline double deltaV() { return m_P.net().Q_Analog()- m_N.net().Q_Analog(); }
87   ATTR_HOT inline double deltaV() { return m_P.net().Q_Analog()- m_N.net().Q_Analog(); }
8888
89    ATTR_HOT void set_mat(double a11, double a12, double a21, double a22, double r1, double r2)
90    {
91        m_P.m_gt = a11;
92        m_P.m_go = -a12;
93        m_N.m_gt = a22;
94        m_N.m_go = -a21;
89   ATTR_HOT void set_mat(double a11, double a12, double a21, double a22, double r1, double r2)
90   {
91      m_P.m_gt = a11;
92      m_P.m_go = -a12;
93      m_N.m_gt = a22;
94      m_N.m_go = -a21;
9595
96        m_P.m_Idr = -r1;
97        m_N.m_Idr = -r2;
96      m_P.m_Idr = -r1;
97      m_N.m_Idr = -r2;
9898
99    }
99   }
100100
101101protected:
102102   ATTR_COLD virtual void start();
103    ATTR_COLD virtual void reset();
103   ATTR_COLD virtual void reset();
104104   ATTR_HOT ATTR_ALIGN void update();
105105
106106private:
r29404r29405
119119
120120protected:
121121   ATTR_COLD virtual void start();
122    ATTR_COLD virtual void reset();
122   ATTR_COLD virtual void reset();
123123   ATTR_HOT ATTR_ALIGN void update();
124124};
125125
r29404r29405
159159
160160protected:
161161   ATTR_COLD virtual void start();
162    ATTR_COLD virtual void reset();
162   ATTR_COLD virtual void reset();
163163   ATTR_COLD virtual void update_param();
164164   ATTR_HOT ATTR_ALIGN void update();
165165
r29404r29405
175175class netlist_generic_diode
176176{
177177public:
178    ATTR_COLD netlist_generic_diode();
178   ATTR_COLD netlist_generic_diode();
179179
180    ATTR_HOT inline void update_diode(const double nVd)
181    {
182        //FIXME: Optimize cutoff case
180   ATTR_HOT inline void update_diode(const double nVd)
181   {
182      //FIXME: Optimize cutoff case
183183
184        if (nVd < -5.0 * m_Vt)
185        {
186            m_Vd = nVd;
187            m_G = m_gmin;
188            m_Id = - m_Is;
189        }
190        else if (nVd < m_Vcrit)
191        {
192            m_Vd = nVd;
184      if (nVd < -5.0 * m_Vt)
185      {
186         m_Vd = nVd;
187         m_G = m_gmin;
188         m_Id = - m_Is;
189      }
190      else if (nVd < m_Vcrit)
191      {
192         m_Vd = nVd;
193193
194            const double eVDVt = exp(m_Vd * m_VtInv);
195            m_Id = m_Is * (eVDVt - 1.0);
196            m_G = m_Is * m_VtInv * eVDVt + m_gmin;
197        }
198        else
199        {
194         const double eVDVt = exp(m_Vd * m_VtInv);
195         m_Id = m_Is * (eVDVt - 1.0);
196         m_G = m_Is * m_VtInv * eVDVt + m_gmin;
197      }
198      else
199      {
200200#if defined(_MSC_VER) && _MSC_VER < 1800
201            m_Vd = m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt;
201         m_Vd = m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt;
202202#else
203            double a = (nVd - m_Vd) * m_VtInv;
204            if (a<1e-12 - 1.0) a = 1e-12 - 1.0;
205            m_Vd = m_Vd + log1p(a) * m_Vt;
203         double a = (nVd - m_Vd) * m_VtInv;
204         if (a<1e-12 - 1.0) a = 1e-12 - 1.0;
205         m_Vd = m_Vd + log1p(a) * m_Vt;
206206#endif
207            const double eVDVt = exp(m_Vd * m_VtInv);
208            m_Id = m_Is * (eVDVt - 1.0);
207         const double eVDVt = exp(m_Vd * m_VtInv);
208         m_Id = m_Is * (eVDVt - 1.0);
209209
210            m_G = m_Is * m_VtInv * eVDVt + m_gmin;
211        }
210         m_G = m_Is * m_VtInv * eVDVt + m_gmin;
211      }
212212
213        //printf("nVd %f m_Vd %f Vcrit %f\n", nVd, m_Vd, m_Vcrit);
214    }
213      //printf("nVd %f m_Vd %f Vcrit %f\n", nVd, m_Vd, m_Vcrit);
214   }
215215
216    ATTR_COLD void set_param(const double Is, const double n, double gmin);
216   ATTR_COLD void set_param(const double Is, const double n, double gmin);
217217
218    ATTR_HOT inline double I() const { return m_Id; }
219    ATTR_HOT inline double G() const { return m_G; }
220    ATTR_HOT inline double Ieq() const { return (m_Id - m_Vd * m_G); }
221    ATTR_HOT inline double Vd() const { return m_Vd; }
218   ATTR_HOT inline double I() const { return m_Id; }
219   ATTR_HOT inline double G() const { return m_G; }
220   ATTR_HOT inline double Ieq() const { return (m_Id - m_Vd * m_G); }
221   ATTR_HOT inline double Vd() const { return m_Vd; }
222222
223    /* owning object must save those ... */
223   /* owning object must save those ... */
224224
225    ATTR_COLD void save(pstring name, netlist_object_t &parent);
225   ATTR_COLD void save(pstring name, netlist_object_t &parent);
226226
227227private:
228    double m_Vd;
229    double m_Id;
230    double m_G;
228   double m_Vd;
229   double m_Id;
230   double m_G;
231231
232    double m_Vt;
233    double m_Is;
234    double m_n;
235    double m_gmin;
232   double m_Vt;
233   double m_Is;
234   double m_n;
235   double m_gmin;
236236
237    double m_VtInv;
238    double m_Vcrit;
237   double m_VtInv;
238   double m_Vcrit;
239239};
240240
241241// ----------------------------------------------------------------------------------------
r29404r29405
278278
279279   NETLIB_UPDATE_TERMINALS()
280280   {
281       m_D.update_diode(deltaV());
281      m_D.update_diode(deltaV());
282282      set(m_D.G(), 0.0, m_D.Ieq());
283283   }
284284
trunk/src/emu/netlist/analog/nld_fourterm.h
r29404r29405
1515// ----------------------------------------------------------------------------------------
1616
1717#define VCCS(_name)                                                                \
18        NET_REGISTER_DEV(VCCS, _name)
18      NET_REGISTER_DEV(VCCS, _name)
1919
2020#define VCVS(_name)                                                                \
21        NET_REGISTER_DEV(VCVS, _name)
21      NET_REGISTER_DEV(VCVS, _name)
2222
2323// ----------------------------------------------------------------------------------------
2424// nld_CCCS
r29404r29405
7070class NETLIB_NAME(VCCS) : public netlist_device_t
7171{
7272public:
73    ATTR_COLD NETLIB_NAME(VCCS)()
74    : netlist_device_t(VCCS) {  }
75    ATTR_COLD NETLIB_NAME(VCCS)(const family_t afamily)
76    : netlist_device_t(afamily) {  }
73   ATTR_COLD NETLIB_NAME(VCCS)()
74   : netlist_device_t(VCCS) {  }
75   ATTR_COLD NETLIB_NAME(VCCS)(const family_t afamily)
76   : netlist_device_t(afamily) {  }
7777
7878protected:
79    ATTR_COLD virtual void start();
80    ATTR_COLD virtual void reset();
81    ATTR_COLD virtual void update_param();
82    ATTR_HOT ATTR_ALIGN void update();
79   ATTR_COLD virtual void start();
80   ATTR_COLD virtual void reset();
81   ATTR_COLD virtual void update_param();
82   ATTR_HOT ATTR_ALIGN void update();
8383
84    netlist_terminal_t m_OP;
85    netlist_terminal_t m_ON;
84   netlist_terminal_t m_OP;
85   netlist_terminal_t m_ON;
8686
87    netlist_terminal_t m_IP;
88    netlist_terminal_t m_IN;
87   netlist_terminal_t m_IP;
88   netlist_terminal_t m_IN;
8989
90    netlist_terminal_t m_OP1;
91    netlist_terminal_t m_ON1;
90   netlist_terminal_t m_OP1;
91   netlist_terminal_t m_ON1;
9292
93    netlist_param_double_t m_G;
94    netlist_param_double_t m_RI;
93   netlist_param_double_t m_G;
94   netlist_param_double_t m_RI;
9595
96    double m_gfac;
96   double m_gfac;
9797};
9898
9999// ----------------------------------------------------------------------------------------
r29404r29405
127127class NETLIB_NAME(VCVS) : public NETLIB_NAME(VCCS)
128128{
129129public:
130    ATTR_COLD NETLIB_NAME(VCVS)()
131    : NETLIB_NAME(VCCS)(VCVS) { }
130   ATTR_COLD NETLIB_NAME(VCVS)()
131   : NETLIB_NAME(VCCS)(VCVS) { }
132132
133133protected:
134    ATTR_COLD virtual void start();
135    ATTR_COLD virtual void reset();
136    ATTR_COLD virtual void update_param();
137    //ATTR_HOT ATTR_ALIGN void update();
134   ATTR_COLD virtual void start();
135   ATTR_COLD virtual void reset();
136   ATTR_COLD virtual void update_param();
137   //ATTR_HOT ATTR_ALIGN void update();
138138
139    netlist_terminal_t m_OP2;
140    netlist_terminal_t m_ON2;
139   netlist_terminal_t m_OP2;
140   netlist_terminal_t m_ON2;
141141
142    netlist_param_double_t m_RO;
142   netlist_param_double_t m_RO;
143143};
144144
145145
trunk/src/emu/digfx.c
r29404r29405
8989                        device().tag(),
9090                        (m_palette_is_sibling ? "sibling " : "sub"),
9191                        m_palette_tag);
92   
92
9393   // if palette device isn't started, wait for it
9494   // if (!m_palette->started())
95   //   throw device_missing_dependencies();
95   //  throw device_missing_dependencies();
9696}
9797
9898
trunk/src/emu/digfx.h
r29404r29405
212212
213213private:
214214   // configuration
215   const gfx_decode_entry *   m_gfxdecodeinfo;      // pointer to array of gfx decode information
216   const char *            m_palette_tag;         // configured tag for palette device
217   bool                  m_palette_is_sibling;   // is palette a sibling or a subdevice?
215   const gfx_decode_entry *    m_gfxdecodeinfo;        // pointer to array of gfx decode information
216   const char *                m_palette_tag;          // configured tag for palette device
217   bool                        m_palette_is_sibling;   // is palette a sibling or a subdevice?
218218
219219   // internal state
220   bool                  m_decoded;               // have we processed our decode info yet?
221   palette_device *         m_palette;               // pointer to the palette device
222   auto_pointer<gfx_element>   m_gfx[MAX_GFX_ELEMENTS];   // array of pointers to graphic sets
220   bool                        m_decoded;                  // have we processed our decode info yet?
221   palette_device *            m_palette;                  // pointer to the palette device
222   auto_pointer<gfx_element>   m_gfx[MAX_GFX_ELEMENTS];    // array of pointers to graphic sets
223223};
224224
225225// iterator
trunk/src/emu/screen.c
r29404r29405
226226
227227
228228//-------------------------------------------------
229//  static_set_video_attributes - set the screen
229//  static_set_video_attributes - set the screen
230230//  video attributes
231231//-------------------------------------------------
232232
r29404r29405
260260   // check for zero frame rate
261261   if (m_refresh == 0)
262262      mame_printf_error("Invalid (zero) refresh rate\n");
263   
263
264264   texture_format texformat = !m_screen_update_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32;
265265   if (m_palette == NULL && texformat == TEXFORMAT_PALETTE16)
266      mame_printf_error("Screen does not have palette defined\n");     
266      mame_printf_error("Screen does not have palette defined\n");
267267   if (m_palette != NULL && texformat == TEXFORMAT_RGB32)
268268      mame_printf_warning("Screen does not need palette defined\n");
269269}
r29404r29405
279279   m_screen_update_ind16.bind_relative_to(*owner());
280280   m_screen_update_rgb32.bind_relative_to(*owner());
281281   m_screen_vblank.bind_relative_to(*owner());
282   
282
283283   // if we have a palette and it's not started, wait for it
284284   if (m_palette != NULL && !m_palette->started())
285285      throw device_missing_dependencies();
trunk/src/emu/screen.h
r29404r29405
261261   screen_update_ind16_delegate m_screen_update_ind16; // screen update callback (16-bit palette)
262262   screen_update_rgb32_delegate m_screen_update_rgb32; // screen update callback (32-bit RGB)
263263   screen_vblank_delegate m_screen_vblank;         // screen vblank callback
264   optional_device<palette_device> m_palette;      // our palette
264   optional_device<palette_device> m_palette;      // our palette
265265   UINT32              m_video_attributes;         // flags describing the video system
266266
267267   // internal state
trunk/src/emu/drivenum.c
r29404r29405
244244{
245245   memset(m_included, 1, sizeof(m_included[0]) * s_driver_count);
246246   m_filtered_count = s_driver_count;
247   
247
248248   // always exclude the empty driver
249249   int empty = find("___empty");
250250   assert(empty != -1);
r29404r29405
385385//-------------------------------------------------
386386//  release_current - release bulky memory
387387//  structures from the current entry because
388//   we're done with it
388//  we're done with it
389389//-------------------------------------------------
390390
391391void driver_enumerator::release_current()
r29404r29405
393393   // skip if no current entry
394394   if (m_current < 0 || m_current >= s_driver_count)
395395      return;
396   
396
397397   // skip if we haven't cached a config
398398   if (m_config[m_current] == NULL)
399399      return;
trunk/src/emu/drawgfx.h
r29404r29405
8787      if (m_dirty[code]) decode(code);
8888      return m_pen_usage[code];
8989   }
90   
90
9191   // ----- core graphics drawing -----
9292
9393   // specific drawgfx implementations for each transparency type
trunk/src/emu/delegate.h
r29404r29405
9393
9494// select which one we will be using
9595#if defined(__GNUC__)
96   /* does not work in versions over 4.7.x of 32bit MINGW  */   
96   /* does not work in versions over 4.7.x of 32bit MINGW  */
9797   #if ((defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
9898      #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
9999   #elif defined(SDLMAME_EMSCRIPTEN)
100100      #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
101   #else
101   #else
102102      #define USE_DELEGATE_TYPE DELEGATE_TYPE_INTERNAL
103   #endif   
103   #endif
104104#else
105105#define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
106106#endif
r29404r29405
459459      return reinterpret_cast<delegate_generic_function>(funcptr);
460460   }
461461
462   
462
463463   struct raw_mfp_data
464464   {
465465#if defined (__INTEL_COMPILER) && defined (PTR64) // needed for "Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.176 Build 20140130" at least
trunk/src/emu/cpu/g65816/g65816.h
r29404r29405
6666{
6767public:
6868   _5a22_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
69   
69
7070   DECLARE_WRITE8_MEMBER( wrmpya_w );
7171   DECLARE_WRITE8_MEMBER( wrmpyb_w );
7272   DECLARE_WRITE8_MEMBER( wrdivl_w );
r29404r29405
7777   DECLARE_READ8_MEMBER( rddivh_r );
7878   DECLARE_READ8_MEMBER( rdmpyl_r );
7979   DECLARE_READ8_MEMBER( rdmpyh_r );
80   
80
8181   void set_5a22_map();
8282};
8383
trunk/src/emu/cpu/z180/z180.c
r29404r29405
26002600         break;
26012601   }
26022602}
2603
trunk/src/emu/cpu/z180/z180tbl.h
r29404r29405
228228EXEC_PROTOTYPE(ed)
229229EXEC_PROTOTYPE(fd)
230230EXEC_PROTOTYPE(xycb)
231
trunk/src/emu/cpu/cosmac/cosmac.h
r29404r29405
374374   const address_space_config      m_io_config;
375375
376376   // device callbacks
377   devcb2_read_line      m_read_wait;
378   devcb2_read_line      m_read_clear;
379   devcb2_read_line      m_read_ef1;
380   devcb2_read_line      m_read_ef2;
381   devcb2_read_line      m_read_ef3;
382   devcb2_read_line      m_read_ef4;
377   devcb2_read_line        m_read_wait;
378   devcb2_read_line        m_read_clear;
379   devcb2_read_line        m_read_ef1;
380   devcb2_read_line        m_read_ef2;
381   devcb2_read_line        m_read_ef3;
382   devcb2_read_line        m_read_ef4;
383383   devcb2_write_line       m_write_q;
384   devcb2_read8         m_read_dma;
385   devcb2_write8         m_write_dma;
386   devcb2_write8         m_write_sc;
384   devcb2_read8            m_read_dma;
385   devcb2_write8           m_write_dma;
386   devcb2_write8           m_write_sc;
387387
388388   // control modes
389389   enum cosmac_mode
trunk/src/emu/cpu/cubeqcpu/cubeqcpu.h
r29404r29405
357357   UINT32  m_clkcnt;
358358
359359   /* RAM */
360   UINT16  m_sram[4096];      /* Shared with rotate CPU */
361   UINT8   m_ptr_ram[1024];   /* Pointer RAM */
362   UINT32  m_e_stack[32768];   /* Stack DRAM: 32kx20 */
363   UINT32  m_o_stack[32768];   /* Stack DRAM: 32kx20 */
360   UINT16  m_sram[4096];       /* Shared with rotate CPU */
361   UINT8   m_ptr_ram[1024];    /* Pointer RAM */
362   UINT32  m_e_stack[32768];   /* Stack DRAM: 32kx20 */
363   UINT32  m_o_stack[32768];   /* Stack DRAM: 32kx20 */
364364
365365   address_space *m_program;
366366   direct_read_data *m_direct;
trunk/src/emu/cpu/avr8/avr8.c
r29404r29405
633633      m_data_config("data", ENDIANNESS_LITTLE, 8, 16, 0, internal_map),
634634      m_io_config("io", ENDIANNESS_LITTLE, 8, 4),
635635      m_eeprom(NULL),
636    m_cpu_type(cpu_type),
637    m_lfuses(0x62),
638    m_hfuses(0x99),
639    m_efuses(0xFF),
640    m_lock_bits(0xFF),
636   m_cpu_type(cpu_type),
637   m_lfuses(0x62),
638   m_hfuses(0x99),
639   m_efuses(0xFF),
640   m_lock_bits(0xFF),
641641      m_pc(0),
642642      m_spi_active(false),
643643      m_spi_prescale(0),
r29404r29405
649649{
650650   // Allocate & setup
651651
652  for (int t=0; t<=5; t++){
652   for (int t=0; t<=5; t++){
653653      m_timer_top[t] = 0;
654654      m_timer_increment[t] = 1;
655655      m_timer_prescale[t] = 0;
656656      m_timer_prescale_count[t] = 0;
657  }
657   }
658658}
659659
660660
r29404r29405
675675
676676void avr8_device::set_low_fuses(const UINT8 byte)
677677{
678  m_lfuses = byte;
678   m_lfuses = byte;
679679}
680680
681681//-------------------------------------------------
r29404r29405
684684
685685void avr8_device::set_high_fuses(const UINT8 byte)
686686{
687  m_hfuses = byte;
687   m_hfuses = byte;
688688}
689689
690690//-------------------------------------------------
r29404r29405
693693
694694void avr8_device::set_extended_fuses(const UINT8 byte)
695695{
696  m_efuses = byte;
696   m_efuses = byte;
697697}
698698
699699//-------------------------------------------------
r29404r29405
702702
703703void avr8_device::set_lock_bits(const UINT8 byte)
704704{
705  m_lock_bits = byte;
705   m_lock_bits = byte;
706706}
707707
708708//-------------------------------------------------
r29404r29405
841841
842842void avr8_device::device_reset()
843843{
844  logerror("AVR low fuse bits: 0x%02X\n", m_lfuses);
845  logerror("AVR high fuse bits: 0x%02X\n", m_hfuses);
846  logerror("AVR extended fuse bits: 0x%02X\n", m_efuses);
847  logerror("AVR lock bits: 0x%02X\n", m_lock_bits);
844   logerror("AVR low fuse bits: 0x%02X\n", m_lfuses);
845   logerror("AVR high fuse bits: 0x%02X\n", m_hfuses);
846   logerror("AVR extended fuse bits: 0x%02X\n", m_efuses);
847   logerror("AVR lock bits: 0x%02X\n", m_lock_bits);
848848
849  switch ((m_hfuses & (BOOTSZ1|BOOTSZ0)) >> 1){
850    case 0: m_boot_size = 4096; break;
851    case 1: m_boot_size = 2048; break;
852    case 2: m_boot_size = 1024; break;
853    case 3: m_boot_size = 512; break;
854    default: break;
855  }
849   switch ((m_hfuses & (BOOTSZ1|BOOTSZ0)) >> 1){
850   case 0: m_boot_size = 4096; break;
851   case 1: m_boot_size = 2048; break;
852   case 2: m_boot_size = 1024; break;
853   case 3: m_boot_size = 512; break;
854   default: break;
855   }
856856
857  if (m_hfuses & BOOTRST){
858    m_shifted_pc = 0x0000;
859    logerror("Booting AVR core from address 0x0000\n");
860  } else {
861    m_shifted_pc = (m_addr_mask + 1) - 2*m_boot_size;
862    logerror("AVR Boot loader section size: %d words\n", m_boot_size);
863  }
857   if (m_hfuses & BOOTRST){
858   m_shifted_pc = 0x0000;
859   logerror("Booting AVR core from address 0x0000\n");
860   } else {
861   m_shifted_pc = (m_addr_mask + 1) - 2*m_boot_size;
862   logerror("AVR Boot loader section size: %d words\n", m_boot_size);
863   }
864864
865865   for (int i = 0; i < 0x200; i++)
866866   {
r29404r29405
871871   m_spi_prescale = 0;
872872   m_spi_prescale_count = 0;
873873
874  for (int t=0; t<=5; t++){
874   for (int t=0; t<=5; t++){
875875      m_timer_top[t] = 0;
876876      m_timer_increment[t] = 1;
877877      m_timer_prescale[t] = 0;
878878      m_timer_prescale_count[t] = 0;
879  }
879   }
880880
881881   m_interrupt_pending = false;
882882   m_elapsed_cycles = 0;
r29404r29405
11361136         }
11371137      }
11381138
1139    for (int t=0; t<=5; t++){
1140        if (m_timer_prescale[t] != 0)
1141        {
1142           m_timer_prescale_count[t]++;
1143           if (m_timer_prescale_count[t] >= m_timer_prescale[t])
1144           {
1145          switch (t){
1146            case 0: timer0_tick(); break;
1147            case 1: timer1_tick(); break;
1148            case 2: timer2_tick(); break;
1149            case 3: timer3_tick(); break;
1150            case 4: timer4_tick(); break;
1151            case 5: timer5_tick(); break;
1152          }
1153              m_timer_prescale_count[t] -= m_timer_prescale[t];
1154           }
1155        }
1156    }
1139   for (int t=0; t<=5; t++){
1140         if (m_timer_prescale[t] != 0)
1141         {
1142            m_timer_prescale_count[t]++;
1143            if (m_timer_prescale_count[t] >= m_timer_prescale[t])
1144            {
1145         switch (t){
1146         case 0: timer0_tick(); break;
1147         case 1: timer1_tick(); break;
1148         case 2: timer2_tick(); break;
1149         case 3: timer3_tick(); break;
1150         case 4: timer4_tick(); break;
1151         case 5: timer5_tick(); break;
1152         }
1153               m_timer_prescale_count[t] -= m_timer_prescale[t];
1154            }
1155         }
1156   }
11571157
11581158   }
11591159}
11601160
1161//   UINT8 ocr0[2] = { m_r[AVR8_REGIDX_OCR0A], m_r[AVR8_REGIDX_OCR0B] };
1162//TODO   UINT8 ocf0[2] = { (1 << AVR8_TIFR0_OCF0A_SHIFT), (1 << AVR8_TIFR4_OCF0B_SHIFT) };
1163//TODO   UINT8 int0[2] = { AVR8_INTIDX_OCF0A, AVR8_INTIDX_OCF0B };
1161//  UINT8 ocr0[2] = { m_r[AVR8_REGIDX_OCR0A], m_r[AVR8_REGIDX_OCR0B] };
1162//TODO  UINT8 ocf0[2] = { (1 << AVR8_TIFR0_OCF0A_SHIFT), (1 << AVR8_TIFR4_OCF0B_SHIFT) };
1163//TODO  UINT8 int0[2] = { AVR8_INTIDX_OCF0A, AVR8_INTIDX_OCF0B };
11641164
11651165#define LOG_TIMER_0 0
11661166#define LOG_TIMER_5 1
r29404r29405
11681168void avr8_device::timer0_tick()
11691169{
11701170#if LOG_TIMER_0
1171  printf("AVR8_WGM0: %d\n", AVR8_WGM0);
1172  printf("AVR8_TCCR0A_COM0B: %d\n", AVR8_TCCR0A_COM0B);
1171   printf("AVR8_WGM0: %d\n", AVR8_WGM0);
1172   printf("AVR8_TCCR0A_COM0B: %d\n", AVR8_TCCR0A_COM0B);
11731173#endif
11741174
11751175   UINT8 count = m_r[AVR8_REGIDX_TCNT0];
r29404r29405
11781178   switch(AVR8_WGM0)
11791179   {
11801180      case WGM02_NORMAL:
1181      printf("WGM02_NORMAL: Unimplemented timer#0 waveform generation mode\n");
1182      break;
1181      printf("WGM02_NORMAL: Unimplemented timer#0 waveform generation mode\n");
1182      break;
11831183
11841184      case WGM02_PWM_PC:
1185      printf("WGM02_PWM_PC: Unimplemented timer#0 waveform generation mode\n");
1186      break;
1185      printf("WGM02_PWM_PC: Unimplemented timer#0 waveform generation mode\n");
1186      break;
11871187
11881188      case WGM02_CTC_CMP:
1189      switch(AVR8_TCCR0A_COM0B){
1190        case 0: /* Normal Operation */
1191          if (count == m_timer_top[0]){
1192            m_timer_top[0] = 0;
1193          }
1194          break;
1195        case 1: /* Toggle OC0B on compare match */
1196          if (count == m_timer_top[0]){
1197            m_timer_top[0] = 0;
1189      switch(AVR8_TCCR0A_COM0B){
1190      case 0: /* Normal Operation */
1191         if (count == m_timer_top[0]){
1192         m_timer_top[0] = 0;
1193         }
1194         break;
1195      case 1: /* Toggle OC0B on compare match */
1196         if (count == m_timer_top[0]){
1197         m_timer_top[0] = 0;
11981198#if LOG_TIMER_0
1199            printf("[0] Toggle OC0B\n");
1199         printf("[0] Toggle OC0B\n");
12001200#endif
1201            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) ^ (1 << 5));
1202          }
1203          break;
1204        case 2: /* Clear OC0B on compare match */
1205          if (count == m_timer_top[0]){
1206            m_timer_top[0] = 0;
1207            //Clear OC0B
1201         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) ^ (1 << 5));
1202         }
1203         break;
1204      case 2: /* Clear OC0B on compare match */
1205         if (count == m_timer_top[0]){
1206         m_timer_top[0] = 0;
1207         //Clear OC0B
12081208#if LOG_TIMER_0
1209            printf("[0] Clear OC0B\n");
1209         printf("[0] Clear OC0B\n");
12101210#endif
1211            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) & ~(1 << 5));
1212          }           
1213          break;
1214        case 3: /* Set OC0B on compare match */
1215          if (count == m_timer_top[0]){
1216            m_timer_top[0] = 0;
1211         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) & ~(1 << 5));
1212         }
1213         break;
1214      case 3: /* Set OC0B on compare match */
1215         if (count == m_timer_top[0]){
1216         m_timer_top[0] = 0;
12171217#if LOG_TIMER_0
1218            printf("[0] Set OC0B\n");
1218         printf("[0] Set OC0B\n");
12191219#endif
1220            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) | (1 << 5));
1221          }           
1222          break;
1223      }
1224      break;
1220         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) | (1 << 5));
1221         }
1222         break;
1223      }
1224      break;
12251225
12261226      case WGM02_FAST_PWM:
1227      printf("WGM02_FAST_PWM: Unimplemented timer#0 waveform generation mode\n");
1228      break;
1227      printf("WGM02_FAST_PWM: Unimplemented timer#0 waveform generation mode\n");
1228      break;
12291229
12301230      case WGM02_PWM_PC_CMP:
1231      printf("WGM02_PWM_PC_CMP: Unimplemented timer#0 waveform generation mode\n");
1232      break;
1231      printf("WGM02_PWM_PC_CMP: Unimplemented timer#0 waveform generation mode\n");
1232      break;
12331233
12341234      case WGM02_FAST_PWM_CMP:
1235      printf("WGM02_FAST_PWM_CMP: Unimplemented timer#0 waveform generation mode\n");
1236      break;
1235      printf("WGM02_FAST_PWM_CMP: Unimplemented timer#0 waveform generation mode\n");
1236      break;
12371237
12381238      default:
12391239         verboselog(m_pc, 0, "update_timer0_compare_mode: Unknown waveform generation mode: %02x\n", AVR8_WGM0);
12401240         break;
12411241   }
12421242
1243  count = count & 0xff;
1243   count = count & 0xff;
12441244
12451245   count += increment;
12461246   m_r[AVR8_REGIDX_TCNT0] = count & 0xff;
r29404r29405
12681268
12691269void avr8_device::changed_tccr0b(UINT8 data)
12701270{
1271  if (VERBOSE_LEVEL) printf("changed_tccr0b: data=0x%02X\n", data);
1271   if (VERBOSE_LEVEL) printf("changed_tccr0b: data=0x%02X\n", data);
12721272
12731273   UINT8 oldtccr = AVR8_TCCR0B;
12741274   UINT8 newtccr = data;
r29404r29405
14151415
14161416void avr8_device::update_timer_waveform_gen_mode(UINT8 t, UINT8 mode)
14171417{
1418  INT32 oc_val = -1, ic_val = -1;
1418   INT32 oc_val = -1, ic_val = -1;
14191419
1420  switch (t){
1421    case 0:
1422      oc_val = AVR8_OCR0A;
1423      ic_val = -1;
1424      break;
1425    case 1:
1426      oc_val = AVR8_OCR1A;
1427      ic_val = AVR8_ICR1;
1428      break;
1429    case 2:
1430      oc_val = AVR8_OCR2A;
1431      ic_val = -1;
1432      break;
1433    case 3:
1434      oc_val = AVR8_OCR3A;
1435      ic_val = AVR8_ICR3;
1436      break;
1437    case 4:
1438      oc_val = AVR8_OCR4A;
1439      ic_val = AVR8_ICR4;
1440      break;
1441    case 5:
1442      oc_val = AVR8_OCR5A;
1443      ic_val = AVR8_ICR5;
1444      break;
1445  }
1420   switch (t){
1421   case 0:
1422      oc_val = AVR8_OCR0A;
1423      ic_val = -1;
1424      break;
1425   case 1:
1426      oc_val = AVR8_OCR1A;
1427      ic_val = AVR8_ICR1;
1428      break;
1429   case 2:
1430      oc_val = AVR8_OCR2A;
1431      ic_val = -1;
1432      break;
1433   case 3:
1434      oc_val = AVR8_OCR3A;
1435      ic_val = AVR8_ICR3;
1436      break;
1437   case 4:
1438      oc_val = AVR8_OCR4A;
1439      ic_val = AVR8_ICR4;
1440      break;
1441   case 5:
1442      oc_val = AVR8_OCR5A;
1443      ic_val = AVR8_ICR5;
1444      break;
1445   }
14461446
1447  INT32 top_values_02[8] = {0xFF, 0xFF, oc_val, 0xFF, -1, oc_val, -1, oc_val}; //table 20-8
1447   INT32 top_values_02[8] = {0xFF, 0xFF, oc_val, 0xFF, -1, oc_val, -1, oc_val}; //table 20-8
14481448
1449  INT32 top_values_1345[16] = {0xFFFF, 0x00FF, 0x01FF, 0x03FF,
1450                            oc_val, 0x00FF, 0x01FF, 0x03FF,
1451                            ic_val, oc_val, ic_val, oc_val,
1452                            ic_val, -1,     ic_val, oc_val}; //table 17-2
1449   INT32 top_values_1345[16] = {0xFFFF, 0x00FF, 0x01FF, 0x03FF,
1450                     oc_val, 0x00FF, 0x01FF, 0x03FF,
1451                     ic_val, oc_val, ic_val, oc_val,
1452                     ic_val, -1,     ic_val, oc_val}; //table 17-2
14531453
1454  switch(t){
1455    case 0:
1456    case 2:
1457       m_timer_top[t] = top_values_02[mode];
1458      break;
1459    case 1:
1460    case 3:
1461    case 4:
1462    case 5:
1463       m_timer_top[t] = top_values_1345[mode];
1464      break;
1465  }
1454   switch(t){
1455   case 0:
1456   case 2:
1457      m_timer_top[t] = top_values_02[mode];
1458      break;
1459   case 1:
1460   case 3:
1461   case 4:
1462   case 5:
1463      m_timer_top[t] = top_values_1345[mode];
1464      break;
1465   }
14661466
1467  if (m_timer_top[t] == -1){
1468    m_timer_top[t] = 0;
1467   if (m_timer_top[t] == -1){
1468   m_timer_top[t] = 0;
14691469      printf("update_timer_waveform_gen_mode: Timer #%d - Unsupported waveform generation type: %d\n", t, mode);
14701470   }
14711471}
r29404r29405
14971497
14981498void avr8_device::changed_tccr1b(UINT8 data)
14991499{
1500  if (VERBOSE_LEVEL) printf("changed_tccr1b: data=0x%02X\n", data);
1500   if (VERBOSE_LEVEL) printf("changed_tccr1b: data=0x%02X\n", data);
15011501
15021502   UINT8 oldtccr = AVR8_TCCR1B;
15031503   UINT8 newtccr = data;
r29404r29405
16511651
16521652void avr8_device::changed_tccr2b(UINT8 data)
16531653{
1654  if (VERBOSE_LEVEL) printf("changed_tccr2b: data=0x%02X\n", data);
1654   if (VERBOSE_LEVEL) printf("changed_tccr2b: data=0x%02X\n", data);
16551655
16561656   UINT8 oldtccr = AVR8_TCCR2B;
16571657   UINT8 newtccr = data;
r29404r29405
17111711                        //(m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1B_MASK) >> AVR8_TCCR1A_COM1B_SHIFT };
17121712   UINT16 ocr4[2] = { (m_r[AVR8_REGIDX_OCR4AH] << 8) | m_r[AVR8_REGIDX_OCR4AL],
17131713                  (m_r[AVR8_REGIDX_OCR4BH] << 8) | m_r[AVR8_REGIDX_OCR4BL] };
1714//TODO   UINT8 ocf4[2] = { (1 << AVR8_TIFR4_OCF4A_SHIFT), (1 << AVR8_TIFR4_OCF4B_SHIFT) };
1715//TODO   UINT8 int4[2] = { AVR8_INTIDX_OCF4A, AVR8_INTIDX_OCF4B };
1714//TODO  UINT8 ocf4[2] = { (1 << AVR8_TIFR4_OCF4A_SHIFT), (1 << AVR8_TIFR4_OCF4B_SHIFT) };
1715//TODO  UINT8 int4[2] = { AVR8_INTIDX_OCF4A, AVR8_INTIDX_OCF4B };
17161716   INT32 increment = m_timer_increment[4];
17171717
17181718   switch(AVR8_WGM4)
r29404r29405
17201720      case WGM4_FAST_PWM_8:
17211721      case WGM4_FAST_PWM_9:
17221722      case WGM4_FAST_PWM_10:
1723      switch(AVR8_TCCR4A_COM4B){
1724        case 0: /* Normal Operation */
1725          break;
1726        case 1: /* TODO */
1727          break;
1728        case 2: /* Non-inverting mode */
1729          if (count == m_timer_top[4]){
1730            //Clear OC0B
1731            printf("[2] Clear OC0B\n");
1732            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) & ~(1 << 5));
1733          } else if (count == 0){
1734            //Set OC0B
1735            printf("[2] Set OC0B\n");
1736            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) | (1 << 5));
1737          }           
1738          break;
1739        case 3: /* Inverting mode */
1740          if (count == m_timer_top[4]){
1741            //Set OC0B
1742            printf("[3] Set OC0B\n");
1743            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) | (1 << 5));
1744          } else if (count == 0){
1745            //Clear OC0B
1746            printf("[3] Clear OC0B\n");
1747            m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) & ~(1 << 5));
1748          }           
1749          break;
1750      }
1751      break;
1723      switch(AVR8_TCCR4A_COM4B){
1724      case 0: /* Normal Operation */
1725         break;
1726      case 1: /* TODO */
1727         break;
1728      case 2: /* Non-inverting mode */
1729         if (count == m_timer_top[4]){
1730         //Clear OC0B
1731         printf("[2] Clear OC0B\n");
1732         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) & ~(1 << 5));
1733         } else if (count == 0){
1734         //Set OC0B
1735         printf("[2] Set OC0B\n");
1736         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) | (1 << 5));
1737         }
1738         break;
1739      case 3: /* Inverting mode */
1740         if (count == m_timer_top[4]){
1741         //Set OC0B
1742         printf("[3] Set OC0B\n");
1743         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) | (1 << 5));
1744         } else if (count == 0){
1745         //Clear OC0B
1746         printf("[3] Clear OC0B\n");
1747         m_io->write_byte(AVR8_IO_PORTG, m_io->read_byte(AVR8_IO_PORTG) & ~(1 << 5));
1748         }
1749         break;
1750      }
1751      break;
17521752
17531753      case WGM4_CTC_OCR:
1754      //printf("[T4] tick WGM4_CTC_OCR: %d\n", count);
1754      //printf("[T4] tick WGM4_CTC_OCR: %d\n", count);
17551755         if (count == 0xffff)
17561756         {
17571757            m_r[AVR8_REGIDX_TIFR4] |= AVR8_TIFR4_TOV4_MASK;
r29404r29405
17851785
17861786void avr8_device::update_timer_clock_source(UINT8 t, UINT8 clock_select)
17871787{
1788  int prescale_values[8] = {0, 1, 8, 64, 256, 1024, -1, -1};
1788   int prescale_values[8] = {0, 1, 8, 64, 256, 1024, -1, -1};
17891789   m_timer_prescale[t] = prescale_values[clock_select];
17901790
1791  if (VERBOSE_LEVEL) printf("update_timer_clock_source: t=%d cs=%d\n", t, clock_select);
1791   if (VERBOSE_LEVEL) printf("update_timer_clock_source: t=%d cs=%d\n", t, clock_select);
17921792
1793  if (m_timer_prescale[t] == 0xFFFF){
1794    printf("[Timer #%d]: update_timer_clock_source: External trigger mode not implemented yet\n", t);
1795    m_timer_prescale[t] = 0;
1796  }
1793   if (m_timer_prescale[t] == 0xFFFF){
1794   printf("[Timer #%d]: update_timer_clock_source: External trigger mode not implemented yet\n", t);
1795   m_timer_prescale[t] = 0;
1796   }
17971797
17981798   if (m_timer_prescale_count[t] > m_timer_prescale[t])
17991799      m_timer_prescale_count[t] = m_timer_prescale[t] - 1;
r29404r29405
18011801
18021802void avr8_device::changed_tccr3a(UINT8 data)
18031803{
1804  //TODO: Implement-me
1805//   AVR8_TCCR3A = data;
1804   //TODO: Implement-me
1805//  AVR8_TCCR3A = data;
18061806}
18071807
18081808void avr8_device::changed_tccr3b(UINT8 data)
18091809{
1810  printf("IMPLEMENT-ME: changed_tccr4b: data=0x%02X\n", data);
1810   printf("IMPLEMENT-ME: changed_tccr4b: data=0x%02X\n", data);
18111811}
18121812
18131813void avr8_device::changed_tccr3c(UINT8 data)
18141814{
1815//   UINT8 oldtccr = AVR8_TCCR3C;
1816//   UINT8 newtccr = data;
1817//   UINT8 changed = newtccr ^ oldtccr;
1818  printf("IMPLEMENT-ME: changed_tccr3c: data=0x%02X\n", data);
1815//  UINT8 oldtccr = AVR8_TCCR3C;
1816//  UINT8 newtccr = data;
1817//  UINT8 changed = newtccr ^ oldtccr;
1818   printf("IMPLEMENT-ME: changed_tccr3c: data=0x%02X\n", data);
18191819
1820//   AVR8_TCCR3C = data;
1820//  AVR8_TCCR3C = data;
18211821
1822  //TODO: Implement-me
1822   //TODO: Implement-me
18231823}
18241824
18251825void avr8_device::changed_tccr4a(UINT8 data)
r29404r29405
18381838
18391839void avr8_device::changed_tccr4b(UINT8 data)
18401840{
1841  printf("changed_tccr4b: data=0x%02X\n", data);
1841   printf("changed_tccr4b: data=0x%02X\n", data);
18421842
18431843   UINT8 oldtccr = AVR8_TCCR4B;
18441844   UINT8 newtccr = data;
r29404r29405
18491849   if(changed & AVR8_TCCR4B_FOC4A_MASK)
18501850   {
18511851      // TODO
1852//      timer4_force_output_compare(AVR8_REG_A);
1852//      timer4_force_output_compare(AVR8_REG_A);
18531853   }
18541854
18551855   if(changed & AVR8_TCCR4B_FOC4B_MASK)
18561856   {
18571857      // TODO
1858//      timer4_force_output_compare(AVR8_REG_B);
1858//      timer4_force_output_compare(AVR8_REG_B);
18591859   }
18601860
18611861   if(changed & AVR8_TCCR4B_WGM4_32_MASK)
r29404r29405
18711871
18721872void avr8_device::changed_tccr4c(UINT8 data)
18731873{
1874//   UINT8 oldtccr = AVR8_TCCR4C;
1875//   UINT8 newtccr = data;
1876//   UINT8 changed = newtccr ^ oldtccr;
1874//  UINT8 oldtccr = AVR8_TCCR4C;
1875//  UINT8 newtccr = data;
1876//  UINT8 changed = newtccr ^ oldtccr;
18771877
18781878   AVR8_TCCR4C = data;
18791879
1880  //TODO: Implement-me
1880   //TODO: Implement-me
18811881}
18821882
18831883/************************************************************************************************/
r29404r29405
18861886void avr8_device::timer5_tick()
18871887{
18881888#if LOG_TIMER_5
1889  printf("AVR8_WGM5: %d\n", AVR8_WGM5);
1890  printf("AVR8_TCCR5A_COM5B: %d\n", AVR8_TCCR5A_COM5B);
1889   printf("AVR8_WGM5: %d\n", AVR8_WGM5);
1890   printf("AVR8_TCCR5A_COM5B: %d\n", AVR8_TCCR5A_COM5B);
18911891#endif
18921892
18931893   UINT16 count = (AVR8_TCNT5H << 8) + AVR8_TCNT5L;
r29404r29405
18961896   switch(AVR8_WGM5)
18971897   {
18981898      case WGM5_NORMAL:
1899    case WGM5_PWM_8_PC:
1900    case WGM5_PWM_9_PC:
1901    case WGM5_PWM_10_PC:
1899   case WGM5_PWM_8_PC:
1900   case WGM5_PWM_9_PC:
1901   case WGM5_PWM_10_PC:
19021902//    case WGM5_CTC_OCR:
1903    case WGM5_FAST_PWM_8:
1904    case WGM5_FAST_PWM_9:
1905    case WGM5_FAST_PWM_10:
1906    case WGM5_PWM_PFC_ICR:
1907    case WGM5_PWM_PFC_OCR:
1908    case WGM5_PWM_PC_ICR:
1909    case WGM5_PWM_PC_OCR:
1910    case WGM5_CTC_ICR:
1911    case WGM5_FAST_PWM_ICR:
1912    case WGM5_FAST_PWM_OCR:
1913      printf("Unimplemented timer#5 waveform generation mode: WGMM5=0x%02X\n", AVR8_WGM5);
1914      break;
1903   case WGM5_FAST_PWM_8:
1904   case WGM5_FAST_PWM_9:
1905   case WGM5_FAST_PWM_10:
1906   case WGM5_PWM_PFC_ICR:
1907   case WGM5_PWM_PFC_OCR:
1908   case WGM5_PWM_PC_ICR:
1909   case WGM5_PWM_PC_OCR:
1910   case WGM5_CTC_ICR:
1911   case WGM5_FAST_PWM_ICR:
1912   case WGM5_FAST_PWM_OCR:
1913      printf("Unimplemented timer#5 waveform generation mode: WGMM5=0x%02X\n", AVR8_WGM5);
1914      break;
19151915
19161916      case WGM5_CTC_OCR:
1917      //TODO: verify this! Can be very wrong!!!
1918      switch(AVR8_TCCR5A_COM5B){
1919        case 0: /* Normal Operation */
1920          if (count == m_timer_top[5]){
1921            m_timer_top[5] = 0;
1922          }
1923          break;
1924        case 1: /* Toggle OC5B on compare match */
1925          if (count == m_timer_top[5]){
1926            m_timer_top[5] = 0;
1917      //TODO: verify this! Can be very wrong!!!
1918      switch(AVR8_TCCR5A_COM5B){
1919      case 0: /* Normal Operation */
1920         if (count == m_timer_top[5]){
1921         m_timer_top[5] = 0;
1922         }
1923         break;
1924      case 1: /* Toggle OC5B on compare match */
1925         if (count == m_timer_top[5]){
1926         m_timer_top[5] = 0;
19271927#if LOG_TIMER_5
1928            printf("[5] Toggle OC5B\n");
1928         printf("[5] Toggle OC5B\n");
19291929#endif
1930            m_io->write_byte(AVR8_IO_PORTL, m_io->read_byte(AVR8_IO_PORTL) ^ (1 << 4));
1931          }           
1932          break;
1933        case 2: /* Clear OC5B on compare match */
1934          if (count == m_timer_top[5]){
1935            m_timer_top[5] = 0;
1936            //Clear OC5B
1930         m_io->write_byte(AVR8_IO_PORTL, m_io->read_byte(AVR8_IO_PORTL) ^ (1 << 4));
1931         }
1932         break;
1933      case 2: /* Clear OC5B on compare match */
1934         if (count == m_timer_top[5]){
1935         m_timer_top[5] = 0;
1936         //Clear OC5B
19371937#if LOG_TIMER_5
1938            printf("[5] Clear OC5B\n");
1938         printf("[5] Clear OC5B\n");
19391939#endif
1940            m_io->write_byte(AVR8_IO_PORTL, m_io->read_byte(AVR8_IO_PORTL) & ~(1 << 4));
1941          }           
1942          break;
1943        case 3: /* Set OC5B on compare match */
1944          if (count == m_timer_top[5]){
1945            m_timer_top[5] = 0;
1940         m_io->write_byte(AVR8_IO_PORTL, m_io->read_byte(AVR8_IO_PORTL) & ~(1 << 4));
1941         }
1942         break;
1943      case 3: /* Set OC5B on compare match */
1944         if (count == m_timer_top[5]){
1945         m_timer_top[5] = 0;
19461946#if LOG_TIMER_5
1947            printf("[5] Set OC5B\n");
1947         printf("[5] Set OC5B\n");
19481948#endif
1949            m_io->write_byte(AVR8_IO_PORTL, m_io->read_byte(AVR8_IO_PORTL) | (1 << 4));
1950          }           
1951          break;
1952      }
1953      break;
1949         m_io->write_byte(AVR8_IO_PORTL, m_io->read_byte(AVR8_IO_PORTL) | (1 << 4));
1950         }
1951         break;
1952      }
1953      break;
19541954
19551955      default:
1956        printf("Timer #5: Unknown waveform generation mode: %02x\n", AVR8_WGM5);
1956         printf("Timer #5: Unknown waveform generation mode: %02x\n", AVR8_WGM5);
19571957         break;
19581958   }
19591959
r29404r29405
19781978
19791979void avr8_device::changed_tccr5b(UINT8 data)
19801980{
1981  printf("changed_tccr5b: data=0x%02X\n", data);
1981   printf("changed_tccr5b: data=0x%02X\n", data);
19821982
19831983   UINT8 oldtccr = AVR8_TCCR5B;
19841984   UINT8 newtccr = data;
r29404r29405
19891989   if(changed & AVR8_TCCR5C_FOC5A_MASK)
19901990   {
19911991      // TODO
1992//      timer5_force_output_compare(AVR8_REG_A);
1992//      timer5_force_output_compare(AVR8_REG_A);
19931993   }
19941994
19951995   if(changed & AVR8_TCCR5C_FOC5B_MASK)
19961996   {
19971997      // TODO
1998//      timer5_force_output_compare(AVR8_REG_B);
1998//      timer5_force_output_compare(AVR8_REG_B);
19991999   }
20002000
20012001   if(changed & AVR8_TCCR5C_FOC5C_MASK)
20022002   {
20032003      // TODO
2004//      timer5_force_output_compare(AVR8_REG_C);
2004//      timer5_force_output_compare(AVR8_REG_C);
20052005   }
20062006
20072007   if(changed & AVR8_TCCR5B_WGM5_32_MASK)
r29404r29405
21602160         break;
21612161
21622162      case AVR8_REGIDX_PORTA:
2163      m_io->write_byte(AVR8_IO_PORTA, data);
2164      m_r[AVR8_REGIDX_PORTA] = data;
2165      break;
2163      m_io->write_byte(AVR8_IO_PORTA, data);
2164      m_r[AVR8_REGIDX_PORTA] = data;
2165      break;
21662166
21672167      case AVR8_REGIDX_PORTB:
2168      m_io->write_byte(AVR8_IO_PORTB, data);
2169      m_r[AVR8_REGIDX_PORTB] = data;
2170      break;
2168      m_io->write_byte(AVR8_IO_PORTB, data);
2169      m_r[AVR8_REGIDX_PORTB] = data;
2170      break;
21712171
21722172      case AVR8_REGIDX_PORTC:
2173      m_io->write_byte(AVR8_IO_PORTC, data);
2174      m_r[AVR8_REGIDX_PORTC] = data;
2175      break;
2173      m_io->write_byte(AVR8_IO_PORTC, data);
2174      m_r[AVR8_REGIDX_PORTC] = data;
2175      break;
21762176
21772177      case AVR8_REGIDX_PORTD:
2178      m_io->write_byte(AVR8_IO_PORTD, data);
2179      m_r[AVR8_REGIDX_PORTD] = data;
2180      break;
2178      m_io->write_byte(AVR8_IO_PORTD, data);
2179      m_r[AVR8_REGIDX_PORTD] = data;
2180      break;
21812181
21822182      case AVR8_REGIDX_PORTE:
2183      m_io->write_byte(AVR8_IO_PORTE, data);
2184      m_r[AVR8_REGIDX_PORTE] = data;
2185      break;
2183      m_io->write_byte(AVR8_IO_PORTE, data);
2184      m_r[AVR8_REGIDX_PORTE] = data;
2185      break;
21862186
21872187      case AVR8_REGIDX_PORTF:
2188      m_io->write_byte(AVR8_IO_PORTF, data);
2189      m_r[AVR8_REGIDX_PORTF] = data;
2190      break;
2188      m_io->write_byte(AVR8_IO_PORTF, data);
2189      m_r[AVR8_REGIDX_PORTF] = data;
2190      break;
21912191
21922192      case AVR8_REGIDX_PORTG:
2193      m_io->write_byte(AVR8_IO_PORTG, data);
2194      m_r[AVR8_REGIDX_PORTG] = data;
2195      break;
2193      m_io->write_byte(AVR8_IO_PORTG, data);
2194      m_r[AVR8_REGIDX_PORTG] = data;
2195      break;
21962196
21972197      case AVR8_REGIDX_PORTH:
2198      m_io->write_byte(AVR8_IO_PORTH, data);
2199      m_r[AVR8_REGIDX_PORTH] = data;
2200      break;
2198      m_io->write_byte(AVR8_IO_PORTH, data);
2199      m_r[AVR8_REGIDX_PORTH] = data;
2200      break;
22012201
22022202      case AVR8_REGIDX_PORTJ:
2203      m_io->write_byte(AVR8_IO_PORTJ, data);
2204      m_r[AVR8_REGIDX_PORTJ] = data;
2205      break;
2203      m_io->write_byte(AVR8_IO_PORTJ, data);
2204      m_r[AVR8_REGIDX_PORTJ] = data;
2205      break;
22062206
22072207      case AVR8_REGIDX_PORTK:
2208      m_io->write_byte(AVR8_IO_PORTK, data);
2209      m_r[AVR8_REGIDX_PORTK] = data;
2210      break;
2208      m_io->write_byte(AVR8_IO_PORTK, data);
2209      m_r[AVR8_REGIDX_PORTK] = data;
2210      break;
22112211
22122212      case AVR8_REGIDX_PORTL:
2213      m_io->write_byte(AVR8_IO_PORTL, data);
2214      m_r[AVR8_REGIDX_PORTL] = data;
2215      break;
2213      m_io->write_byte(AVR8_IO_PORTL, data);
2214      m_r[AVR8_REGIDX_PORTL] = data;
2215      break;
22162216
22172217      case AVR8_REGIDX_DDRA:
22182218      case AVR8_REGIDX_DDRB:
22192219      case AVR8_REGIDX_DDRC:
22202220      case AVR8_REGIDX_DDRD:
22212221      case AVR8_REGIDX_SREG:
2222    case AVR8_REGIDX_RAMPZ:
2222   case AVR8_REGIDX_RAMPZ:
22232223      case AVR8_REGIDX_SPH:
22242224      case AVR8_REGIDX_SPL:
22252225         m_r[offset] = data;
r29404r29405
22872287      case AVR8_REGIDX_EEARH:
22882288      case AVR8_REGIDX_EEDR:
22892289         m_r[offset] = data;
2290      break;
2290      break;
22912291
22922292      case AVR8_REGIDX_EECR:
22932293         m_r[offset] = data;
r29404r29405
22972297            UINT16 addr = (m_r[AVR8_REGIDX_EEARH] & AVR8_EEARH_MASK) << 8;
22982298            addr |= m_r[AVR8_REGIDX_EEARL];
22992299            m_r[AVR8_REGIDX_EEDR] = m_eeprom[addr];
2300        if (VERBOSE_LEVEL) printf("EEPROM read @ 0x%04x data = 0x%02x\n", addr, m_eeprom[addr]);
2300      if (VERBOSE_LEVEL) printf("EEPROM read @ 0x%04x data = 0x%02x\n", addr, m_eeprom[addr]);
23012301         }
23022302         if ((data & AVR8_EECR_EEPE_MASK) && (data & AVR8_EECR_EEMPE_MASK))
23032303         {
23042304            UINT16 addr = (m_r[AVR8_REGIDX_EEARH] & AVR8_EEARH_MASK) << 8;
23052305            addr |= m_r[AVR8_REGIDX_EEARL];
23062306            m_eeprom[addr] = m_r[AVR8_REGIDX_EEDR];
2307        if (VERBOSE_LEVEL) printf("EEPROM write @ 0x%04x data = 0x%02x ('%c')\n", addr, m_eeprom[addr], m_eeprom[addr]);
2307      if (VERBOSE_LEVEL) printf("EEPROM write @ 0x%04x data = 0x%02x ('%c')\n", addr, m_eeprom[addr], m_eeprom[addr]);
23082308
2309           m_r[offset] = data & ~AVR8_EECR_EEPE_MASK; //indicates that we've finished writing a value to the EEPROM.
2310                                                   //TODO: shouldn't this happen only after a certain dalay?
2309         m_r[offset] = data & ~AVR8_EECR_EEPE_MASK; //indicates that we've finished writing a value to the EEPROM.
2310                                       //TODO: shouldn't this happen only after a certain dalay?
23112311         }
23122312         break;
23132313
r29404r29405
23382338         break;
23392339      }
23402340
2341    case AVR8_REGIDX_WDTCSR:
2341   case AVR8_REGIDX_WDTCSR:
23422342         verboselog(m_pc, 0, "AVR8: WDTCSR = %02x\n", data );
2343      //TODO: changed_wdtcsr(data);
2344      break;
2343      //TODO: changed_wdtcsr(data);
2344      break;
23452345
2346    case AVR8_REGIDX_CLKPR:
2346   case AVR8_REGIDX_CLKPR:
23472347         verboselog(m_pc, 0, "AVR8: CLKPR = %02x\n", data );
2348      //TODO: changed_clkpr(data);
2349      break;
2348      //TODO: changed_clkpr(data);
2349      break;
23502350
2351    case AVR8_REGIDX_PRR0:
2351   case AVR8_REGIDX_PRR0:
23522352         verboselog(m_pc, 0, "AVR8: PRR0 = %02x\n", data );
2353      //TODO: changed_prr0(data);
2354      break;
2353      //TODO: changed_prr0(data);
2354      break;
23552355
2356    case AVR8_REGIDX_PRR1:
2356   case AVR8_REGIDX_PRR1:
23572357         verboselog(m_pc, 0, "AVR8: PRR1 = %02x\n", data );
2358      //TODO: changed_prr1(data);
2359      break;
2358      //TODO: changed_prr1(data);
2359      break;
23602360
2361    case AVR8_REGIDX_OSCCAL:
2361   case AVR8_REGIDX_OSCCAL:
23622362         verboselog(m_pc, 0, "AVR8: OSCCAL = %02x\n", data );
2363      //TODO: changed_osccal(data);
2364      break;
2363      //TODO: changed_osccal(data);
2364      break;
23652365
2366    case AVR8_REGIDX_PCICR:
2366   case AVR8_REGIDX_PCICR:
23672367         verboselog(m_pc, 0, "AVR8: PCICR = %02x\n", data );
2368      //TODO: changed_pcicr(data);
2369      break;
2368      //TODO: changed_pcicr(data);
2369      break;
23702370
2371    case AVR8_REGIDX_EICRA:
2371   case AVR8_REGIDX_EICRA:
23722372         verboselog(m_pc, 0, "AVR8: EICRA = %02x\n", data );
2373      //TODO: changed_eicra(data);
2374      break;
2373      //TODO: changed_eicra(data);
2374      break;
23752375
2376    case AVR8_REGIDX_EICRB:
2376   case AVR8_REGIDX_EICRB:
23772377         verboselog(m_pc, 0, "AVR8: EICRB = %02x\n", data );
2378      //TODO: changed_eicrb(data);
2379      break;
2378      //TODO: changed_eicrb(data);
2379      break;
23802380
2381    case AVR8_REGIDX_PCMSK0:
2381   case AVR8_REGIDX_PCMSK0:
23822382         verboselog(m_pc, 0, "AVR8: PCMSK0 = %02x\n", data );
2383      //TODO: changed_pcmsk0(data);
2384      break;
2383      //TODO: changed_pcmsk0(data);
2384      break;
23852385
2386    case AVR8_REGIDX_PCMSK1:
2386   case AVR8_REGIDX_PCMSK1:
23872387         verboselog(m_pc, 0, "AVR8: PCMSK1 = %02x\n", data );
2388      //TODO: changed_pcmsk1(data);
2389      break;
2388      //TODO: changed_pcmsk1(data);
2389      break;
23902390
2391    case AVR8_REGIDX_PCMSK2:
2391   case AVR8_REGIDX_PCMSK2:
23922392         verboselog(m_pc, 0, "AVR8: PCMSK2 = %02x\n", data );
2393      //TODO: changed_pcmsk2(data);
2394      break;
2393      //TODO: changed_pcmsk2(data);
2394      break;
23952395
23962396      case AVR8_REGIDX_TIMSK0:
23972397         verboselog(m_pc, 0, "AVR8: TIMSK0 = %02x\n", data );
r29404r29405
24422442         update_interrupt(AVR8_INTIDX_TOV5);
24432443         break;
24442444
2445    case AVR8_REGIDX_XMCRA:
2445   case AVR8_REGIDX_XMCRA:
24462446         verboselog(m_pc, 0, "AVR8: XMCRA = %02x\n", data );
2447      //TODO: changed_xmcra(data);
2448      break;
2447      //TODO: changed_xmcra(data);
2448      break;
24492449
2450    case AVR8_REGIDX_XMCRB:
2450   case AVR8_REGIDX_XMCRB:
24512451         verboselog(m_pc, 0, "AVR8: XMCRB = %02x\n", data );
2452      //TODO: changed_xmcrb(data);
2453      break;
2452      //TODO: changed_xmcrb(data);
2453      break;
24542454
2455    case AVR8_REGIDX_ADCL:
2455   case AVR8_REGIDX_ADCL:
24562456         verboselog(m_pc, 0, "AVR8: ADCL = %02x\n", data );
2457      //TODO: changed_adcl(data);
2458      break;
2457      //TODO: changed_adcl(data);
2458      break;
24592459
2460    case AVR8_REGIDX_ADCH:
2460   case AVR8_REGIDX_ADCH:
24612461         verboselog(m_pc, 0, "AVR8: ADCH = %02x\n", data );
2462      //TODO: changed_adch(data);
2463      break;
2462      //TODO: changed_adch(data);
2463      break;
24642464
2465    case AVR8_REGIDX_ADCSRA:
2465   case AVR8_REGIDX_ADCSRA:
24662466         verboselog(m_pc, 0, "AVR8: ADCSRA = %02x\n", data );
2467      //TODO: changed_adcsra(data);
2468      break;
2467      //TODO: changed_adcsra(data);
2468      break;
24692469
2470    case AVR8_REGIDX_ADCSRB:
2470   case AVR8_REGIDX_ADCSRB:
24712471         verboselog(m_pc, 0, "AVR8: ADCSRB = %02x\n", data );
2472      //TODO: changed_adcsrb(data);
2473      break;
2472      //TODO: changed_adcsrb(data);
2473      break;
24742474
2475    case AVR8_REGIDX_ADMUX:
2475   case AVR8_REGIDX_ADMUX:
24762476         verboselog(m_pc, 0, "AVR8: ADMUX = %02x\n", data );
2477      //TODO: changed_admux(data);
2478      break;
2477      //TODO: changed_admux(data);
2478      break;
24792479
2480    case AVR8_REGIDX_DIDR0:
2480   case AVR8_REGIDX_DIDR0:
24812481         verboselog(m_pc, 0, "AVR8: DIDR0 = %02x\n", data );
2482      //TODO: changed_didr0(data);
2483      break;
2482      //TODO: changed_didr0(data);
2483      break;
24842484
2485    case AVR8_REGIDX_DIDR1:
2485   case AVR8_REGIDX_DIDR1:
24862486         verboselog(m_pc, 0, "AVR8: DIDR1 = %02x\n", data );
2487      //TODO: changed_didr1(data);
2488      break;
2487      //TODO: changed_didr1(data);
2488      break;
24892489
2490    case AVR8_REGIDX_DIDR2:
2490   case AVR8_REGIDX_DIDR2:
24912491         verboselog(m_pc, 0, "AVR8: DIDR2 = %02x\n", data );
2492      //TODO: changed_didr2(data);
2493      break;
2492      //TODO: changed_didr2(data);
2493      break;
24942494
24952495      case AVR8_REGIDX_TCCR1A:
24962496         verboselog(m_pc, 0, "AVR8: TCCR1A = %02x\n", data );
r29404r29405
25772577
25782578      case AVR8_REGIDX_TCCR3A:
25792579         verboselog(m_pc, 0, "AVR8: TCCR3A = %02x\n", data );
2580      changed_tccr3a(data);
2580      changed_tccr3a(data);
25812581         break;
25822582
25832583      case AVR8_REGIDX_TCCR3B:
25842584         verboselog(m_pc, 0, "AVR8: TCCR3B = %02x\n", data );
2585      changed_tccr3b(data);
2585      changed_tccr3b(data);
25862586         break;
25872587
25882588      case AVR8_REGIDX_TCCR3C:
25892589         verboselog(m_pc, 0, "AVR8: TCCR3C = %02x\n", data );
2590      changed_tccr3c(data);
2590      changed_tccr3c(data);
25912591         break;
25922592
25932593      case AVR8_REGIDX_TCNT3L:
r29404r29405
26322632
26332633      case AVR8_REGIDX_TCCR4A:
26342634         verboselog(m_pc, 0, "AVR8: TCCR4A = %02x\n", data );
2635      changed_tccr4a(data);
2635      changed_tccr4a(data);
26362636         break;
26372637
26382638      case AVR8_REGIDX_TCCR4B:
26392639         verboselog(m_pc, 0, "AVR8: TCCR4B = %02x\n", data );
2640      changed_tccr4b(data);
2640      changed_tccr4b(data);
26412641         break;
26422642
26432643      case AVR8_REGIDX_TCCR4C:
26442644         verboselog(m_pc, 0, "AVR8: TCCR4C = %02x\n", data );
2645      changed_tccr4c(data);
2645      changed_tccr4c(data);
26462646         break;
26472647
26482648      case AVR8_REGIDX_TCNT4L:
r29404r29405
26872687
26882688      case AVR8_REGIDX_TCCR5A:
26892689         verboselog(m_pc, 0, "AVR8: TCCR5A = %02x\n", data );
2690      changed_tccr5a(data);
2690      changed_tccr5a(data);
26912691         break;
26922692
26932693      case AVR8_REGIDX_TCCR5B:
26942694         verboselog(m_pc, 0, "AVR8: TCCR5B = %02x\n", data );
2695      changed_tccr5b(data);
2695      changed_tccr5b(data);
26962696         break;
26972697
26982698      case AVR8_REGIDX_ASSR:
r29404r29405
27232723      case AVR8_REGIDX_TWCR:
27242724         verboselog(m_pc, 0, "AVR8: TWCR = %02x\n", data );
27252725         //TODO: changed_twcr(data);
2726      m_r[AVR8_REGIDX_TWCR] = data;
2726      m_r[AVR8_REGIDX_TWCR] = data;
27272727         break;
27282728
27292729      case AVR8_REGIDX_TWAMR:
r29404r29405
27462746         //TODO: changed_ucsr0c(data);
27472747         break;
27482748/*
2749      case AVR8_REGIDX_:
2750         verboselog(m_pc, 0, "AVR8:  = %02x\n", data );
2751         //TODO: changed_(data);
2752         break;
2749        case AVR8_REGIDX_:
2750            verboselog(m_pc, 0, "AVR8:  = %02x\n", data );
2751            //TODO: changed_(data);
2752            break;
27532753*/
27542754      default:
27552755         verboselog(m_pc, 0, "AVR8: Unknown Register Write: %03x = %02x\n", offset, data);
r29404r29405
27592759
27602760READ8_MEMBER( avr8_device::regs_r )
27612761{
2762//   printf("--- READ offset %04x ---\n", offset);
2762//  printf("--- READ offset %04x ---\n", offset);
27632763
27642764   switch( offset )
27652765   {
r29404r29405
27982798         return m_r[offset];
27992799
28002800      case AVR8_REGIDX_PINA:
2801        // TODO: consider the DDRA
2802      return m_io->read_byte(AVR8_REG_A);
2801      // TODO: consider the DDRA
2802      return m_io->read_byte(AVR8_REG_A);
28032803
28042804      case AVR8_REGIDX_PINB:
2805        // TODO: consider the DDRB
2806      return m_io->read_byte(AVR8_REG_B);
2805      // TODO: consider the DDRB
2806      return m_io->read_byte(AVR8_REG_B);
28072807
28082808      case AVR8_REGIDX_PINC:
2809        // TODO: consider the DDRC
2810      return m_io->read_byte(AVR8_REG_C);
2809      // TODO: consider the DDRC
2810      return m_io->read_byte(AVR8_REG_C);
28112811
28122812      case AVR8_REGIDX_PIND:
2813        // TODO: consider the DDRD
2814      return m_io->read_byte(AVR8_REG_D);
2813      // TODO: consider the DDRD
2814      return m_io->read_byte(AVR8_REG_D);
28152815
28162816      case AVR8_REGIDX_PINE:
2817        // TODO: consider the DDRE
2818      return m_io->read_byte(AVR8_REG_E);
2817      // TODO: consider the DDRE
2818      return m_io->read_byte(AVR8_REG_E);
28192819
28202820      case AVR8_REGIDX_PINF:
2821        // TODO: consider the DDRF
2822      return m_io->read_byte(AVR8_REG_F);
2821      // TODO: consider the DDRF
2822      return m_io->read_byte(AVR8_REG_F);
28232823
28242824      case AVR8_REGIDX_PING:
2825        // TODO: consider the DDRG
2826      return m_io->read_byte(AVR8_REG_G);
2825      // TODO: consider the DDRG
2826      return m_io->read_byte(AVR8_REG_G);
28272827
28282828      case AVR8_REGIDX_PINH:
2829        // TODO: consider the DDRH
2830      return m_io->read_byte(AVR8_REG_H);
2829      // TODO: consider the DDRH
2830      return m_io->read_byte(AVR8_REG_H);
28312831
28322832      case AVR8_REGIDX_PINJ:
2833        // TODO: consider the DDRJ
2834      return m_io->read_byte(AVR8_REG_J);
2833      // TODO: consider the DDRJ
2834      return m_io->read_byte(AVR8_REG_J);
28352835
28362836      case AVR8_REGIDX_PINK:
2837        // TODO: consider the DDRK
2838      return m_io->read_byte(AVR8_REG_K);
2837      // TODO: consider the DDRK
2838      return m_io->read_byte(AVR8_REG_K);
28392839
28402840      case AVR8_REGIDX_PINL:
2841        // TODO: consider the DDRL
2842      return m_io->read_byte(AVR8_REG_L);
2841      // TODO: consider the DDRL
2842      return m_io->read_byte(AVR8_REG_L);
28432843
28442844      case AVR8_REGIDX_PORTA:
28452845      case AVR8_REGIDX_PORTB:
r29404r29405
28682868         return m_r[offset];
28692869
28702870// EEPROM registers:
2871    case AVR8_REGIDX_EECR:
2871   case AVR8_REGIDX_EECR:
28722872      case AVR8_REGIDX_EEDR:
28732873         return m_r[offset];
28742874
r29404r29405
28782878      case AVR8_REGIDX_GPIOR0:
28792879      case AVR8_REGIDX_GPIOR1:
28802880      case AVR8_REGIDX_GPIOR2:
2881//      case AVR8_REGIDX_UCSR0B:/*TODO: needed for Replicator 1 */
2881//      case AVR8_REGIDX_UCSR0B:/*TODO: needed for Replicator 1 */
28822882      case AVR8_REGIDX_SPDR:  /*TODO: needed for Replicator 1 */
28832883      case AVR8_REGIDX_SPSR:  /*TODO: needed for Replicator 1 */
28842884//    case AVR8_REGIDX_ADCSRA:   /*TODO: needed for Replicator 1 */
r29404r29405
28862886      case AVR8_REGIDX_SPL:
28872887      case AVR8_REGIDX_SPH:
28882888      case AVR8_REGIDX_SREG:
2889    case AVR8_REGIDX_TIMSK0:
2890    case AVR8_REGIDX_TIMSK1:
2891    case AVR8_REGIDX_TIMSK2:
2889   case AVR8_REGIDX_TIMSK0:
2890   case AVR8_REGIDX_TIMSK1:
2891   case AVR8_REGIDX_TIMSK2:
28922892//    case AVR8_REGIDX_TIMSK3:  /*TODO: needed for Replicator 1 */
2893    case AVR8_REGIDX_TIMSK4:
2894    case AVR8_REGIDX_TIMSK5:
2893   case AVR8_REGIDX_TIMSK4:
2894   case AVR8_REGIDX_TIMSK5:
28952895         return m_r[offset];
28962896
28972897/* Two-wire registers: */
28982898      case AVR8_REGIDX_TWCR:
2899      /*TODO: needed for Replicator 1
2900      BLOQUEIA PROGRESSO DA EXECUÇÃO DO FIRMWARE no endereço 105EC*/
2899      /*TODO: needed for Replicator 1
2900      BLOQUEIA PROGRESSO DA EXECU??O DO FIRMWARE no endere?o 105EC*/
29012901         return m_r[offset];
29022902
29032903      case AVR8_REGIDX_TWSR:
2904      //quick hack: by returning a value != 0x08 we induce an error state that makes the object code jump out of the wait loop and continue execution failing the 2-wire write operation.
2905      //TODO: implement-me!
2904      //quick hack: by returning a value != 0x08 we induce an error state that makes the object code jump out of the wait loop and continue execution failing the 2-wire write operation.
2905      //TODO: implement-me!
29062906         return 0x00; /*TODO: needed for Replicator 1 */
29072907
29082908
r29404r29405
33093309                        break;
33103310                     case 0x0007:    // ELPM Rd,Z+
33113311                        pd32 = (m_r[AVR8_REGIDX_RAMPZ] << 16) | ZREG;
3312                m_r[RD5(op)] = m_program->read_byte(pd32);
3313                pd32++;
3314                m_r[AVR8_REGIDX_RAMPZ] = (pd32 >> 16) & 0x00ff;
3315                m_r[31] = (pd32 >> 8) & 0x00ff;
3312            m_r[RD5(op)] = m_program->read_byte(pd32);
3313            pd32++;
3314            m_r[AVR8_REGIDX_RAMPZ] = (pd32 >> 16) & 0x00ff;
3315            m_r[31] = (pd32 >> 8) & 0x00ff;
33163316                        m_r[30] = pd32 & 0x00ff;
3317                opcycles = 3;
3317            opcycles = 3;
33183318                        break;
33193319                     case 0x0009:    // LD Rd,Y+
33203320                        pd = YREG;
r29404r29405
33233323                        m_r[29] = (pd >> 8) & 0x00ff;
33243324                        m_r[28] = pd & 0x00ff;
33253325                        opcycles = 2;
3326                break;
3326            break;
33273327                     case 0x000a:    // LD Rd,-Y
33283328                        pd = YREG;
33293329                        pd--;
r29404r29405
36793679                           case 0x00a0:    // WDR
36803680                              //output += sprintf( output, "WDR" );
36813681                              //unimplemented_opcode(op); //TODO: necessary for emulating the Replicator 1
3682                    //printf("Watchdot Reset!\n");
3682               //printf("Watchdot Reset!\n");
36833683                              opcycles = 1;
36843684                              break;
36853685                           case 0x00c0:    // LPM
trunk/src/emu/cpu/avr8/avr8.h
r29404r29405
9090   // inline configuration helpers
9191   static void static_set_config(device_t &device, const avr8_config &config);
9292
93  // fuse configs
93   // fuse configs
9494   void set_low_fuses(UINT8 byte);
9595   void set_high_fuses(UINT8 byte);
9696   void set_extended_fuses(UINT8 byte);
r29404r29405
147147   const address_space_config m_io_config;
148148   UINT8 *m_eeprom;
149149
150  // bootloader
150   // bootloader
151151   UINT16 m_boot_size;
152152   UINT8 m_cpu_type;
153153
154  // Fuses
155  UINT8 m_lfuses;
156  UINT8 m_hfuses;
157  UINT8 m_efuses;
158  UINT8 m_lock_bits;
154   // Fuses
155   UINT8 m_lfuses;
156   UINT8 m_hfuses;
157   UINT8 m_efuses;
158   UINT8 m_lock_bits;
159159
160160   // CPU registers
161161   UINT32 m_pc;
r29404r29405
241241   void changed_tccr3a(UINT8 data);
242242   void changed_tccr3b(UINT8 data);
243243   void changed_tccr3c(UINT8 data);
244//   void update_ocr3(UINT8 newval, UINT8 reg);
245//   void timer3_force_output_compare(int reg);
244//  void update_ocr3(UINT8 newval, UINT8 reg);
245//  void timer3_force_output_compare(int reg);
246246
247247   // timer 4
248248   void timer4_tick();
r29404r29405
256256   void timer5_tick();
257257   void changed_tccr5a(UINT8 data);
258258   void changed_tccr5b(UINT8 data);
259//   void update_ocr5(UINT8 newval, UINT8 reg);
260//   void timer5_force_output_compare(int reg);
259//  void update_ocr5(UINT8 newval, UINT8 reg);
260//  void timer5_force_output_compare(int reg);
261261
262262   // address spaces
263263   address_space *m_program;
r29404r29405
496496   AVR8_REGIDX_TCNT0,
497497   AVR8_REGIDX_OCR0A,
498498   AVR8_REGIDX_OCR0B,
499  //0x49: Reserved
499   //0x49: Reserved
500500   AVR8_REGIDX_GPIOR1 = 0x4A,
501501   AVR8_REGIDX_GPIOR2,
502502   AVR8_REGIDX_SPCR,
503503   AVR8_REGIDX_SPSR,
504504   AVR8_REGIDX_SPDR,
505  //0x4F: Reserved
505   //0x4F: Reserved
506506   AVR8_REGIDX_ACSR = 0x50,
507507   AVR8_REGIDX_OCDR,
508  //0x52: Reserved
508   //0x52: Reserved
509509   AVR8_REGIDX_SMCR = 0x53,
510510   AVR8_REGIDX_MCUSR,
511511   AVR8_REGIDX_MCUCR,
512  //0x56: Reserved
512   //0x56: Reserved
513513   AVR8_REGIDX_SPMCSR = 0x57,
514  //0x58: Reserved
515  //0x59: Reserved
516  //0x5A: Reserved
514   //0x58: Reserved
515   //0x59: Reserved
516   //0x5A: Reserved
517517   AVR8_REGIDX_RAMPZ = 0x5B,
518518   AVR8_REGIDX_EIND,
519519   AVR8_REGIDX_SPL,
r29404r29405
522522//--------------------------
523523   AVR8_REGIDX_WDTCSR = 0x60,
524524   AVR8_REGIDX_CLKPR,
525  //0x62: Reserved
526  //0x63: Reserved
525   //0x62: Reserved
526   //0x63: Reserved
527527   AVR8_REGIDX_PRR0 = 0x64,
528528   AVR8_REGIDX_PRR1,
529529   AVR8_REGIDX_OSCCAL,
530  //0x67: Reserved
530   //0x67: Reserved
531531   AVR8_REGIDX_PCICR = 0x68,
532532   AVR8_REGIDX_EICRA,
533533   AVR8_REGIDX_EICRB,
r29404r29405
542542   AVR8_REGIDX_TIMSK5,
543543   AVR8_REGIDX_XMCRA,
544544   AVR8_REGIDX_XMCRB,
545  //0x76: Reserved
546  //0x77: Reserved
545   //0x76: Reserved
546   //0x77: Reserved
547547   AVR8_REGIDX_ADCL = 0x78,
548548   AVR8_REGIDX_ADCH,
549549   AVR8_REGIDX_ADCSRA,
r29404r29405
555555   AVR8_REGIDX_TCCR1A,
556556   AVR8_REGIDX_TCCR1B,
557557   AVR8_REGIDX_TCCR1C,
558  //0x83: Reserved
558   //0x83: Reserved
559559   AVR8_REGIDX_TCNT1L = 0x84,
560560   AVR8_REGIDX_TCNT1H,
561561   AVR8_REGIDX_ICR1L,
r29404r29405
566566   AVR8_REGIDX_OCR1BH,
567567   AVR8_REGIDX_OCR1CL,
568568   AVR8_REGIDX_OCR1CH,
569  //0x8E: Reserved
570  //0x8F: Reserved
569   //0x8E: Reserved
570   //0x8F: Reserved
571571   AVR8_REGIDX_TCCR3A = 0x90,
572572   AVR8_REGIDX_TCCR3B,
573573   AVR8_REGIDX_TCCR3C,
574  //0x93: Reserved
574   //0x93: Reserved
575575   AVR8_REGIDX_TCNT3L = 0x94,
576576   AVR8_REGIDX_TCNT3H,
577577   AVR8_REGIDX_ICR3L,
r29404r29405
582582   AVR8_REGIDX_OCR3BH,
583583   AVR8_REGIDX_OCR3CL,
584584   AVR8_REGIDX_OCR3CH,
585  //0x9E: Reserved
586  //0x9F: Reserved
585   //0x9E: Reserved
586   //0x9F: Reserved
587587   AVR8_REGIDX_TCCR4A = 0xA0,
588588   AVR8_REGIDX_TCCR4B,
589589   AVR8_REGIDX_TCCR4C,
590  //0xA3: Reserved
590   //0xA3: Reserved
591591   AVR8_REGIDX_TCNT4L = 0xA4,
592592   AVR8_REGIDX_TCNT4H,
593593   AVR8_REGIDX_ICR4L,
r29404r29405
598598   AVR8_REGIDX_OCR4BH,
599599   AVR8_REGIDX_OCR4CL,
600600   AVR8_REGIDX_OCR4CH,
601  //0xAE: Reserved
602  //0xAF: Reserved
601   //0xAE: Reserved
602   //0xAF: Reserved
603603   AVR8_REGIDX_TCCR2A = 0xB0,
604604   AVR8_REGIDX_TCCR2B,
605605   AVR8_REGIDX_TCNT2,
606606   AVR8_REGIDX_OCR2A,
607607   AVR8_REGIDX_OCR2B,
608  //0xB5: Reserved
608   //0xB5: Reserved
609609   AVR8_REGIDX_ASSR = 0xB6,
610  //0xB7: Reserved
610   //0xB7: Reserved
611611   AVR8_REGIDX_TWBR = 0xB8,
612612   AVR8_REGIDX_TWSR,
613613   AVR8_REGIDX_TWAR,
614614   AVR8_REGIDX_TWDR,
615615   AVR8_REGIDX_TWCR,
616616   AVR8_REGIDX_TWAMR,
617  //0xBE: Reserved
618  //0xBF: Reserved
617   //0xBE: Reserved
618   //0xBF: Reserved
619619   AVR8_REGIDX_UCSR0A = 0xC0,
620620   AVR8_REGIDX_UCSR0B,
621621   AVR8_REGIDX_UCSR0C,
622  //0xC3: Reserved
622   //0xC3: Reserved
623623   AVR8_REGIDX_UBRR0L = 0xC4,
624624   AVR8_REGIDX_UBRR0H,
625625   AVR8_REGIDX_UDR0,
626  //0xC7: Reserved
626   //0xC7: Reserved
627627   AVR8_REGIDX_UCSR1A = 0xC8,
628628   AVR8_REGIDX_UCSR1B,
629629   AVR8_REGIDX_UCSR1C,
630  //0xCB: Reserved
630   //0xCB: Reserved
631631   AVR8_REGIDX_UBRR1L = 0xCC,
632632   AVR8_REGIDX_UBRR1H,
633633   AVR8_REGIDX_UDR1,
634  //0xCF: Reserved
634   //0xCF: Reserved
635635   AVR8_REGIDX_UCSR2A = 0xD0,
636636   AVR8_REGIDX_UCSR2B,
637637   AVR8_REGIDX_UCSR2C,
638  //0xD3: Reserved
638   //0xD3: Reserved
639639   AVR8_REGIDX_UBRR2L = 0xD4,
640640   AVR8_REGIDX_UBRR2H,
641641   AVR8_REGIDX_UDR2,
642  //0xD7: Reserved
643  //0xD8: Reserved
644  //0xD9: Reserved
645  //0xDA: Reserved
646  //0xDB: Reserved
647  //0xDC: Reserved
648  //0xDD: Reserved
649  //0xDE: Reserved
650  //0xDF: Reserved
651  //0xE0: Reserved
652  //0xE1: Reserved
653  //0xE2: Reserved
654  //0xE3: Reserved
655  //0xE4: Reserved
656  //0xE5: Reserved
657  //0xE6: Reserved
658  //0xE7: Reserved
659  //0xE8: Reserved
660  //0xE9: Reserved
661  //0xEA: Reserved
662  //0xEB: Reserved
663  //0xEC: Reserved
664  //0xED: Reserved
665  //0xEE: Reserved
666  //0xEF: Reserved
667  //0xF0: Reserved
668  //0xF1: Reserved
669  //0xF2: Reserved
670  //0xF3: Reserved
671  //0xF4: Reserved
672  //0xF5: Reserved
673  //0xF6: Reserved
674  //0xF7: Reserved
675  //0xF8: Reserved
676  //0xF9: Reserved
677  //0xFA: Reserved
678  //0xFB: Reserved
679  //0xFC: Reserved
680  //0xFD: Reserved
681  //0xFE: Reserved
682  //0xFF: Reserved
642   //0xD7: Reserved
643   //0xD8: Reserved
644   //0xD9: Reserved
645   //0xDA: Reserved
646   //0xDB: Reserved
647   //0xDC: Reserved
648   //0xDD: Reserved
649   //0xDE: Reserved
650   //0xDF: Reserved
651   //0xE0: Reserved
652   //0xE1: Reserved
653   //0xE2: Reserved
654   //0xE3: Reserved
655   //0xE4: Reserved
656   //0xE5: Reserved
657   //0xE6: Reserved
658   //0xE7: Reserved
659   //0xE8: Reserved
660   //0xE9: Reserved
661   //0xEA: Reserved
662   //0xEB: Reserved
663   //0xEC: Reserved
664   //0xED: Reserved
665   //0xEE: Reserved
666   //0xEF: Reserved
667   //0xF0: Reserved
668   //0xF1: Reserved
669   //0xF2: Reserved
670   //0xF3: Reserved
671   //0xF4: Reserved
672   //0xF5: Reserved
673   //0xF6: Reserved
674   //0xF7: Reserved
675   //0xF8: Reserved
676   //0xF9: Reserved
677   //0xFA: Reserved
678   //0xFB: Reserved
679   //0xFC: Reserved
680   //0xFD: Reserved
681   //0xFE: Reserved
682   //0xFF: Reserved
683683   AVR8_REGIDX_PINH = 0x100,
684684   AVR8_REGIDX_DDRH,
685685   AVR8_REGIDX_PORTH,
r29404r29405
692692   AVR8_REGIDX_PINL,
693693   AVR8_REGIDX_DDRL,
694694   AVR8_REGIDX_PORTL,
695  //0x10C: Reserved
696  //0x10D: Reserved
697  //0x10E: Reserved
698  //0x10F: Reserved
699  //0x110: Reserved
700  //0x111: Reserved
701  //0x112: Reserved
702  //0x113: Reserved
703  //0x114: Reserved
704  //0x115: Reserved
705  //0x116: Reserved
706  //0x117: Reserved
707  //0x118: Reserved
708  //0x119: Reserved
709  //0x11A: Reserved
710  //0x11B: Reserved
711  //0x11C: Reserved
712  //0x11D: Reserved
713  //0x11E: Reserved
714  //0x11F: Reserved
695   //0x10C: Reserved
696   //0x10D: Reserved
697   //0x10E: Reserved
698   //0x10F: Reserved
699   //0x110: Reserved
700   //0x111: Reserved
701   //0x112: Reserved
702   //0x113: Reserved
703   //0x114: Reserved
704   //0x115: Reserved
705   //0x116: Reserved
706   //0x117: Reserved
707   //0x118: Reserved
708   //0x119: Reserved
709   //0x11A: Reserved
710   //0x11B: Reserved
711   //0x11C: Reserved
712   //0x11D: Reserved
713   //0x11E: Reserved
714   //0x11F: Reserved
715715   AVR8_REGIDX_TCCR5A,
716716   AVR8_REGIDX_TCCR5B,
717717   AVR8_REGIDX_TCCR5C,
718  //0x123: Reserved
718   //0x123: Reserved
719719   AVR8_REGIDX_TCNT5L,
720720   AVR8_REGIDX_TCNT5H,
721721   AVR8_REGIDX_ICR5L,
r29404r29405
726726   AVR8_REGIDX_OCR5BH,
727727   AVR8_REGIDX_OCR5CL,
728728   AVR8_REGIDX_OCR5CH,
729  //0x12E: Reserved
730  //0x12F: Reserved
729   //0x12E: Reserved
730   //0x12F: Reserved
731731   AVR8_REGIDX_UCSR3A,
732732   AVR8_REGIDX_UCSR3B,
733733   AVR8_REGIDX_UCSR3C,
734  //0x133: Reserved
734   //0x133: Reserved
735735   AVR8_REGIDX_UBRR3L,
736736   AVR8_REGIDX_UBRR3H,
737737   AVR8_REGIDX_UDR3,
738  //0x137: Reserved
739  //  .
740  //  . up to
741  //  .
742  //0x1FF: Reserved
738   //0x137: Reserved
739   //  .
740   //  . up to
741   //  .
742   //0x1FF: Reserved
743743};
744744
745745enum {
746  AVR8_IO_PORTA = 0,
747  AVR8_IO_PORTB,
748  AVR8_IO_PORTC,
749  AVR8_IO_PORTD,
750  AVR8_IO_PORTE,
751  AVR8_IO_PORTF,
752  AVR8_IO_PORTG,
753  AVR8_IO_PORTH,
754  AVR8_IO_PORTJ,
755  AVR8_IO_PORTK,
756  AVR8_IO_PORTL
746   AVR8_IO_PORTA = 0,
747   AVR8_IO_PORTB,
748   AVR8_IO_PORTC,
749   AVR8_IO_PORTD,
750   AVR8_IO_PORTE,
751   AVR8_IO_PORTF,
752   AVR8_IO_PORTG,
753   AVR8_IO_PORTH,
754   AVR8_IO_PORTJ,
755   AVR8_IO_PORTK,
756   AVR8_IO_PORTL
757757};
758758
759759//TODO: AVR8_REG_* and AVR8_IO_PORT* seem to serve the same purpose and thus should be unified. Verify this!
r29404r29405
810810//lock bit masks
811811enum
812812{
813  LB1 = (1 << 0),
814  LB2 = (1 << 1),
815  BLB01 = (1 << 2),
816  BLB02 = (1 << 3),
817  BLB11 = (1 << 4),
818  BLB12 = (1 << 5),
813   LB1 = (1 << 0),
814   LB2 = (1 << 1),
815   BLB01 = (1 << 2),
816   BLB02 = (1 << 3),
817   BLB11 = (1 << 4),
818   BLB12 = (1 << 5),
819819};
820820
821821//extended fuses bit masks
822822enum
823823{
824  BODLEVEL0 = (1 << 0),
825  BODLEVEL1 = (1 << 1),
826  BODLEVEL2 = (1 << 2),
824   BODLEVEL0 = (1 << 0),
825   BODLEVEL1 = (1 << 1),
826   BODLEVEL2 = (1 << 2),
827827};
828828
829829//high fuses bit masks
830830enum
831831{
832  BOOTRST = (1 << 0),
833  BOOTSZ0 = (1 << 1),
834  BOOTSZ1 = (1 << 2),
835  EESAVE = (1 << 3),
836  WDTON = (1 << 4),
837  SPIEN = (1 << 5),
838  JTAGEN = (1 << 6),
839  OCDEN = (1 << 7),
832   BOOTRST = (1 << 0),
833   BOOTSZ0 = (1 << 1),
834   BOOTSZ1 = (1 << 2),
835   EESAVE = (1 << 3),
836   WDTON = (1 << 4),
837   SPIEN = (1 << 5),
838   JTAGEN = (1 << 6),
839   OCDEN = (1 << 7),
840840};
841841
842842//low fuses bit masks
843843enum
844844{
845  CKSEL0 = (1 << 0),
846  CKSEL1 = (1 << 1),
847  CKSEL2 = (1 << 2),
848  CKSEL3 = (1 << 3),
849  SUT0 = (1 << 4),
850  SUT1 = (1 << 5),
851  CKOUT = (1 << 6),
852  CKDIV8 = (1 << 7),
845   CKSEL0 = (1 << 0),
846   CKSEL1 = (1 << 1),
847   CKSEL2 = (1 << 2),
848   CKSEL3 = (1 << 3),
849   SUT0 = (1 << 4),
850   SUT1 = (1 << 5),
851   CKOUT = (1 << 6),
852   CKDIV8 = (1 << 7),
853853};
854854
855855#define AVR8_EEARH_MASK         0x01
trunk/src/emu/cpu/avr8/avr8dasm.c
r29404r29405
3030   UINT32 op = oprom[pos++];
3131   op |= oprom[pos++] << 8;
3232   UINT32 addr = 0;
33  const char* register_names[0x40] = {"PINA", "DDRA", "PORTA", "PINB", "DDRB", "PORTB", "PINC", "DDRC", "PORTC", "PIND", "DDRD", "PORTD", "PINE", "DDRE", "PORTE", "PINF", "DDRF", "PORTF", "PING", "DDRG", "PORTG", "TIFR0", "TIFR1", "TIFR2","TIFR3", "TIFR4", "TIFR5", "PCIFR", "EIFR", "EIMSK", "GPIOR0", "EECR", "EEDR", "EEARL", "EEARH", "GTCCR", "TCCR0A", "TCCR0B", "TCNT0", "OCR0A", "OCR0B", "0x29", "GPIOR1", "GPIOR2", "SPCR", "SPSR", "SPDR", "0x2F", "ACSR", "OCDR", "0x32", "SMCR", "MCUSR", "MCUCR", "0x36", "SPMCSR", "0x38", "0x39", "0x3A", "RAMPZ", "EIND", "SPL", "SPH", "SREG"};
33   const char* register_names[0x40] = {"PINA", "DDRA", "PORTA", "PINB", "DDRB", "PORTB", "PINC", "DDRC", "PORTC", "PIND", "DDRD", "PORTD", "PINE", "DDRE", "PORTE", "PINF", "DDRF", "PORTF", "PING", "DDRG", "PORTG", "TIFR0", "TIFR1", "TIFR2","TIFR3", "TIFR4", "TIFR5", "PCIFR", "EIFR", "EIMSK", "GPIOR0", "EECR", "EEDR", "EEARL", "EEARH", "GTCCR", "TCCR0A", "TCCR0B", "TCNT0", "OCR0A", "OCR0B", "0x29", "GPIOR1", "GPIOR2", "SPCR", "SPSR", "SPDR", "0x2F", "ACSR", "OCDR", "0x32", "SMCR", "MCUSR", "MCUCR", "0x36", "SPMCSR", "0x38", "0x39", "0x3A", "RAMPZ", "EIND", "SPL", "SPH", "SREG"};
3434
35  const char* register_bit_names[0x40][8] = {
36    /* PINA   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
37    /* DDRA   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
38    /* PORTA  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
39    /* PINB   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
40    /* DDRB   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
41    /* PORTB  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
42    /* PINC   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
43    /* DDRC   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
44    /* PORTC  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
45    /* PIND   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
46    /* DDRD   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
47    /* PORTD  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
48    /* PINE   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
49    /* DDRE   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
50    /* PORTE  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
51    /* PINF   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
52    /* DDRF   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
53    /* PORTF  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
54    /* PING   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
55    /* DDRG   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
56    /* PORTG  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
57    /* TIFR0  */ { "TOV0", "OCF0A", "OCF0B",     "3",     "4",     "5",     "6",     "7"},
58    /* TIFR1  */ { "TOV1", "OCF1A", "OCF1B", "OCF1C",     "4",  "ICF1",     "6",     "7"},
59    /* TIFR2  */ { "TOV2", "OCF2A", "OCF2B",     "3",     "4",     "5",     "6",     "7"},
60    /* TIFR3  */ { "TOV3", "OCF3A", "OCF3B", "OCF3C",     "4",  "ICF3",     "6",     "7"},
61    /* TIFR4  */ { "TOV4", "OCF4A", "OCF4B", "OCF4C",     "4",  "ICF4",     "6",     "7"},
62    /* TIFR5  */ { "TOV5", "OCF5A", "OCF5B", "OCF5C",     "4",  "ICF5",     "6",     "7"},
63    /* PCIFR  */ {"PCIF0", "PCIF1", "PCIF2",     "3",     "4",     "5",     "6",     "7"},
64    /* EIFR   */ {"INTF0", "INTF1", "INTF2", "INTF3", "INTF4", "INTF5", "INTF6", "INTF7"},
65    /* EIMSK  */ { "INT0",  "INT1",  "INT2",  "INT3",  "INT4",  "INT5",  "INT6",  "INT7"},
66    /* GPIOR0 */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
67    /* EECR   */ { "EERE",  "EEPE", "EEMPE", "EERIE", "EEPM0", "EEPM1",     "6",     "7"},
68    /* EEDR   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
69    /* EEARL  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
70    /* EEARH  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
71    /* GTCCR  */ {"PSRSYNC", "PSRASY",  "2",     "3",     "4",     "5",     "6",   "TSM"},
72    /* TCCR0A */ {"WGM00", "WGM01",     "2",     "3","COM0B0","COM0B1","COM0A0","COM0A1"},
73    /* TCCR0B */ {  "CS0",   "CS1",   "CS2", "WGM02",     "4",     "5", "FOC0B", "FOC0A"},
74    /* TCNT0  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
75    /* OCR0A  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
76    /* OCR0B  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
77    /* 0x29   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
78    /* GPIOR1 */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
79    /* GPIOR2 */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
80    /* SPCR   */ { "SPR0",  "SPR1",  "CPHA",  "CPOL",  "MSTR",  "DORD",   "SPE",  "SPIE"},
81    /* SPSR   */ {"SPI2X",     "1",     "2",     "3",     "4",     "5",  "WCOL",  "SPIF"},
82    /* SPDR   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
83    /* 0x2F   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
84    /* ACSR   */ {"ACIS0", "ACIS1",  "ACIC",  "ACIE",   "ACI",   "ACO",  "ACBG",   "ACD"},
85    /* OCDR   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
86    /* 0x32   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
87    /* SMCR   */ {   "SE",   "SM0",   "SM1",   "SM2",     "4",     "5",     "6",     "7"},
88    /* MCUSR  */ { "PORF", "EXTRF",  "BORF",  "WDRF",  "JTRF",     "5",     "6",     "7"},
89    /* MCUCR  */ { "IVCE", "IVSEL",     "2",     "3",   "PUD",     "5",     "6",   "JTD"},
90    /* 0x36   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
91    /* SPMCSR */ {"SPMEN", "PGERS", "PGWRT","BLBSET","RWWSRE", "SIGRD", "RWWSB", "SPMIE"},
92    /* 0x38   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
93    /* 0x39   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
94    /* 0x3A   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
95    /* RAMPZ  */ {"RAMPZ0","RAMPZ1",     "2",     "3",     "4",     "5",     "6",     "7"},
96    /* EIND   */ {"EIND0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
97    /* SPL    */ {  "SP0",   "SP1",   "SP2",   "SP3",   "SP4",   "SP5",   "SP6",   "SP7"},
98    /* SPH    */ {  "SP8",   "SP9",  "SP10",  "SP11",  "SP12",  "SP13",  "SP14",  "SP15"},
99    /* SREG   */ {    "C",     "Z",     "N",     "V",     "S",     "H",     "T",     "I"}};
35   const char* register_bit_names[0x40][8] = {
36   /* PINA   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
37   /* DDRA   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
38   /* PORTA  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
39   /* PINB   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
40   /* DDRB   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
41   /* PORTB  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
42   /* PINC   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
43   /* DDRC   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
44   /* PORTC  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
45   /* PIND   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
46   /* DDRD   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
47   /* PORTD  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
48   /* PINE   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
49   /* DDRE   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
50   /* PORTE  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
51   /* PINF   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
52   /* DDRF   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
53   /* PORTF  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
54   /* PING   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
55   /* DDRG   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
56   /* PORTG  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
57   /* TIFR0  */ { "TOV0", "OCF0A", "OCF0B",     "3",     "4",     "5",     "6",     "7"},
58   /* TIFR1  */ { "TOV1", "OCF1A", "OCF1B", "OCF1C",     "4",  "ICF1",     "6",     "7"},
59   /* TIFR2  */ { "TOV2", "OCF2A", "OCF2B",     "3",     "4",     "5",     "6",     "7"},
60   /* TIFR3  */ { "TOV3", "OCF3A", "OCF3B", "OCF3C",     "4",  "ICF3",     "6",     "7"},
61   /* TIFR4  */ { "TOV4", "OCF4A", "OCF4B", "OCF4C",     "4",  "ICF4",     "6",     "7"},
62   /* TIFR5  */ { "TOV5", "OCF5A", "OCF5B", "OCF5C",     "4",  "ICF5",     "6",     "7"},
63   /* PCIFR  */ {"PCIF0", "PCIF1", "PCIF2",     "3",     "4",     "5",     "6",     "7"},
64   /* EIFR   */ {"INTF0", "INTF1", "INTF2", "INTF3", "INTF4", "INTF5", "INTF6", "INTF7"},
65   /* EIMSK  */ { "INT0",  "INT1",  "INT2",  "INT3",  "INT4",  "INT5",  "INT6",  "INT7"},
66   /* GPIOR0 */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
67   /* EECR   */ { "EERE",  "EEPE", "EEMPE", "EERIE", "EEPM0", "EEPM1",     "6",     "7"},
68   /* EEDR   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
69   /* EEARL  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
70   /* EEARH  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
71   /* GTCCR  */ {"PSRSYNC", "PSRASY",  "2",     "3",     "4",     "5",     "6",   "TSM"},
72   /* TCCR0A */ {"WGM00", "WGM01",     "2",     "3","COM0B0","COM0B1","COM0A0","COM0A1"},
73   /* TCCR0B */ {  "CS0",   "CS1",   "CS2", "WGM02",     "4",     "5", "FOC0B", "FOC0A"},
74   /* TCNT0  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
75   /* OCR0A  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
76   /* OCR0B  */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
77   /* 0x29   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
78   /* GPIOR1 */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
79   /* GPIOR2 */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
80   /* SPCR   */ { "SPR0",  "SPR1",  "CPHA",  "CPOL",  "MSTR",  "DORD",   "SPE",  "SPIE"},
81   /* SPSR   */ {"SPI2X",     "1",     "2",     "3",     "4",     "5",  "WCOL",  "SPIF"},
82   /* SPDR   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
83   /* 0x2F   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
84   /* ACSR   */ {"ACIS0", "ACIS1",  "ACIC",  "ACIE",   "ACI",   "ACO",  "ACBG",   "ACD"},
85   /* OCDR   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
86   /* 0x32   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
87   /* SMCR   */ {   "SE",   "SM0",   "SM1",   "SM2",     "4",     "5",     "6",     "7"},
88   /* MCUSR  */ { "PORF", "EXTRF",  "BORF",  "WDRF",  "JTRF",     "5",     "6",     "7"},
89   /* MCUCR  */ { "IVCE", "IVSEL",     "2",     "3",   "PUD",     "5",     "6",   "JTD"},
90   /* 0x36   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
91   /* SPMCSR */ {"SPMEN", "PGERS", "PGWRT","BLBSET","RWWSRE", "SIGRD", "RWWSB", "SPMIE"},
92   /* 0x38   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
93   /* 0x39   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
94   /* 0x3A   */ {    "0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
95   /* RAMPZ  */ {"RAMPZ0","RAMPZ1",     "2",     "3",     "4",     "5",     "6",     "7"},
96   /* EIND   */ {"EIND0",     "1",     "2",     "3",     "4",     "5",     "6",     "7"},
97   /* SPL    */ {  "SP0",   "SP1",   "SP2",   "SP3",   "SP4",   "SP5",   "SP6",   "SP7"},
98   /* SPH    */ {  "SP8",   "SP9",  "SP10",  "SP11",  "SP12",  "SP13",  "SP14",  "SP15"},
99   /* SREG   */ {    "C",     "Z",     "N",     "V",     "S",     "H",     "T",     "I"}};
100100
101101   switch(op & 0xf000)
102102   {
r29404r29405
524524               output += sprintf( output, "SBIW    R%d:R%d, 0x%02x", 24+(RD2(op) << 1)+1, 24+(RD2(op) << 1), KCONST6(op) );
525525               break;
526526            case 0x0800:
527          if (ACONST5(op) < 0x20)
528            output += sprintf( output, "CBI     %s, %s", register_names[ACONST5(op)], register_bit_names[ACONST5(op)][RR3(op)] );
529          else
530            output += sprintf( output, "CBI     0x%02x, %d", ACONST5(op), RR3(op) );
527         if (ACONST5(op) < 0x20)
528         output += sprintf( output, "CBI     %s, %s", register_names[ACONST5(op)], register_bit_names[ACONST5(op)][RR3(op)] );
529         else
530         output += sprintf( output, "CBI     0x%02x, %d", ACONST5(op), RR3(op) );
531531               break;
532532            case 0x0900:
533          if (ACONST5(op) < 0x20)
534            output += sprintf( output, "SBIC    %s, %s", register_names[ACONST5(op)],  register_bit_names[ACONST5(op)][RR3(op)] );
535          else
536            output += sprintf( output, "SBIC    0x%02x, %d", ACONST5(op), RR3(op) );
533         if (ACONST5(op) < 0x20)
534         output += sprintf( output, "SBIC    %s, %s", register_names[ACONST5(op)],  register_bit_names[ACONST5(op)][RR3(op)] );
535         else
536         output += sprintf( output, "SBIC    0x%02x, %d", ACONST5(op), RR3(op) );
537537               break;
538538            case 0x0a00:
539          if (ACONST5(op) < 0x20)
540            output += sprintf( output, "SBI     %s, %s", register_names[ACONST5(op)],  register_bit_names[ACONST5(op)][RR3(op)] );
541          else
542            output += sprintf( output, "SBI     0x%02x, %d", ACONST5(op), RR3(op) );
539         if (ACONST5(op) < 0x20)
540         output += sprintf( output, "SBI     %s, %s", register_names[ACONST5(op)],  register_bit_names[ACONST5(op)][RR3(op)] );
541         else
542         output += sprintf( output, "SBI     0x%02x, %d", ACONST5(op), RR3(op) );
543543               break;
544544            case 0x0b00:
545          if (ACONST5(op) < 0x20)
546            output += sprintf( output, "SBIS    %s, %s", register_names[ACONST5(op)],  register_bit_names[ACONST5(op)][RR3(op)] );
547          else
548            output += sprintf( output, "SBIS    0x%02x, %d", ACONST5(op), RR3(op) );
545         if (ACONST5(op) < 0x20)
546         output += sprintf( output, "SBIS    %s, %s", register_names[ACONST5(op)],  register_bit_names[ACONST5(op)][RR3(op)] );
547         else
548         output += sprintf( output, "SBIS    0x%02x, %d", ACONST5(op), RR3(op) );
549549               break;
550550            case 0x0c00:
551551            case 0x0d00:
r29404r29405
558558      case 0xb000:
559559         if(op & 0x0800)
560560         {
561        if (ACONST6(op) < 0x40 ) {
562          output += sprintf( output, "OUT     %s, R%d", register_names[ACONST6(op)], RD5(op) );
563        } else {
564          output += sprintf( output, "OUT     0x%02x, R%d", ACONST6(op), RD5(op) );
565        }
561      if (ACONST6(op) < 0x40 ) {
562         output += sprintf( output, "OUT     %s, R%d", register_names[ACONST6(op)], RD5(op) );
563      } else {
564         output += sprintf( output, "OUT     0x%02x, R%d", ACONST6(op), RD5(op) );
565      }
566566         }
567567         else
568568         {
569        if (ACONST6(op) < 0x40 ) {
570          output += sprintf( output, "IN      R%d, %s", RD5(op), register_names[ACONST6(op)] );
571        } else {
572          output += sprintf( output, "IN      R%d, 0x%02x", RD5(op), ACONST6(op) );
573        }
569      if (ACONST6(op) < 0x40 ) {
570         output += sprintf( output, "IN      R%d, %s", RD5(op), register_names[ACONST6(op)] );
571      } else {
572         output += sprintf( output, "IN      R%d, 0x%02x", RD5(op), ACONST6(op) );
573      }
574574         }
575575         break;
576576      case 0xc000:
577      //I'm not sure if this is correct. why pc + ... : pc + 8 + ... ?
577      //I'm not sure if this is correct. why pc + ... : pc + 8 + ... ?
578578         output += sprintf( output, "RJMP    %08x", (((op & 0x0800) ? pc + ((op & 0x0fff) | 0xfffff000) : pc + 8 + (op & 0x0fff)) << 0) );
579579         break;
580580      case 0xd000:
trunk/src/emu/cpu/z8000/z8000.c
r29404r29405
834834      }
835835   }
836836}
837
trunk/src/emu/cpu/z8000/z8000.h
r29404r29405
655655   virtual UINT32 PSA_ADDR();
656656   virtual UINT32 read_irq_vector();
657657};
658       
659658
659
660660extern const device_type Z8001;
661661extern const device_type Z8002;
662662
trunk/src/emu/cpu/z8000/z8000ops.inc
r29404r29405
6969   if (fcw & F_S_N)    /* new mode is system mode */
7070   {
7171      if (!(m_fcw & F_S_N)                /* old mode was user mode */
72          || ((fcw ^ m_fcw) & F_SEG))     /* or switch between segmented and non-segmented */
72         || ((fcw ^ m_fcw) & F_SEG))     /* or switch between segmented and non-segmented */
7373      {
7474         tmp = RW(14);
7575         RW(14) = m_nspseg;
r29404r29405
7979   else    /* new mode is user mode */
8080   {
8181      if (m_fcw & F_S_N          /* old mode was system mode */
82          && m_fcw & F_SEG)      /* and was segmented */
82         && m_fcw & F_SEG)      /* and was segmented */
8383      {
8484         tmp = RW(14);
8585         RW(14) = m_nspseg;
trunk/src/emu/cpu/i386/i386.c
r29404r29405
43264326
43274327   CHANGE_PC(m_eip);
43284328}
4329
trunk/src/emu/cpu/superfx/superfx.c
r29404r29405
14321432{
14331433extern offs_t superfx_dasm_one(char *buffer, offs_t pc, UINT8 op, UINT8 param0, UINT8 param1, UINT16 alt);
14341434
1435    UINT8  op = *(UINT8 *)(opram + 0);
1436    UINT8  param0 = *(UINT8 *)(opram + 1);
1437    UINT8  param1 = *(UINT8 *)(opram + 2);
1438    UINT16 alt = m_sfr & SUPERFX_SFR_ALT;
1435   UINT8  op = *(UINT8 *)(opram + 0);
1436   UINT8  param0 = *(UINT8 *)(opram + 1);
1437   UINT8  param1 = *(UINT8 *)(opram + 2);
1438   UINT16 alt = m_sfr & SUPERFX_SFR_ALT;
14391439
1440    return superfx_dasm_one(buffer, pc, op, param0, param1, alt);
1440   return superfx_dasm_one(buffer, pc, op, param0, param1, alt);
14411441}
1442
trunk/src/emu/cpu/cpu.mak
r29404r29405
489489ifneq ($(filter H8,$(CPUS)),)
490490OBJDIRS += $(CPUOBJ)/h8
491491CPUOBJS += $(CPUOBJ)/h8/h8.o $(CPUOBJ)/h8/h8h.o $(CPUOBJ)/h8/h8s2000.o $(CPUOBJ)/h8/h8s2600.o \
492           $(CPUOBJ)/h8/h83337.o \
493           $(CPUOBJ)/h8/h83002.o $(CPUOBJ)/h8/h83006.o  $(CPUOBJ)/h8/h83008.o \
494           $(CPUOBJ)/h8/h83048.o \
495           $(CPUOBJ)/h8/h8s2245.o $(CPUOBJ)/h8/h8s2320.o $(CPUOBJ)/h8/h8s2357.o \
496           $(CPUOBJ)/h8/h8s2655.o \
497           $(CPUOBJ)/h8/h8_adc.o $(CPUOBJ)/h8/h8_port.o $(CPUOBJ)/h8/h8_intc.o \
498           $(CPUOBJ)/h8/h8_timer8.o $(CPUOBJ)/h8/h8_timer16.o $(CPUOBJ)/h8/h8_sci.o
492         $(CPUOBJ)/h8/h83337.o \
493         $(CPUOBJ)/h8/h83002.o $(CPUOBJ)/h8/h83006.o  $(CPUOBJ)/h8/h83008.o \
494         $(CPUOBJ)/h8/h83048.o \
495         $(CPUOBJ)/h8/h8s2245.o $(CPUOBJ)/h8/h8s2320.o $(CPUOBJ)/h8/h8s2357.o \
496         $(CPUOBJ)/h8/h8s2655.o \
497         $(CPUOBJ)/h8/h8_adc.o $(CPUOBJ)/h8/h8_port.o $(CPUOBJ)/h8/h8_intc.o \
498         $(CPUOBJ)/h8/h8_timer8.o $(CPUOBJ)/h8/h8_timer16.o $(CPUOBJ)/h8/h8_sci.o
499499DASMOBJS +=
500500endif
501501
502$(CPUOBJ)/h8/h8.o:            $(CPUSRC)/h8/h8.c \
502$(CPUOBJ)/h8/h8.o:              $(CPUSRC)/h8/h8.c \
503503                        $(CPUOBJ)/h8/h8.inc \
504504                        $(CPUSRC)/h8/h8.h
505505
506$(CPUOBJ)/h8/h8h.o:            $(CPUSRC)/h8/h8h.c \
506$(CPUOBJ)/h8/h8h.o:             $(CPUSRC)/h8/h8h.c \
507507                        $(CPUOBJ)/h8/h8h.inc \
508508                        $(CPUSRC)/h8/h8h.h \
509509                        $(CPUSRC)/h8/h8.h
510510
511$(CPUOBJ)/h8/h8s2000.o:         $(CPUSRC)/h8/h8s2000.c \
511$(CPUOBJ)/h8/h8s2000.o:         $(CPUSRC)/h8/h8s2000.c \
512512                        $(CPUOBJ)/h8/h8s2000.inc \
513513                        $(CPUSRC)/h8/h8s2000.h \
514514                        $(CPUSRC)/h8/h8h.h \
515515                        $(CPUSRC)/h8/h8.h
516516
517$(CPUOBJ)/h8/h8s2600.o:         $(CPUSRC)/h8/h8s2600.c \
517$(CPUOBJ)/h8/h8s2600.o:         $(CPUSRC)/h8/h8s2600.c \
518518                        $(CPUOBJ)/h8/h8s2600.inc \
519519                        $(CPUSRC)/h8/h8s2600.h \
520520                        $(CPUSRC)/h8/h8s2000.h \
521521                        $(CPUSRC)/h8/h8h.h \
522522                        $(CPUSRC)/h8/h8.h
523523
524$(CPUOBJ)/h8/h83337.o:         $(CPUSRC)/h8/h83337.c \
524$(CPUOBJ)/h8/h83337.o:          $(CPUSRC)/h8/h83337.c \
525525                        $(CPUSRC)/h8/h83337.h \
526526                        $(CPUSRC)/h8/h8.h \
527527                        $(CPUSRC)/h8/h8_intc.h \
r29404r29405
531531                        $(CPUSRC)/h8/h8_timer16.h \
532532                        $(CPUSRC)/h8/h8_sci.h
533533
534$(CPUOBJ)/h8/h83002.o:         $(CPUSRC)/h8/h83002.c \
534$(CPUOBJ)/h8/h83002.o:          $(CPUSRC)/h8/h83002.c \
535535                        $(CPUSRC)/h8/h83002.h \
536536                        $(CPUSRC)/h8/h8h.h \
537537                        $(CPUSRC)/h8/h8.h \
r29404r29405
541541                        $(CPUSRC)/h8/h8_timer16.h \
542542                        $(CPUSRC)/h8/h8_sci.h
543543
544$(CPUOBJ)/h8/h83006.o:         $(CPUSRC)/h8/h83006.c \
544$(CPUOBJ)/h8/h83006.o:          $(CPUSRC)/h8/h83006.c \
545545                        $(CPUSRC)/h8/h83006.h \
546546                        $(CPUSRC)/h8/h8h.h \
547547                        $(CPUSRC)/h8/h8.h \
r29404r29405
552552                        $(CPUSRC)/h8/h8_timer16.h \
553553                        $(CPUSRC)/h8/h8_sci.h
554554
555$(CPUOBJ)/h8/h83008.o:         $(CPUSRC)/h8/h83008.c \
555$(CPUOBJ)/h8/h83008.o:          $(CPUSRC)/h8/h83008.c \
556556                        $(CPUSRC)/h8/h83008.h \
557557                        $(CPUSRC)/h8/h8h.h \
558558                        $(CPUSRC)/h8/h8.h \
r29404r29405
563563                        $(CPUSRC)/h8/h8_timer16.h \
564564                        $(CPUSRC)/h8/h8_sci.h
565565
566$(CPUOBJ)/h8/h83048.o:         $(CPUSRC)/h8/h83048.c \
566$(CPUOBJ)/h8/h83048.o:          $(CPUSRC)/h8/h83048.c \
567567                        $(CPUSRC)/h8/h83048.h \
568568                        $(CPUSRC)/h8/h8h.h \
569569                        $(CPUSRC)/h8/h8.h \
r29404r29405
573573                        $(CPUSRC)/h8/h8_timer16.h \
574574                        $(CPUSRC)/h8/h8_sci.h
575575
576$(CPUOBJ)/h8/h8s2245.o:         $(CPUSRC)/h8/h8s2245.c \
576$(CPUOBJ)/h8/h8s2245.o:         $(CPUSRC)/h8/h8s2245.c \
577577                        $(CPUSRC)/h8/h8s2245.h \
578578                        $(CPUSRC)/h8/h8s2000.h \
579579                        $(CPUSRC)/h8/h8h.h \
r29404r29405
585585                        $(CPUSRC)/h8/h8_timer16.h \
586586                        $(CPUSRC)/h8/h8_sci.h
587587
588$(CPUOBJ)/h8/h8s2320.o:         $(CPUSRC)/h8/h8s2320.c \
588$(CPUOBJ)/h8/h8s2320.o:         $(CPUSRC)/h8/h8s2320.c \
589589                        $(CPUSRC)/h8/h8s2320.h \
590590                        $(CPUSRC)/h8/h8s2000.h \
591591                        $(CPUSRC)/h8/h8h.h \
r29404r29405
597597                        $(CPUSRC)/h8/h8_timer16.h \
598598                        $(CPUSRC)/h8/h8_sci.h
599599
600$(CPUOBJ)/h8/h8s2357.o:         $(CPUSRC)/h8/h8s2357.c \
600$(CPUOBJ)/h8/h8s2357.o:         $(CPUSRC)/h8/h8s2357.c \
601601                        $(CPUSRC)/h8/h8s2357.h \
602602                        $(CPUSRC)/h8/h8s2000.h \
603603                        $(CPUSRC)/h8/h8h.h \
r29404r29405
609609                        $(CPUSRC)/h8/h8_timer16.h \
610610                        $(CPUSRC)/h8/h8_sci.h
611611
612$(CPUOBJ)/h8/h8s2655.o:         $(CPUSRC)/h8/h8s2655.c \
612$(CPUOBJ)/h8/h8s2655.o:         $(CPUSRC)/h8/h8s2655.c \
613613                        $(CPUSRC)/h8/h8s2655.h \
614614                        $(CPUSRC)/h8/h8s2600.h \
615615                        $(CPUSRC)/h8/h8s2000.h \
r29404r29405
622622                        $(CPUSRC)/h8/h8_timer16.h \
623623                        $(CPUSRC)/h8/h8_sci.h
624624
625$(CPUOBJ)/h8/h8_intc.o:         $(CPUSRC)/h8/h8_intc.c \
625$(CPUOBJ)/h8/h8_intc.o:         $(CPUSRC)/h8/h8_intc.c \
626626                        $(CPUSRC)/h8/h8_intc.h \
627627                        $(CPUSRC)/h8/h8.h
628628
629$(CPUOBJ)/h8/h8_adc.o:         $(CPUSRC)/h8/h8_adc.c \
629$(CPUOBJ)/h8/h8_adc.o:          $(CPUSRC)/h8/h8_adc.c \
630630                        $(CPUSRC)/h8/h8_adc.h \
631631                        $(CPUSRC)/h8/h8_intc.h \
632632                        $(CPUSRC)/h8/h8.h
633633
634$(CPUOBJ)/h8/h8_port.o:         $(CPUSRC)/h8/h8_port.c \
634$(CPUOBJ)/h8/h8_port.o:         $(CPUSRC)/h8/h8_port.c \
635635                        $(CPUSRC)/h8/h8_port.h \
636636                        $(CPUSRC)/h8/h8.h
637637
638$(CPUOBJ)/h8/h8_timer16.o:      $(CPUSRC)/h8/h8_timer16.c \
638$(CPUOBJ)/h8/h8_timer16.o:      $(CPUSRC)/h8/h8_timer16.c \
639639                        $(CPUSRC)/h8/h8_timer16.h \
640640                        $(CPUSRC)/h8/h8_intc.h \
641641                        $(CPUSRC)/h8/h8.h
642642
643$(CPUOBJ)/h8/h8_sci.o:         $(CPUSRC)/h8/h8_sci.c \
643$(CPUOBJ)/h8/h8_sci.o:          $(CPUSRC)/h8/h8_sci.c \
644644                        $(CPUSRC)/h8/h8_sci.h \
645645                        $(CPUSRC)/h8/h8_intc.h \
646646                        $(CPUSRC)/h8/h8.h
trunk/src/emu/cpu/scmp/scmp.c
r29404r29405
564564         break;
565565   }
566566}
567
trunk/src/emu/cpu/i86/i186.c
r29404r29405
642642   m_timer[0].control = 0;
643643   m_timer[1].control = 0;
644644   m_timer[2].control = 0;
645   
645
646646   set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback),this));
647647}
648648
trunk/src/emu/cpu/upd7810/upd7810.c
r29404r29405
487487}
488488
489489upd78c05_device::upd78c05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
490    : upd7810_device(mconfig, UPD78C05, "uPD78C05", tag, owner, clock, "upd78c05", __FILE__)
490   : upd7810_device(mconfig, UPD78C05, "uPD78C05", tag, owner, clock, "upd78c05", __FILE__)
491491{
492492   m_op48 = s_op48_78c05;
493493   m_op4C = s_op4C_78c05;
r29404r29405
22502250   }
22512251   /* resetting interrupt requests is done with the SKIT/SKNIT opcodes only! */
22522252}
2253
trunk/src/emu/cpu/upd7810/upd7810.h
r29404r29405
8181   upd7810_device::set_an7_func(*device, DEVCB2_##_devcb);
8282
8383
84class upd7810_device : public cpu_device
84class upd7810_device : public cpu_device
8585{
8686public:
8787   // construction/destruction
trunk/src/emu/cpu/sc61860/sc61860.c
r29404r29405
259259
260260   } while (m_icount > 0);
261261}
262
trunk/src/emu/cpu/v60/v60.c
r29404r29405
550550         v60_try_irq();
551551   }
552552}
553
trunk/src/emu/cpu/v60/v60.h
r29404r29405
157157      UINT8 OV;
158158      UINT8 S;
159159      UINT8 Z;
160    }                   m_flags;
160   }                   m_flags;
161161   UINT8               m_irq_line;
162162   UINT8               m_nmi_line;
163163   address_space *m_program;
trunk/src/emu/cpu/ssp1601/ssp1601.c
r29404r29405
780780{
781781   fatalerror("ssp1610: execute_set_input not implemented yet!\n");
782782}
783
trunk/src/emu/cpu/esrip/esrip.h
r29404r29405
2727
2828#define MCFG_ESRIP_FDT_R_CALLBACK(_read) \
2929   devcb = &esrip_device::static_set_fdt_r_callback(*device, DEVCB2_##_read);
30
30
3131#define MCFG_ESRIP_FDT_W_CALLBACK(_write) \
3232   devcb = &esrip_device::static_set_fdt_w_callback(*device, DEVCB2_##_write);
33
33
3434#define MCFG_ESRIP_STATUS_IN_CALLBACK(_read) \
3535   devcb = &esrip_device::static_set_status_in_callback(*device, DEVCB2_##_read);
36
36
3737#define MCFG_ESRIP_DRAW_CALLBACK_OWNER(_class, _method) \
3838   esrip_device::static_set_draw_callback(*device, esrip_draw_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
3939
trunk/src/emu/cpu/tms32010/tms32010.c
r29404r29405
882882
883883void tms32010_device::device_reset()
884884{
885    m_PC    = 0;
886    m_ACC.d = 0;
887    m_INTF  = TMS32010_INT_NONE;
888    /* Setup Status Register : 7efe */
889    CLR((OV_FLAG | ARP_REG | DP_REG));
890    SET_FLAG((OVM_FLAG | INTM_FLAG));
885   m_PC    = 0;
886   m_ACC.d = 0;
887   m_INTF  = TMS32010_INT_NONE;
888   /* Setup Status Register : 7efe */
889   CLR((OV_FLAG | ARP_REG | DP_REG));
890   SET_FLAG((OVM_FLAG | INTM_FLAG));
891891}
892892
893893
r29404r29405
981981      }
982982   } while (m_icount > 0);
983983}
984
trunk/src/emu/cpu/tms32051/tms32051.c
r29404r29405
520520   }
521521   return 1;
522522}
523
trunk/src/emu/cpu/tms32051/tms32051.h
r29404r29405
6161
6262   // device_memory_interface overrides
6363   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_DATA) ? &m_data_config : NULL ); }
64    virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
64   virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
6565
6666   // device_disasm_interface overrides
6767   virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
trunk/src/emu/cpu/rsp/rsp.h
r29404r29405
1717#define __RSP_H__
1818
1919#define USE_SIMD        (0)
20#define SIMUL_SIMD      (0)
20#define SIMUL_SIMD      (0)
2121
2222#if USE_SIMD
2323#include <tmmintrin.h>
trunk/src/emu/cpu/rsp/rspdrc.c
r29404r29405
38293829   }
38303830   VEC_WRITEBACK_RESULT();
38313831/*
3832   __m128i loProduct, hiProduct, unpackLo, unpackHi;
3833   __m128i vaccHigh;
3834   __m128i vdReg, vdRegLo, vdRegHi;
3832    __m128i loProduct, hiProduct, unpackLo, unpackHi;
3833    __m128i vaccHigh;
3834    __m128i vdReg, vdRegLo, vdRegHi;
38353835
3836   __m128i vsReg = rsp->xv[VS1REG];
3837   __m128i vtReg = _mm_shuffle_epi8(rsp->xv[VS2REG], vec_shuf_inverse[EL]);
3836    __m128i vsReg = rsp->xv[VS1REG];
3837    __m128i vtReg = _mm_shuffle_epi8(rsp->xv[VS2REG], vec_shuf_inverse[EL]);
38383838
3839   __m128i vaccLow = rsp->accum_l;
3839    __m128i vaccLow = rsp->accum_l;
38403840
3841   // Unpack to obtain for 32-bit precision.
3842   RSPZeroExtend16to32(vaccLow, &vaccLow, &vaccHigh);
3841    // Unpack to obtain for 32-bit precision.
3842    RSPZeroExtend16to32(vaccLow, &vaccLow, &vaccHigh);
38433843
3844   // Begin accumulating the products.
3845   unpackLo = _mm_mullo_epi16(vsReg, vtReg);
3846   unpackHi = _mm_mulhi_epi16(vsReg, vtReg);
3847   loProduct = _mm_unpacklo_epi16(unpackLo, unpackHi);
3848   hiProduct = _mm_unpackhi_epi16(unpackLo, unpackHi);
3849   loProduct = _mm_slli_epi32(loProduct, 1);
3850   hiProduct = _mm_slli_epi32(hiProduct, 1);
3844    // Begin accumulating the products.
3845    unpackLo = _mm_mullo_epi16(vsReg, vtReg);
3846    unpackHi = _mm_mulhi_epi16(vsReg, vtReg);
3847    loProduct = _mm_unpacklo_epi16(unpackLo, unpackHi);
3848    hiProduct = _mm_unpackhi_epi16(unpackLo, unpackHi);
3849    loProduct = _mm_slli_epi32(loProduct, 1);
3850    hiProduct = _mm_slli_epi32(hiProduct, 1);
38513851
3852   vdRegLo = _mm_srli_epi32(loProduct, 16);
3853   vdRegHi = _mm_srli_epi32(hiProduct, 16);
3854   vdRegLo = _mm_slli_epi32(vdRegLo, 16);
3855   vdRegHi = _mm_slli_epi32(vdRegHi, 16);
3856   vdRegLo = _mm_xor_si128(vdRegLo, loProduct);
3857   vdRegHi = _mm_xor_si128(vdRegHi, hiProduct);
3852    vdRegLo = _mm_srli_epi32(loProduct, 16);
3853    vdRegHi = _mm_srli_epi32(hiProduct, 16);
3854    vdRegLo = _mm_slli_epi32(vdRegLo, 16);
3855    vdRegHi = _mm_slli_epi32(vdRegHi, 16);
3856    vdRegLo = _mm_xor_si128(vdRegLo, loProduct);
3857    vdRegHi = _mm_xor_si128(vdRegHi, hiProduct);
38583858
3859   vaccLow = _mm_add_epi32(vaccLow, vdRegLo);
3860   vaccHigh = _mm_add_epi32(vaccHigh, vdRegHi);
3859    vaccLow = _mm_add_epi32(vaccLow, vdRegLo);
3860    vaccHigh = _mm_add_epi32(vaccHigh, vdRegHi);
38613861
3862   rsp->accum_l = vdReg = RSPPackLo32to16(vaccLow, vaccHigh);
3862    rsp->accum_l = vdReg = RSPPackLo32to16(vaccLow, vaccHigh);
38633863
3864   // Multiply the MSB of sources, accumulate the product.
3865   vdRegLo = _mm_unpacklo_epi16(rsp->accum_m, rsp->accum_h);
3866   vdRegHi = _mm_unpackhi_epi16(rsp->accum_m, rsp->accum_h);
3864    // Multiply the MSB of sources, accumulate the product.
3865    vdRegLo = _mm_unpacklo_epi16(rsp->accum_m, rsp->accum_h);
3866    vdRegHi = _mm_unpackhi_epi16(rsp->accum_m, rsp->accum_h);
38673867
3868   loProduct = _mm_srai_epi32(loProduct, 16);
3869   hiProduct = _mm_srai_epi32(hiProduct, 16);
3870   vaccLow = _mm_srai_epi32(vaccLow, 16);
3871   vaccHigh = _mm_srai_epi32(vaccHigh, 16);
3868    loProduct = _mm_srai_epi32(loProduct, 16);
3869    hiProduct = _mm_srai_epi32(hiProduct, 16);
3870    vaccLow = _mm_srai_epi32(vaccLow, 16);
3871    vaccHigh = _mm_srai_epi32(vaccHigh, 16);
38723872
3873   vaccLow = _mm_add_epi32(loProduct, vaccLow);
3874   vaccHigh = _mm_add_epi32(hiProduct, vaccHigh);
3875   vaccLow = _mm_add_epi32(vdRegLo, vaccLow);
3876   vaccHigh = _mm_add_epi32(vdRegHi, vaccHigh);
3873    vaccLow = _mm_add_epi32(loProduct, vaccLow);
3874    vaccHigh = _mm_add_epi32(hiProduct, vaccHigh);
3875    vaccLow = _mm_add_epi32(vdRegLo, vaccLow);
3876    vaccHigh = _mm_add_epi32(vdRegHi, vaccHigh);
38773877
3878   // Clamp the accumulator and write it all out.
3879   rsp->xv[VDREG] = _mm_packs_epi32(vaccLow, vaccHigh);
3880   rsp->accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
3881   rsp->accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
3878    // Clamp the accumulator and write it all out.
3879    rsp->xv[VDREG] = _mm_packs_epi32(vaccLow, vaccHigh);
3880    rsp->accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
3881    rsp->accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
38823882*/
38833883}
38843884
r29404r29405
42694269}
42704270/*INLINE void cfunc_rsp_vmadn_simd(void *param)
42714271{
4272   rsp_state *rsp = (rsp_state*)param;
4273   int op = rsp->impstate->arg0;
4272    rsp_state *rsp = (rsp_state*)param;
4273    int op = rsp->impstate->arg0;
42744274
4275   __m128i vaccLow, vaccHigh, loProduct, hiProduct;
4276   __m128i vsRegLo, vsRegHi, vtRegLo, vtRegHi, vdRegLo, vdRegHi;
4275    __m128i vaccLow, vaccHigh, loProduct, hiProduct;
4276    __m128i vsRegLo, vsRegHi, vtRegLo, vtRegHi, vdRegLo, vdRegHi;
42774277
4278   __m128i vsReg = rsp->xv[VS1REG];
4279   __m128i vtReg = _mm_shuffle_epi8(rsp->xv[VS2REG], vec_shuf_inverse[EL]);
4278    __m128i vsReg = rsp->xv[VS1REG];
4279    __m128i vtReg = _mm_shuffle_epi8(rsp->xv[VS2REG], vec_shuf_inverse[EL]);
42804280
4281   vaccLow = rsp->accum_l;
4281    vaccLow = rsp->accum_l;
42824282
4283   RSPZeroExtend16to32(vsReg, &vsRegLo, &vsRegHi);
4284   RSPSignExtend16to32(vtReg, &vtRegLo, &vtRegHi);
4285   RSPZeroExtend16to32(vaccLow, &vaccLow, &vaccHigh);
4283    RSPZeroExtend16to32(vsReg, &vsRegLo, &vsRegHi);
4284    RSPSignExtend16to32(vtReg, &vtRegLo, &vtRegHi);
4285    RSPZeroExtend16to32(vaccLow, &vaccLow, &vaccHigh);
42864286
4287   // Begin accumulating the products.
4288   loProduct = _mm_mullo_epi32(vsRegLo, vtRegLo);
4289   hiProduct = _mm_mullo_epi32(vsRegHi, vtRegHi);
4287    // Begin accumulating the products.
4288    loProduct = _mm_mullo_epi32(vsRegLo, vtRegLo);
4289    hiProduct = _mm_mullo_epi32(vsRegHi, vtRegHi);
42904290
4291   vdRegLo = _mm_srli_epi32(loProduct, 16);
4292   vdRegHi = _mm_srli_epi32(hiProduct, 16);
4293   vdRegLo = _mm_slli_epi32(vdRegLo, 16);
4294   vdRegHi = _mm_slli_epi32(vdRegHi, 16);
4295   vdRegLo = _mm_xor_si128(vdRegLo, loProduct);
4296   vdRegHi = _mm_xor_si128(vdRegHi, hiProduct);
4291    vdRegLo = _mm_srli_epi32(loProduct, 16);
4292    vdRegHi = _mm_srli_epi32(hiProduct, 16);
4293    vdRegLo = _mm_slli_epi32(vdRegLo, 16);
4294    vdRegHi = _mm_slli_epi32(vdRegHi, 16);
4295    vdRegLo = _mm_xor_si128(vdRegLo, loProduct);
4296    vdRegHi = _mm_xor_si128(vdRegHi, hiProduct);
42974297
4298   vaccLow = _mm_add_epi32(vaccLow, vdRegLo);
4299   vaccHigh = _mm_add_epi32(vaccHigh, vdRegHi);
4298    vaccLow = _mm_add_epi32(vaccLow, vdRegLo);
4299    vaccHigh = _mm_add_epi32(vaccHigh, vdRegHi);
43004300
4301   rsp->accum_l = RSPPackLo32to16(vaccLow, vaccHigh);
4301    rsp->accum_l = RSPPackLo32to16(vaccLow, vaccHigh);
43024302
4303   // Multiply the MSB of sources, accumulate the product.
4304   vdRegLo = _mm_unpacklo_epi16(rsp->accum_m, rsp->accum_h);
4305   vdRegHi = _mm_unpackhi_epi16(rsp->accum_m, rsp->accum_h);
4303    // Multiply the MSB of sources, accumulate the product.
4304    vdRegLo = _mm_unpacklo_epi16(rsp->accum_m, rsp->accum_h);
4305    vdRegHi = _mm_unpackhi_epi16(rsp->accum_m, rsp->accum_h);
43064306
4307   loProduct = _mm_srai_epi32(loProduct, 16);
4308   hiProduct = _mm_srai_epi32(hiProduct, 16);
4309   vaccLow = _mm_srai_epi32(vaccLow, 16);
4310   vaccHigh = _mm_srai_epi32(vaccHigh, 16);
4307    loProduct = _mm_srai_epi32(loProduct, 16);
4308    hiProduct = _mm_srai_epi32(hiProduct, 16);
4309    vaccLow = _mm_srai_epi32(vaccLow, 16);
4310    vaccHigh = _mm_srai_epi32(vaccHigh, 16);
43114311
4312   vaccLow = _mm_add_epi32(loProduct, vaccLow);
4313   vaccHigh = _mm_add_epi32(hiProduct, vaccHigh);
4314   vaccLow = _mm_add_epi32(vdRegLo, vaccLow);
4315   vaccHigh = _mm_add_epi32(vdRegHi, vaccHigh);
4312    vaccLow = _mm_add_epi32(loProduct, vaccLow);
4313    vaccHigh = _mm_add_epi32(hiProduct, vaccHigh);
4314    vaccLow = _mm_add_epi32(vdRegLo, vaccLow);
4315    vaccHigh = _mm_add_epi32(vdRegHi, vaccHigh);
43164316
4317   // Clamp the accumulator and write it all out.
4318   rsp->accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
4319   rsp->accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
4320   rsp->xv[VDREG] = RSPClampLowToVal(rsp->accum_l, rsp->accum_m, rsp->accum_h);
4317    // Clamp the accumulator and write it all out.
4318    rsp->accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
4319    rsp->accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
4320    rsp->xv[VDREG] = RSPClampLowToVal(rsp->accum_l, rsp->accum_m, rsp->accum_h);
43214321}*/
43224322
43234323#endif
trunk/src/emu/cpu/tlcs90/tlcs90.c
r29404r29405
27882788         break;
27892789   }
27902790}
2791
trunk/src/emu/cpu/powerpc/ppccom.c
r29404r29405
24892489}
24902490
24912491/*-------------------------------------------------
2492    ppc4xx_set_dcr_read_handler
2492    ppc4xx_set_dcr_read_handler
24932493-------------------------------------------------*/
24942494
24952495void ppc4xx_set_dcr_read_handler(device_t *device, read32_delegate dcr_read_func)
r29404r29405
25002500}
25012501
25022502/*-------------------------------------------------
2503    ppc4xx_set_dcr_write_handler
2503    ppc4xx_set_dcr_write_handler
25042504-------------------------------------------------*/
25052505
25062506void ppc4xx_set_dcr_write_handler(device_t *device, write32_delegate dcr_write_func)
trunk/src/emu/cpu/h8/h8_sci.c
r29404r29405
3232{
3333   smr = data;
3434   logerror("%s: smr_w %02x %s %c%c%c%s /%d (%06x)\n", tag(), data,
35          data & SMR_CA ? "sync" : "async",
36          data & SMR_CHR ? '7' : '8',
37          data & SMR_PE ? data & SMR_OE ? 'o' : 'e' : 'n',
38          data & SMR_STOP ? '2' : '1',
39          data & SMR_MP ? " mp" : "",
40          1 << 2*(data & SMR_CKS),
41          cpu->pc());
35            data & SMR_CA ? "sync" : "async",
36            data & SMR_CHR ? '7' : '8',
37            data & SMR_PE ? data & SMR_OE ? 'o' : 'e' : 'n',
38            data & SMR_STOP ? '2' : '1',
39            data & SMR_MP ? " mp" : "",
40            1 << 2*(data & SMR_CKS),
41            cpu->pc());
4242   clock_update();
4343}
4444
r29404r29405
6464WRITE8_MEMBER(h8_sci_device::scr_w)
6565{
6666   logerror("%s: scr_w %02x%s%s%s%s%s%s clk=%d (%06x)\n", tag(), data,
67          data & SCR_TIE  ? " txi" : "",
68          data & SCR_RIE  ? " rxi" : "",
69          data & SCR_TE   ? " tx" : "",
70          data & SCR_RE   ? " rx" : "",
71          data & SCR_MPIE ? " mpi" : "",
72          data & SCR_TEIE ? " tei" : "",
73          data & SCR_CKE,
74          cpu->pc());
67            data & SCR_TIE  ? " txi" : "",
68            data & SCR_RIE  ? " rxi" : "",
69            data & SCR_TE   ? " tx" : "",
70            data & SCR_RE   ? " rx" : "",
71            data & SCR_MPIE ? " mpi" : "",
72            data & SCR_TEIE ? " tei" : "",
73            data & SCR_CKE,
74            cpu->pc());
7575
7676   UINT8 delta = scr ^ data;
7777   scr = data;
r29404r29405
217217      external_to_internal_ratio = (external_clock_period*cpu->clock()).as_double();
218218      internal_to_external_ratio = 1/external_to_internal_ratio;
219219   }
220     
220
221221   intc = siblingdevice<h8_intc_device>(intc_tag);
222222   save_item(NAME(rdr));
223223   save_item(NAME(tdr));
r29404r29405
301301         case CLKM_EXTERNAL_SYNC:
302302            if((!ext_clock_value) && (clock_state & CLK_TX))
303303               tx_dropped_edge();
304           
304
305305            else if(ext_clock_value && (clock_state & CLK_RX))
306306               rx_raised_edge();
307307            break;
r29404r29405
324324               clock_base += fp;
325325            }
326326            assert(delta < fp);
327           
327
328328            bool new_clock = delta >= divider;
329329            if(new_clock != clock_value) {
330330               cpu->synchronize();
331331               if((!new_clock) && (clock_state & CLK_TX))
332332                  tx_dropped_edge();
333               
333
334334               else if(new_clock && (clock_state & CLK_RX))
335335                  rx_raised_edge();
336               
336
337337               clock_value = new_clock;
338338               if(clock_state || clock_value)
339339                  clk_cb(clock_value);
r29404r29405
359359               cpu->synchronize();
360360               if((!new_clock) && (clock_state & CLK_TX))
361361                  tx_dropped_edge();
362               
362
363363               else if(new_clock && (clock_state & CLK_RX))
364364                  rx_raised_edge();
365               
365
366366               clock_value = new_clock;
367367               if(clock_mode == CLKM_INTERNAL_ASYNC_OUT && (clock_state || !clock_value))
368368                  clk_cb(clock_value);
369369            }
370370         }
371         
371
372372         event = clock_base + (clock_value ? fp : divider*8);
373373      }
374374      break;
r29404r29405
385385               cpu->synchronize();
386386               if((!new_clock) && (clock_state & CLK_TX))
387387                  tx_dropped_edge();
388               
388
389389               else if(new_clock && (clock_state & CLK_RX))
390390                  rx_raised_edge();
391               
391
392392               clock_value = new_clock;
393393            }
394394         }
395         
395
396396         event = UINT64((clock_base + (clock_value ? 2 : 1))*external_to_internal_ratio)+1;
397397      }
398398      break;
r29404r29405
409409               cpu->synchronize();
410410               if((!new_clock) && (clock_state & CLK_TX))
411411                  tx_dropped_edge();
412               
412
413413               else if(new_clock && (clock_state & CLK_RX))
414414                  rx_raised_edge();
415               
415
416416               clock_value = new_clock;
417417            }
418418         }
419         
419
420420         event = UINT64((clock_base + (clock_value ? 16 : 8))*external_to_internal_ratio)+1;
421421      }
422422      break;
r29404r29405
503503   }
504504   clock_start(CLK_TX);
505505}
506
506
507507void h8_sci_device::tx_dropped_edge()
508508{
509509   logerror("%s: tx_dropped_edge state=%s bit=%d\n", tag(), state_names[tx_state], tx_bit);
r29404r29405
676676   }
677677   logerror("%s:             -> state=%s, bit=%d\n", tag(), state_names[rx_state], rx_bit);
678678}
679
trunk/src/emu/cpu/h8/h8s2320.h
r29404r29405
6868   h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6969
7070   DECLARE_READ8_MEMBER(syscr_r);
71   DECLARE_WRITE8_MEMBER(syscr_w);   
71   DECLARE_WRITE8_MEMBER(syscr_w);
7272
7373protected:
7474   required_device<h8s_intc_device> intc;
trunk/src/emu/cpu/h8/h8s2245.c
r29404r29405
101101   MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A,        false, false)
102102   MCFG_H8_TIMER16_ADD("timer16", 3, 0x00)
103103   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
104                         h8_timer16_channel_device::DIV_1,
105                         h8_timer16_channel_device::DIV_4,
106                         h8_timer16_channel_device::DIV_16,
107                         h8_timer16_channel_device::DIV_64,
108                         h8_timer16_channel_device::INPUT_A,
109                         h8_timer16_channel_device::INPUT_B,
110                         h8_timer16_channel_device::INPUT_C,
111                         h8_timer16_channel_device::INPUT_D)
104                           h8_timer16_channel_device::DIV_1,
105                           h8_timer16_channel_device::DIV_4,
106                           h8_timer16_channel_device::DIV_16,
107                           h8_timer16_channel_device::DIV_64,
108                           h8_timer16_channel_device::INPUT_A,
109                           h8_timer16_channel_device::INPUT_B,
110                           h8_timer16_channel_device::INPUT_C,
111                           h8_timer16_channel_device::INPUT_D)
112112   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
113                         h8_timer16_channel_device::DIV_1,
114                         h8_timer16_channel_device::DIV_4,
115                         h8_timer16_channel_device::DIV_16,
116                         h8_timer16_channel_device::DIV_64,
117                         h8_timer16_channel_device::INPUT_A,
118                         h8_timer16_channel_device::INPUT_B,
119                         h8_timer16_channel_device::DIV_256,
120                         h8_timer16_channel_device::CHAIN)
113                           h8_timer16_channel_device::DIV_1,
114                           h8_timer16_channel_device::DIV_4,
115                           h8_timer16_channel_device::DIV_16,
116                           h8_timer16_channel_device::DIV_64,
117                           h8_timer16_channel_device::INPUT_A,
118                           h8_timer16_channel_device::INPUT_B,
119                           h8_timer16_channel_device::DIV_256,
120                           h8_timer16_channel_device::CHAIN)
121121   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
122122   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
123                         h8_timer16_channel_device::DIV_1,
124                         h8_timer16_channel_device::DIV_4,
125                         h8_timer16_channel_device::DIV_16,
126                         h8_timer16_channel_device::DIV_64,
127                         h8_timer16_channel_device::INPUT_A,
128                         h8_timer16_channel_device::INPUT_B,
129                         h8_timer16_channel_device::INPUT_C,
130                         h8_timer16_channel_device::DIV_1024)
123                           h8_timer16_channel_device::DIV_1,
124                           h8_timer16_channel_device::DIV_4,
125                           h8_timer16_channel_device::DIV_16,
126                           h8_timer16_channel_device::DIV_64,
127                           h8_timer16_channel_device::INPUT_A,
128                           h8_timer16_channel_device::INPUT_B,
129                           h8_timer16_channel_device::INPUT_C,
130                           h8_timer16_channel_device::DIV_1024)
131131   MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
132132   MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
133133   MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
trunk/src/emu/cpu/h8/h8_sci.h
r29404r29405
8484   template<class _Object> static devcb2_base &set_clk_cb(device_t &device, _Object object) { return downcast<h8_sci_device &>(device).clk_cb.set_callback(object); }
8585
8686   UINT64 internal_update(UINT64 current_time);
87   
87
8888protected:
8989   enum {
9090      ST_IDLE, ST_START, ST_BIT, ST_PARITY, ST_STOP, ST_LAST_TICK,
trunk/src/emu/cpu/h8/h8s2245.h
r29404r29405
6363   h8s2245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6464
6565   DECLARE_READ8_MEMBER(syscr_r);
66   DECLARE_WRITE8_MEMBER(syscr_w);   
66   DECLARE_WRITE8_MEMBER(syscr_w);
6767
6868protected:
6969   required_device<h8s_intc_device> intc;
trunk/src/emu/cpu/h8/h8_adc.c
r29404r29405
124124   mode = IDLE;
125125   channel = 0;
126126   count = 0;
127   next_event = 0; 
127   next_event = 0;
128128   mode_update();
129129   analog_powered = !analog_power_control;
130130   adtrg = true;
r29404r29405
188188   count = start_count;
189189   sampling();
190190   conversion_wait(true, !analog_powered);
191   analog_powered = true;   
191   analog_powered = true;
192192}
193193
194194void h8_adc_device::timeout(UINT64 current_time)
r29404r29405
450450
451451   if(adcsr & 0x03) {
452452      mode |= BUFFER;
453     
453
454454   }
455455
456456   if(adcsr & 0x08) {
trunk/src/emu/cpu/h8/h8_timer16.c
r29404r29405
9494   tier = data;
9595   tier_update();
9696   logerror("%s: irq %c%c%c%c%c%c trigger=%d\n",
97          tag(),
98          ier & IRQ_A ? 'a' : '.',
99          ier & IRQ_B ? 'b' : '.',
100          ier & IRQ_C ? 'c' : '.',
101          ier & IRQ_D ? 'd' : '.',
102          ier & IRQ_V ? 'v' : '.',
103          ier & IRQ_U ? 'u' : '.',
104          ier & IRQ_TRIG ? 1 : 0);
97            tag(),
98            ier & IRQ_A ? 'a' : '.',
99            ier & IRQ_B ? 'b' : '.',
100            ier & IRQ_C ? 'c' : '.',
101            ier & IRQ_D ? 'd' : '.',
102            ier & IRQ_V ? 'v' : '.',
103            ier & IRQ_U ? 'u' : '.',
104            ier & IRQ_TRIG ? 1 : 0);
105105   recalc_event();
106106}
107107
r29404r29405
218218      tcnt = tt % counter_cycle;
219219      if(0)
220220      logerror("%s: Updating %d (%ld %ld) (%ld %ld) -> %d/%d\n",
221             tag(),
222             ott,
223             long(last_clock_update), long(cur_time),
224             long(base_time), long(new_time),
225             tt, tcnt);
221               tag(),
222               ott,
223               long(last_clock_update), long(cur_time),
224               long(base_time), long(new_time),
225               tt, tcnt);
226226
227227      for(int i=0; i<tgr_count; i++)
228228         if((ier & (1 << i)) && (tt == tgr[i] || tcnt == tgr[i]) && interrupt[i] != -1) {
r29404r29405
284284
285285            if(0)
286286            logerror("%s: tcnt=%d tgr%c=%d cycle=%d -> delay=%d\n",
287                  tag(), tcnt, 'a'+i, tgr[i], counter_cycle, new_delay);
287                     tag(), tcnt, 'a'+i, tgr[i], counter_cycle, new_delay);
288288            if(event_delay > new_delay)
289289               event_delay = new_delay;
290290         }
r29404r29405
292292         event_time = ((((cur_time + (1ULL << clock_divider) - phase) >> clock_divider) + event_delay - 1) << clock_divider) + phase;
293293      else
294294         event_time = 0;
295     
295
296296      if(event_time && 0)
297297         logerror("%s: next event in %d cycles (%ld)\n", tag(), int(event_time - cpu->get_cycle()), long(event_time));
298     
298
299299   } else {
300300      logerror("decrementing counter\n");
301301      exit(1);
r29404r29405
622622}
623623
624624void h8s_timer16_channel_device::set_info(int _tgr_count, UINT8 _tier_mask, const char *intc, int irq_base,
625                                int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7)
625                                 int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7)
626626{
627627   tgr_count = _tgr_count;
628628   tbr_count = 0;
trunk/src/emu/cpu/h8/h83002.h
r29404r29405
5454   h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5555
5656   DECLARE_READ8_MEMBER(syscr_r);
57   DECLARE_WRITE8_MEMBER(syscr_w);   
57   DECLARE_WRITE8_MEMBER(syscr_w);
5858
5959protected:
6060   required_device<h8h_intc_device> intc;
trunk/src/emu/cpu/h8/h8_adc.h
r29404r29405
4343#include "h8.h"
4444#include "h8_intc.h"
4545
46#define MCFG_H8_ADC_GENERIC_ADD( _tag, _type, intc, vect )   \
46#define MCFG_H8_ADC_GENERIC_ADD( _tag, _type, intc, vect )  \
4747   MCFG_DEVICE_ADD( _tag, _type, 0 ) \
4848   downcast<h8_adc_device *>(device)->set_info(intc, vect);
4949
trunk/src/emu/cpu/h8/h8_timer16.h
r29404r29405
4343#include "h8.h"
4444#include "h8_intc.h"
4545
46#define MCFG_H8_TIMER16_ADD( _tag, _count, _tstr )   \
47   MCFG_DEVICE_ADD( _tag, H8_TIMER16, 0 )         \
46#define MCFG_H8_TIMER16_ADD( _tag, _count, _tstr )  \
47   MCFG_DEVICE_ADD( _tag, H8_TIMER16, 0 )          \
4848   downcast<h8_timer16_device *>(device)->set_info(_count, _tstr);
4949
5050#define MCFG_H8_TIMER16_CHANNEL_ADD( _tag, tgr_count, tbr_count, intc, irq_base ) \
51   MCFG_DEVICE_ADD( _tag, H8_TIMER16_CHANNEL, 0 )   \
51   MCFG_DEVICE_ADD( _tag, H8_TIMER16_CHANNEL, 0 )  \
5252   downcast<h8_timer16_channel_device *>(device)->set_info(tgr_count, tbr_count, intc, irq_base);
5353
5454#define MCFG_H8H_TIMER16_CHANNEL_ADD( _tag, tgr_count, tbr_count, intc, irq_base ) \
55   MCFG_DEVICE_ADD( _tag, H8H_TIMER16_CHANNEL, 0 )   \
55   MCFG_DEVICE_ADD( _tag, H8H_TIMER16_CHANNEL, 0 ) \
5656   downcast<h8h_timer16_channel_device *>(device)->set_info(tgr_count, tbr_count, intc, irq_base);
5757
5858#define MCFG_H8S_TIMER16_CHANNEL_ADD( _tag, tgr_count, tier_mask, intc, irq_base, t0, t1, t2, t3, t4, t5, t6, t7 ) \
59   MCFG_DEVICE_ADD( _tag, H8S_TIMER16_CHANNEL, 0 )   \
59   MCFG_DEVICE_ADD( _tag, H8S_TIMER16_CHANNEL, 0 ) \
6060   downcast<h8s_timer16_channel_device *>(device)->set_info(tgr_count, tier_mask, intc, irq_base, t0, t1, t2, t3, t4, t5, t6, t7);
6161
62#define MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN( _tag )   \
62#define MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN( _tag )  \
6363   downcast<h8s_timer16_channel_device *>(device)->set_chain(_tag);
6464
6565class h8_timer16_channel_device : public device_t {
r29404r29405
180180   virtual ~h8s_timer16_channel_device();
181181
182182   void set_info(int tgr_count, UINT8 _tier_mask, const char *intc, int irq_base,
183              int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7);
183               int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7);
184184   void set_chain(const char *chain_tag);
185185
186186protected:
trunk/src/emu/cpu/h8/h83006.h
r29404r29405
5656   h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5757
5858   DECLARE_READ8_MEMBER(syscr_r);
59   DECLARE_WRITE8_MEMBER(syscr_w);   
59   DECLARE_WRITE8_MEMBER(syscr_w);
6060
6161protected:
6262   required_device<h8h_intc_device> intc;
trunk/src/emu/cpu/h8/h83008.h
r29404r29405
5656   h83008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5757
5858   DECLARE_READ8_MEMBER(syscr_r);
59   DECLARE_WRITE8_MEMBER(syscr_w);   
59   DECLARE_WRITE8_MEMBER(syscr_w);
6060
6161protected:
6262   required_device<h8h_intc_device> intc;
trunk/src/emu/cpu/h8/h83048.h
r29404r29405
6363   h83048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6464
6565   DECLARE_READ8_MEMBER(syscr_r);
66   DECLARE_WRITE8_MEMBER(syscr_w);   
66   DECLARE_WRITE8_MEMBER(syscr_w);
6767
6868protected:
6969   required_device<h8h_intc_device> intc;
trunk/src/emu/cpu/h8/h8_timer8.c
r29404r29405
9292      clock_type = INPUT_UPDOWN;
9393      clock_divider = 0;
9494      logerror("%s: clock external both edges", tag());
95      break;     
95      break;
9696   }
9797
9898   switch(tcr & TCR_CCLR) {
r29404r29405
118118   }
119119
120120   logerror(", irq=%c%c%c\n",
121          tcr & TCR_CMIEB ? 'b' : '-',
122          tcr & TCR_CMIEA ? 'a' : '-',
123          tcr & TCR_OVIE  ? 'o' : '-');
121            tcr & TCR_CMIEB ? 'b' : '-',
122            tcr & TCR_CMIEA ? 'a' : '-',
123            tcr & TCR_OVIE  ? 'o' : '-');
124124}
125125
126126READ8_MEMBER(h8_timer8_channel_device::tcsr_r)
r29404r29405
223223   if(tt == tcor[0] || tcnt == tcor[0]) {
224224      if(chained_timer)
225225         chained_timer->chained_timer_tcora();
226     
226
227227      if(!(tcsr & TCSR_CMFA)) {
228228         tcsr |= TCSR_CMFA;
229229         if(tcr & TCR_CMIEA)
r29404r29405
317317   if(tcnt == tcor[0]) {
318318      if(chained_timer)
319319         chained_timer->chained_timer_tcora();
320     
320
321321      if(!(tcsr & TCSR_CMFA)) {
322322         tcsr |= TCSR_CMFA;
323323         if(tcr & TCR_CMIEA)
trunk/src/emu/cpu/h8/h8_timer8.h
r29404r29405
4444#include "h8_intc.h"
4545
4646#define MCFG_H8_TIMER8_CHANNEL_ADD( _tag, intc, irq_ca, irq_cb, irq_v, div1, div2, div3, div4, div5, div6 ) \
47   MCFG_DEVICE_ADD( _tag, H8_TIMER8_CHANNEL, 0 )   \
47   MCFG_DEVICE_ADD( _tag, H8_TIMER8_CHANNEL, 0 )   \
4848   downcast<h8_timer8_channel_device *>(device)->set_info(intc, irq_ca, irq_cb, irq_v, div1, div2, div3, div4, div5, div6);
4949
5050#define MCFG_H8H_TIMER8_CHANNEL_ADD( _tag, intc, irq_ca, irq_cb, irq_v, chain, chain_mode, has_adte, has_ice ) \
51   MCFG_DEVICE_ADD( _tag, H8H_TIMER8_CHANNEL, 0 )   \
51   MCFG_DEVICE_ADD( _tag, H8H_TIMER8_CHANNEL, 0 )  \
5252   downcast<h8h_timer8_channel_device *>(device)->set_info(intc, irq_ca, irq_cb, irq_v, chain, chain_mode, has_adte, has_ice);
5353
5454class h8_timer8_channel_device : public device_t {
r29404r29405
9595      TCSR_ADTE = 0x10,
9696      TCSR_OVF  = 0x20,
9797      TCSR_CMFA = 0x40,
98      TCSR_CMFB = 0x80     
98      TCSR_CMFB = 0x80
9999   };
100100
101101   enum {
trunk/src/emu/cpu/h8/h8.c
r29404r29405
252252   case STATE_GENFLAGS:
253253      if(has_exr)
254254         string.printf("%c%c %c%c%c%c%c%c%c%c",
255                    (EXR & EXR_T) ? 'T' : '-',
256                    '0' + (EXR & EXR_I),
257                    (CCR & F_I)  ? 'I' : '-',
258                    (CCR & F_UI) ? 'u' : '-',
259                    (CCR & F_H)  ? 'H' : '-',
260                    (CCR & F_U)  ? 'U' : '-',
261                    (CCR & F_N)  ? 'N' : '-',
262                    (CCR & F_Z)  ? 'Z' : '-',
263                    (CCR & F_V)  ? 'V' : '-',
264                    (CCR & F_C)  ? 'C' : '-');
255                     (EXR & EXR_T) ? 'T' : '-',
256                     '0' + (EXR & EXR_I),
257                     (CCR & F_I)  ? 'I' : '-',
258                     (CCR & F_UI) ? 'u' : '-',
259                     (CCR & F_H)  ? 'H' : '-',
260                     (CCR & F_U)  ? 'U' : '-',
261                     (CCR & F_N)  ? 'N' : '-',
262                     (CCR & F_Z)  ? 'Z' : '-',
263                     (CCR & F_V)  ? 'V' : '-',
264                     (CCR & F_C)  ? 'C' : '-');
265265      else
266         string.printf("%c%c%c%c%c%c%c%c",
267                    (CCR & F_I)  ? 'I' : '-',
268                    (CCR & F_UI) ? 'u' : '-',
269                    (CCR & F_H)  ? 'H' : '-',
270                    (CCR & F_U)  ? 'U' : '-',
271                    (CCR & F_N)  ? 'N' : '-',
272                    (CCR & F_Z)  ? 'Z' : '-',
273                    (CCR & F_V)  ? 'V' : '-',
274                    (CCR & F_C)  ? 'C' : '-');
266         string.printf("%c%c%c%c%c%c%c%c",
267                     (CCR & F_I)  ? 'I' : '-',
268                     (CCR & F_UI) ? 'u' : '-',
269                     (CCR & F_H)  ? 'H' : '-',
270                     (CCR & F_U)  ? 'U' : '-',
271                     (CCR & F_N)  ? 'N' : '-',
272                     (CCR & F_Z)  ? 'Z' : '-',
273                     (CCR & F_V)  ? 'V' : '-',
274                     (CCR & F_C)  ? 'C' : '-');
275275      break;
276276   case H8_R0:
277277   case H8_R1:
r29404r29405
554554
555555void h8_device::write8(UINT32 adr, UINT8 data)
556556{
557   //   logerror("W %06x %02x\n", adr & 0xffffff, data);
557   //  logerror("W %06x %02x\n", adr & 0xffffff, data);
558558   icount--;
559559   program->write_byte(adr, data);
560560}
r29404r29405
567567
568568void h8_device::write16(UINT32 adr, UINT16 data)
569569{
570   //   logerror("W %06x %04x\n", adr & 0xfffffe, data);
570   //  logerror("W %06x %04x\n", adr & 0xfffffe, data);
571571   icount--;
572572   program->write_word(adr & ~1, data);
573573}
r29404r29405
644644   if(res & 0x100)
645645      CCR |= F_C;
646646   return res;
647   
647
648648}
649649
650650UINT8 h8_device::do_subx8(UINT8 v1, UINT8 v2)
r29404r29405
662662   if(res & 0x100)
663663      CCR |= F_C;
664664   return res;
665   
665
666666}
667667
668668UINT8 h8_device::do_inc8(UINT8 v1, UINT8 v2)
r29404r29405
675675      CCR |= F_N;
676676   if((v1^v2) & (v1^res) & 0x80)
677677      CCR |= F_V;
678   return res;   
678   return res;
679679}
680680
681681UINT16 h8_device::do_inc16(UINT16 v1, UINT16 v2)
r29404r29405
688688      CCR |= F_N;
689689   if((v1^v2) & (v1^res) & 0x8000)
690690      CCR |= F_V;
691   return res;   
691   return res;
692692}
693693
694694UINT32 h8_device::do_inc32(UINT32 v1, UINT32 v2)
r29404r29405
701701      CCR |= F_N;
702702   if((v1^v2) & (v1^res) & 0x80000000)
703703      CCR |= F_V;
704   return res;   
704   return res;
705705}
706706
707707UINT8 h8_device::do_add8(UINT8 v1, UINT8 v2)
r29404r29405
719719   if(res & 0x100)
720720      CCR |= F_C;
721721   return res;
722   
722
723723}
724724
725725UINT16 h8_device::do_add16(UINT16 v1, UINT16 v2)
r29404r29405
737737   if(res & 0x10000)
738738      CCR |= F_C;
739739   return res;
740   
740
741741}
742742
743743UINT32 h8_device::do_add32(UINT32 v1, UINT32 v2)
r29404r29405
754754      CCR |= F_V;
755755   if(res & U64(0x100000000))
756756      CCR |= F_C;
757   return res;   
757   return res;
758758}
759759
760760UINT8 h8_device::do_dec8(UINT8 v1, UINT8 v2)
r29404r29405
767767      CCR |= F_N;
768768   if((v1^v2) & (v1^res) & 0x80)
769769      CCR |= F_V;
770   return res;   
770   return res;
771771}
772772
773773UINT16 h8_device::do_dec16(UINT16 v1, UINT16 v2)
r29404r29405
780780      CCR |= F_N;
781781   if((v1^v2) & (v1^res) & 0x8000)
782782      CCR |= F_V;
783   return res;   
783   return res;
784784}
785785
786786UINT32 h8_device::do_dec32(UINT32 v1, UINT32 v2)
r29404r29405
793793      CCR |= F_N;
794794   if((v1^v2) & (v1^res) & 0x80000000)
795795      CCR |= F_V;
796   return res;   
796   return res;
797797}
798798
799799UINT8 h8_device::do_sub8(UINT8 v1, UINT8 v2)
r29404r29405
811811   if(res & 0x100)
812812      CCR |= F_C;
813813   return res;
814   
814
815815}
816816
817817UINT16 h8_device::do_sub16(UINT16 v1, UINT16 v2)
r29404r29405
829829   if(res & 0x10000)
830830      CCR |= F_C;
831831   return res;
832   
832
833833}
834834
835835UINT32 h8_device::do_sub32(UINT32 v1, UINT32 v2)
r29404r29405
846846      CCR |= F_V;
847847   if(res & U64(0x100000000))
848848      CCR |= F_C;
849   return res;   
849   return res;
850850}
851851
852852UINT8 h8_device::do_shal8(UINT8 v)
r29404r29405
10171017   if(v & 0x40)
10181018      CCR |= F_C;
10191019   if((v & 0xc0) == 0x40 || (v & 0xc0) == 0x80 ||
1020      (v & 0x60) == 0x20 || (v & 0x60) == 0x40)
1020      (v & 0x60) == 0x20 || (v & 0x60) == 0x40)
10211021      CCR |= F_V;
10221022   v <<= 2;
10231023   if(!v)
r29404r29405
10331033   if(v & 0x4000)
10341034      CCR |= F_C;
10351035   if((v & 0xc000) == 0x4000 || (v & 0xc000) == 0x8000 ||
1036      (v & 0x6000) == 0x2000 || (v & 0x6000) == 0x4000)
1036      (v & 0x6000) == 0x2000 || (v & 0x6000) == 0x4000)
10371037      CCR |= F_V;
10381038   v <<= 2;
10391039   if(!v)
r29404r29405
10491049   if(v & 0x40000000)
10501050      CCR |= F_C;
10511051   if((v & 0xc0000000) == 0x40000000 || (v & 0xc0000000) == 0x80000000 ||
1052      (v & 0x60000000) == 0x20000000 || (v & 0x60000000) == 0x40000000)
1052      (v & 0x60000000) == 0x20000000 || (v & 0x60000000) == 0x40000000)
10531053      CCR |= F_V;
10541054   v <<= 2;
10551055   if(!v)
trunk/src/emu/cpu/h8/h8s2357.c
r29404r29405
123123   MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A,        false, false)
124124   MCFG_H8_TIMER16_ADD("timer16", 6, 0x00)
125125   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
126                         h8_timer16_channel_device::DIV_1,
127                         h8_timer16_channel_device::DIV_4,
128                         h8_timer16_channel_device::DIV_16,
129                         h8_timer16_channel_device::DIV_64,
130                         h8_timer16_channel_device::INPUT_A,
131                         h8_timer16_channel_device::INPUT_B,
132                         h8_timer16_channel_device::INPUT_C,
133                         h8_timer16_channel_device::INPUT_D)
126                           h8_timer16_channel_device::DIV_1,
127                           h8_timer16_channel_device::DIV_4,
128                           h8_timer16_channel_device::DIV_16,
129                           h8_timer16_channel_device::DIV_64,
130                           h8_timer16_channel_device::INPUT_A,
131                           h8_timer16_channel_device::INPUT_B,
132                           h8_timer16_channel_device::INPUT_C,
133                           h8_timer16_channel_device::INPUT_D)
134134   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
135                         h8_timer16_channel_device::DIV_1,
136                         h8_timer16_channel_device::DIV_4,
137                         h8_timer16_channel_device::DIV_16,
138                         h8_timer16_channel_device::DIV_64,
139                         h8_timer16_channel_device::INPUT_A,
140                         h8_timer16_channel_device::INPUT_B,
141                         h8_timer16_channel_device::DIV_256,
142                         h8_timer16_channel_device::CHAIN)
135                           h8_timer16_channel_device::DIV_1,
136                           h8_timer16_channel_device::DIV_4,
137                           h8_timer16_channel_device::DIV_16,
138                           h8_timer16_channel_device::DIV_64,
139                           h8_timer16_channel_device::INPUT_A,
140                           h8_timer16_channel_device::INPUT_B,
141                           h8_timer16_channel_device::DIV_256,
142                           h8_timer16_channel_device::CHAIN)
143143   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
144144   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
145                         h8_timer16_channel_device::DIV_1,
146                         h8_timer16_channel_device::DIV_4,
147                         h8_timer16_channel_device::DIV_16,
148                         h8_timer16_channel_device::DIV_64,
149                         h8_timer16_channel_device::INPUT_A,
150                         h8_timer16_channel_device::INPUT_B,
151                         h8_timer16_channel_device::INPUT_C,
152                         h8_timer16_channel_device::DIV_1024)
145                           h8_timer16_channel_device::DIV_1,
146                           h8_timer16_channel_device::DIV_4,
147                           h8_timer16_channel_device::DIV_16,
148                           h8_timer16_channel_device::DIV_64,
149                           h8_timer16_channel_device::INPUT_A,
150                           h8_timer16_channel_device::INPUT_B,
151                           h8_timer16_channel_device::INPUT_C,
152                           h8_timer16_channel_device::DIV_1024)
153153   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:3", 4, 0x60, "intc", 48,
154                         h8_timer16_channel_device::DIV_1,
155                         h8_timer16_channel_device::DIV_4,
156                         h8_timer16_channel_device::DIV_16,
157                         h8_timer16_channel_device::DIV_64,
158                         h8_timer16_channel_device::INPUT_A,
159                         h8_timer16_channel_device::DIV_1024,
160                         h8_timer16_channel_device::DIV_256,
161                         h8_timer16_channel_device::DIV_4096)
154                           h8_timer16_channel_device::DIV_1,
155                           h8_timer16_channel_device::DIV_4,
156                           h8_timer16_channel_device::DIV_16,
157                           h8_timer16_channel_device::DIV_64,
158                           h8_timer16_channel_device::INPUT_A,
159                           h8_timer16_channel_device::DIV_1024,
160                           h8_timer16_channel_device::DIV_256,
161                           h8_timer16_channel_device::DIV_4096)
162162   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:4", 2, 0x4c, "intc", 56,
163                         h8_timer16_channel_device::DIV_1,
164                         h8_timer16_channel_device::DIV_4,
165                         h8_timer16_channel_device::DIV_16,
166                         h8_timer16_channel_device::DIV_64,
167                         h8_timer16_channel_device::INPUT_A,
168                         h8_timer16_channel_device::INPUT_C,
169                         h8_timer16_channel_device::DIV_1024,
170                         h8_timer16_channel_device::CHAIN)
163                           h8_timer16_channel_device::DIV_1,
164                           h8_timer16_channel_device::DIV_4,
165                           h8_timer16_channel_device::DIV_16,
166                           h8_timer16_channel_device::DIV_64,
167                           h8_timer16_channel_device::INPUT_A,
168                           h8_timer16_channel_device::INPUT_C,
169                           h8_timer16_channel_device::DIV_1024,
170                           h8_timer16_channel_device::CHAIN)
171171   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:5")
172172   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:5", 2, 0x4c, "intc", 60,
173                         h8_timer16_channel_device::DIV_1,
174                         h8_timer16_channel_device::DIV_4,
175                         h8_timer16_channel_device::DIV_16,
176                         h8_timer16_channel_device::DIV_64,
177                         h8_timer16_channel_device::INPUT_A,
178                         h8_timer16_channel_device::INPUT_C,
179                         h8_timer16_channel_device::DIV_256,
180                         h8_timer16_channel_device::INPUT_D)
173                           h8_timer16_channel_device::DIV_1,
174                           h8_timer16_channel_device::DIV_4,
175                           h8_timer16_channel_device::DIV_16,
176                           h8_timer16_channel_device::DIV_64,
177                           h8_timer16_channel_device::INPUT_A,
178                           h8_timer16_channel_device::INPUT_C,
179                           h8_timer16_channel_device::DIV_256,
180                           h8_timer16_channel_device::INPUT_D)
181181   MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
182182   MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
183183   MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
trunk/src/emu/cpu/h8/h8_port.c
r29404r29405
1818
1919WRITE8_MEMBER(h8_port_device::ddr_w)
2020{
21   //   logerror("%s: ddr_w %02x\n", tag(), data);
21   //  logerror("%s: ddr_w %02x\n", tag(), data);
2222   ddr = data;
2323   update_output();
2424}
2525
2626WRITE8_MEMBER(h8_port_device::dr_w)
2727{
28   //   logerror("%s: dr_w %02x\n", tag(), data);
28   //  logerror("%s: dr_w %02x\n", tag(), data);
2929   dr = data;
3030   update_output();
3131}
3232
3333READ8_MEMBER(h8_port_device::dr_r)
3434{
35   //   logerror("%s: dr_r %02x\n", tag(), (dr | mask) & 0xff);
35   //  logerror("%s: dr_r %02x\n", tag(), (dr | mask) & 0xff);
3636   return dr | mask;
3737}
3838
r29404r29405
4141   UINT8 res = mask | (dr & ddr);
4242   if((ddr & ~mask) != UINT8(~mask))
4343      res |= io->read_word(address) & ~ddr;
44   
45   //   logerror("%s: port_r %02x (%02x %02x)\n", tag(), res, ddr & ~mask, UINT8(~mask));
44
45   //  logerror("%s: port_r %02x (%02x %02x)\n", tag(), res, ddr & ~mask, UINT8(~mask));
4646   return res;
4747}
4848
trunk/src/emu/cpu/h8/h8s2655.c
r29404r29405
9696   MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A,        false, false)
9797   MCFG_H8_TIMER16_ADD("timer16", 6, 0x00)
9898   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
99                         h8_timer16_channel_device::DIV_1,
100                         h8_timer16_channel_device::DIV_4,
101                         h8_timer16_channel_device::DIV_16,
102                         h8_timer16_channel_device::DIV_64,
103                         h8_timer16_channel_device::INPUT_A,
104                         h8_timer16_channel_device::INPUT_B,
105                         h8_timer16_channel_device::INPUT_C,
106                         h8_timer16_channel_device::INPUT_D)
99                           h8_timer16_channel_device::DIV_1,
100                           h8_timer16_channel_device::DIV_4,
101                           h8_timer16_channel_device::DIV_16,
102                           h8_timer16_channel_device::DIV_64,
103                           h8_timer16_channel_device::INPUT_A,
104                           h8_timer16_channel_device::INPUT_B,
105                           h8_timer16_channel_device::INPUT_C,
106                           h8_timer16_channel_device::INPUT_D)
107107   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
108                         h8_timer16_channel_device::DIV_1,
109                         h8_timer16_channel_device::DIV_4,
110                         h8_timer16_channel_device::DIV_16,
111                         h8_timer16_channel_device::DIV_64,
112                         h8_timer16_channel_device::INPUT_A,
113                         h8_timer16_channel_device::INPUT_B,
114                         h8_timer16_channel_device::DIV_256,
115                         h8_timer16_channel_device::CHAIN)
108                           h8_timer16_channel_device::DIV_1,
109                           h8_timer16_channel_device::DIV_4,
110                           h8_timer16_channel_device::DIV_16,
111                           h8_timer16_channel_device::DIV_64,
112                           h8_timer16_channel_device::INPUT_A,
113                           h8_timer16_channel_device::INPUT_B,
114                           h8_timer16_channel_device::DIV_256,
115                           h8_timer16_channel_device::CHAIN)
116116   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
117117   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
118                         h8_timer16_channel_device::DIV_1,
119                         h8_timer16_channel_device::DIV_4,
120                         h8_timer16_channel_device::DIV_16,
121                         h8_timer16_channel_device::DIV_64,
122                         h8_timer16_channel_device::INPUT_A,
123                         h8_timer16_channel_device::INPUT_B,
124                         h8_timer16_channel_device::INPUT_C,
125                         h8_timer16_channel_device::DIV_1024)
118                           h8_timer16_channel_device::DIV_1,
119                           h8_timer16_channel_device::DIV_4,
120                           h8_timer16_channel_device::DIV_16,
121                           h8_timer16_channel_device::DIV_64,
122                           h8_timer16_channel_device::INPUT_A,
123                           h8_timer16_channel_device::INPUT_B,
124                           h8_timer16_channel_device::INPUT_C,
125                           h8_timer16_channel_device::DIV_1024)
126126   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:3", 4, 0x60, "intc", 48,
127                         h8_timer16_channel_device::DIV_1,
128                         h8_timer16_channel_device::DIV_4,
129                         h8_timer16_channel_device::DIV_16,
130                         h8_timer16_channel_device::DIV_64,
131                         h8_timer16_channel_device::INPUT_A,
132                         h8_timer16_channel_device::DIV_1024,
133                         h8_timer16_channel_device::DIV_256,
134                         h8_timer16_channel_device::DIV_4096)
127                           h8_timer16_channel_device::DIV_1,
128                           h8_timer16_channel_device::DIV_4,
129                           h8_timer16_channel_device::DIV_16,
130                           h8_timer16_channel_device::DIV_64,
131                           h8_timer16_channel_device::INPUT_A,
132                           h8_timer16_channel_device::DIV_1024,
133                           h8_timer16_channel_device::DIV_256,
134                           h8_timer16_channel_device::DIV_4096)
135135   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:4", 2, 0x4c, "intc", 56,
136                         h8_timer16_channel_device::DIV_1,
137                         h8_timer16_channel_device::DIV_4,
138                         h8_timer16_channel_device::DIV_16,
139                         h8_timer16_channel_device::DIV_64,
140                         h8_timer16_channel_device::INPUT_A,
141                         h8_timer16_channel_device::INPUT_C,
142                         h8_timer16_channel_device::DIV_1024,
143                         h8_timer16_channel_device::CHAIN)
136                           h8_timer16_channel_device::DIV_1,
137                           h8_timer16_channel_device::DIV_4,
138                           h8_timer16_channel_device::DIV_16,
139                           h8_timer16_channel_device::DIV_64,
140                           h8_timer16_channel_device::INPUT_A,
141                           h8_timer16_channel_device::INPUT_C,
142                           h8_timer16_channel_device::DIV_1024,
143                           h8_timer16_channel_device::CHAIN)
144144   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:5")
145145   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:5", 2, 0x4c, "intc", 60,
146                         h8_timer16_channel_device::DIV_1,
147                         h8_timer16_channel_device::DIV_4,
148                         h8_timer16_channel_device::DIV_16,
149                         h8_timer16_channel_device::DIV_64,
150                         h8_timer16_channel_device::INPUT_A,
151                         h8_timer16_channel_device::INPUT_C,
152                         h8_timer16_channel_device::DIV_256,
153                         h8_timer16_channel_device::INPUT_D)
146                           h8_timer16_channel_device::DIV_1,
147                           h8_timer16_channel_device::DIV_4,
148                           h8_timer16_channel_device::DIV_16,
149                           h8_timer16_channel_device::DIV_64,
150                           h8_timer16_channel_device::INPUT_A,
151                           h8_timer16_channel_device::INPUT_C,
152                           h8_timer16_channel_device::DIV_256,
153                           h8_timer16_channel_device::INPUT_D)
154154   MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
155155   MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
156156   MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
trunk/src/emu/cpu/h8/h8.h
r29404r29405
499499   H8_E6,
500500   H8_E7,
501501   H8_CCR,
502   H8_EXR,   
502   H8_EXR,
503503};
504504
505505#endif
trunk/src/emu/cpu/h8/h8s2357.h
r29404r29405
6565   h8s2357_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6666
6767   DECLARE_READ8_MEMBER(syscr_r);
68   DECLARE_WRITE8_MEMBER(syscr_w);   
68   DECLARE_WRITE8_MEMBER(syscr_w);
6969
7070protected:
7171   required_device<h8s_intc_device> intc;
trunk/src/emu/cpu/h8/h8_port.h
r29404r29405
4242
4343#include "h8.h"
4444
45#define MCFG_H8_PORT_ADD( _tag, address, ddr, mask )   \
45#define MCFG_H8_PORT_ADD( _tag, address, ddr, mask )    \
4646   MCFG_DEVICE_ADD( _tag, H8_PORT, 0 ) \
4747   downcast<h8_port_device *>(device)->set_info(address, ddr, mask);
4848
trunk/src/emu/cpu/h8/h8s2655.h
r29404r29405
5757   h8s2655_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5858
5959   DECLARE_READ8_MEMBER(syscr_r);
60   DECLARE_WRITE8_MEMBER(syscr_w);   
60   DECLARE_WRITE8_MEMBER(syscr_w);
6161
6262protected:
6363   required_device<h8s_intc_device> intc;
trunk/src/emu/cpu/h8/h8_intc.c
r29404r29405
280280const int h8h_intc_device::vector_to_slot[64] = {
281281   -1, -1, -1, -1, -1, -1, -1, -1, // NMI at 7
282282   -1, -1, -1, -1,  0,  1,  2,  2, // IRQ 0-3
283    3,  3,  3,  3,  4,  4,  4,  4, // IRQ 4-5, (reservedx2), WOVI, CMI, (reserved), ADI
284    5,  5,  5,  5,  6,  6,  6,  6, // IMIA0, IMIB0, OVI0, (reserved), IMIA1, IMIB1, OVI1, (reserved)
285    7,  7,  7,  7,  8,  8,  8,  8, // IMIA2, IMIB2, OVI2, (reserved), CMIA0, CMIB0, CMIx1, TOVI0/1
286    9,  9,  9,  9, 10, 10, 10, 10, // CMIA2, CMIB2, CMIx3, TOVI2/3, DEND0A, DEND0B, DEND1A, DEND1B
283      3,  3,  3,  3,  4,  4,  4,  4, // IRQ 4-5, (reservedx2), WOVI, CMI, (reserved), ADI
284      5,  5,  5,  5,  6,  6,  6,  6, // IMIA0, IMIB0, OVI0, (reserved), IMIA1, IMIB1, OVI1, (reserved)
285      7,  7,  7,  7,  8,  8,  8,  8, // IMIA2, IMIB2, OVI2, (reserved), CMIA0, CMIB0, CMIx1, TOVI0/1
286      9,  9,  9,  9, 10, 10, 10, 10, // CMIA2, CMIB2, CMIx3, TOVI2/3, DEND0A, DEND0B, DEND1A, DEND1B
287287   11, 11, 11, 11, 12, 12, 12, 12, // (reservedx4), ERI0, RXI0, TXI0, TEI0
288288   13, 13, 13, 13, 14, 14, 14, 14  // ERI1, RXI1, TXI1, TEI1, ERI2, RXI2, TXI2, TEI2
289289};
r29404r29405
342342const int h8s_intc_device::vector_to_slot[92] = {
343343   -1, -1, -1, -1, -1, -1, -1, -1, // NMI at 7
344344   -1, -1, -1, -1, -1, -1, -1, -1,
345    0,  1,  2,  2,  3,  3,  4,  4, // IRQ 0-7
346    5,  6,  7,  8,  9,  9,  9,  9, // SWDTEND, WOVI, CMI, (reserved), ADI
345      0,  1,  2,  2,  3,  3,  4,  4, // IRQ 0-7
346      5,  6,  7,  8,  9,  9,  9,  9, // SWDTEND, WOVI, CMI, (reserved), ADI
347347   10, 10, 10, 10, 10, 10, 10, 10, // TGI0A, TGI0B, TGI0C, TGI0D, TGI0V
348348   11, 11, 11, 11, 12, 12, 12, 12, // TGI1A, TGI1B, TGI1V, TGI1U, TGI2A, TGI2B, TGI2V, TGI2U
349349   13, 13, 13, 13, 13, 13, 13, 13, // TGI3A, TGI3B, TGI3C, TGI3D, TGI3V
trunk/src/emu/cpu/h8/h8.lst
r29404r29405
937937   }
938938   r8_w(IR[0], do_add8(TMP1, TMP2));
939939   prefetch();
940     
940
9419410f80         ff88         0 mov.l    r32h     r32l     h
942942   TMP1 = r32_r(IR[0] >> 4);
943943   set_nzv32(TMP1);
r29404r29405
13031303   }
13041304   r8_w(IR[0], do_add8(TMP1, TMP2));
13051305   prefetch();
1306     
1306
130713071f80         ff88         0 cmp.l    r32h     r32l     h
13081308   do_sub32(r32_r(IR[0]), r32_r(IR[0] >> 4));
13091309   prefetch();
r29404r29405
220622067000         ff80         0 bset     imm3     r8l
22072207   TMP1 = r8_r(IR[0]);
22082208   bset IR[0] >> 4
2209   r8_w(IR[0], TMP1);   
2209   r8_w(IR[0], TMP1);
22102210   prefetch();
22112211
221222127100         ff80         0 bnot     imm3     r8l
22132213   TMP1 = r8_r(IR[0]);
22142214   bnot IR[0] >> 4
2215   r8_w(IR[0], TMP1);   
2215   r8_w(IR[0], TMP1);
22162216   prefetch();
22172217
221822187200         ff80         0 bclr     imm3     r8l
22192219   TMP1 = r8_r(IR[0]);
22202220   bclr IR[0] >> 4
2221   r8_w(IR[0], TMP1);   
2221   r8_w(IR[0], TMP1);
22222222   prefetch();
22232223
222422247300         ff80         0 btst     imm3     r8l
trunk/src/emu/cpu/h8/h83337.c
r29404r29405
9595   AM_RANGE(0xff90, 0xff91) AM_DEVREADWRITE8("timer16:0", h8_timer16_channel_device, tier_r,  tier_w,  0xff00)
9696   AM_RANGE(0xff90, 0xff91) AM_DEVREADWRITE8("timer16:0", h8_timer16_channel_device, tsr_r,   tsr_w,   0x00ff)
9797   AM_RANGE(0xff92, 0xff93) AM_DEVREADWRITE( "timer16:0", h8_timer16_channel_device, tcnt_r,  tcnt_w         )
98//   AM_RANGE(0xff94, 0xff95) AM_DEVREADWRITE( "timer16:0", h8_timer16_channel_device, ocr_r,   ocr_w          )
98//  AM_RANGE(0xff94, 0xff95) AM_DEVREADWRITE( "timer16:0", h8_timer16_channel_device, ocr_r,   ocr_w          )
9999   AM_RANGE(0xff96, 0xff97) AM_DEVREADWRITE8("timer16:0", h8_timer16_channel_device, tcr_r,   tcr_w,   0xff00)
100//   AM_RANGE(0xff96, 0xff97) AM_DEVREADWRITE8("timer16:0", h8_timer16_channel_device, tocr_r,  tocr_w,  0x00ff)
100//  AM_RANGE(0xff96, 0xff97) AM_DEVREADWRITE8("timer16:0", h8_timer16_channel_device, tocr_r,  tocr_w,  0x00ff)
101101   AM_RANGE(0xff98, 0xff9f) AM_DEVREAD(      "timer16:0", h8_timer16_channel_device, tgr_r                   )
102102
103103   AM_RANGE(0xffac, 0xffad) AM_DEVREADWRITE8("port1",     h8_port_device,            pcr_r,   pcr_w,   0xff00)
trunk/src/emu/cpu/h8/h8_intc.h
r29404r29405
4242
4343#include "h8.h"
4444
45#define MCFG_H8_INTC_ADD( _tag )   \
45#define MCFG_H8_INTC_ADD( _tag )    \
4646   MCFG_DEVICE_ADD( _tag, H8_INTC, 0 )
4747
48#define MCFG_H8H_INTC_ADD( _tag )   \
48#define MCFG_H8H_INTC_ADD( _tag )   \
4949   MCFG_DEVICE_ADD( _tag, H8H_INTC, 0 )
5050
51#define MCFG_H8S_INTC_ADD( _tag )   \
51#define MCFG_H8S_INTC_ADD( _tag )   \
5252   MCFG_DEVICE_ADD( _tag, H8S_INTC, 0 )
5353
5454
r29404r29405
100100   h8h_intc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
101101
102102   DECLARE_READ8_MEMBER(isr_r);
103   DECLARE_WRITE8_MEMBER(isr_w);   
103   DECLARE_WRITE8_MEMBER(isr_w);
104104   DECLARE_READ8_MEMBER(icr_r);
105105   DECLARE_WRITE8_MEMBER(icr_w);
106106   DECLARE_READ8_MEMBER(icrc_r);
trunk/src/emu/cpu/h8/h83337.h
r29404r29405
6363   h83337_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6464
6565   DECLARE_READ8_MEMBER(wscr_r);
66   DECLARE_WRITE8_MEMBER(wscr_w);   
66   DECLARE_WRITE8_MEMBER(wscr_w);
6767   DECLARE_READ8_MEMBER(stcr_r);
68   DECLARE_WRITE8_MEMBER(stcr_w);   
68   DECLARE_WRITE8_MEMBER(stcr_w);
6969   DECLARE_READ8_MEMBER(syscr_r);
70   DECLARE_WRITE8_MEMBER(syscr_w);   
70   DECLARE_WRITE8_MEMBER(syscr_w);
7171   DECLARE_READ8_MEMBER(mdcr_r);
72   DECLARE_WRITE8_MEMBER(mdcr_w);   
72   DECLARE_WRITE8_MEMBER(mdcr_w);
7373
7474protected:
7575   required_device<h8_intc_device> intc;
trunk/src/emu/cpu/h8/h8s2320.c
r29404r29405
145145   MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A,        false, false)
146146   MCFG_H8_TIMER16_ADD("timer16", 6, 0x00)
147147   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
148                         h8_timer16_channel_device::DIV_1,
149                         h8_timer16_channel_device::DIV_4,
150                         h8_timer16_channel_device::DIV_16,
151                         h8_timer16_channel_device::DIV_64,
152                         h8_timer16_channel_device::INPUT_A,
153                         h8_timer16_channel_device::INPUT_B,
154                         h8_timer16_channel_device::INPUT_C,
155                         h8_timer16_channel_device::INPUT_D)
148                           h8_timer16_channel_device::DIV_1,
149                           h8_timer16_channel_device::DIV_4,
150                           h8_timer16_channel_device::DIV_16,
151                           h8_timer16_channel_device::DIV_64,
152                           h8_timer16_channel_device::INPUT_A,
153                           h8_timer16_channel_device::INPUT_B,
154                           h8_timer16_channel_device::INPUT_C,
155                           h8_timer16_channel_device::INPUT_D)
156156   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
157                         h8_timer16_channel_device::DIV_1,
158                         h8_timer16_channel_device::DIV_4,
159                         h8_timer16_channel_device::DIV_16,
160                         h8_timer16_channel_device::DIV_64,
161                         h8_timer16_channel_device::INPUT_A,
162                         h8_timer16_channel_device::INPUT_B,
163                         h8_timer16_channel_device::DIV_256,
164                         h8_timer16_channel_device::CHAIN)
157                           h8_timer16_channel_device::DIV_1,
158                           h8_timer16_channel_device::DIV_4,
159                           h8_timer16_channel_device::DIV_16,
160                           h8_timer16_channel_device::DIV_64,
161                           h8_timer16_channel_device::INPUT_A,
162                           h8_timer16_channel_device::INPUT_B,
163                           h8_timer16_channel_device::DIV_256,
164                           h8_timer16_channel_device::CHAIN)
165165   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
166166   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
167                         h8_timer16_channel_device::DIV_1,
168                         h8_timer16_channel_device::DIV_4,
169                         h8_timer16_channel_device::DIV_16,
170                         h8_timer16_channel_device::DIV_64,
171                         h8_timer16_channel_device::INPUT_A,
172                         h8_timer16_channel_device::INPUT_B,
173                         h8_timer16_channel_device::INPUT_C,
174                         h8_timer16_channel_device::DIV_1024)
167                           h8_timer16_channel_device::DIV_1,
168                           h8_timer16_channel_device::DIV_4,
169                           h8_timer16_channel_device::DIV_16,
170                           h8_timer16_channel_device::DIV_64,
171                           h8_timer16_channel_device::INPUT_A,
172                           h8_timer16_channel_device::INPUT_B,
173                           h8_timer16_channel_device::INPUT_C,
174                           h8_timer16_channel_device::DIV_1024)
175175   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:3", 4, 0x60, "intc", 48,
176                         h8_timer16_channel_device::DIV_1,
177                         h8_timer16_channel_device::DIV_4,
178                         h8_timer16_channel_device::DIV_16,
179                         h8_timer16_channel_device::DIV_64,
180                         h8_timer16_channel_device::INPUT_A,
181                         h8_timer16_channel_device::DIV_1024,
182                         h8_timer16_channel_device::DIV_256,
183                         h8_timer16_channel_device::DIV_4096)
176                           h8_timer16_channel_device::DIV_1,
177                           h8_timer16_channel_device::DIV_4,
178                           h8_timer16_channel_device::DIV_16,
179                           h8_timer16_channel_device::DIV_64,
180                           h8_timer16_channel_device::INPUT_A,
181                           h8_timer16_channel_device::DIV_1024,
182                           h8_timer16_channel_device::DIV_256,
183                           h8_timer16_channel_device::DIV_4096)
184184   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:4", 2, 0x4c, "intc", 56,
185                         h8_timer16_channel_device::DIV_1,
186                         h8_timer16_channel_device::DIV_4,
187                         h8_timer16_channel_device::DIV_16,
188                         h8_timer16_channel_device::DIV_64,
189                         h8_timer16_channel_device::INPUT_A,
190                         h8_timer16_channel_device::INPUT_C,
191                         h8_timer16_channel_device::DIV_1024,
192                         h8_timer16_channel_device::CHAIN)
185                           h8_timer16_channel_device::DIV_1,
186                           h8_timer16_channel_device::DIV_4,
187                           h8_timer16_channel_device::DIV_16,
188                           h8_timer16_channel_device::DIV_64,
189                           h8_timer16_channel_device::INPUT_A,
190                           h8_timer16_channel_device::INPUT_C,
191                           h8_timer16_channel_device::DIV_1024,
192                           h8_timer16_channel_device::CHAIN)
193193   MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:5")
194194   MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:5", 2, 0x4c, "intc", 60,
195                         h8_timer16_channel_device::DIV_1,
196                         h8_timer16_channel_device::DIV_4,
197                         h8_timer16_channel_device::DIV_16,
198                         h8_timer16_channel_device::DIV_64,
199                         h8_timer16_channel_device::INPUT_A,
200                         h8_timer16_channel_device::INPUT_C,
201                         h8_timer16_channel_device::DIV_256,
202                         h8_timer16_channel_device::INPUT_D)
195                           h8_timer16_channel_device::DIV_1,
196                           h8_timer16_channel_device::DIV_4,
197                           h8_timer16_channel_device::DIV_16,
198                           h8_timer16_channel_device::DIV_64,
199                           h8_timer16_channel_device::INPUT_A,
200                           h8_timer16_channel_device::INPUT_C,
201                           h8_timer16_channel_device::DIV_256,
202                           h8_timer16_channel_device::INPUT_D)
203203   MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
204204   MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
205205   MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
trunk/src/emu/cpu/se3208/se3208.c
r29404r29405
18301830   extern CPU_DISASSEMBLE( se3208 );
18311831   return CPU_DISASSEMBLE_NAME(se3208)(this, buffer, pc, oprom, opram, options);
18321832}
1833
1834
trunk/src/emu/cpu/se3208/se3208.h
r29404r29405
165165
166166
167167extern const device_type SE3208;
168
trunk/src/emu/cpu/sh2/sh2comn.c
r29404r29405
538538   {
539539   case 0x00:
540540      //if(mem_mask == 0xff)
541      //   printf("%c",data & 0xff);
541      //  printf("%c",data & 0xff);
542542      break;
543543   case 0x01:
544544      //printf("%08x %02x %02x\n",mem_mask,offset,data);
trunk/src/emu/cpu/mn10200/mn10200.h
r29404r29405
4343   MN10200_IRQ1,
4444   MN10200_IRQ2,
4545   MN10200_IRQ3,
46   
46
4747   MN10200_MAX_EXT_IRQ
4848};
4949
r29404r29405
155155      UINT8 ctrlh;
156156      UINT8 buf;
157157   } m_serial[2];
158   
158
159159   // ports
160160   UINT8 m_pplul;
161161   UINT8 m_ppluh;
r29404r29405
167167      UINT8 out;
168168      UINT8 dir;
169169   } m_port[4];
170   
170
171171   // internal read/write
172172   inline UINT8 read_arg8(UINT32 address) { return m_program->read_byte(address); }
173173   inline UINT16 read_arg16(UINT32 address) { return m_program->read_byte(address) | m_program->read_byte(address + 1) << 8; }
trunk/src/emu/cpu/mn10200/mn10200.c
r29404r29405
7474   save_item(NAME(m_icrl));
7575   save_item(NAME(m_icrh));
7676   save_item(NAME(m_possible_irq));
77   
77
7878   // timers
7979   m_sysclock_base = attotime::from_hz(unscaled_clock() / 2);
8080
r29404r29405
9494      save_item(NAME(m_simple_timer[i].base), i);
9595      save_item(NAME(m_simple_timer[i].cur), i);
9696   }
97   
97
9898   for (int i = 0; i < MN10200_NUM_PRESCALERS; i++)
9999   {
100100      m_prescaler[i].mode = 0;
r29404r29405
105105      save_item(NAME(m_prescaler[i].base), i);
106106      save_item(NAME(m_prescaler[i].cur), i);
107107   }
108   
108
109109   // dma
110110   for (int i = 0; i < 8; i++)
111111   {
r29404r29405
123123      save_item(NAME(m_dma[i].ctrlh), i);
124124      save_item(NAME(m_dma[i].irq), i);
125125   }
126   
126
127127   // serial
128128   for (int i = 0; i < 2; i++)
129129   {
r29404r29405
135135      save_item(NAME(m_serial[i].ctrlh), i);
136136      save_item(NAME(m_serial[i].buf), i);
137137   }
138   
138
139139   // ports
140140   m_p4 = 0xf;
141141
r29404r29405
211211{
212212   change_pc(0x80000);
213213   m_psw = 0;
214   
214
215215   // note: officially, these registers are reset to 'undefined'
216216   memset(m_d, 0, sizeof(m_d));
217217   memset(m_a, 0, sizeof(m_a));
218218   m_mdr = 0;
219   
219
220220   // reset internal peripherals
221221   m_nmicr = 0;
222222   m_iagr = 0;
223223   write_mem16(0xfc00, 0x8000);
224224   write_mem16(0xfc02, 0x0737);
225   
225
226226   // need to clear them twice since some rely on the value of others
227227   for (int i = 0; i < 2; i++)
228228      for (int address = 0xfc04; address < 0x10000; address++)
r29404r29405
250250{
251251   if (!m_nmicr && !(m_psw & FLAG_IE))
252252      return;
253   
253
254254   int level = m_psw >> 8 & 7;
255255   int group = 0;
256   
256
257257   // find highest valid level
258258   for (int i = 1; i < 11; i++)
259259   {
r29404r29405
263263         group = i;
264264      }
265265   }
266   
266
267267   // take interrupt
268268   if (m_nmicr && group)
269269      take_irq(level, 0);
r29404r29405
271271      take_irq(0, 0);
272272   else if (group)
273273      take_irq(level, group);
274   
274
275275   return;
276276}
277277
r29404r29405
283283      if ((m_p4 >> i & 1) == (m_extmdl >> (i * 2) & 3))
284284         m_icrl[8] |= (1 << (4 + i));
285285   }
286   
286
287287   m_possible_irq = true;
288288}
289289
r29404r29405
295295   int pin = state ? 0 : 1;
296296   int old = m_p4 >> irqnum & 1;
297297   bool active = false;
298   
298
299299   switch (m_extmdl >> (irqnum * 2) & 3)
300300   {
301301      // 'L' level
302302      case 0:
303303         active = (pin == 0);
304304         break;
305     
305
306306      // 'H' level
307307      case 1:
308308         active = (pin == 1);
309309         break;
310     
310
311311      // falling edge
312312      case 2:
313313         active = (pin == 0 && old == 1);
314314         break;
315     
315
316316      // rising edge
317317      case 3:
318318         active = (pin == 1 && old == 0);
319319         break;
320320   }
321   
321
322322   m_p4 &= ~(1 << irqnum);
323323   m_p4 |= pin << irqnum;
324   
324
325325   if (active)
326326   {
327327      m_icrl[8] |= (1 << (4 + irqnum));
r29404r29405
335335int mn10200_device::timer_tick_simple(int tmr)
336336{
337337   int next = tmr + 1;
338   
338
339339   // is it a cascaded timer, and enabled?
340340   if (next < MN10200_NUM_TIMERS_8BIT && m_simple_timer[next].mode & 0x83 && (m_simple_timer[next].mode & 0x83) == 0x81)
341341   {
r29404r29405
391391TIMER_CALLBACK_MEMBER( mn10200_device::simple_timer_cb )
392392{
393393   int tmr = param;
394   
394
395395   // handle our expiring and also tick our cascaded children
396396   if (timer_tick_simple(tmr) == 2)
397397      m_simple_timer[tmr].cur = 0xff; // cascaded and no underflow occured
398398   else
399399      m_simple_timer[tmr].cur = m_simple_timer[tmr].base;
400   
400
401401   // refresh this timer
402402   refresh_timer(tmr);
403403}
r29404r29405
492492{
493493   while (m_cycles > 0)
494494   {
495
496495   // internal peripheral, external pin, or prev instruction may have changed irq state
497496   while (m_possible_irq)
498497   {
r29404r29405
780779
781780      switch (op)
782781      {
783
784782      // jmp (an)
785783      case 0x00: case 0x04: case 0x08: case 0x0c:
786784         m_cycles -= 1;
r29404r29405
868866
869867      switch (op & 0xc0)
870868      {
871
872869      // mov (di, an), am
873870      case 0x00:
874871         m_cycles -= 1;
r29404r29405
903900
904901      switch (op & 0xf0)
905902      {
906
907903      // add dm, an
908904      case 0x00:
909905         m_a[op&3] = do_add(m_a[op&3], m_d[op>>2&3], 0);
r29404r29405
999995
1000996      switch (op)
1001997      {
1002
1003998      // and dn, dm
1004999      case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
10051000      case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
r29404r29405
11801175
11811176      switch (op)
11821177      {
1183
11841178      // mov dm, (d24, an)
11851179      case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
11861180      case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
r29404r29405
13461340
13471341      switch (op)
13481342      {
1349
13501343      // and imm8, dn
13511344      case 0x00: case 0x01: case 0x02: case 0x03:
13521345         test_nz16(m_d[op&3] &= 0xff0000 | read_arg8(m_pc));
r29404r29405
15071500
15081501      switch (op)
15091502      {
1510
15111503      // and imm16, dn
15121504      case 0x00: case 0x01: case 0x02: case 0x03:
15131505         test_nz16(m_d[op&3] &= 0xff0000 | read_arg16(m_pc));
r29404r29405
21642156         return (m_io->read_byte(MN10200_PORT2) & 0x0f) | m_port[2].dir;
21652157      case 0x3d3:
21662158         return (m_io->read_byte(MN10200_PORT3) & 0x1f) | m_port[3].dir;
2167     
2159
21682160      // directions (0=input, 1=output)
21692161      case 0x3e0:
21702162         return m_port[0].dir;
r29404r29405
21842176         log_event("MN102", "internal_r %04x (%03x)", offset+0xfc00, adr);
21852177         break;
21862178   }
2187   
2179
21882180   return 0;
21892181}
trunk/src/emu/cpu/v810/v810.c
r29404r29405
13921392   m_irq_state = state;
13931393   m_irq_line = irqline;
13941394}
1395
trunk/src/emu/cpu/tms32025/tms32025.c
r29404r29405
22792279
22802280   return 1;
22812281}
2282
trunk/src/emu/cpu/tms32025/tms32025.h
r29404r29405
8888
8989   // device_memory_interface overrides
9090   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : NULL ) ); }
91    virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
92    virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value);
91   virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
92   virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value);
9393   virtual bool memory_readop(offs_t offset, int size, UINT64 &value);
9494
9595   // device_state_interface overrides
trunk/src/emu/cpu/sharc/sharc.c
r29404r29405
659659      {
660660         m_irq_active &= ~(1 << (8-irqline));
661661      }
662    }
662   }
663663   else if (irqline >= SHARC_INPUT_FLAG0 && irqline <= SHARC_INPUT_FLAG3)
664    {
665        set_flag_input(irqline - SHARC_INPUT_FLAG0, state);
666    }
664   {
665      set_flag_input(irqline - SHARC_INPUT_FLAG0, state);
666   }
667667}
668668
669669void adsp21062_device::set_flag_input(int flag_num, int state)
r29404r29405
917917
918918   return false;
919919}
920
trunk/src/emu/cpu/sharc/sharc.h
r29404r29405
212212   UINT32 m_astat_old_old;
213213   UINT32 m_astat_old_old_old;
214214
215   UINT16 m_internal_ram[2 * 0x10000];   // 2x 128KB
215   UINT16 m_internal_ram[2 * 0x10000]; // 2x 128KB
216216
217217   inline void CHANGE_PC(UINT32 newpc);
218218   inline void CHANGE_PC_DELAYED(UINT32 newpc);
trunk/src/emu/cpu/pdp1/tx0.h
r29404r29405
9696   unsigned int m_run;       /* processor is running */
9797   unsigned int m_rim;       /* processor is in read-in mode */
9898   unsigned int m_cycle;     /* 0 -> fetch */
99                             /* 1 -> execute (except for taken branches) */
100                             /* 2 -> extra execute cycle for SXA and ADO */
99                        /* 1 -> execute (except for taken branches) */
100                        /* 2 -> extra execute cycle for SXA and ADO */
101101
102102   unsigned int m_ioh;       /* i-o halt: processor is executing an Input-Output Transfer wait */
103103   unsigned int m_ios;       /* i-o synchronizer: set on i-o operation completion */
trunk/src/emu/cpu/pdp1/pdp1.c
r29404r29405
18131813   if (m_io_sc_callback)
18141814      (*m_io_sc_callback)(this);
18151815}
1816
trunk/src/emu/cpu/pdp1/pdp1.h
r29404r29405
7373
7474
7575class pdp1_device : public cpu_device
76                  , public pdp1_reset_param_t
76               , public pdp1_reset_param_t
7777{
7878public:
7979   // construction/destruction
trunk/src/emu/cpu/pdp1/tx0.c
r29404r29405
10681068   extern CPU_DISASSEMBLE( tx0_64kw );
10691069   return CPU_DISASSEMBLE_NAME(tx0_64kw)(this, buffer, pc, oprom, opram, options);
10701070}
1071
trunk/src/emu/cpu/tms7000/tms7000.c
r29404r29405
572572{
573573   return m_rf[ offset ];
574574}
575
trunk/src/emu/cpu/z80/z80.c
r29404r29405
639639 ***************************************************************/
640640inline void z80_device::retn()
641641{
642   LOG(("Z80 '%s' RETN m_iff1:%d m_iff2:%d\n",
642   LOG(("Z80 '%s' RETN m_iff1:%d m_iff2:%d\n",
643643      tag(), m_iff1, m_iff2));
644644   pop(m_pc);
645645   WZ = PC;
r29404r29405
26492649OP(ed,55) { retn();                                          } /* RETN             */
26502650OP(ed,56) { m_im = 1;                                        } /* IM   1           */
26512651OP(ed,57) { ld_a_i();                                        } /* LD   A,i         */
2652
2652
26532653OP(ed,58) { E = in(BC); F = (F & CF) | SZP[E];               } /* IN   E,(C)       */
26542654OP(ed,59) { out(BC, E);                                      } /* OUT  (C),E       */
26552655OP(ed,5a) { adc_hl(m_de);                                    } /* ADC  HL,DE       */
trunk/src/emu/cpu/z80/tlcs_z80.c
r29404r29405
4040static const z80sio_interface sio_intf =
4141{
4242   DEVCB_CPU_INPUT_LINE(DEVICE_SELF_OWNER, INPUT_LINE_IRQ0), /* interrupt handler */
43  DEVCB_NULL, /* DTR changed handler */
43   DEVCB_NULL, /* DTR changed handler */
4444   DEVCB_NULL, /* RTS changed handler */
4545   DEVCB_NULL, /* BREAK changed handler */
4646   DEVCB_NULL, /* transmit handler */
r29404r29405
6363   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(TLCSZ80_INTERNAL_CTC_TAG, z80ctc_device, read, write)
6464   AM_RANGE(0x18, 0x1B) AM_DEVREADWRITE(TLCSZ80_INTERNAL_SIO_TAG, z80sio_device, read, write)
6565   AM_RANGE(0x1C, 0x1F) AM_DEVREADWRITE(TLCSZ80_INTERNAL_PIO_TAG, z80pio_device, read, write)
66//   AM_RANGE(0xF0, 0xF0) TODO: Watchdog Timer: Stand-by mode Register
67//   AM_RANGE(0xF1, 0xF1) TODO: Watchdog Timer: command Register
68//   AM_RANGE(0xF4, 0xF4) TODO: Daisy chain interrupt precedence Register
66//  AM_RANGE(0xF0, 0xF0) TODO: Watchdog Timer: Stand-by mode Register
67//  AM_RANGE(0xF1, 0xF1) TODO: Watchdog Timer: command Register
68//  AM_RANGE(0xF4, 0xF4) TODO: Daisy chain interrupt precedence Register
6969ADDRESS_MAP_END
7070
7171//This is wrong!
r29404r29405
7979MACHINE_CONFIG_END
8080
8181tlcs_z80_device::tlcs_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
82   : z80_device(mconfig, TLCS_Z80, "TLCS-Z80", tag, owner, clock, "tlcs_z80", __FILE__),
82   : z80_device(mconfig, TLCS_Z80, "TLCS-Z80", tag, owner, clock, "tlcs_z80", __FILE__),
8383      m_z80ctc(*this, TLCSZ80_INTERNAL_CTC_TAG),
8484      m_io_space_config( "io", ENDIANNESS_LITTLE, 8, 8, 0, ADDRESS_MAP_NAME( tlcs_z80_internal_io_map ) )
8585   { }
r29404r29405
9797}
9898
9999const device_type TLCS_Z80 = &device_creator<tlcs_z80_device>;
100
trunk/src/emu/cpu/unsp/unsp.c
r29404r29405
162162
163163void unsp_device::state_import(const device_state_entry &entry)
164164{
165    switch (entry.index())
166    {
167        case UNSP_PC:
165   switch (entry.index())
166   {
167      case UNSP_PC:
168168         UNSP_REG(PC) = (m_debugger_temp & 0x0001fffe) >> 1;
169169         UNSP_REG(SR) = (UNSP_REG(SR) & 0xffc0) | ((m_debugger_temp & 0x007e0000) >> 17);
170            break;
171    }
170         break;
171   }
172172}
173173
174174void unsp_device::device_reset()
r29404r29405
863863   UNSP_REG(PC) = READ16(irq_vector);
864864   UNSP_REG(SR) = 0;
865865}
866
trunk/src/emu/cpu/tms34010/tms34010.h
r29404r29405
216216   /* Reads & writes to the 34010 I/O registers; place at 0xc0000000 */
217217   DECLARE_WRITE16_MEMBER( io_register_w );
218218   DECLARE_READ16_MEMBER( io_register_r );
219   
219
220220   DECLARE_WRITE16_MEMBER(host_w);
221221   DECLARE_READ16_MEMBER(host_r);
222222};
trunk/src/emu/cpu/tms34010/tms34010.c
r29404r29405
16591659   tms34010_state *tms = get_safe_token(this);
16601660   unsigned int addr;
16611661   int result = 0;
1662   
1662
16631663   /* swap to the target cpu */
16641664
16651665   switch (reg)
trunk/src/emu/cpu/tms34010/34010gfx.c
r29404r29405
109109      /* clip Y */
110110      diff = WSTART_Y(tms) - sy;
111111      if (diff > 0)
112      {   
112      {
113113#if 0 // littlerb and megaphx do not work correctly with this enabled, see items dropping into playfield from top
114114         if (srcaddr)
115115            *srcaddr += diff * SPTCH(tms);
trunk/src/emu/cpu/dsp32/dsp32.c
r29404r29405
188188void dsp32c_device::device_start()
189189{
190190   m_output_pins_changed.resolve_safe();
191   
191
192192   // get our address spaces
193193   m_program = &space(AS_PROGRAM);
194194   m_direct = &m_program->direct();
trunk/src/emu/video/pc_vga.c
r29404r29405
128128
129129vga_device::vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
130130   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
131     m_palette(*this, "^palette")
131      m_palette(*this, "^palette")
132132{
133133}
134134
135135vga_device::vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
136136   : device_t(mconfig, VGA, "VGA", tag, owner, clock, "vga", __FILE__),
137     m_palette(*this, "^palette")
137      m_palette(*this, "^palette")
138138{
139139}
140140
r29404r29405
28732873      // DCLK calculation
28742874      freq = ((double)(s3.clk_pll_m+2) / (double)((s3.clk_pll_n+2)*(pow(2.0,s3.clk_pll_r)))) * 14.318f; // clock between XIN and XOUT
28752875      xtal = freq * 1000000;
2876    }
2876   }
28772877
28782878   if((s3.ext_misc_ctrl_2) >> 4)
28792879   {
trunk/src/emu/video/tms34061.c
r29404r29405
5454{
5555   /* resolve callbak */
5656   m_interrupt_cb.resolve();
57   
57
5858   /* reset the data */
5959   m_vrammask = m_vramsize - 1;
6060
trunk/src/emu/video/tms34061.h
r29404r29405
2020
2121#define MCFG_TMS34061_INTERRUPT_CB(_devcb) \
2222   devcb = &tms34061_device::set_interrupt_callback(*device, DEVCB2_##_devcb);
23   
2423
24
2525/* register constants */
2626enum
2727{
r29404r29405
6767public:
6868   // construction/destruction
6969   tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
70   
70
7171   static void set_rowshift(device_t &device, UINT8 rowshift) { downcast<tms34061_device &>(device).m_rowshift = rowshift; }
7272   static void set_vram_size(device_t &device, UINT32 vramsize) { downcast<tms34061_device &>(device).m_vramsize = vramsize; }
7373   template<class _Object> static devcb2_base &set_interrupt_callback(device_t &device, _Object object) { return downcast<tms34061_device &>(device).m_interrupt_cb.set_callback(object); }
r29404r29405
9191   virtual void device_reset();
9292
9393private:
94   UINT8             m_rowshift;         /* VRAM address is (row << rowshift) | col */
95   UINT32            m_vramsize;         /* size of video RAM */
96   devcb2_write_line    m_interrupt_cb;      /* interrupt gen callback */
97   
94   UINT8               m_rowshift;         /* VRAM address is (row << rowshift) | col */
95   UINT32              m_vramsize;         /* size of video RAM */
96   devcb2_write_line   m_interrupt_cb;     /* interrupt gen callback */
97
9898   UINT16              m_regs[TMS34061_REGCOUNT];
9999   UINT16              m_xmask;
100100   UINT8               m_yshift;
trunk/src/emu/video/hd44780.h
r29404r29405
125125   int         m_rw_state;
126126   bool        m_nibble;
127127   int         m_charset_type;
128   UINT8      m_render_buf[80*16];
128   UINT8       m_render_buf[80*16];
129129
130130   enum        { DDRAM, CGRAM };
131131};
trunk/src/emu/video/crt9212.h
r29404r29405
7272public:
7373   // construction/destruction
7474   crt9212_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
75   
75
7676   static void static_set_wen2(device_t &device, int state) { downcast<crt9212_t &>(device).m_wen2 = state; }
7777
7878   template<class _Object> static devcb2_base &set_dout_wr_callback(device_t &device, _Object object) { return downcast<crt9212_t &>(device).m_write_dout.set_callback(object); }
r29404r29405
9494   virtual void device_start();
9595
9696private:
97   devcb2_write8         m_write_dout;
97   devcb2_write8           m_write_dout;
9898   devcb2_write_line       m_write_rof;
9999   devcb2_write_line       m_write_wof;
100100
trunk/src/emu/video/epic12_blit2.c
r29404r29405
553553#undef FLIPX
554554#undef TINT
555555#undef TRANSPARENT
556#undef REALLY_SIMPLE
No newline at end of file
556#undef REALLY_SIMPLE
trunk/src/emu/video/epic12_blit6.c
r29404r29405
554554#undef TINT
555555#undef TRANSPARENT
556556#undef REALLY_SIMPLE
557
558
trunk/src/emu/video/crt9021.h
r29404r29405
5656// ======================> crt9021_t
5757
5858class crt9021_t :  public device_t,
59               public device_video_interface
59               public device_video_interface
6060{
6161public:
6262   // construction/destruction
6363   crt9021_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
64   
64
6565   static void static_set_display_callback(device_t &device, crt9021_draw_character_delegate callback) { downcast<crt9021_t &>(device).m_display_cb = callback; }
6666
6767   void write(UINT8 data) { m_data = data; }
trunk/src/emu/video/mb_vcu.h
r29404r29405
1919
2020#define MCFG_MB_VCU_ADD(_tag,_freq,_config, _palette_tag) \
2121   MCFG_DEVICE_ADD(_tag, MB_VCU, _freq) \
22   MCFG_DEVICE_CONFIG(_config)   \
22   MCFG_DEVICE_CONFIG(_config) \
2323   mb_vcu_device::static_set_palette_tag(*device, "^" _palette_tag);
2424
2525//**************************************************************************
trunk/src/emu/video/ramdac.h
r29404r29405
1919#define MCFG_RAMDAC_ADD(_tag,_config,_map,_palette_tag) \
2020   MCFG_DEVICE_ADD(_tag, RAMDAC, 0) \
2121   MCFG_DEVICE_CONFIG(_config) \
22   MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)   \
23   ramdac_device::static_set_palette_tag(*device, "^" _palette_tag);   
22   MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \
23   ramdac_device::static_set_palette_tag(*device, "^" _palette_tag);
2424
2525#define RAMDAC_INTERFACE(name) \
2626   const ramdac_interface (name) =
r29404r29405
7979   UINT8 m_int_index[2];
8080   UINT8 *m_palram;
8181
82   const address_space_config      m_space_config;   
82   const address_space_config      m_space_config;
8383   required_device<palette_device> m_palette;
8484};
8585
trunk/src/emu/video/hd61830.h
r29404r29405
9393
9494   emu_timer *m_busy_timer;
9595   //address_space *m_data;
96   
96
9797   bool m_bf;                      // busy flag
9898
9999   UINT8 m_ir;                     // instruction register
trunk/src/emu/video/epic12_blit3.c
r29404r29405
553553#undef FLIPX
554554#undef TINT
555555#undef TRANSPARENT
556#undef REALLY_SIMPLE
No newline at end of file
556#undef REALLY_SIMPLE
trunk/src/emu/video/epic12_blit7.c
r29404r29405
554554#undef TINT
555555#undef TRANSPARENT
556556#undef REALLY_SIMPLE
557
558
trunk/src/emu/video/mc6847.c
r29404r29405
18581858//-------------------------------------------------
18591859
18601860s68047_device::s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1861    : mc6847_base_device(mconfig, S68047, "S68047", tag, owner, clock, s68047_fontdata8x12, 262.0, "s68047", __FILE__)
1861   : mc6847_base_device(mconfig, S68047, "S68047", tag, owner, clock, s68047_fontdata8x12, 262.0, "s68047", __FILE__)
18621862{
18631863}
18641864
r29404r29405
18791879
18801880const UINT32 s68047_device::s_s68047_hack_palette[16] =
18811881{
1882    rgb_t(0x07, 0xff, 0x00), /* GREEN */
1883    rgb_t(0xff, 0xff, 0x00), /* YELLOW */
1884    rgb_t(0x3b, 0x08, 0xff), /* BLUE */
1885    rgb_t(0xcc, 0x00, 0x3b), /* RED */
1886    rgb_t(0xff, 0xff, 0xff), /* BUFF */
1887    rgb_t(0x07, 0xe3, 0x99), /* CYAN */
1888    rgb_t(0xff, 0x1c, 0xff), /* MAGENTA */
1889    rgb_t(0xff, 0x81, 0x00), /* ORANGE */
1882   rgb_t(0x07, 0xff, 0x00), /* GREEN */
1883   rgb_t(0xff, 0xff, 0x00), /* YELLOW */
1884   rgb_t(0x3b, 0x08, 0xff), /* BLUE */
1885   rgb_t(0xcc, 0x00, 0x3b), /* RED */
1886   rgb_t(0xff, 0xff, 0xff), /* BUFF */
1887   rgb_t(0x07, 0xe3, 0x99), /* CYAN */
1888   rgb_t(0xff, 0x1c, 0xff), /* MAGENTA */
1889   rgb_t(0xff, 0x81, 0x00), /* ORANGE */
18901890
1891    rgb_t(0x00, 0x00, 0x00), /* BLACK */
1892    rgb_t(0x07, 0xff, 0x00), /* GREEN */
1893    rgb_t(0x3b, 0x08, 0xff), /* BLUE */
1894    rgb_t(0xff, 0xff, 0xff), /* BUFF */
1891   rgb_t(0x00, 0x00, 0x00), /* BLACK */
1892   rgb_t(0x07, 0xff, 0x00), /* GREEN */
1893   rgb_t(0x3b, 0x08, 0xff), /* BLUE */
1894   rgb_t(0xff, 0xff, 0xff), /* BUFF */
18951895
1896    rgb_t(0x00, 0x7c, 0x00), /* ALPHANUMERIC DARK GREEN */
1897    rgb_t(0x07, 0xff, 0x00), /* ALPHANUMERIC BRIGHT GREEN */
1898    rgb_t(0x91, 0x00, 0x00), /* ALPHANUMERIC DARK ORANGE */
1899    rgb_t(0xff, 0x81, 0x00)  /* ALPHANUMERIC BRIGHT ORANGE */
1896   rgb_t(0x00, 0x7c, 0x00), /* ALPHANUMERIC DARK GREEN */
1897   rgb_t(0x07, 0xff, 0x00), /* ALPHANUMERIC BRIGHT GREEN */
1898   rgb_t(0x91, 0x00, 0x00), /* ALPHANUMERIC DARK ORANGE */
1899   rgb_t(0xff, 0x81, 0x00)  /* ALPHANUMERIC BRIGHT ORANGE */
19001900};
1901
trunk/src/emu/video/mc6847.h
r29404r29405
4444#define MCFG_MC6847_FSYNC_CALLBACK(_write) \
4545   devcb = &mc6847_friend_device::set_fsync_wr_callback(*device, DEVCB2_##_write);
4646
47   
47
4848/* interface */
4949struct mc6847_interface
5050{
r29404r29405
668668class s68047_device : public mc6847_base_device
669669{
670670public:
671    s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
671   s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
672672
673673   void hack_black_becomes_blue(bool flag);
674674
675675private:
676    static const UINT32 s_s68047_hack_palette[16];
676   static const UINT32 s_s68047_hack_palette[16];
677677};
678678
679679
trunk/src/emu/video/upd3301.c
r29404r29405
636636   update_hrtc_timer(0);
637637   update_vrtc_timer(0);
638638}
639
trunk/src/emu/video/hd44352.h
r29404r29405
3030   hd44352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3131
3232   template<class _Object> static devcb2_base &set_on_callback(device_t &device, _Object object) { return downcast<hd44352_device &>(device).m_on_cb.set_callback(object); }
33   
33
3434   // device interface
3535   UINT8 data_read();
3636   void data_write(UINT8 data);
trunk/src/emu/video/huc6260.h
r29404r29405
2020
2121#define MCFG_HUC6260_NEXT_PIXEL_DATA_CB(_devcb) \
2222   devcb = &huc6260_device::set_next_pixel_data_callback(*device, DEVCB2_##_devcb);
23   
23
2424#define MCFG_HUC6260_TIME_TIL_NEXT_EVENT_CB(_devcb) \
2525   devcb = &huc6260_device::set_time_til_next_event_callback(*device, DEVCB2_##_devcb);
26   
26
2727#define MCFG_HUC6260_VSYNC_CHANGED_CB(_devcb) \
2828   devcb = &huc6260_device::set_vsync_changed_callback(*device, DEVCB2_##_devcb);
29   
29
3030#define MCFG_HUC6260_HSYNC_CHANGED_CB(_devcb) \
3131   devcb = &huc6260_device::set_hsync_changed_callback(*device, DEVCB2_##_devcb);
32   
3332
33
3434class huc6260_device :  public device_t,
3535                  public device_video_interface
3636{
r29404r29405
4242   template<class _Object> static devcb2_base &set_time_til_next_event_callback(device_t &device, _Object object) { return downcast<huc6260_device &>(device).m_time_til_next_event_cb.set_callback(object); }
4343   template<class _Object> static devcb2_base &set_vsync_changed_callback(device_t &device, _Object object) { return downcast<huc6260_device &>(device).m_vsync_changed_cb.set_callback(object); }
4444   template<class _Object> static devcb2_base &set_hsync_changed_callback(device_t &device, _Object object) { return downcast<huc6260_device &>(device).m_hsync_changed_cb.set_callback(object); }
45   
45
4646   void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
4747   DECLARE_READ8_MEMBER( read );
4848   DECLARE_WRITE8_MEMBER( write );
trunk/src/emu/video/fixfreq.c
r29404r29405
268268      {
269269         int colv = (int) ((m_vid - m_sync_threshold) / 3.7 * 255.0);
270270         if (colv > 255)
271             colv = 255;
271            colv = 255;
272272         col = rgb_t(colv, colv, colv);
273273      }
274274
trunk/src/emu/video/epic12.c
r29404r29405
4242}
4343
4444// static
45 void epic12_device::set_rambase(device_t &device, UINT16* rambase)
45   void epic12_device::set_rambase(device_t &device, UINT16* rambase)
4646{
4747   epic12_device &dev = downcast<epic12_device &>(device);
4848   dev.epic12_device_ram16 = rambase;
r29404r29405
8787
8888void epic12_device::device_reset()
8989{
90
9190   if (m_is_unsafe)
9291   {
9392      use_ram = epic12_device_ram16;
r29404r29405
138137{
139138//  UINT16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticably slower
140139   UINT16 data = use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
141   
140
142141   *addr += 2;
143142
144143//  printf("data %04x\n", data);
r29404r29405
229228
230229epic12_device_blitfunction epic12_device_f0_ti1_tr1_blit_funcs[] =
231230{
232
233231   epic12_device::draw_sprite_f0_ti1_tr1_s0_d0, epic12_device::draw_sprite_f0_ti1_tr1_s1_d0, epic12_device::draw_sprite_f0_ti1_tr1_s2_d0, epic12_device::draw_sprite_f0_ti1_tr1_s3_d0, epic12_device::draw_sprite_f0_ti1_tr1_s4_d0, epic12_device::draw_sprite_f0_ti1_tr1_s5_d0, epic12_device::draw_sprite_f0_ti1_tr1_s6_d0, epic12_device::draw_sprite_f0_ti1_tr1_s7_d0,
234232   epic12_device::draw_sprite_f0_ti1_tr1_s0_d1, epic12_device::draw_sprite_f0_ti1_tr1_s1_d1, epic12_device::draw_sprite_f0_ti1_tr1_s2_d1, epic12_device::draw_sprite_f0_ti1_tr1_s3_d1, epic12_device::draw_sprite_f0_ti1_tr1_s4_d1, epic12_device::draw_sprite_f0_ti1_tr1_s5_d1, epic12_device::draw_sprite_f0_ti1_tr1_s6_d1, epic12_device::draw_sprite_f0_ti1_tr1_s7_d1,
235233   epic12_device::draw_sprite_f0_ti1_tr1_s0_d2, epic12_device::draw_sprite_f0_ti1_tr1_s1_d2, epic12_device::draw_sprite_f0_ti1_tr1_s2_d2, epic12_device::draw_sprite_f0_ti1_tr1_s3_d2, epic12_device::draw_sprite_f0_ti1_tr1_s4_d2, epic12_device::draw_sprite_f0_ti1_tr1_s5_d2, epic12_device::draw_sprite_f0_ti1_tr1_s6_d2, epic12_device::draw_sprite_f0_ti1_tr1_s7_d2,
r29404r29405
242240
243241epic12_device_blitfunction epic12_device_f0_ti1_tr0_blit_funcs[] =
244242{
245
246243   epic12_device::draw_sprite_f0_ti1_tr0_s0_d0, epic12_device::draw_sprite_f0_ti1_tr0_s1_d0, epic12_device::draw_sprite_f0_ti1_tr0_s2_d0, epic12_device::draw_sprite_f0_ti1_tr0_s3_d0, epic12_device::draw_sprite_f0_ti1_tr0_s4_d0, epic12_device::draw_sprite_f0_ti1_tr0_s5_d0, epic12_device::draw_sprite_f0_ti1_tr0_s6_d0, epic12_device::draw_sprite_f0_ti1_tr0_s7_d0,
247244   epic12_device::draw_sprite_f0_ti1_tr0_s0_d1, epic12_device::draw_sprite_f0_ti1_tr0_s1_d1, epic12_device::draw_sprite_f0_ti1_tr0_s2_d1, epic12_device::draw_sprite_f0_ti1_tr0_s3_d1, epic12_device::draw_sprite_f0_ti1_tr0_s4_d1, epic12_device::draw_sprite_f0_ti1_tr0_s5_d1, epic12_device::draw_sprite_f0_ti1_tr0_s6_d1, epic12_device::draw_sprite_f0_ti1_tr0_s7_d1,
248245   epic12_device::draw_sprite_f0_ti1_tr0_s0_d2, epic12_device::draw_sprite_f0_ti1_tr0_s1_d2, epic12_device::draw_sprite_f0_ti1_tr0_s2_d2, epic12_device::draw_sprite_f0_ti1_tr0_s3_d2, epic12_device::draw_sprite_f0_ti1_tr0_s4_d2, epic12_device::draw_sprite_f0_ti1_tr0_s5_d2, epic12_device::draw_sprite_f0_ti1_tr0_s6_d2, epic12_device::draw_sprite_f0_ti1_tr0_s7_d2,
r29404r29405
255252
256253epic12_device_blitfunction epic12_device_f1_ti1_tr1_blit_funcs[] =
257254{
258
259255   epic12_device::draw_sprite_f1_ti1_tr1_s0_d0, epic12_device::draw_sprite_f1_ti1_tr1_s1_d0, epic12_device::draw_sprite_f1_ti1_tr1_s2_d0, epic12_device::draw_sprite_f1_ti1_tr1_s3_d0, epic12_device::draw_sprite_f1_ti1_tr1_s4_d0, epic12_device::draw_sprite_f1_ti1_tr1_s5_d0, epic12_device::draw_sprite_f1_ti1_tr1_s6_d0, epic12_device::draw_sprite_f1_ti1_tr1_s7_d0,
260256   epic12_device::draw_sprite_f1_ti1_tr1_s0_d1, epic12_device::draw_sprite_f1_ti1_tr1_s1_d1, epic12_device::draw_sprite_f1_ti1_tr1_s2_d1, epic12_device::draw_sprite_f1_ti1_tr1_s3_d1, epic12_device::draw_sprite_f1_ti1_tr1_s4_d1, epic12_device::draw_sprite_f1_ti1_tr1_s5_d1, epic12_device::draw_sprite_f1_ti1_tr1_s6_d1, epic12_device::draw_sprite_f1_ti1_tr1_s7_d1,
261257   epic12_device::draw_sprite_f1_ti1_tr1_s0_d2, epic12_device::draw_sprite_f1_ti1_tr1_s1_d2, epic12_device::draw_sprite_f1_ti1_tr1_s2_d2, epic12_device::draw_sprite_f1_ti1_tr1_s3_d2, epic12_device::draw_sprite_f1_ti1_tr1_s4_d2, epic12_device::draw_sprite_f1_ti1_tr1_s5_d2, epic12_device::draw_sprite_f1_ti1_tr1_s6_d2, epic12_device::draw_sprite_f1_ti1_tr1_s7_d2,
r29404r29405
268264
269265epic12_device_blitfunction epic12_device_f1_ti1_tr0_blit_funcs[] =
270266{
271
272267   epic12_device::draw_sprite_f1_ti1_tr0_s0_d0, epic12_device::draw_sprite_f1_ti1_tr0_s1_d0, epic12_device::draw_sprite_f1_ti1_tr0_s2_d0, epic12_device::draw_sprite_f1_ti1_tr0_s3_d0, epic12_device::draw_sprite_f1_ti1_tr0_s4_d0, epic12_device::draw_sprite_f1_ti1_tr0_s5_d0, epic12_device::draw_sprite_f1_ti1_tr0_s6_d0, epic12_device::draw_sprite_f1_ti1_tr0_s7_d0,
273268   epic12_device::draw_sprite_f1_ti1_tr0_s0_d1, epic12_device::draw_sprite_f1_ti1_tr0_s1_d1, epic12_device::draw_sprite_f1_ti1_tr0_s2_d1, epic12_device::draw_sprite_f1_ti1_tr0_s3_d1, epic12_device::draw_sprite_f1_ti1_tr0_s4_d1, epic12_device::draw_sprite_f1_ti1_tr0_s5_d1, epic12_device::draw_sprite_f1_ti1_tr0_s6_d1, epic12_device::draw_sprite_f1_ti1_tr0_s7_d1,
274269   epic12_device::draw_sprite_f1_ti1_tr0_s0_d2, epic12_device::draw_sprite_f1_ti1_tr0_s1_d2, epic12_device::draw_sprite_f1_ti1_tr0_s2_d2, epic12_device::draw_sprite_f1_ti1_tr0_s3_d2, epic12_device::draw_sprite_f1_ti1_tr0_s4_d2, epic12_device::draw_sprite_f1_ti1_tr0_s5_d2, epic12_device::draw_sprite_f1_ti1_tr0_s6_d2, epic12_device::draw_sprite_f1_ti1_tr0_s7_d2,
r29404r29405
283278
284279epic12_device_blitfunction epic12_device_f0_ti0_tr1_blit_funcs[] =
285280{
286
287281   epic12_device::draw_sprite_f0_ti0_tr1_s0_d0, epic12_device::draw_sprite_f0_ti0_tr1_s1_d0, epic12_device::draw_sprite_f0_ti0_tr1_s2_d0, epic12_device::draw_sprite_f0_ti0_tr1_s3_d0, epic12_device::draw_sprite_f0_ti0_tr1_s4_d0, epic12_device::draw_sprite_f0_ti0_tr1_s5_d0, epic12_device::draw_sprite_f0_ti0_tr1_s6_d0, epic12_device::draw_sprite_f0_ti0_tr1_s7_d0,
288282   epic12_device::draw_sprite_f0_ti0_tr1_s0_d1, epic12_device::draw_sprite_f0_ti0_tr1_s1_d1, epic12_device::draw_sprite_f0_ti0_tr1_s2_d1, epic12_device::draw_sprite_f0_ti0_tr1_s3_d1, epic12_device::draw_sprite_f0_ti0_tr1_s4_d1, epic12_device::draw_sprite_f0_ti0_tr1_s5_d1, epic12_device::draw_sprite_f0_ti0_tr1_s6_d1, epic12_device::draw_sprite_f0_ti0_tr1_s7_d1,
289283   epic12_device::draw_sprite_f0_ti0_tr1_s0_d2, epic12_device::draw_sprite_f0_ti0_tr1_s1_d2, epic12_device::draw_sprite_f0_ti0_tr1_s2_d2, epic12_device::draw_sprite_f0_ti0_tr1_s3_d2, epic12_device::draw_sprite_f0_ti0_tr1_s4_d2, epic12_device::draw_sprite_f0_ti0_tr1_s5_d2, epic12_device::draw_sprite_f0_ti0_tr1_s6_d2, epic12_device::draw_sprite_f0_ti0_tr1_s7_d2,
r29404r29405
296290
297291epic12_device_blitfunction epic12_device_f0_ti0_tr0_blit_funcs[] =
298292{
299
300293   epic12_device::draw_sprite_f0_ti0_tr0_s0_d0, epic12_device::draw_sprite_f0_ti0_tr0_s1_d0, epic12_device::draw_sprite_f0_ti0_tr0_s2_d0, epic12_device::draw_sprite_f0_ti0_tr0_s3_d0, epic12_device::draw_sprite_f0_ti0_tr0_s4_d0, epic12_device::draw_sprite_f0_ti0_tr0_s5_d0, epic12_device::draw_sprite_f0_ti0_tr0_s6_d0, epic12_device::draw_sprite_f0_ti0_tr0_s7_d0,
301294   epic12_device::draw_sprite_f0_ti0_tr0_s0_d1, epic12_device::draw_sprite_f0_ti0_tr0_s1_d1, epic12_device::draw_sprite_f0_ti0_tr0_s2_d1, epic12_device::draw_sprite_f0_ti0_tr0_s3_d1, epic12_device::draw_sprite_f0_ti0_tr0_s4_d1, epic12_device::draw_sprite_f0_ti0_tr0_s5_d1, epic12_device::draw_sprite_f0_ti0_tr0_s6_d1, epic12_device::draw_sprite_f0_ti0_tr0_s7_d1,
302295   epic12_device::draw_sprite_f0_ti0_tr0_s0_d2, epic12_device::draw_sprite_f0_ti0_tr0_s1_d2, epic12_device::draw_sprite_f0_ti0_tr0_s2_d2, epic12_device::draw_sprite_f0_ti0_tr0_s3_d2, epic12_device::draw_sprite_f0_ti0_tr0_s4_d2, epic12_device::draw_sprite_f0_ti0_tr0_s5_d2, epic12_device::draw_sprite_f0_ti0_tr0_s6_d2, epic12_device::draw_sprite_f0_ti0_tr0_s7_d2,
r29404r29405
309302
310303epic12_device_blitfunction epic12_device_f1_ti0_tr1_blit_funcs[] =
311304{
312
313305   epic12_device::draw_sprite_f1_ti0_tr1_s0_d0, epic12_device::draw_sprite_f1_ti0_tr1_s1_d0, epic12_device::draw_sprite_f1_ti0_tr1_s2_d0, epic12_device::draw_sprite_f1_ti0_tr1_s3_d0, epic12_device::draw_sprite_f1_ti0_tr1_s4_d0, epic12_device::draw_sprite_f1_ti0_tr1_s5_d0, epic12_device::draw_sprite_f1_ti0_tr1_s6_d0, epic12_device::draw_sprite_f1_ti0_tr1_s7_d0,
314306   epic12_device::draw_sprite_f1_ti0_tr1_s0_d1, epic12_device::draw_sprite_f1_ti0_tr1_s1_d1, epic12_device::draw_sprite_f1_ti0_tr1_s2_d1, epic12_device::draw_sprite_f1_ti0_tr1_s3_d1, epic12_device::draw_sprite_f1_ti0_tr1_s4_d1, epic12_device::draw_sprite_f1_ti0_tr1_s5_d1, epic12_device::draw_sprite_f1_ti0_tr1_s6_d1, epic12_device::draw_sprite_f1_ti0_tr1_s7_d1,
315307   epic12_device::draw_sprite_f1_ti0_tr1_s0_d2, epic12_device::draw_sprite_f1_ti0_tr1_s1_d2, epic12_device::draw_sprite_f1_ti0_tr1_s2_d2, epic12_device::draw_sprite_f1_ti0_tr1_s3_d2, epic12_device::draw_sprite_f1_ti0_tr1_s4_d2, epic12_device::draw_sprite_f1_ti0_tr1_s5_d2, epic12_device::draw_sprite_f1_ti0_tr1_s6_d2, epic12_device::draw_sprite_f1_ti0_tr1_s7_d2,
r29404r29405
322314
323315epic12_device_blitfunction epic12_device_f1_ti0_tr0_blit_funcs[] =
324316{
325
326317   epic12_device::draw_sprite_f1_ti0_tr0_s0_d0, epic12_device::draw_sprite_f1_ti0_tr0_s1_d0, epic12_device::draw_sprite_f1_ti0_tr0_s2_d0, epic12_device::draw_sprite_f1_ti0_tr0_s3_d0, epic12_device::draw_sprite_f1_ti0_tr0_s4_d0, epic12_device::draw_sprite_f1_ti0_tr0_s5_d0, epic12_device::draw_sprite_f1_ti0_tr0_s6_d0, epic12_device::draw_sprite_f1_ti0_tr0_s7_d0,
327318   epic12_device::draw_sprite_f1_ti0_tr0_s0_d1, epic12_device::draw_sprite_f1_ti0_tr0_s1_d1, epic12_device::draw_sprite_f1_ti0_tr0_s2_d1, epic12_device::draw_sprite_f1_ti0_tr0_s3_d1, epic12_device::draw_sprite_f1_ti0_tr0_s4_d1, epic12_device::draw_sprite_f1_ti0_tr0_s5_d1, epic12_device::draw_sprite_f1_ti0_tr0_s6_d1, epic12_device::draw_sprite_f1_ti0_tr0_s7_d1,
328319   epic12_device::draw_sprite_f1_ti0_tr0_s0_d2, epic12_device::draw_sprite_f1_ti0_tr0_s1_d2, epic12_device::draw_sprite_f1_ti0_tr0_s2_d2, epic12_device::draw_sprite_f1_ti0_tr0_s3_d2, epic12_device::draw_sprite_f1_ti0_tr0_s4_d2, epic12_device::draw_sprite_f1_ti0_tr0_s5_d2, epic12_device::draw_sprite_f1_ti0_tr0_s6_d2, epic12_device::draw_sprite_f1_ti0_tr0_s7_d2,
r29404r29405
343334   COPY_NEXT_WORD(space, addr);
344335   COPY_NEXT_WORD(space, addr); // UINT16 dst_x_start  =   COPY_NEXT_WORD(space, addr);
345336   COPY_NEXT_WORD(space, addr); // UINT16 dst_y_start  =   COPY_NEXT_WORD(space, addr);
346   UINT16 w      =   COPY_NEXT_WORD(space, addr);
347   UINT16 h      =   COPY_NEXT_WORD(space, addr);
337   UINT16 w        =   COPY_NEXT_WORD(space, addr);
338   UINT16 h        =   COPY_NEXT_WORD(space, addr);
348339   COPY_NEXT_WORD(space, addr);
349340   COPY_NEXT_WORD(space, addr);
350341
r29404r29405
359350
360351inline void epic12_device::epic12_device_gfx_draw(offs_t *addr)
361352{
362   int   x,y, dimx,dimy, flipx,flipy;//, src_p;
353   int x,y, dimx,dimy, flipx,flipy;//, src_p;
363354   int trans,blend, s_mode, d_mode;
364355   clr_t tint_clr;
365356   int tinted = 0;
366357
367   UINT16 attr      =   READ_NEXT_WORD(addr);
368   UINT16 alpha   =   READ_NEXT_WORD(addr);
369   UINT16 src_x   =   READ_NEXT_WORD(addr);
370   UINT16 src_y   =   READ_NEXT_WORD(addr);
371   UINT16 dst_x_start   =   READ_NEXT_WORD(addr);
372   UINT16 dst_y_start   =   READ_NEXT_WORD(addr);
373   UINT16 w      =   READ_NEXT_WORD(addr);
374   UINT16 h      =   READ_NEXT_WORD(addr);
375   UINT16 tint_r   =   READ_NEXT_WORD(addr);
376   UINT16 tint_gb   =   READ_NEXT_WORD(addr);
358   UINT16 attr     =   READ_NEXT_WORD(addr);
359   UINT16 alpha    =   READ_NEXT_WORD(addr);
360   UINT16 src_x    =   READ_NEXT_WORD(addr);
361   UINT16 src_y    =   READ_NEXT_WORD(addr);
362   UINT16 dst_x_start  =   READ_NEXT_WORD(addr);
363   UINT16 dst_y_start  =   READ_NEXT_WORD(addr);
364   UINT16 w        =   READ_NEXT_WORD(addr);
365   UINT16 h        =   READ_NEXT_WORD(addr);
366   UINT16 tint_r   =   READ_NEXT_WORD(addr);
367   UINT16 tint_gb  =   READ_NEXT_WORD(addr);
377368
378369   // 0: +alpha
379370   // 1: +source
r29404r29405
384375   // 6: -dest
385376   // 7: *
386377
387   d_mode   =    attr & 0x0007;
388   s_mode   =   (attr & 0x0070) >> 4;
378   d_mode  =    attr & 0x0007;
379   s_mode  =   (attr & 0x0070) >> 4;
389380
390   trans   =    attr & 0x0100;
391   blend   =      attr & 0x0200;
381   trans   =    attr & 0x0100;
382   blend   =      attr & 0x0200;
392383
393   flipy   =    attr & 0x0400;
394   flipx   =    attr & 0x0800;
384   flipy   =    attr & 0x0400;
385   flipx   =    attr & 0x0800;
395386
396   const UINT8 d_alpha   =   ((alpha & 0x00ff)       )>>3;
397   const UINT8 s_alpha   =   ((alpha & 0xff00) >> 8  )>>3;
387   const UINT8 d_alpha =   ((alpha & 0x00ff)       )>>3;
388   const UINT8 s_alpha =   ((alpha & 0xff00) >> 8  )>>3;
398389
399390//  src_p   =   0;
400   src_x   =   src_x & 0x1fff;
401   src_y   =   src_y & 0x0fff;
391   src_x   =   src_x & 0x1fff;
392   src_y   =   src_y & 0x0fff;
402393
403394
404   x      =   (dst_x_start & 0x7fff) - (dst_x_start & 0x8000);
405   y      =   (dst_y_start & 0x7fff) - (dst_y_start & 0x8000);
395   x       =   (dst_x_start & 0x7fff) - (dst_x_start & 0x8000);
396   y       =   (dst_y_start & 0x7fff) - (dst_y_start & 0x8000);
406397
407   dimx   =   (w & 0x1fff) + 1;
408   dimy   =   (h & 0x0fff) + 1;
398   dimx    =   (w & 0x1fff) + 1;
399   dimy    =   (h & 0x0fff) + 1;
409400
410401   // convert parameters to clr
411402
r29404r29405
483474   }
484475   else
485476   {
486
487477      if (blend==0 && tinted==0)
488478      {
489479         if (!flipx)
r29404r29405
903893
904894
905895
906   
896
907897READ32_MEMBER( epic12_device::epic12_device_blitter_r )
908898{
909899   switch (offset*4)
trunk/src/emu/video/ef9345.h
r29404r29405
2121
2222#define MCFG_EF9345_PALETTE(_palette_tag) \
2323   ef9345_device::static_set_palette_tag(*device, "^" _palette_tag);
24   
24
2525//**************************************************************************
2626//  TYPE DEFINITIONS
2727//**************************************************************************
r29404r29405
3838
3939   // static configuration
4040   static void static_set_palette_tag(device_t &device, const char *tag);
41   
41
4242   // device interface
4343   DECLARE_READ8_MEMBER( data_r );
4444   DECLARE_WRITE8_MEMBER( data_w );
r29404r29405
112112   // timers
113113   emu_timer *m_busy_timer;
114114   emu_timer *m_blink_timer;
115   
115
116116   required_device<palette_device> m_palette;
117117};
118118
trunk/src/emu/video/315_5124.h
r29404r29405
6464   static void set_signal_type(device_t &device, bool is_pal) { downcast<sega315_5124_device &>(device).m_is_pal = is_pal; }
6565   template<class _Object> static devcb2_base &set_int_callback(device_t &device, _Object object) { return downcast<sega315_5124_device &>(device).m_int_cb.set_callback(object); }
6666   template<class _Object> static devcb2_base &set_pause_callback(device_t &device, _Object object) { return downcast<sega315_5124_device &>(device).m_pause_cb.set_callback(object); }
67   
67
6868   DECLARE_READ8_MEMBER( vram_read );
6969   DECLARE_WRITE8_MEMBER( vram_write );
7070   DECLARE_READ8_MEMBER( register_read );
r29404r29405
164164   static const device_timer_id TIMER_DRAW = 1;
165165   static const device_timer_id TIMER_CHECK_HINT = 2;
166166   static const device_timer_id TIMER_CHECK_VINT = 3;
167   
167
168168   required_device<palette_device> m_palette;
169169};
170170
r29404r29405
209209
210210#define MCFG_SEGA315_5124_INT_CB(_devcb) \
211211   devcb = &sega315_5124_device::set_int_callback(*device, DEVCB2_##_devcb);
212   
212
213213#define MCFG_SEGA315_5124_PAUSE_CB(_devcb) \
214214   devcb = &sega315_5124_device::set_pause_callback(*device, DEVCB2_##_devcb);
215215
216216
217217#define MCFG_SEGA315_5246_SET_SCREEN MCFG_VIDEO_SET_SCREEN
218   
218
219219#define MCFG_SEGA315_5246_IS_PAL(_bool) \
220220   sega315_5246_device::set_signal_type(*device, _bool);
221221
222222#define MCFG_SEGA315_5246_INT_CB(_devcb) \
223223   devcb = &sega315_5246_device::set_int_callback(*device, DEVCB2_##_devcb);
224   
224
225225#define MCFG_SEGA315_5246_PAUSE_CB(_devcb) \
226226   devcb = &sega315_5246_device::set_pause_callback(*device, DEVCB2_##_devcb);
227227
228228
229229#define MCFG_SEGA315_5378_SET_SCREEN MCFG_VIDEO_SET_SCREEN
230   
230
231231#define MCFG_SEGA315_5378_IS_PAL(_bool) \
232232   sega315_5378_device::set_signal_type(*device, _bool);
233233
234234#define MCFG_SEGA315_5378_INT_CB(_devcb) \
235235   devcb = &sega315_5378_device::set_int_callback(*device, DEVCB2_##_devcb);
236   
236
237237#define MCFG_SEGA315_5378_PAUSE_CB(_devcb) \
238238   devcb = &sega315_5378_device::set_pause_callback(*device, DEVCB2_##_devcb);
239239
trunk/src/emu/video/epic12.h
r29404r29405
33   MCFG_DEVICE_ADD(_tag, EPIC12, 0)
44
55//#define MCFG_EP1C12_ADD(_tag,_config,_map)
6//   MCFG_DEVICE_CONFIG(_config)
7//   MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
6//  MCFG_DEVICE_CONFIG(_config)
7//  MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
88
99#define MCFG_EPIC12_SET_MAINRAMSIZE( _rgn ) \
1010   epic12_device::set_mainramsize(*device, _rgn);
r29404r29405
2929};
3030
3131typedef const void (*epic12_device_blitfunction)(bitmap_rgb32 *,
32                const rectangle *,
33                UINT32 *, /* gfx */
34                int , /* src_x */
35                int , /* src_y */
36                const int , /* dst_x_start */
37                const int , /* dst_y_start */
38                int , /* dimx */
39                int , /* dimy */
40                const int , /* flipy */
41                const UINT8 , /* s_alpha */
42                const UINT8 , /* d_alpha */
43                //int , /* tint */
44                const clr_t * );
32                  const rectangle *,
33                  UINT32 *, /* gfx */
34                  int , /* src_x */
35                  int , /* src_y */
36                  const int , /* dst_x_start */
37                  const int , /* dst_y_start */
38                  int , /* dimx */
39                  int , /* dimy */
40                  const int , /* flipy */
41                  const UINT8 , /* s_alpha */
42                  const UINT8 , /* d_alpha */
43                  //int , /* tint */
44                  const clr_t * );
4545
4646
4747class epic12_device : public device_t,
r29404r29405
7979   bitmap_rgb32 *epic12_device_bitmaps;
8080   rectangle epic12_device_clip;
8181
82   
82
8383   UINT16* use_ram;
8484   int m_main_ramsize; // type D has double the main ram
8585   int m_main_rammask;
r29404r29405
676676   // convert separate r,g,b biases (0..80..ff) to clr_t (-1f..0..1f)
677677   static inline void tint_to_clr(UINT8 r, UINT8 g, UINT8 b, clr_t *clr)
678678   {
679      clr->r   =   r>>2;
680      clr->g   =   g>>2;
681      clr->b   =   b>>2;
679      clr->r  =   r>>2;
680      clr->g  =   g>>2;
681      clr->b  =   b>>2;
682682   };
683683
684684   // clr_t to r5g5b5
685685   static inline UINT32 clr_to_pen(const clr_t *clr)
686686   {
687
688687   // --t- ---- rrrr r--- gggg g--- bbbb b---  format
689688      return (clr->r << (16+3)) | (clr->g << (8+3)) | (clr->b << 3);
690689
r29404r29405
739738   static inline  void clr_add(clr_t *clr, const clr_t *clr0, const clr_t *clr1)
740739   {
741740   /*
742      clr->r = clr0->r + clr1->r;
743      clr->g = clr0->g + clr1->g;
744      clr->b = clr0->b + clr1->b;
741       clr->r = clr0->r + clr1->r;
742       clr->g = clr0->g + clr1->g;
743       clr->b = clr0->b + clr1->b;
745744   */
746745      // use pre-clamped lookup table
747746      clr->r =  epic12_device_colrtable_add[clr0->r][clr1->r];
r29404r29405
834833
835834
836835
837   osd_work_queue *   queue;               /* work queue */
836   osd_work_queue *    queue;                  /* work queue */
838837   osd_work_item * blitter_request;
839838
840839   // blit timing
trunk/src/emu/video/v9938.h
r29404r29405
233233      void (v99x8_device::*draw_sprite_16)(const pen_t *, UINT16*, UINT8*);
234234      void (v99x8_device::*draw_sprite_16s)(const pen_t *, UINT16*, UINT8*);
235235   } ;
236   static const v99x8_mode s_modes[];   
236   static const v99x8_mode s_modes[];
237237   required_device<palette_device> m_palette;
238238protected:
239239   static UINT16 s_pal_indYJK[0x20000];
trunk/src/emu/video/epic12_blit4.c
r29404r29405
553553#undef FLIPX
554554#undef TINT
555555#undef TRANSPARENT
556#undef REALLY_SIMPLE
No newline at end of file
556#undef REALLY_SIMPLE
trunk/src/emu/video/epic12_blit8.c
r29404r29405
3838
3939#undef BLENDED
4040#undef REALLY_SIMPLE
41
42
43
trunk/src/emu/video/dl1416.h
r29404r29405
3434public:
3535   dl1416_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
3636   ~dl1416_device() {}
37   
37
3838   template<class _Object> static devcb2_base &set_update_handler(device_t &device, _Object object) { return downcast<dl1416_device &>(device).m_update.set_callback(object); }
3939
4040   /* inputs */
trunk/src/emu/video/epic12in.inc
r29404r29405
33
44const void epic12_device::FUNCNAME(BLIT_PARAMS)
55{
6
7
86   UINT32* gfx2;
97   int y, yf;
108
r29404r29405
4745   src_x += (dimx-1);
4846#endif
4947
50   if (flipy)   {   yf = -1;   src_y += (dimy-1);   }
51   else      {   yf = +1;                  }
48   if (flipy)  {   yf = -1;    src_y += (dimy-1);  }
49   else        {   yf = +1;                        }
5250
5351   int starty = 0;
5452   const int dst_y_end = dst_y_start+dimy;
r29404r29405
6462#if FLIPX == 1
6563   if ((src_x &0x1fff) < ((src_x-(dimx-1))&0x1fff))
6664   {
67   //   popmessage("sprite gets clipped off src_x %04x dimx %04x\n", src_x, dimx);
65   //  popmessage("sprite gets clipped off src_x %04x dimx %04x\n", src_x, dimx);
6866      return;
6967   }
7068#else
7169   if ((src_x &0x1fff) > ((src_x+(dimx-1))&0x1fff))
7270   {
73   //   popmessage("sprite gets clipped off src_x %04x dimx %04x\n", src_x, dimx);
71   //  popmessage("sprite gets clipped off src_x %04x dimx %04x\n", src_x, dimx);
7472      return;
7573   }
7674#endif
trunk/src/emu/video/huc6270.h
r29404r29405
2020public:
2121   // construction/destruction
2222   huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   
23
2424   static void set_vram_size(device_t &device, UINT32 vram_size) { downcast<huc6270_device &>(device).m_vram_size = vram_size; }
2525   template<class _Object> static devcb2_base &set_irq_changed_callback(device_t &device, _Object object) { return downcast<huc6270_device &>(device).m_irq_changed_cb.set_callback(object); }
2626
r29404r29405
6666      HUC6270_HSW
6767   };
6868
69   
69
7070   /* Size of Video ram (mandatory) */
7171   UINT32 m_vram_size;
72   
72
7373   /* Callback for when the irq line may have changed (mandatory) */
7474   devcb2_write_line    m_irq_changed_cb;
7575
trunk/src/emu/video/epic12pixel.inc
r29404r29405
33#if FLIPX == 1
44#define LOOP_INCREMENTS \
55         bmp++;  \
6         gfx2--; \
7
6         gfx2--;
87#else
98
109#define LOOP_INCREMENTS \
1110         bmp++;  \
12         gfx2++; \
13
11         gfx2++;
1412#endif
1513
1614
r29404r29405
4947
5048            // convert destination to clr
5149            pen_to_clr(*bmp, &d_clr.trgb);
52                //d_clr.u32 = *bmp >> 3; // using the union is actually significantly slower than our pen_to_clr to function!
50            //d_clr.u32 = *bmp >> 3; // using the union is actually significantly slower than our pen_to_clr to function!
5351            #if _SMODE == 0
5452            //g_profiler.start(PROFILER_USER7);
5553
r29404r29405
193191         }
194192#endif
195193         LOOP_INCREMENTS
196
trunk/src/emu/video/315_5313.c
r29404r29405
25302530            lineptr[x] = m_palette_lookup[(dat & 0x3f)];
25312531            m_render_line_raw[x] |= (dat & 0x3f) | 0x040;
25322532         }
2533         
2533
25342534      }
25352535      else
25362536      {
r29404r29405
25462546               lineptr[x] = m_palette_lookup_shadow[(dat & 0x3f)];
25472547               m_render_line_raw[x] |= (dat & 0x3f) | 0x000;
25482548               break;
2549               
2549
25502550            case 0x4000: // normal pri, no shadow sprite, no highlight = normal;
25512551            case 0x8000: // low pri, highlight sprite = normal;
25522552               lineptr[x] = m_palette_lookup[(dat & 0x3f)];
25532553               m_render_line_raw[x] |= (dat & 0x3f) | 0x040;
25542554               break;
2555               
2555
25562556            case 0x14000: // (sprite) normal pri, no shadow sprite, no highlight = normal;
25572557            case 0x18000: // (sprite) low pri, highlight sprite = normal;
25582558               lineptr[x] = m_palette_lookup_sprite[(dat & 0x3f)];
25592559               m_render_line_raw[x] |= (dat & 0x3f) | 0x080;
25602560               break;
2561               
2562               
2561
2562
25632563            case 0x0c000: // normal pri, highlight set = highlight?
25642564            case 0x1c000: // (sprite) normal pri, highlight set = highlight?
25652565               lineptr[x] = m_palette_lookup_highlight[(dat & 0x3f)];
25662566               m_render_line_raw[x] |= (dat & 0x3f) | 0x0c0;
25672567               break;
2568               
2568
25692569            case 0x0a000: // shadow set, highlight set - not possible
25702570            case 0x0e000: // shadow set, highlight set, normal set, not possible
25712571            case 0x1a000: // (sprite)shadow set, highlight set - not possible
trunk/src/emu/video/mc6845.c
r29404r29405
14721472
14731473machine_config_constructor mos8563_device::device_mconfig_additions() const
14741474{
1475        return MACHINE_CONFIG_NAME( mos8563 );
1475      return MACHINE_CONFIG_NAME( mos8563 );
14761476}
14771477
14781478
trunk/src/emu/video/315_5313.h
r29404r29405
149149
150150#define MCFG_SEGA315_5313_INT_CB(_devcb) \
151151   devcb = &sega315_5313_device::set_int_callback(*device, DEVCB2_##_devcb);
152   
152
153153#define MCFG_SEGA315_5313_PAUSE_CB(_devcb) \
154154   devcb = &sega315_5313_device::set_pause_callback(*device, DEVCB2_##_devcb);
155155
156156#define MCFG_SEGA315_5313_SND_IRQ_CALLBACK(_write) \
157157   devcb = &sega315_5313_device::set_sndirqline_callback(*device, DEVCB2_##_write);
158
158
159159#define MCFG_SEGA315_5313_LV6_IRQ_CALLBACK(_write) \
160160   devcb = &sega315_5313_device::set_lv6irqline_callback(*device, DEVCB2_##_write);
161
161
162162#define MCFG_SEGA315_5313_LV4_IRQ_CALLBACK(_write) \
163163   devcb = &sega315_5313_device::set_lv4irqline_callback(*device, DEVCB2_##_write);
164
164
165165#define MCFG_SEGA315_5313_ALT_TIMING(_data) \
166166   sega315_5313_device::set_alt_timing(*device, _data);
167
167
168168#define MCFG_SEGA315_5313_PAL_WRITE_BASE(_data) \
169169   sega315_5313_device::set_palwrite_base(*device, _data);
170
170
171171#define MCFG_SEGA315_5313_PALETTE(_palette_tag) \
172172   sega315_5313_device::static_set_palette_tag(*device, "^" _palette_tag);
173173
r29404r29405
257257   devcb2_write_line m_sndirqline_callback;
258258   devcb2_write_line m_lv6irqline_callback;
259259   devcb2_write_line m_lv4irqline_callback;
260   
260
261261   md_32x_scanline_delegate m_32x_scanline_func;
262262   md_32x_interrupt_delegate m_32x_interrupt_func;
263263   md_32x_scanline_helper_delegate m_32x_scanline_helper_func;
264   
264
265265private:
266266
267267   int m_command_pending; // 2nd half of command pending..
r29404r29405
291291   int m_framerate;
292292   int m_vdp_pal;
293293   int m_use_cram; // c2 uses it's own palette ram, so it sets this to 0
294   int m_dma_delay;   // SVP and SegaCD have some 'lag' in DMA transfers
294   int m_dma_delay;    // SVP and SegaCD have some 'lag' in DMA transfers
295295
296296   UINT16* m_regs;
297297   UINT16* m_vram;
trunk/src/emu/video/upd7220.h
r29404r29405
153153   void draw_graphics_line(bitmap_rgb32 &bitmap, UINT32 addr, int y, int wd);
154154   void update_graphics(bitmap_rgb32 &bitmap, const rectangle &cliprect, int force_bitmap);
155155
156   upd7220_display_pixels_delegate      m_display_cb;
157   upd7220_draw_text_delegate         m_draw_text_cb;
156   upd7220_display_pixels_delegate     m_display_cb;
157   upd7220_draw_text_delegate          m_draw_text_cb;
158158
159159   devcb2_write_line   m_write_drq;
160160   devcb2_write_line   m_write_hsync;
trunk/src/emu/video/vic4567.h
r29404r29405
241241   UINT8 m_palette_green[0x100];
242242   UINT8 m_palette_blue[0x100];
243243   int m_palette_dirty;
244   
244
245245   required_device<palette_device> m_palette;
246246};
247247
trunk/src/emu/video/crt9007.h
r29404r29405
9797// ======================> crt9007_t
9898
9999class crt9007_t :  public device_t,
100               public device_memory_interface,
101               public device_video_interface
100               public device_memory_interface,
101               public device_video_interface
102102{
103103public:
104104   // construction/destruction
trunk/src/emu/emuopts.c
r29404r29405
491491      astring error;
492492      set_value(OPTION_SYSTEMNAME, name, OPTION_PRIORITY_CMDLINE, error);
493493      assert(!error);
494     
494
495495      // remove any existing device options and then add them afresh
496496      remove_device_options();
497497      if (add_slot_options(true))
trunk/src/emu/tilemap.h
r29404r29405
438438   UINT8           flags;          // defaults to 0; one or more of TILE_* flags above
439439   UINT8           pen_mask;       // defaults to 0xff; mask to apply to pen_data while rendering the tile
440440   UINT8           gfxnum;         // defaults to 0xff; specify index of gfx for auto-invalidation on dirty
441   
441
442442   void set(int _gfxnum, int rawcode, int rawcolor, int _flags)
443443   {
444444      gfx_element *gfx = decoder->gfx(_gfxnum);
trunk/src/emu/video.c
r29404r29405
12471247}
12481248
12491249//-------------------------------------------------
1250//   toggle_throttle
1250//  toggle_throttle
12511251//-------------------------------------------------
12521252
12531253void video_manager::toggle_throttle()
r29404r29405
12571257
12581258
12591259//-------------------------------------------------
1260//   toggle_record_movie
1260//  toggle_record_movie
12611261//-------------------------------------------------
12621262
12631263void video_manager::toggle_record_movie()
trunk/src/lib/formats/d64_dsk.c
r29404r29405
228228
229229         build_sector_description(f, img, track_offset, error_offset, sectors, sector_count);
230230         generate_track(desc, physical_track, head, sectors, sector_count, total_size, image);
231         
231
232232         track_offset += track_size;
233233         error_offset += sector_count;
234234      }
trunk/src/lib/formats/g64_dsk.c
r29404r29405
5454   for (int track = 0; track < track_count; track++)
5555   {
5656      offs_t track_offset = pick_integer_le(img, TRACK_OFFSET + (track * 4), 4);
57     
57
5858      if (!track_offset)
5959         continue;
6060
r29404r29405
6868
6969      UINT16 track_bytes = pick_integer_le(img, track_offset, 2);
7070      int track_size = track_bytes * 8;
71     
71
7272      LOG_FORMATS("track %u size %u cell %ld\n", track, track_size, 200000000L/track_size);
7373
7474      generate_track_from_bitstream(track, head, &img[track_offset+2], track_size, image);
r29404r29405
8282int g64_format::generate_bitstream(int track, int head, int speed_zone, UINT8 *trackbuf, int &track_size, floppy_image *image)
8383{
8484   int cell_size = c1541_cell_size[speed_zone];
85   
85
8686   generate_bitstream_from_track(track, head, cell_size, trackbuf, track_size, image);
87   
87
8888   int actual_cell_size = 200000000L/track_size;
8989
9090   // allow a tolerance of +- 10 us (3990..4010 -> 4000)
r29404r29405
9696   UINT8 header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, 0x54, TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 };
9797
9898   io_generic_write(io, header, SIGNATURE, sizeof(header));
99   
99
100100   int head = 0;
101101   int tracks_written = 0;
102102
r29404r29405
137137      io_generic_write_filler(io, 0xff, dpos, TRACK_LENGTH);
138138      io_generic_write(io, track_length, dpos, 2);
139139      io_generic_write(io, trackbuf, dpos + 2, track_size);
140     
140
141141      tracks_written++;
142142   }
143143
trunk/src/lib/formats/mbee_cas.h
r29404r29405
1212#include "cassimg.h"
1313
1414CASSETTE_FORMATLIST_EXTERN(mbee_cassette_formats);
15
trunk/src/lib/formats/spc1000_cas.h
r29404r29405
1212#include "cassimg.h"
1313
1414CASSETTE_FORMATLIST_EXTERN(spc1000_cassette_formats);
15
trunk/src/lib/formats/sol_cas.c
r29404r29405
177177   }
178178   return data;
179179}
180         
180
181181// Turn digits into decimal
182182static int sol20_read_dec(const UINT8 *bytes)
183183{
r29404r29405
191191
192192   return data;
193193}
194         
194
195195static int sol20_handle_cassette(INT16 *buffer, const UINT8 *bytes)
196196{
197197   UINT32 sample_count = 0;
r29404r29405
283283                     sample_count += sol20_output_byte(buffer, sample_count, sol20_header[i]);
284284                  // write checksum
285285                  sample_count += sol20_output_byte(buffer, sample_count, sol20_cksm_byte);
286   
286
287287                  sol20_cksm_byte = 0;
288288                  process_d = 1;
289289                  sol20_scan_to_eol(bytes);
trunk/src/lib/formats/cassimg.c
r29404r29405
379379   /* is this block beyond the edge of our waveform? */
380380   if (sample_blocknum >= cassette->blocks.count())
381381      cassette->blocks.resize_keep_and_clear_new(sample_blocknum + 1);
382   
382
383383   if (cassette->blocks[sample_blocknum] == NULL)
384384      cassette->blocks[sample_blocknum] = global_alloc(sample_block);
385385
trunk/src/lib/formats/sol_cas.h
r29404r29405
1212#include "cassimg.h"
1313
1414CASSETTE_FORMATLIST_EXTERN(sol20_cassette_formats);
15
trunk/src/lib/formats/z80ne_dsk.c
r29404r29405
208208
209209   /* set up sector map */
210210   sector_map.resize_and_clear(sectors, 0xFF);
211   
211
212212   physical_sector = 0;
213213   for (logical_sector = 0; logical_sector < sectors; logical_sector++)
214214   {
trunk/src/lib/formats/fmtowns_dsk.c
r29404r29405
11/*
22 * fmtowns_dsk.c
33 *
4 *   FM Towns floppy image format
4 *  FM Towns floppy image format
55 *
66 *  Created on: 23/03/2014
77 */
trunk/src/lib/formats/ccvf_dsk.c
r29404r29405
100100   astring line;
101101   offs_t byteoffs = 0;
102102   char hex[3] = {0};
103   
103
104104   do {
105105      end = ccvf.chr(start, 10);
106106      line.cpysubstr(ccvf, start, end);
107      if (line.find(0, "Compucolor Virtual Floppy Disk Image") &&   line.find(0, "Label") && line.find(0, "Track")) {
107      if (line.find(0, "Compucolor Virtual Floppy Disk Image") && line.find(0, "Label") && line.find(0, "Track")) {
108108         for (int byte = 0; byte < 32; byte++) {
109109            if (byteoffs==78720) break;
110110            hex[0]=line[byte * 2];
r29404r29405
117117
118118   UINT64 pos = 0;
119119   int total_size = 200000000/f.cell_size;
120   
120
121121   for(int track=0; track < f.track_count; track++) {
122122      dynamic_array<UINT32> buffer(total_size);
123123      int offset = 0;
124   
124
125125      for (int i=0; i<1920 && pos<size; i++, pos++) {
126126         for (int bit=0; bit<8; bit++) {
127127            bit_w(buffer, offset++, BIT(bytes[pos], bit), f.cell_size);
trunk/src/lib/formats/sorc_cas.h
r29404r29405
1212#include "cassimg.h"
1313
1414CASSETTE_FORMATLIST_EXTERN(sorcerer_cassette_formats);
15
trunk/src/lib/formats/phc25_cas.c
r29404r29405
9797   UINT32 i;
9898
9999   // silence
100//   sample_count += phc25_put_samples(buffer, 6640, 2, WAVEENTRY_HIGH);
100//  sample_count += phc25_put_samples(buffer, 6640, 2, WAVEENTRY_HIGH);
101101
102102   /* start */
103//   for (i=0; i<12155; i++)
103//  for (i=0; i<12155; i++)
104104   for (i=0; i<2155; i++)
105105      sample_count += phc25_output_bit(buffer, sample_count, 1);
106106
trunk/src/lib/formats/phc25_cas.h
r29404r29405
1212#include "cassimg.h"
1313
1414CASSETTE_FORMATLIST_EXTERN(phc25_cassette_formats);
15
trunk/src/lib/libflac/include/FLAC/stream_encoder.h
r29404r29405
238238 * must be deleted with FLAC__stream_encoder_delete().
239239 */
240240typedef enum {
241
242241   FLAC__STREAM_ENCODER_OK = 0,
243242   /**< The encoder is in the normal OK state and samples can be processed. */
244243
r29404r29405
290289/** Possible return values for the FLAC__stream_encoder_init_*() functions.
291290 */
292291typedef enum {
293
294292   FLAC__STREAM_ENCODER_INIT_STATUS_OK = 0,
295293   /**< Initialization was successful. */
296294
r29404r29405
360358/** Return values for the FLAC__StreamEncoder read callback.
361359 */
362360typedef enum {
363
364361   FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE,
365362   /**< The read was OK and decoding can continue. */
366363
r29404r29405
386383/** Return values for the FLAC__StreamEncoder write callback.
387384 */
388385typedef enum {
389
390386   FLAC__STREAM_ENCODER_WRITE_STATUS_OK = 0,
391387   /**< The write was OK and encoding can continue. */
392388
r29404r29405
406402/** Return values for the FLAC__StreamEncoder seek callback.
407403 */
408404typedef enum {
409
410405   FLAC__STREAM_ENCODER_SEEK_STATUS_OK,
411406   /**< The seek was OK and encoding can continue. */
412407
r29404r29405
429424/** Return values for the FLAC__StreamEncoder tell callback.
430425 */
431426typedef enum {
432
433427   FLAC__STREAM_ENCODER_TELL_STATUS_OK,
434428   /**< The tell was OK and encoding can continue. */
435429
trunk/src/lib/libflac/include/FLAC/metadata.h
r29404r29405
306306 *  The iterator's current status can be obtained by calling FLAC__metadata_simple_iterator_status().
307307 */
308308typedef enum {
309
310309   FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0,
311310   /**< The iterator is in the normal OK state */
312311
r29404r29405
763762   FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH,
764763   /**< FLAC__metadata_chain_write() was called on a chain read by
765764    *   FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(),
766    *   or
765    *   or
767766    *   FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile()
768767    *   was called on a chain read by
769768    *   FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg().
trunk/src/lib/libflac/include/FLAC/stream_decoder.h
r29404r29405
199199 * The decoder's state can be obtained by calling FLAC__stream_decoder_get_state().
200200 */
201201typedef enum {
202
203202   FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0,
204203   /**< The decoder is ready to search for metadata. */
205204
r29404r29405
253252/** Possible return values for the FLAC__stream_decoder_init_*() functions.
254253 */
255254typedef enum {
256
257255   FLAC__STREAM_DECODER_INIT_STATUS_OK = 0,
258256   /**< Initialization was successful. */
259257
r29404r29405
291289/** Return values for the FLAC__StreamDecoder read callback.
292290 */
293291typedef enum {
294
295292   FLAC__STREAM_DECODER_READ_STATUS_CONTINUE,
296293   /**< The read was OK and decoding can continue. */
297294
r29404r29405
322319/** Return values for the FLAC__StreamDecoder seek callback.
323320 */
324321typedef enum {
325
326322   FLAC__STREAM_DECODER_SEEK_STATUS_OK,
327323   /**< The seek was OK and decoding can continue. */
328324
r29404r29405
345341/** Return values for the FLAC__StreamDecoder tell callback.
346342 */
347343typedef enum {
348
349344   FLAC__STREAM_DECODER_TELL_STATUS_OK,
350345   /**< The tell was OK and decoding can continue. */
351346
r29404r29405
368363/** Return values for the FLAC__StreamDecoder length callback.
369364 */
370365typedef enum {
371
372366   FLAC__STREAM_DECODER_LENGTH_STATUS_OK,
373367   /**< The length call was OK and decoding can continue. */
374368
r29404r29405
391385/** Return values for the FLAC__StreamDecoder write callback.
392386 */
393387typedef enum {
394
395388   FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE,
396389   /**< The write was OK and decoding can continue. */
397390
r29404r29405
424417 *  a future encoder.
425418 */
426419typedef enum {
427
428420   FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC,
429421   /**< An error in the stream caused the decoder to lose synchronization. */
430422
trunk/src/lib/libflac/include/FLAC/export.h
r29404r29405
6161#else
6262
6363#ifdef FLAC_API_EXPORTS
64#define   FLAC_API   _declspec(dllexport)
64#define FLAC_API    _declspec(dllexport)
6565#else
66#define FLAC_API   _declspec(dllimport)
66#define FLAC_API    _declspec(dllimport)
6767
6868#endif
6969#endif
trunk/src/lib/libflac/include/FLAC/format.h
r29404r29405
8484
8585
8686/*
87   Most of the values described in this file are defined by the FLAC
88   format specification.  There is nothing to tune here.
87    Most of the values described in this file are defined by the FLAC
88    format specification.  There is nothing to tune here.
8989*/
9090
9191/** The largest legal metadata type code. */
r29404r29405
211211/** Contents of a Rice partitioned residual
212212 */
213213typedef struct {
214
215214   unsigned *parameters;
216215   /**< The Rice parameters for each context. */
217216
r29404r29405
230229/** Header for a Rice partitioned residual.  (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>)
231230 */
232231typedef struct {
233
234232   unsigned order;
235233   /**< The partition order, i.e. # of contexts = 2 ^ \a order. */
236234
r29404r29405
486484
487485/** An enumeration of the available metadata block types. */
488486typedef enum {
489
490487   FLAC__METADATA_TYPE_STREAMINFO = 0,
491488   /**< <A HREF="../format.html#metadata_block_streaminfo">STREAMINFO</A> block */
492489
trunk/src/lib/libflac/include/private/float.h
r29404r29405
7474#define FLAC__fixedpoint_div(x, y) ( (FLAC__fixedpoint) ( ( ((FLAC__int64)(x)<<32) / (FLAC__int64)(y) ) >> 16 ) )
7575
7676/*
77 *   FLAC__fixedpoint_log2()
78 *   --------------------------------------------------------------------
79 *   Returns the base-2 logarithm of the fixed-point number 'x' using an
80 *   algorithm by Knuth for x >= 1.0
77 *  FLAC__fixedpoint_log2()
78 *  --------------------------------------------------------------------
79 *  Returns the base-2 logarithm of the fixed-point number 'x' using an
80 *  algorithm by Knuth for x >= 1.0
8181 *
82 *   'fracbits' is the number of fractional bits of 'x'.  'fracbits' must
83 *   be < 32 and evenly divisible by 4 (0 is OK but not very precise).
82 *  'fracbits' is the number of fractional bits of 'x'.  'fracbits' must
83 *  be < 32 and evenly divisible by 4 (0 is OK but not very precise).
8484 *
85 *   'precision' roughly limits the number of iterations that are done;
86 *   use (unsigned)(-1) for maximum precision.
85 *  'precision' roughly limits the number of iterations that are done;
86 *  use (unsigned)(-1) for maximum precision.
8787 *
88 *   If 'x' is less than one -- that is, x < (1<<fracbits) -- then this
89 *   function will punt and return 0.
88 *  If 'x' is less than one -- that is, x < (1<<fracbits) -- then this
89 *  function will punt and return 0.
9090 *
91 *   The return value will also have 'fracbits' fractional bits.
91 *  The return value will also have 'fracbits' fractional bits.
9292 */
9393FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned precision);
9494
trunk/src/lib/libflac/include/private/window.h
r29404r29405
4242#ifndef FLAC__INTEGER_ONLY_LIBRARY
4343
4444/*
45 *   FLAC__window_*()
46 *   --------------------------------------------------------------------
47 *   Calculates window coefficients according to different apodization
48 *   functions.
45 *  FLAC__window_*()
46 *  --------------------------------------------------------------------
47 *  Calculates window coefficients according to different apodization
48 *  functions.
4949 *
50 *   OUT window[0,L-1]
51 *   IN L (number of points in window)
50 *  OUT window[0,L-1]
51 *  IN L (number of points in window)
5252 */
5353void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L);
5454void FLAC__window_bartlett_hann(FLAC__real *window, const FLAC__int32 L);
trunk/src/lib/libflac/include/private/lpc.h
r29404r29405
4242#ifndef FLAC__INTEGER_ONLY_LIBRARY
4343
4444/*
45 *   FLAC__lpc_window_data()
46 *   --------------------------------------------------------------------
47 *   Applies the given window to the data.
45 *  FLAC__lpc_window_data()
46 *  --------------------------------------------------------------------
47 *  Applies the given window to the data.
4848 *  OPT: asm implementation
4949 *
50 *   IN in[0,data_len-1]
51 *   IN window[0,data_len-1]
52 *   OUT out[0,lag-1]
53 *   IN data_len
50 *  IN in[0,data_len-1]
51 *  IN window[0,data_len-1]
52 *  OUT out[0,lag-1]
53 *  IN data_len
5454 */
5555void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len);
5656
5757/*
58 *   FLAC__lpc_compute_autocorrelation()
59 *   --------------------------------------------------------------------
60 *   Compute the autocorrelation for lags between 0 and lag-1.
61 *   Assumes data[] outside of [0,data_len-1] == 0.
62 *   Asserts that lag > 0.
58 *  FLAC__lpc_compute_autocorrelation()
59 *  --------------------------------------------------------------------
60 *  Compute the autocorrelation for lags between 0 and lag-1.
61 *  Assumes data[] outside of [0,data_len-1] == 0.
62 *  Asserts that lag > 0.
6363 *
64 *   IN data[0,data_len-1]
65 *   IN data_len
66 *   IN 0 < lag <= data_len
67 *   OUT autoc[0,lag-1]
64 *  IN data[0,data_len-1]
65 *  IN data_len
66 *  IN 0 < lag <= data_len
67 *  OUT autoc[0,lag-1]
6868 */
6969void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
7070#ifndef FLAC__NO_ASM
r29404r29405
8080#endif
8181
8282/*
83 *   FLAC__lpc_compute_lp_coefficients()
84 *   --------------------------------------------------------------------
85 *   Computes LP coefficients for orders 1..max_order.
86 *   Do not call if autoc[0] == 0.0.  This means the signal is zero
87 *   and there is no point in calculating a predictor.
83 *  FLAC__lpc_compute_lp_coefficients()
84 *  --------------------------------------------------------------------
85 *  Computes LP coefficients for orders 1..max_order.
86 *  Do not call if autoc[0] == 0.0.  This means the signal is zero
87 *  and there is no point in calculating a predictor.
8888 *
89 *   IN autoc[0,max_order]                      autocorrelation values
90 *   IN 0 < max_order <= FLAC__MAX_LPC_ORDER    max LP order to compute
91 *   OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order
92 *   *** IMPORTANT:
93 *   *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched
94 *   OUT error[0,max_order-1]                   error for each order (more
95 *                                              specifically, the variance of
96 *                                              the error signal times # of
97 *                                              samples in the signal)
89 *  IN autoc[0,max_order]                      autocorrelation values
90 *  IN 0 < max_order <= FLAC__MAX_LPC_ORDER    max LP order to compute
91 *  OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order
92 *  *** IMPORTANT:
93 *  *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched
94 *  OUT error[0,max_order-1]                   error for each order (more
95 *                                             specifically, the variance of
96 *                                             the error signal times # of
97 *                                             samples in the signal)
9898 *
99 *   Example: if max_order is 9, the LP coefficients for order 9 will be
100 *            in lp_coeff[8][0,8], the LP coefficients for order 8 will be
101 *          in lp_coeff[7][0,7], etc.
99 *  Example: if max_order is 9, the LP coefficients for order 9 will be
100 *           in lp_coeff[8][0,8], the LP coefficients for order 8 will be
101 *           in lp_coeff[7][0,7], etc.
102102 */
103103void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]);
104104
105105/*
106 *   FLAC__lpc_quantize_coefficients()
107 *   --------------------------------------------------------------------
108 *   Quantizes the LP coefficients.  NOTE: precision + bits_per_sample
109 *   must be less than 32 (sizeof(FLAC__int32)*8).
106 *  FLAC__lpc_quantize_coefficients()
107 *  --------------------------------------------------------------------
108 *  Quantizes the LP coefficients.  NOTE: precision + bits_per_sample
109 *  must be less than 32 (sizeof(FLAC__int32)*8).
110110 *
111 *   IN lp_coeff[0,order-1]    LP coefficients
112 *   IN order                  LP order
113 *   IN FLAC__MIN_QLP_COEFF_PRECISION < precision
114 *                             desired precision (in bits, including sign
115 *                             bit) of largest coefficient
116 *   OUT qlp_coeff[0,order-1]  quantized coefficients
117 *   OUT shift                 # of bits to shift right to get approximated
118 *                             LP coefficients.  NOTE: could be negative.
119 *   RETURN 0 => quantization OK
120 *          1 => coefficients require too much shifting for *shift to
111 *  IN lp_coeff[0,order-1]    LP coefficients
112 *  IN order                  LP order
113 *  IN FLAC__MIN_QLP_COEFF_PRECISION < precision
114 *                            desired precision (in bits, including sign
115 *                            bit) of largest coefficient
116 *  OUT qlp_coeff[0,order-1]  quantized coefficients
117 *  OUT shift                 # of bits to shift right to get approximated
118 *                            LP coefficients.  NOTE: could be negative.
119 *  RETURN 0 => quantization OK
120 *         1 => coefficients require too much shifting for *shift to
121121 *              fit in the LPC subframe header.  'shift' is unset.
122122 *         2 => coefficients are all zero, which is bad.  'shift' is
123123 *              unset.
r29404r29405
125125int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift);
126126
127127/*
128 *   FLAC__lpc_compute_residual_from_qlp_coefficients()
129 *   --------------------------------------------------------------------
130 *   Compute the residual signal obtained from sutracting the predicted
131 *   signal from the original.
128 *  FLAC__lpc_compute_residual_from_qlp_coefficients()
129 *  --------------------------------------------------------------------
130 *  Compute the residual signal obtained from sutracting the predicted
131 *  signal from the original.
132132 *
133 *   IN data[-order,data_len-1] original signal (NOTE THE INDICES!)
134 *   IN data_len                length of original signal
135 *   IN qlp_coeff[0,order-1]    quantized LP coefficients
136 *   IN order > 0               LP order
137 *   IN lp_quantization         quantization of LP coefficients in bits
138 *   OUT residual[0,data_len-1] residual signal
133 *  IN data[-order,data_len-1] original signal (NOTE THE INDICES!)
134 *  IN data_len                length of original signal
135 *  IN qlp_coeff[0,order-1]    quantized LP coefficients
136 *  IN order > 0               LP order
137 *  IN lp_quantization         quantization of LP coefficients in bits
138 *  OUT residual[0,data_len-1] residual signal
139139 */
140140void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]);
141141void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]);
r29404r29405
151151#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */
152152
153153/*
154 *   FLAC__lpc_restore_signal()
155 *   --------------------------------------------------------------------
156 *   Restore the original signal by summing the residual and the
157 *   predictor.
154 *  FLAC__lpc_restore_signal()
155 *  --------------------------------------------------------------------
156 *  Restore the original signal by summing the residual and the
157 *  predictor.
158158 *
159 *   IN residual[0,data_len-1]  residual signal
160 *   IN data_len                length of original signal
161 *   IN qlp_coeff[0,order-1]    quantized LP coefficients
162 *   IN order > 0               LP order
163 *   IN lp_quantization         quantization of LP coefficients in bits
164 *   *** IMPORTANT: the caller must pass in the historical samples:
165 *   IN  data[-order,-1]        previously-reconstructed historical samples
166 *   OUT data[0,data_len-1]     original signal
159 *  IN residual[0,data_len-1]  residual signal
160 *  IN data_len                length of original signal
161 *  IN qlp_coeff[0,order-1]    quantized LP coefficients
162 *  IN order > 0               LP order
163 *  IN lp_quantization         quantization of LP coefficients in bits
164 *  *** IMPORTANT: the caller must pass in the historical samples:
165 *  IN  data[-order,-1]        previously-reconstructed historical samples
166 *  OUT data[0,data_len-1]     original signal
167167 */
168168void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
169169void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
r29404r29405
182182#ifndef FLAC__INTEGER_ONLY_LIBRARY
183183
184184/*
185 *   FLAC__lpc_compute_expected_bits_per_residual_sample()
186 *   --------------------------------------------------------------------
187 *   Compute the expected number of bits per residual signal sample
188 *   based on the LP error (which is related to the residual variance).
185 *  FLAC__lpc_compute_expected_bits_per_residual_sample()
186 *  --------------------------------------------------------------------
187 *  Compute the expected number of bits per residual signal sample
188 *  based on the LP error (which is related to the residual variance).
189189 *
190 *   IN lpc_error >= 0.0   error returned from calculating LP coefficients
191 *   IN total_samples > 0  # of samples in residual signal
192 *   RETURN                expected bits per sample
190 *  IN lpc_error >= 0.0   error returned from calculating LP coefficients
191 *  IN total_samples > 0  # of samples in residual signal
192 *  RETURN                expected bits per sample
193193 */
194194FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample(FLAC__double lpc_error, unsigned total_samples);
195195FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(FLAC__double lpc_error, FLAC__double error_scale);
196196
197197/*
198 *   FLAC__lpc_compute_best_order()
199 *   --------------------------------------------------------------------
200 *   Compute the best order from the array of signal errors returned
201 *   during coefficient computation.
198 *  FLAC__lpc_compute_best_order()
199 *  --------------------------------------------------------------------
200 *  Compute the best order from the array of signal errors returned
201 *  during coefficient computation.
202202 *
203 *   IN lpc_error[0,max_order-1] >= 0.0  error returned from calculating LP coefficients
204 *   IN max_order > 0                    max LP order
205 *   IN total_samples > 0                # of samples in residual signal
206 *   IN overhead_bits_per_order          # of bits overhead for each increased LP order
207 *                                       (includes warmup sample size and quantized LP coefficient)
208 *   RETURN [1,max_order]                best order
203 *  IN lpc_error[0,max_order-1] >= 0.0  error returned from calculating LP coefficients
204 *  IN max_order > 0                    max LP order
205 *  IN total_samples > 0                # of samples in residual signal
206 *  IN overhead_bits_per_order          # of bits overhead for each increased LP order
207 *                                      (includes warmup sample size and quantized LP coefficient)
208 *  RETURN [1,max_order]                best order
209209 */
210210unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned max_order, unsigned total_samples, unsigned overhead_bits_per_order);
211211
trunk/src/lib/libflac/include/private/fixed.h
r29404r29405
4040#include "FLAC/format.h"
4141
4242/*
43 *   FLAC__fixed_compute_best_predictor()
44 *   --------------------------------------------------------------------
45 *   Compute the best fixed predictor and the expected bits-per-sample
43 *  FLAC__fixed_compute_best_predictor()
44 *  --------------------------------------------------------------------
45 *  Compute the best fixed predictor and the expected bits-per-sample
4646 *  of the residual signal for each order.  The _wide() version uses
4747 *  64-bit integers which is statistically necessary when bits-per-
4848 *  sample + log2(blocksize) > 30
4949 *
50 *   IN data[0,data_len-1]
51 *   IN data_len
52 *   OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER]
50 *  IN data[0,data_len-1]
51 *  IN data_len
52 *  OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER]
5353 */
5454#ifndef FLAC__INTEGER_ONLY_LIBRARY
5555unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
r29404r29405
6767#endif
6868
6969/*
70 *   FLAC__fixed_compute_residual()
71 *   --------------------------------------------------------------------
72 *   Compute the residual signal obtained from sutracting the predicted
73 *   signal from the original.
70 *  FLAC__fixed_compute_residual()
71 *  --------------------------------------------------------------------
72 *  Compute the residual signal obtained from sutracting the predicted
73 *  signal from the original.
7474 *
75 *   IN data[-order,data_len-1]        original signal (NOTE THE INDICES!)
76 *   IN data_len                       length of original signal
77 *   IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order
78 *   OUT residual[0,data_len-1]        residual signal
75 *  IN data[-order,data_len-1]        original signal (NOTE THE INDICES!)
76 *  IN data_len                       length of original signal
77 *  IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order
78 *  OUT residual[0,data_len-1]        residual signal
7979 */
8080void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[]);
8181
8282/*
83 *   FLAC__fixed_restore_signal()
84 *   --------------------------------------------------------------------
85 *   Restore the original signal by summing the residual and the
86 *   predictor.
83 *  FLAC__fixed_restore_signal()
84 *  --------------------------------------------------------------------
85 *  Restore the original signal by summing the residual and the
86 *  predictor.
8787 *
88 *   IN residual[0,data_len-1]         residual signal
89 *   IN data_len                       length of original signal
90 *   IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order
91 *   *** IMPORTANT: the caller must pass in the historical samples:
92 *   IN  data[-order,-1]               previously-reconstructed historical samples
93 *   OUT data[0,data_len-1]            original signal
88 *  IN residual[0,data_len-1]         residual signal
89 *  IN data_len                       length of original signal
90 *  IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order
91 *  *** IMPORTANT: the caller must pass in the historical samples:
92 *  IN  data[-order,-1]               previously-reconstructed historical samples
93 *  OUT data[0,data_len-1]            original signal
9494 */
9595void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]);
9696
trunk/src/lib/libflac/libFLAC/bitreader.c
r29404r29405
301301   FLAC__BitReader *br = (FLAC__BitReader*)calloc(1, sizeof(FLAC__BitReader));
302302
303303   /* calloc() implies:
304      memset(br, 0, sizeof(FLAC__BitReader));
305      br->buffer = 0;
306      br->capacity = 0;
307      br->words = br->bytes = 0;
308      br->consumed_words = br->consumed_bits = 0;
309      br->read_callback = 0;
310      br->client_data = 0;
304       memset(br, 0, sizeof(FLAC__BitReader));
305       br->buffer = 0;
306       br->capacity = 0;
307       br->words = br->bytes = 0;
308       br->consumed_words = br->consumed_bits = 0;
309       br->read_callback = 0;
310       br->client_data = 0;
311311   */
312312   return br;
313313}
r29404r29405
835835   cwords = br->consumed_words;
836836
837837   while(1) {
838
839838      /* read unary part */
840839      while(1) {
841840         while(cwords < br->words) { /* if we've not consumed up to a partial tail word... */
r29404r29405
10181017   ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits;
10191018
10201019   while(1) {
1021
10221020      /* read unary part */
10231021      while(1) {
10241022         while(cwords < br->words) { /* if we've not consumed up to a partial tail word... */
trunk/src/lib/libflac/libFLAC/float.c
r29404r29405
282282
283283   if(x < ONE)
284284      return 0;
285   
285
286286   if(precision > LOG2_LOOKUP_PRECISION)
287287      precision = LOG2_LOOKUP_PRECISION;
288288
trunk/src/lib/libflac/libFLAC/metadata_object.c
r29404r29405
13301330      memcpy(entry->entry+nn+1, field_value, nv);
13311331      entry->entry[entry->length] = '\0';
13321332   }
1333   
1333
13341334   return true;
13351335}
13361336
trunk/src/lib/libflac/libFLAC/metadata_iterators.c
r29404r29405
18351835   FLAC__Metadata_Iterator *iterator = (FLAC__Metadata_Iterator*)calloc(1, sizeof(FLAC__Metadata_Iterator));
18361836
18371837   /* calloc() implies:
1838      iterator->current = 0;
1839      iterator->chain = 0;
1838       iterator->current = 0;
1839       iterator->chain = 0;
18401840   */
18411841
18421842   return iterator;
trunk/src/lib/libflac/libFLAC/lpc.c
r29404r29405
305305
306306   /* Here's a slower but clearer version:
307307   for(i = 0; i < data_len; i++) {
308      sum = 0;
309      for(j = 0; j < order; j++)
310         sum += qlp_coeff[j] * data[i-j-1];
311      residual[i] = data[i] - (sum >> lp_quantization);
308       sum = 0;
309       for(j = 0; j < order; j++)
310           sum += qlp_coeff[j] * data[i-j-1];
311       residual[i] = data[i] - (sum >> lp_quantization);
312312   }
313313   */
314314}
r29404r29405
516516            case 15: sum += qlp_coeff[14] * data[i-15];
517517            case 14: sum += qlp_coeff[13] * data[i-14];
518518            case 13: sum += qlp_coeff[12] * data[i-13];
519                     sum += qlp_coeff[11] * data[i-12];
520                     sum += qlp_coeff[10] * data[i-11];
521                     sum += qlp_coeff[ 9] * data[i-10];
522                     sum += qlp_coeff[ 8] * data[i- 9];
523                     sum += qlp_coeff[ 7] * data[i- 8];
524                     sum += qlp_coeff[ 6] * data[i- 7];
525                     sum += qlp_coeff[ 5] * data[i- 6];
526                     sum += qlp_coeff[ 4] * data[i- 5];
527                     sum += qlp_coeff[ 3] * data[i- 4];
528                     sum += qlp_coeff[ 2] * data[i- 3];
529                     sum += qlp_coeff[ 1] * data[i- 2];
530                     sum += qlp_coeff[ 0] * data[i- 1];
519                     sum += qlp_coeff[11] * data[i-12];
520                     sum += qlp_coeff[10] * data[i-11];
521                     sum += qlp_coeff[ 9] * data[i-10];
522                     sum += qlp_coeff[ 8] * data[i- 9];
523                     sum += qlp_coeff[ 7] * data[i- 8];
524                     sum += qlp_coeff[ 6] * data[i- 7];
525                     sum += qlp_coeff[ 5] * data[i- 6];
526                     sum += qlp_coeff[ 4] * data[i- 5];
527                     sum += qlp_coeff[ 3] * data[i- 4];
528                     sum += qlp_coeff[ 2] * data[i- 3];
529                     sum += qlp_coeff[ 1] * data[i- 2];
530                     sum += qlp_coeff[ 0] * data[i- 1];
531531         }
532532         residual[i] = data[i] - (sum >> lp_quantization);
533533      }
r29404r29405
778778            case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15];
779779            case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14];
780780            case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13];
781                     sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
782                     sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
783                     sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10];
784                     sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9];
785                     sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8];
786                     sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7];
787                     sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6];
788                     sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5];
789                     sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4];
790                     sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3];
791                     sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
792                     sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
781                     sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
782                     sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
783                     sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10];
784                     sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9];
785                     sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8];
786                     sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7];
787                     sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6];
788                     sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5];
789                     sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4];
790                     sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3];
791                     sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
792                     sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
793793         }
794794         residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
795795      }
r29404r29405
835835
836836   /* Here's a slower but clearer version:
837837   for(i = 0; i < data_len; i++) {
838      sum = 0;
839      for(j = 0; j < order; j++)
840         sum += qlp_coeff[j] * data[i-j-1];
841      data[i] = residual[i] + (sum >> lp_quantization);
838       sum = 0;
839       for(j = 0; j < order; j++)
840           sum += qlp_coeff[j] * data[i-j-1];
841       data[i] = residual[i] + (sum >> lp_quantization);
842842   }
843843   */
844844}
r29404r29405
10461046            case 15: sum += qlp_coeff[14] * data[i-15];
10471047            case 14: sum += qlp_coeff[13] * data[i-14];
10481048            case 13: sum += qlp_coeff[12] * data[i-13];
1049                     sum += qlp_coeff[11] * data[i-12];
1050                     sum += qlp_coeff[10] * data[i-11];
1051                     sum += qlp_coeff[ 9] * data[i-10];
1052                     sum += qlp_coeff[ 8] * data[i- 9];
1053                     sum += qlp_coeff[ 7] * data[i- 8];
1054                     sum += qlp_coeff[ 6] * data[i- 7];
1055                     sum += qlp_coeff[ 5] * data[i- 6];
1056                     sum += qlp_coeff[ 4] * data[i- 5];
1057                     sum += qlp_coeff[ 3] * data[i- 4];
1058                     sum += qlp_coeff[ 2] * data[i- 3];
1059                     sum += qlp_coeff[ 1] * data[i- 2];
1060                     sum += qlp_coeff[ 0] * data[i- 1];
1049                     sum += qlp_coeff[11] * data[i-12];
1050                     sum += qlp_coeff[10] * data[i-11];
1051                     sum += qlp_coeff[ 9] * data[i-10];
1052                     sum += qlp_coeff[ 8] * data[i- 9];
1053                     sum += qlp_coeff[ 7] * data[i- 8];
1054                     sum += qlp_coeff[ 6] * data[i- 7];
1055                     sum += qlp_coeff[ 5] * data[i- 6];
1056                     sum += qlp_coeff[ 4] * data[i- 5];
1057                     sum += qlp_coeff[ 3] * data[i- 4];
1058                     sum += qlp_coeff[ 2] * data[i- 3];
1059                     sum += qlp_coeff[ 1] * data[i- 2];
1060                     sum += qlp_coeff[ 0] * data[i- 1];
10611061         }
10621062         data[i] = residual[i] + (sum >> lp_quantization);
10631063      }
r29404r29405
13081308            case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15];
13091309            case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14];
13101310            case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13];
1311                     sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
1312                     sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
1313                     sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10];
1314                     sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9];
1315                     sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8];
1316                     sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7];
1317                     sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6];
1318                     sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5];
1319                     sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4];
1320                     sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3];
1321                     sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
1322                     sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
1311                     sum += qlp_coeff[11] * (FLAC__int64)data[i-12];
1312                     sum += qlp_coeff[10] * (FLAC__int64)data[i-11];
1313                     sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10];
1314                     sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9];
1315                     sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8];
1316                     sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7];
1317                     sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6];
1318                     sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5];
1319                     sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4];
1320                     sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3];
1321                     sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
1322                     sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
13231323         }
13241324         data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization);
13251325      }
trunk/src/lib/libflac/libFLAC/stream_decoder.c
r29404r29405
12901290    */
12911291#if defined _MSC_VER || defined __MINGW32__
12921292   _setmode(_fileno(stdin), _O_BINARY);
1293#elif defined __CYGWIN__
1293#elif defined __CYGWIN__
12941294   /* almost certainly not needed for any modern Cygwin, but let's be safe... */
12951295   setmode(_fileno(stdin), _O_BINARY);
12961296#elif defined __EMX__
r29404r29405
31523152         }
31533153         /* our last move backwards wasn't big enough, try again */
31543154         approx_bytes_per_frame = approx_bytes_per_frame? approx_bytes_per_frame * 2 : 16;
3155         continue;   
3155         continue;
31563156      }
31573157      /* allow one seek over upper bound, so we can get a correct upper_bound_sample for streams with unknown total_samples */
31583158      first_seek = false;
3159     
3159
31603160      /* make sure we are not seeking in corrupted stream */
31613161      if (this_frame_sample < lower_bound_sample) {
31623162         decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
r29404r29405
31963196   FLAC__bool did_a_seek;
31973197   unsigned iteration = 0;
31983198
3199   /* In the first iterations, we will calculate the target byte position
3199   /* In the first iterations, we will calculate the target byte position
32003200    * by the distance from the target sample to left_sample and
32013201    * right_sample (let's call it "proportional search").  After that, we
32023202    * will switch to binary search.
trunk/src/lib/libflac/libFLAC/md5.c
r29404r29405
22#  include <config.h>
33#endif
44
5#include <stdlib.h>      /* for malloc() */
6#include <string.h>      /* for memcpy() */
5#include <stdlib.h>     /* for malloc() */
6#include <string.h>     /* for memcpy() */
77
88#include "private/md5.h"
99#include "share/alloc.h"
r29404r29405
4747
4848/* This is the central step in the MD5 algorithm. */
4949#define MD5STEP(f,w,x,y,z,in,s) \
50    (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
50      (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
5151
5252/*
5353 * The core of the MD5 algorithm, this alters an existing MD5 hash to
r29404r29405
143143{
144144   register FLAC__uint32 x;
145145   do {
146      x = *buf;
146      x = *buf;
147147      x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff);
148148      *buf++ = (x >> 16) | (x << 16);
149149   } while (--words);
r29404r29405
186186
187187   t = ctx->bytes[0];
188188   if ((ctx->bytes[0] = t + len) < t)
189      ctx->bytes[1]++;   /* Carry from low to high */
189      ctx->bytes[1]++;    /* Carry from low to high */
190190
191   t = 64 - (t & 0x3f);   /* Space available in ctx->in (at least 1) */
191   t = 64 - (t & 0x3f);    /* Space available in ctx->in (at least 1) */
192192   if (t > len) {
193193      memcpy((FLAC__byte *)ctx->in + 64 - t, buf, len);
194194      return;
r29404r29405
237237 */
238238void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx)
239239{
240   int count = ctx->bytes[0] & 0x3f;   /* Number of bytes in ctx->in */
240   int count = ctx->bytes[0] & 0x3f;   /* Number of bytes in ctx->in */
241241   FLAC__byte *p = (FLAC__byte *)ctx->in + count;
242242
243243   /* Set the first char of padding to 0x80.  There is always room. */
r29404r29405
246246   /* Bytes of padding needed to make 56 bytes (-8..55) */
247247   count = 56 - 1 - count;
248248
249   if (count < 0) {   /* Padding forces an extra block */
249   if (count < 0) {    /* Padding forces an extra block */
250250      memset(p, 0, count + 8);
251251      byteSwapX16(ctx->in);
252252      FLAC__MD5Transform(ctx->buf, ctx->in);
trunk/src/lib/libflac/libFLAC/stream_encoder.c
r29404r29405
9898 * parameter estimation in this encoder is very good, almost always
9999 * yielding compression within 0.1% of the optimal parameters.
100100 */
101#undef ENABLE_RICE_PARAMETER_SEARCH
101#undef ENABLE_RICE_PARAMETER_SEARCH
102102
103103
104104typedef struct {
r29404r29405
234234#endif
235235
236236static unsigned evaluate_verbatim_subframe_(
237   FLAC__StreamEncoder *encoder,
237   FLAC__StreamEncoder *encoder,
238238   const FLAC__int32 signal[],
239239   unsigned blocksize,
240240   unsigned subframe_bps,
r29404r29405
835835            metadata_picture_has_type1 = true;
836836            /* standard icon must be 32x32 pixel PNG */
837837            if(
838               m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD &&
838               m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD &&
839839               (
840840                  (strcmp(m->data.picture.mime_type, "image/png") && strcmp(m->data.picture.mime_type, "-->")) ||
841841                  m->data.picture.width != 32 ||
r29404r29405
11821182      /*is_ogg=*/true
11831183   );
11841184}
1185
1185
11861186static FLAC__StreamEncoderInitStatus init_FILE_internal_(
11871187   FLAC__StreamEncoder *encoder,
11881188   FILE *file,
r29404r29405
12441244
12451245   return init_status;
12461246}
1247
1247
12481248FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE(
12491249   FLAC__StreamEncoder *encoder,
12501250   FILE *file,
r29404r29405
12541254{
12551255   return init_FILE_internal_(encoder, file, progress_callback, client_data, /*is_ogg=*/false);
12561256}
1257
1257
12581258FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE(
12591259   FLAC__StreamEncoder *encoder,
12601260   FILE *file,
r29404r29405
41344134
41354135   if(shift > 0) {
41364136      for(i = 0; i < samples; i++)
4137          signal[i] >>= shift;
4137            signal[i] >>= shift;
41384138   }
41394139
41404140   return shift;
trunk/src/lib/util/corealloc.c
r29404r29405
4646   const char *        m_file;             // file the allocation was made from
4747   int                 m_line;             // line number within that file
4848   UINT64              m_id;               // unique id
49   bool            m_array;         // array?
49   bool                m_array;            // array?
5050
5151   // hashing prime number
5252   static const int    k_hash_prime = 6151;
r29404r29405
115115   if (clear)
116116      memset(result, 0, size);
117117   else
118   {   
118   {
119119#if !__has_feature(memory_sanitizer) && defined(INITIALIZE_ALLOCATED_MEMORY)
120120      memset(result, 0xdd, size);
121121#endif
r29404r29405
145145      osd_break_into_debugger("Error: attempt to free untracked memory");
146146      return;
147147   }
148   
148
149149   // warn about mismatched arrays
150150   if (!array && entry->m_array)
151151   {
r29404r29405
182182
183183
184184//-------------------------------------------------
185//  next_memory_id - return the ID of the next
186//   allocated block
185//  next_memory_id - return the ID of the next
186//  allocated block
187187//-------------------------------------------------
188188
189189UINT64 next_memory_id()
trunk/src/lib/util/tagmap.c
r29404r29405
1212
1313#ifdef MAME_DEBUG
1414INT32 g_tagmap_finds = 0;
15#endif
No newline at end of file
15#endif
trunk/src/lib/util/tagmap.h
r29404r29405
203203   tagged_list &operator=(const tagged_list &);
204204
205205public:
206   class add_exception
206   class add_exception
207207   {
208208   public:
209209      add_exception(const char *tag) : m_tag(tag) { }
r29404r29405
211211   private:
212212      const char *m_tag;
213213   };
214   
214
215215   // construction
216216   tagged_list() { }
217217
trunk/src/lib/util/palette.c
r29404r29405
4747
4848palette_client::dirty_state::dirty_state()
4949   : m_mindirty(0),
50     m_maxdirty(0)
50      m_maxdirty(0)
5151{
5252}
5353
5454
5555//-------------------------------------------------
5656//  dirty_list - return the current list and
57//   min/max values
57//  min/max values
5858//-------------------------------------------------
5959
6060const UINT32 *palette_client::dirty_state::dirty_list(UINT32 &mindirty, UINT32 &maxdirty)
r29404r29405
7070
7171//-------------------------------------------------
7272//  resize - resize the dirty array and mark all
73//   dirty
73//  dirty
7474//-------------------------------------------------
7575
7676void palette_client::dirty_state::resize(UINT32 colors)
r29404r29405
8282   // mark all entries dirty
8383   m_dirty[dirty_dwords - 1] &= (1 << (colors % 32)) - 1;
8484
85   // set min/max   
85   // set min/max
8686   m_mindirty = 0;
8787   m_maxdirty = colors - 1;
8888}
r29404r29405
102102
103103//-------------------------------------------------
104104//  reset - clear the dirty array to mark all
105//   entries as clean
105//  entries as clean
106106//-------------------------------------------------
107107
108108void palette_client::dirty_state::reset()
r29404r29405
125125
126126palette_client::palette_client(palette_t &palette)
127127   : m_palette(palette),
128     m_next(NULL),
129     m_live(&m_dirty[0]),
130     m_previous(&m_dirty[1])
128      m_next(NULL),
129      m_live(&m_dirty[0]),
130      m_previous(&m_dirty[1])
131131{
132132   // add a reference to the palette
133133   palette.ref();
r29404r29405
163163
164164
165165//-------------------------------------------------
166//  dirty_list - atomically get the current dirty
166//  dirty_list - atomically get the current dirty
167167//  list for a client
168168//-------------------------------------------------
169169
r29404r29405
206206
207207palette_t::palette_t(UINT32 numcolors, UINT32 numgroups)
208208   : m_refcount(1),
209     m_numcolors(numcolors),
210     m_numgroups(numgroups),
211     m_brightness(0.0f),
212     m_contrast(1.0f),
213     m_gamma(1.0f),
214     m_entry_color(numcolors),
215     m_entry_contrast(numcolors),
216     m_adjusted_color(numcolors * numgroups + 2),
217     m_adjusted_rgb15(numcolors * numgroups + 2),
218     m_group_bright(numgroups),
219     m_group_contrast(numgroups),
220     m_client_list(NULL)
209      m_numcolors(numcolors),
210      m_numgroups(numgroups),
211      m_brightness(0.0f),
212      m_contrast(1.0f),
213      m_gamma(1.0f),
214      m_entry_color(numcolors),
215      m_entry_contrast(numcolors),
216      m_adjusted_color(numcolors * numgroups + 2),
217      m_adjusted_rgb15(numcolors * numgroups + 2),
218      m_group_bright(numgroups),
219      m_group_contrast(numgroups),
220      m_client_list(NULL)
221221{
222222   // initialize gamma map
223223   for (UINT32 index = 0; index < 256; index++)
r29404r29405
273273
274274
275275//-------------------------------------------------
276//  set_brightness - set the overall brightness
276//  set_brightness - set the overall brightness
277277//  for the palette
278278//-------------------------------------------------
279279
r29404r29405
295295
296296
297297//-------------------------------------------------
298//  set_contrast - set the overall contrast for
298//  set_contrast - set the overall contrast for
299299//  the palette
300300//-------------------------------------------------
301301
r29404r29405
314314
315315
316316//-------------------------------------------------
317//  set_gamma - set the overall gamma for the
317//  set_gamma - set the overall gamma for the
318318//  palette
319319//-------------------------------------------------
320320
r29404r29405
342342
343343
344344//-------------------------------------------------
345//  entry_set_color - set the raw RGB color for a
345//  entry_set_color - set the raw RGB color for a
346346//  given palette index
347347//-------------------------------------------------
348348
r29404r29405
362362
363363
364364//-------------------------------------------------
365//  entry_set_contrast - set the contrast
365//  entry_set_contrast - set the contrast
366366//  adjustment for a single palette index
367367//-------------------------------------------------
368368
r29404r29405
382382
383383
384384//-------------------------------------------------
385//  group_set_brightness - configure overall
385//  group_set_brightness - configure overall
386386//  brightness for a palette group
387387//-------------------------------------------------
388388
r29404r29405
405405
406406
407407//-------------------------------------------------
408//  group_set_contrast - configure overall
408//  group_set_contrast - configure overall
409409//  contrast for a palette group
410410//-------------------------------------------------
411411
r29404r29405
425425
426426
427427//-------------------------------------------------
428//  normalize_range - normalize a range of palette
428//  normalize_range - normalize a range of palette
429429//  entries
430430//-------------------------------------------------
431431
r29404r29405
474474{
475475   // compute the adjusted value
476476   rgb_t adjusted = adjust_palette_entry(m_entry_color[index],
477                                m_group_bright[group] + m_brightness,
478                                m_group_contrast[group] * m_entry_contrast[index] * m_contrast,
479                                m_gamma_map);
477                                 m_group_bright[group] + m_brightness,
478                                 m_group_contrast[group] * m_entry_contrast[index] * m_contrast,
479                                 m_gamma_map);
480480
481481   // if not different, ignore
482482   UINT32 finalindex = group * m_numcolors + index;
trunk/src/lib/util/options.h
r29404r29405
175175   bool validate_and_set_data(entry &curentry, const char *newdata, int priority, astring &error_string);
176176
177177   // internal state
178   simple_list<entry>      m_entrylist;            // head of list of entries
178   simple_list<entry>      m_entrylist;            // head of list of entries
179179   tagmap_t<entry *>       m_entrymap;             // map for fast lookup
180180   astring                 m_command;              // command found
181181   static const char *const s_option_unadorned[];  // array of unadorned option "names"
trunk/src/lib/util/chd.h
r29404r29405
526526         , m_compression(0)
527527         , m_codecs(NULL)
528528      { }
529   
529
530530      osd_work_item *     m_osd;              // OSD work item running on this block
531531      chd_file_compressor *m_compressor;      // pointer back to the compressor
532532      volatile work_status m_status;          // current status of this item
trunk/src/lib/util/palette.h
r29404r29405
3939   rgb_t(UINT32 data) { m_data = data; }
4040   rgb_t(UINT8 r, UINT8 g, UINT8 b) { m_data = (255 << 24) | (r << 16) | (g << 8) | b; }
4141   rgb_t(UINT8 a, UINT8 r, UINT8 g, UINT8 b) { m_data = (a << 24) | (r << 16) | (g << 8) | b; }
42   
42
4343   // getters
4444   UINT8 a() const { return m_data >> 24; }
4545   UINT8 r() const { return m_data >> 16; }
r29404r29405
5353   rgb_t &set_r(UINT8 r) { m_data &= ~0x00ff0000; m_data |= r << 16; return *this; }
5454   rgb_t &set_g(UINT8 g) { m_data &= ~0x0000ff00; m_data |= g <<  8; return *this; }
5555   rgb_t &set_b(UINT8 b) { m_data &= ~0x000000ff; m_data |= b <<  0; return *this; }
56   
56
5757   // implicit conversion operators
5858   operator UINT32() const { return m_data; }
5959
r29404r29405
6464   rgb_t &operator=(UINT32 rhs) { m_data = rhs; return *this; }
6565   rgb_t &operator+=(const rgb_t &rhs) { m_data = rgb_t(clamphi(a() + rhs.a()), clamphi(r() + rhs.r()), clamphi(g() + rhs.g()), clamphi(b() + rhs.b())); return *this; }
6666   rgb_t &operator-=(const rgb_t &rhs) { m_data = rgb_t(clamplo(a() - rhs.a()), clamplo(r() - rhs.r()), clamplo(g() - rhs.g()), clamplo(b() - rhs.b())); return *this; }
67   
67
6868   // arithmetic operators
6969   const rgb_t operator+(const rgb_t &rhs) const { rgb_t result = *this; result += rhs; return result; }
7070   const rgb_t operator-(const rgb_t &rhs) const { rgb_t result = *this; result -= rhs; return result; }
71   
71
7272   // static helpers
7373   static UINT8 clamp(INT32 value) { return (value < 0) ? 0 : (value > 255) ? 255 : value; }
7474   static UINT8 clamphi(INT32 value) { return (value > 255) ? 255 : value; }
r29404r29405
7979   static const rgb_t white;
8080
8181private:
82   UINT32   m_data;
82   UINT32  m_data;
8383};
8484
8585
r29404r29405
108108   public:
109109      // construction
110110      dirty_state();
111     
111
112112      // operations
113113      const UINT32 *dirty_list(UINT32 &mindirty, UINT32 &maxdirty);
114114      void resize(UINT32 colors);
r29404r29405
127127   palette_client *m_next;                     // pointer to next client
128128   dirty_state *   m_live;                     // live dirty state
129129   dirty_state *   m_previous;                 // previous dirty state
130   dirty_state      m_dirty[2];               // two dirty states
130   dirty_state     m_dirty[2];                 // two dirty states
131131};
132132
133133
r29404r29405
141141public:
142142   // static constructor: used to ensure same new/delete is used
143143   static palette_t *alloc(UINT32 numcolors, UINT32 numgroups = 1);
144   
144
145145   // reference counting
146146   void ref() { m_refcount++; }
147147   void deref();
r29404r29405
152152   int max_index() const { return m_numcolors * m_numgroups + 2; }
153153   UINT32 black_entry() const { return m_numcolors * m_numgroups + 0; }
154154   UINT32 white_entry() const { return m_numcolors * m_numgroups + 1; }
155   
155
156156   // overall adjustments
157157   void set_brightness(float brightness);
158158   void set_contrast(float contrast);
159159   void set_gamma(float gamma);
160   
160
161161   // entry getters
162162   rgb_t entry_color(UINT32 index) const { return (index < m_numcolors) ? m_entry_color[index] : rgb_t::black; }
163163   rgb_t entry_adjusted_color(UINT32 index) const { return (index < m_numcolors * m_numgroups) ? m_adjusted_color[index] : rgb_t::black; }
r29404r29405
166166   // entry setters
167167   void entry_set_color(UINT32 index, rgb_t rgb);
168168   void entry_set_contrast(UINT32 index, float contrast);
169   
169
170170   // entry list getters
171171   const rgb_t *entry_list_raw() const { return m_entry_color; }
172172   const rgb_t *entry_list_adjusted() const { return m_adjusted_color; }
173173   const rgb_t *entry_list_adjusted_rgb15() const { return m_adjusted_rgb15; }
174   
174
175175   // group adjustments
176176   void group_set_brightness(UINT32 group, float brightness);
177177   void group_set_contrast(UINT32 group, float contrast);
178   
178
179179   // utilities
180180   void normalize_range(UINT32 start, UINT32 end, int lum_min = 0, int lum_max = 255);
181   
181
182182private:
183183   // construction/destruction
184184   palette_t(UINT32 numcolors, UINT32 numgroups = 1);
trunk/src/lib/util/cstrpool.c
r29404r29405
3939      if (result != NULL)
4040         return result;
4141   }
42   
42
4343   // no space anywhere, create a new pool and prepend it (so it gets used first)
4444   const char *result = m_chunklist.prepend(*global_alloc(pool_chunk)).add(string);
4545   assert(result != NULL);
r29404r29405
4848
4949
5050//-------------------------------------------------
51//  contains - determine if the given string
51//  contains - determine if the given string
5252//  pointer lives in the pool
5353//-------------------------------------------------
5454
r29404r29405
6262   for (pool_chunk *chunk = m_chunklist.first(); chunk != NULL; chunk = chunk->next())
6363      if (chunk->contains(string))
6464         return true;
65   
65
6666   return false;
6767}
6868
r29404r29405
7272//-------------------------------------------------
7373
7474const_string_pool::pool_chunk::pool_chunk()
75   : m_next(NULL),
76     m_used(0)
75   : m_next(NULL),
76      m_used(0)
7777{
7878}
7979
r29404r29405
8787   // get the length of the string (no string can be longer than a full pool)
8888   int bytes = strlen(string) + 1;
8989   assert(bytes < POOL_SIZE);
90   
90
9191   // if too big, return NULL
9292   if (m_used + bytes > POOL_SIZE)
9393      return NULL;
trunk/src/lib/util/cstrpool.h
r29404r29405
2626public:
2727   // construction
2828   const_string_pool();
29   
29
3030   // operations
3131   void reset() { m_chunklist.reset(); }
3232   const char *add(const char *string);
3333   bool contains(const char *string);
34   
34
3535private:
3636   // shared string pool
3737   class pool_chunk
3838   {
3939      static const int POOL_SIZE = 4096;
4040      friend class simple_list<pool_chunk>;
41     
41
4242   public:
4343      // construction
4444      pool_chunk();
45     
45
4646      // getters
4747      pool_chunk *next() const { return m_next; }
4848
r29404r29405
5252
5353   private:
5454      // internal state
55      pool_chunk *         m_next;
56      UINT32               m_used;
57      char               m_buffer[POOL_SIZE];
55      pool_chunk *            m_next;
56      UINT32                  m_used;
57      char                    m_buffer[POOL_SIZE];
5858   };
59   simple_list<pool_chunk>      m_chunklist;
59   simple_list<pool_chunk>     m_chunklist;
6060};
6161
6262
trunk/src/version.c
r29404r29405
99***************************************************************************/
1010
1111extern const char build_version[];
12const char build_version[] = "0.152 ("__DATE__")";
12const char build_version[] = "0.153 ("__DATE__")";
trunk/src/mess/audio/upd1771.h
r29404r29405
2727   ~upd1771c_device() {}
2828
2929   template<class _Object> static devcb2_base &set_ack_handler(device_t &device, _Object object) { return downcast<upd1771c_device &>(device).m_ack_handler.set_callback(object); }
30   
30
3131   DECLARE_READ8_MEMBER( read );
3232   DECLARE_WRITE8_MEMBER( write );
3333   WRITE_LINE_MEMBER( pcm_write );
trunk/src/mess/machine/mega32x.h
r29404r29405
4141   // set some variables at start, depending on region (shall be moved to a device interface?)
4242   void set_framerate(int rate) { m_framerate = rate; }
4343   void set_32x_pal(bool pal) { m_32x_pal = pal ? 1 : 0; }
44   void set_total_scanlines(int total) { m_base_total_scanlines = total; }      // this get set at start only
45   void update_total_scanlines(bool mode3) { m_total_scanlines = mode3 ? (m_base_total_scanlines * 2) : m_base_total_scanlines; }   // this gets set at each EOF
46   
44   void set_total_scanlines(int total) { m_base_total_scanlines = total; }     // this get set at start only
45   void update_total_scanlines(bool mode3) { m_total_scanlines = mode3 ? (m_base_total_scanlines * 2) : m_base_total_scanlines; }  // this gets set at each EOF
46
4747   // static configuration
4848   static void static_set_palette_tag(device_t &device, const char *tag);
4949
r29404r29405
192192   UINT16 *m_32x_display_dram, *m_32x_access_dram;
193193   UINT16* m_32x_palette;
194194   UINT16* m_32x_palette_lookup;
195   
195
196196   required_device<palette_device> m_palette;
197197};
198198
trunk/src/mess/machine/apple3.c
r29404r29405
33    machine/apple3.c
44
55    Apple ///
6
6
77    VIA #0 (D VIA)
8   CA1: IRQ from the MM58167 RTC
9       CA2: 1 if key pressed, 0 otherwise
10       CB1/CB2: connected to VBL
11 
12      Port A: Environment register (all bits out)
13         bit 7: 1 for 1 MHz, 0 for 2 MHz
14         bit 6: 1 for I/O at C000-CFFF
15         bit 5: 1 to enable video
16         bit 4: 1 to enable NMI/Reset
17         bit 3: 1 to write-protect RAM in system bank C000-FFFF
18         bit 2: 1 to force primary stack at 0100-01FF
19         bit 1: 1 for primary ROM, 0 for secondary (Apple III doesn't have a secondary ROM, so this should always be '1' when bit 0 is)
20         bit 0: 1 to enable ROM in F000-FFFF
21 
22      Port B: Zero page high 8 address bits, also MM58167 RTC register select (all bits out)
23 
8    CA1: IRQ from the MM58167 RTC
9        CA2: 1 if key pressed, 0 otherwise
10        CB1/CB2: connected to VBL
11
12        Port A: Environment register (all bits out)
13            bit 7: 1 for 1 MHz, 0 for 2 MHz
14            bit 6: 1 for I/O at C000-CFFF
15            bit 5: 1 to enable video
16            bit 4: 1 to enable NMI/Reset
17            bit 3: 1 to write-protect RAM in system bank C000-FFFF
18            bit 2: 1 to force primary stack at 0100-01FF
19            bit 1: 1 for primary ROM, 0 for secondary (Apple III doesn't have a secondary ROM, so this should always be '1' when bit 0 is)
20            bit 0: 1 to enable ROM in F000-FFFF
21
22        Port B: Zero page high 8 address bits, also MM58167 RTC register select (all bits out)
23
2424    VIA #1 (E VIA)
25       CA1: OR of all 4 slots' IRQ status
26       CA2: SW1 (Open Apple key?)
27       CB1: SW3/SCO
28       CB2: SER
29 
30       Port A:
31         bits 0-2: bank select for $2000-$9FFF range
32         bit 3: n/c
33         bit 4: slot 4 IRQ (in)
34         bit 5: slot 3 IRQ (in)
35         bit 6: Apple II mode trap output (out)
36         bit 7: IRQ status (in) (0 = IRQ, 1 = no IRQ)
37 
38      Port B:
39         bits 0-5: 6-bit audio DAC output
40         bit 6: screen blank
41         bit 7: OR of NMI from slots
42 
25        CA1: OR of all 4 slots' IRQ status
26        CA2: SW1 (Open Apple key?)
27        CB1: SW3/SCO
28        CB2: SER
29
30        Port A:
31            bits 0-2: bank select for $2000-$9FFF range
32            bit 3: n/c
33            bit 4: slot 4 IRQ (in)
34            bit 5: slot 3 IRQ (in)
35            bit 6: Apple II mode trap output (out)
36            bit 7: IRQ status (in) (0 = IRQ, 1 = no IRQ)
37
38        Port B:
39            bits 0-5: 6-bit audio DAC output
40            bit 6: screen blank
41            bit 7: OR of NMI from slots
42
4343***************************************************************************/
4444
4545#include "emu.h"
r29404r29405
5353#define LOG_MEMORY      1
5454#define LOG_INDXADDR    1
5555
56#define ENV_SLOWSPEED   (0x80)
57#define ENV_IOENABLE   (0x40)
58#define ENV_VIDENABLE   (0x20)
59#define ENV_NMIENABLE   (0x10)
60#define ENV_WRITEPROT   (0x08)
61#define ENV_STACK1XX   (0x04)
62#define ENV_PRIMARYROM   (0x02)
63#define ENV_ROMENABLE   (0x01)
56#define ENV_SLOWSPEED   (0x80)
57#define ENV_IOENABLE    (0x40)
58#define ENV_VIDENABLE   (0x20)
59#define ENV_NMIENABLE   (0x10)
60#define ENV_WRITEPROT   (0x08)
61#define ENV_STACK1XX    (0x04)
62#define ENV_PRIMARYROM  (0x02)
63#define ENV_ROMENABLE   (0x01)
6464
6565READ8_MEMBER(apple3_state::apple3_c0xx_r)
6666{
r29404r29405
109109               result &= ~0x20;
110110            }
111111         }
112//         printf("modifier = %02x\n", result);
112//          printf("modifier = %02x\n", result);
113113         break;
114114
115115      case 0x10: case 0x11: case 0x12: case 0x13:
r29404r29405
174174         {
175175            result = slotdevice->read_c0nx(space, offset&0xf);
176176         }
177         break;
177         break;
178178
179179      case 0xa0: case 0xa1: case 0xa2: case 0xa3:
180180      case 0xa4: case 0xa5: case 0xa6: case 0xa7:
r29404r29405
185185         {
186186            result = slotdevice->read_c0nx(space, offset&0xf);
187187         }
188         break;
188         break;
189189
190190      case 0xb0: case 0xb1: case 0xb2: case 0xb3:
191191      case 0xb4: case 0xb5: case 0xb6: case 0xb7:
r29404r29405
196196         {
197197            result = slotdevice->read_c0nx(space, offset&0xf);
198198         }
199         break;
199         break;
200200
201201      case 0xc0: case 0xc1: case 0xc2: case 0xc3:
202202      case 0xc4: case 0xc5: case 0xc6: case 0xc7:
r29404r29405
207207         {
208208            result = slotdevice->read_c0nx(space, offset&0xf);
209209         }
210         break;
210         break;
211211
212212      case 0xD0: case 0xD1: case 0xD2: case 0xD3:
213213      case 0xD4: case 0xD5: case 0xD6: case 0xD7:
r29404r29405
305305         {
306306            slotdevice->write_c0nx(space, offset&0xf, data);
307307         }
308         break;
308         break;
309309
310310      case 0xa0: case 0xa1: case 0xa2: case 0xa3:
311311      case 0xa4: case 0xa5: case 0xa6: case 0xa7:
r29404r29405
316316         {
317317            slotdevice->write_c0nx(space, offset&0xf, data);
318318         }
319         break;
319         break;
320320
321321      case 0xb0: case 0xb1: case 0xb2: case 0xb3:
322322      case 0xb4: case 0xb5: case 0xb6: case 0xb7:
r29404r29405
327327         {
328328            slotdevice->write_c0nx(space, offset&0xf, data);
329329         }
330         break;
330         break;
331331
332332      case 0xc0: case 0xc1: case 0xc2: case 0xc3:
333333      case 0xc4: case 0xc5: case 0xc6: case 0xc7:
r29404r29405
338338         {
339339            slotdevice->write_c0nx(space, offset&0xf, data);
340340         }
341         break;
341         break;
342342
343343      case 0xD0: case 0xD1: case 0xD2: case 0xD3:
344344      case 0xD4: case 0xD5: case 0xD6: case 0xD7:
r29404r29405
372372
373373TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::apple3_interrupt)
374374{
375   m_via_1->write_cb1(machine().first_screen()->vblank());
375   m_via_1->write_cb1(machine().first_screen()->vblank());
376376   m_via_1->write_cb2(machine().first_screen()->vblank());
377377}
378378
r29404r29405
437437      bank = ~0;
438438      page = 0x01;
439439   }
440   m_bank2 = apple3_bankaddr(bank, ((offs_t) page) * 0x100);
440   m_bank2 = apple3_bankaddr(bank, ((offs_t) page) * 0x100);
441441
442442   /* bank 3 (0200-1FFF) */
443   m_bank3 = apple3_bankaddr(~0, 0x0200);
443   m_bank3 = apple3_bankaddr(~0, 0x0200);
444444
445445   /* bank 4 (2000-9FFF) */
446   m_bank4 = apple3_bankaddr(m_via_1_a, 0x0000);
446   m_bank4 = apple3_bankaddr(m_via_1_a, 0x0000);
447447
448448   /* bank 5 (A000-BFFF) */
449   m_bank5 = apple3_bankaddr(~0, 0x2000);
449   m_bank5 = apple3_bankaddr(~0, 0x2000);
450450
451451   /* bank 8 (C000-C0FF) */
452452   if (!(m_via_0_a & ENV_IOENABLE))
453453   {
454      m_bank8 = apple3_bankaddr(~0, 0x4000);
454      m_bank8 = apple3_bankaddr(~0, 0x4000);
455455   }
456456
457457   /* bank 9 (C100-C4FF) */
458458   if (!(m_via_0_a & ENV_IOENABLE))
459459   {
460      m_bank9 = apple3_bankaddr(~0, 0x4100);                                 
460      m_bank9 = apple3_bankaddr(~0, 0x4100);
461461   }
462462
463463   /* bank 10 (C500-C7FF) */
464   m_bank10 = apple3_bankaddr(~0, 0x4500);
464   m_bank10 = apple3_bankaddr(~0, 0x4500);
465465
466466   /* bank 11 (C800-CFFF) */
467467   if (!(m_via_0_a & ENV_IOENABLE))
r29404r29405
507507
508508WRITE8_MEMBER(apple3_state::apple3_via_0_out_b)
509509{
510//   printf("ZP to %02x\n", data);
510//  printf("ZP to %02x\n", data);
511511   apple3_via_out(&m_via_0_b, data);
512512}
513513
r29404r29405
529529      // HACK: SOS floppy driver enables ROM at Fxxx *before* trying to
530530      // suppress IRQs.  IRQ hits at inopportune time -> bad vector -> system crash.
531531      // This breaks the Confidence Test, but the Confidence Test
532      // never disables the ROM so checking for that gets us
532      // never disables the ROM so checking for that gets us
533533      // working in all cases.
534534      // Bonus points: for some reason this isn't a problem with -debug.
535535      // m6502 heisenbug maybe?
r29404r29405
537537      {
538538         return;
539539      }
540//      printf("   setting IRQ\n");
540//      printf("   setting IRQ\n");
541541      m_maincpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
542      m_via_1->write_pa7(0);   // this is active low
542      m_via_1->write_pa7(0);  // this is active low
543543   }
544544   else
545545   {
546//      printf("   clearing IRQ\n");
546//      printf("   clearing IRQ\n");
547547      m_maincpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
548548      m_via_1->write_pa7(1);
549549   }
r29404r29405
551551
552552WRITE_LINE_MEMBER(apple3_state::apple3_acia_irq_func)
553553{
554//   printf("acia IRQ: %d\n", state);
554//  printf("acia IRQ: %d\n", state);
555555   m_acia_irq = state;
556556   apple3_irq_update();
557557}
558558
559559WRITE_LINE_MEMBER(apple3_state::apple3_via_1_irq_func)
560560{
561//   printf("via 1 IRQ: %d\n", state);
561//  printf("via 1 IRQ: %d\n", state);
562562   m_via_1_irq = state;
563563   apple3_irq_update();
564564}
r29404r29405
566566
567567WRITE_LINE_MEMBER(apple3_state::apple3_via_0_irq_func)
568568{
569//   printf("via 0 IRQ: %d\n", state);
569//  printf("via 0 IRQ: %d\n", state);
570570   m_via_0_irq = state;
571571   apple3_irq_update();
572572}
r29404r29405
745745
746746   if (offset < 0x100)
747747   {
748      rv = *apple3_get_zpa_addr(offset);
748      rv = *apple3_get_zpa_addr(offset);
749749
750750      if ((!m_sync) && (m_via_0_b >= 0x18) && (m_via_0_b <= 0x1F))
751751      {
r29404r29405
849849      }
850850      else
851851      {
852         rv = m_bank7rd[offset - 0xf000];
852         rv = m_bank7rd[offset - 0xf000];
853853      }
854854   }
855855
r29404r29405
10021002
10031003WRITE_LINE_MEMBER(apple3_state::apple3_sync_w)
10041004{
1005//   printf("sync: %d\n", state);
1005//  printf("sync: %d\n", state);
10061006   m_sync = (state == ASSERT_LINE) ? true : false;
10071007
10081008   if (m_sync)
r29404r29405
10441044
10451045static const UINT8 key_remap[0x50][4] =
10461046{
1047/*     norm shft ctrl both */
1047/*    norm shft ctrl both */
10481048   { 0x9b,0x9b,0x9b,0x9b },    /* Escape  00     */
10491049   { 0x31,0x21,0x31,0x31 },    /* 1 !     01     */
10501050   { 0x32,0x40,0x32,0x00 },    /* 2 @     02     */
r29404r29405
11351135   {
11361136      UINT16 trans;
11371137      int mod = 0;
1138      m_lastchar = m_ay3600->b_r();
1138      m_lastchar = m_ay3600->b_r();
11391139
1140      trans = m_lastchar & ~(0x1c0);   // clear the 3600's control/shift stuff
1141      trans |= (m_lastchar & 0x100)>>2;   // bring the 0x100 bit down to the 0x40 place
1140      trans = m_lastchar & ~(0x1c0);  // clear the 3600's control/shift stuff
1141      trans |= (m_lastchar & 0x100)>>2;   // bring the 0x100 bit down to the 0x40 place
11421142
11431143      mod = (m_kbspecial->read() & 0x06) ? 0x01 : 0x00;
11441144      mod |= (m_kbspecial->read() & 0x08) ? 0x02 : 0x00;
r29404r29405
11481148      if (m_transchar != 0)
11491149      {
11501150         m_strobe = 0x80;
1151//         printf("new char = %04x (%02x)\n", trans, m_transchar);
1151//          printf("new char = %04x (%02x)\n", trans, m_transchar);
11521152      }
11531153   }
11541154}
1155
trunk/src/mess/machine/thomson.c
r29404r29405
41614161               {
41624162                  if ( bank_is_read_only )
41634163                  {
4164                                                        space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4165                                                        space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4166                                                        space.nop_write( 0xb000, 0xefff);
4164                                          space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4165                                          space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4166                                          space.nop_write( 0xb000, 0xefff);
41674167                  }
41684168                  else
41694169                  {
41704170                     space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4171                                                        space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
4171                                          space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
41724172                  }
41734173               }
41744174            }
r29404r29405
41864186            {
41874187               if (m_to8_cart_vpage < 4)
41884188               {
4189                                                space.install_write_handler( 0xb000, 0xbfff, write8_delegate(FUNC(thomson_state::mo6_vcart_lo_w),this));
4190                                                space.install_write_handler( 0xc000, 0xefff, write8_delegate(FUNC(thomson_state::mo6_vcart_hi_w),this));
4189                                    space.install_write_handler( 0xb000, 0xbfff, write8_delegate(FUNC(thomson_state::mo6_vcart_lo_w),this));
4190                                    space.install_write_handler( 0xc000, 0xefff, write8_delegate(FUNC(thomson_state::mo6_vcart_hi_w),this));
41914191
41924192               }
41934193               else
41944194               {
4195                                                space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4196                                                space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
4195                                    space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4196                                    space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
41974197               }
41984198            }
41994199            LOG_BANK(( "mo6_update_cart_bank: update CART bank %i write status to %s\n",
r29404r29405
42104210         {
42114211            if ( m_old_cart_bank < 0 || m_old_cart_bank > 3 )
42124212            {
4213                                        space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4214                                        space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4213                              space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4214                              space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
42154215               space.nop_write( 0xb000, 0xefff);
42164216            }
42174217            LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i (A7CB style)\n", bank ));
r29404r29405
42294229            {
42304230               if ( bank_is_read_only )
42314231               {
4232                                                space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4233                                                space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4232                                    space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4233                                    space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
42344234                  space.nop_write( 0xb000, 0xefff);
42354235               }
42364236               else
42374237               {
4238                                                space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4239                                                space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
4238                                    space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4239                                    space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
42404240               }
42414241            }
42424242            LOG_BANK(( "mo6_update_cart_bank: CART is RAM bank %i (MO5 compat.) (%s)\n",
r29404r29405
42474247         {
42484248            if ( bank_is_read_only )
42494249            {
4250                                        space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4251                                        space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4250                              space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4251                              space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
42524252               space.nop_write( 0xb000, 0xefff);
42534253            }
42544254            else
42554255            {
4256                                        space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4257                                        space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
4256                              space.install_readwrite_bank( 0xb000, 0xbfff, MO6_CART_LO );
4257                              space.install_readwrite_bank( 0xc000, 0xefff, MO6_CART_HI );
42584258            }
42594259            LOG_BANK(( "mo5_update_cart_bank: update CART bank %i write status to %s\n",
42604260                                 m_to8_cart_vpage,
r29404r29405
42814281         {
42824282            if ( m_old_cart_bank < 4 || m_old_cart_bank > 7 )
42834283            {
4284                                        space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4285                                        space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4284                              space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4285                              space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
42864286               space.install_write_handler( 0xb000, 0xefff, write8_delegate(FUNC(thomson_state::mo6_cartridge_w),this) );
42874287            }
42884288            LOG_BANK(( "mo6_update_cart_bank: CART is internal ROM bank %i\n", b ));
r29404r29405
42964296            bank = m_thom_cart_bank % m_thom_cart_nb_banks;
42974297            if ( bank != m_old_cart_bank )
42984298            {
4299                                  if ( m_old_cart_bank < 0 || m_old_cart_bank > 3 )
4299                           if ( m_old_cart_bank < 0 || m_old_cart_bank > 3 )
43004300               {
4301                                                space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4302                                                space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
4301                                    space.install_read_bank( 0xb000, 0xbfff, MO6_CART_LO );
4302                                    space.install_read_bank( 0xc000, 0xefff, MO6_CART_HI );
43034303                  space.install_write_handler( 0xb000, 0xefff, write8_delegate(FUNC(thomson_state::mo6_cartridge_w),this) );
43044304                  space.install_read_handler( 0xbffc, 0xbfff, read8_delegate(FUNC(thomson_state::mo6_cartridge_r),this) );
43054305               }
trunk/src/mess/machine/pecom.c
r29404r29405
170170      // DMA acknowledge clears the DMAOUT request
171171      m_cdp1802->set_input_line(COSMAC_INPUT_LINE_DMAOUT, CLEAR_LINE);
172172      break;
173     
173
174174   case COSMAC_STATE_CODE_S3_INTERRUPT:
175175      break;
176176   }
trunk/src/mess/machine/ti99/grom.c
r29404r29405
9494*/
9595ti99_grom_device::ti99_grom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
9696: bus8z_device(mconfig, GROM, "TI-99 GROM device", tag, owner, clock, "ti99_grom", __FILE__),
97  m_gromready(*this)
97   m_gromready(*this)
9898{
9999}
100100
trunk/src/mess/machine/ti99/speech8.h
r29404r29405
2727{
2828public:
2929   ti998_spsyn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   
30
3131   template<class _Object> static devcb2_base &set_ready_wr_callback(device_t &device, _Object object) { return downcast<ti998_spsyn_device &>(device).m_ready.set_callback(object); }
3232
3333   DECLARE_READ8Z_MEMBER(readz);
trunk/src/mess/machine/ti99/gromport.c
r29404r29405
13911391*/
13921392static MACHINE_CONFIG_FRAGMENT( ti99_cartridge )
13931393   MCFG_GROM_ADD( GROM3_TAG, grom3_config )
1394    MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
1394   MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
13951395   MCFG_GROM_ADD( GROM4_TAG, grom4_config )
1396    MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
1396   MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
13971397   MCFG_GROM_ADD( GROM5_TAG, grom5_config )
1398    MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
1398   MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
13991399   MCFG_GROM_ADD( GROM6_TAG, grom6_config )
1400    MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
1400   MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
14011401   MCFG_GROM_ADD( GROM7_TAG, grom7_config )
1402    MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
1402   MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_cartridge_device, ready_line))
14031403MACHINE_CONFIG_END
14041404
14051405machine_config_constructor ti99_cartridge_device::device_mconfig_additions() const
r29404r29405
24282428   catch (rpk_exception &exp)
24292429   {
24302430      newrpk->close();
2431      if (layout_xml != NULL)      xml_file_free(layout_xml);
2431      if (layout_xml != NULL)     xml_file_free(layout_xml);
24322432      if (zipfile != NULL)        zip_file_close(zipfile);
24332433      if (layout_text != NULL)    global_free_array(layout_text);
24342434
r29404r29405
24362436      throw exp;
24372437   }
24382438
2439   if (layout_xml != NULL)      xml_file_free(layout_xml);
2439   if (layout_xml != NULL)     xml_file_free(layout_xml);
24402440   if (zipfile != NULL)        zip_file_close(zipfile);
24412441   if (layout_text != NULL)    global_free_array(layout_text);
24422442
trunk/src/mess/machine/ti99/grom.h
r29404r29405
4040{
4141public:
4242   ti99_grom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
43   
43
4444   template<class _Object> static devcb2_base &set_ready_wr_callback(device_t &device, _Object object) { return downcast<ti99_grom_device &>(device).m_gromready.set_callback(object); }
45   
45
4646   DECLARE_READ8Z_MEMBER(readz);
4747   DECLARE_WRITE8_MEMBER(write);
4848
trunk/src/mess/machine/ti99/990_hd.h
r29404r29405
1414{
1515public:
1616   ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   
17
1818   template<class _Object> static devcb2_base &static_set_int_callback(device_t &device, _Object object) { return downcast<ti990_hdc_device &>(device).m_interrupt_callback.set_callback(object); }
1919
2020   DECLARE_READ16_MEMBER(read);
r29404r29405
6262      /* disk geometry */
6363      unsigned int cylinders, heads, sectors_per_track, bytes_per_sector;
6464   };
65   
65
6666   UINT16 m_w[8];
6767
6868   devcb2_write_line m_interrupt_callback;
trunk/src/mess/machine/6883sam.h
r29404r29405
170170
171171   // incidentals
172172   address_space *             m_cpu_space;
173   devcb2_read8              m_read_res;
173   devcb2_read8                m_read_res;
174174   sam_bank                    m_banks[8];
175175   sam_space<0x0000, 0x7FFF>   m_space_0000;
176176   sam_space<0x8000, 0x9FFF>   m_space_8000;
trunk/src/mess/machine/partner.c
r29404r29405
7777   }
7878}
7979
80READ8_MEMBER(partner_state::partner_floppy_r){   
80READ8_MEMBER(partner_state::partner_floppy_r){
8181   if (offset<0x100) {
8282      switch(offset & 3) {
8383         case 0x00 : return m_fdc->status_r(space, 0);
trunk/src/mess/machine/apollo.c
r29404r29405
2323 * - http://www.freescale.com/files/32bit/doc/inactive/MC68681UM.pdf
2424 *
2525 *  SIO usage:
26 *     SIO: ch A keyboard, ch B serial console
27 *      SIO2: modem/printer?
26 *      SIO: ch A keyboard, ch B serial console
27 *      SIO2: modem/printer?
2828 *
2929 */
3030
r29404r29405
190190
191191/*static int apollo_csr_get_servicemode()
192192{
193   return cpu_status_register & APOLLO_CSR_SR_SERVICE ? 0 : 1;
193    return cpu_status_register & APOLLO_CSR_SR_SERVICE ? 0 : 1;
194194}*/
195195
196196static void apollo_csr_set_servicemode(int mode)
r29404r29405
569569#undef VERBOSE
570570#define VERBOSE 0
571571
572void apollo_state::apollo_pic_set_irq_line(int irq, int state)
572void apollo_state::apollo_pic_set_irq_line(int irq, int state)
573573{
574574   switch (irq) {
575575   case 0: m_pic8259_master->ir0_w(state); break;
r29404r29405
665665{
666666   if ((state) && (m_ptm->started()))
667667   {
668      ptm_counter++;
668      ptm_counter++;
669669      m_ptm->set_c1( 1);
670670      m_ptm->set_c1( 0);
671671      m_ptm->set_c2(ptm_counter & 1);
r29404r29405
751751
752752WRITE8_MEMBER(apollo_state::sio_output)
753753{
754   if ((data & 0x80) != (sio_output_data & 0x80))
754   if ((data & 0x80) != (sio_output_data & 0x80))
755755   {
756756      apollo_pic_set_irq_line(APOLLO_IRQ_DIAG, (data & 0x80) ? 1 : 0);
757757      sio_output_data = data;
r29404r29405
762762   // The period of the output is 15 microseconds.
763763
764764   // toggle memory refresh counter
765//   sio_input_data ^= 0x01;
765//  sio_input_data ^= 0x01;
766766
767767//##########################################################################
768768// machine/apollo_sio2.c - APOLLO DS3500 SIO2
r29404r29405
808808};
809809
810810static SLOT_INTERFACE_START(apollo_isa_cards)
811   SLOT_INTERFACE("wdc", ISA16_OMTI8621)   // Combo ESDI/AT floppy controller
812   SLOT_INTERFACE("ctape", ISA8_SC499)      // Archive SC499 cartridge tape
813   SLOT_INTERFACE("3c505", ISA16_3C505)   // 3Com 3C505 Ethernet card
811   SLOT_INTERFACE("wdc", ISA16_OMTI8621)   // Combo ESDI/AT floppy controller
812   SLOT_INTERFACE("ctape", ISA8_SC499)     // Archive SC499 cartridge tape
813   SLOT_INTERFACE("3c505", ISA16_3C505)    // 3Com 3C505 Ethernet card
814814SLOT_INTERFACE_END
815815
816816MACHINE_CONFIG_FRAGMENT( common )
r29404r29405
849849
850850   MCFG_MC68681_ADD( APOLLO_SIO_TAG, XTAL_3_6864MHz )
851851   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(apollo_state, sio_irq_handler))
852   MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(apollo_state, sio_output))
852   MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(apollo_state, sio_output))
853853   MCFG_MC68681_A_TX_CALLBACK(DEVWRITELINE(APOLLO_KBD_TAG, apollo_kbd_device, rx_w))
854854MACHINE_CONFIG_END
855855
r29404r29405
868868
869869   MCFG_MC68681_ADD( APOLLO_SIO_TAG, XTAL_3_6864MHz )
870870   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(apollo_state, sio_irq_handler))
871   MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(apollo_state, sio_output))
871   MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(apollo_state, sio_output))
872872   MCFG_MC68681_B_TX_CALLBACK(DEVWRITELINE("rs232", rs232_port_device, write_txd))
873873
874874   MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal")
trunk/src/mess/machine/dec_lk201.c
r29404r29405
116116//  SERIAL COMMUNICATIONS INTERFACE
117117//-------------------------------------------------
118118
119#define SCI_BAUD      0                        // Baud rate register
120#define BAUD_SCR      0x07                     // SCI baud rate select
121#define BAUD_SCP      0x30                     // SCI prescaler select
119#define SCI_BAUD        0                               // Baud rate register
120#define BAUD_SCR        0x07                            // SCI baud rate select
121#define BAUD_SCP        0x30                            // SCI prescaler select
122122
123#define SCI_SCCR1      1                        // Control register 1
124#define SCCR1_WAKE      0x08                     // Wakeup method
125#define SCCR1_M         0x10                     // Character length
126#define SCCR1_T8      0x40                     // Transmit bit 8
127#define SCCR1_R8      0x80                     // Receive bit 8
123#define SCI_SCCR1       1                               // Control register 1
124#define SCCR1_WAKE      0x08                            // Wakeup method
125#define SCCR1_M         0x10                            // Character length
126#define SCCR1_T8        0x40                            // Transmit bit 8
127#define SCCR1_R8        0x80                            // Receive bit 8
128128
129#define SCI_SCCR2      2                        // Control register 2
130#define SCCR2_SBK      0x01                     // Send break
131#define SCCR2_RWU      0x02                     // Receiver wakeup enable
132#define SCCR2_RE      0x04                     // Receiver enable
133#define SCCR2_TE      0x08                     // Transmitter enable
134#define SCCR2_ILIE      0x10                     // Idle line interrupt enable
135#define SCCR2_RIE      0x20                     // Receiver interrupt enable
136#define SCCR2_TCIE      0x40                     // Transmit complete interrupt enable
137#define SCCR2_TIE      0x80                     // Transmit interrupt enable
129#define SCI_SCCR2       2                               // Control register 2
130#define SCCR2_SBK       0x01                            // Send break
131#define SCCR2_RWU       0x02                            // Receiver wakeup enable
132#define SCCR2_RE        0x04                            // Receiver enable
133#define SCCR2_TE        0x08                            // Transmitter enable
134#define SCCR2_ILIE      0x10                            // Idle line interrupt enable
135#define SCCR2_RIE       0x20                            // Receiver interrupt enable
136#define SCCR2_TCIE      0x40                            // Transmit complete interrupt enable
137#define SCCR2_TIE       0x80                            // Transmit interrupt enable
138138
139#define SCI_SCSR      3                        // Status register
140#define SCSR_FE         0x02                     // Receiver framing error
141#define SCSR_NF         0x04                     // Receiver noise
142#define SCSR_OR         0x08                     // Receiver overrun
143#define SCSR_IDLE      0x10                     // Receiver idle
144#define SCSR_RDRF      0x20                     // Receive data register full
145#define SCSR_TC         0x40                     // Transmit complete
146#define SCSR_TDRE      0x80                     // Transmit data register empty
147#define SCSR_INT      (SCSR_IDLE | SCSR_RDRF| \
148                     SCSR_TC | SCSR_TDRE)      // Interrupt sources
139#define SCI_SCSR        3                               // Status register
140#define SCSR_FE         0x02                            // Receiver framing error
141#define SCSR_NF         0x04                            // Receiver noise
142#define SCSR_OR         0x08                            // Receiver overrun
143#define SCSR_IDLE       0x10                            // Receiver idle
144#define SCSR_RDRF       0x20                            // Receive data register full
145#define SCSR_TC         0x40                            // Transmit complete
146#define SCSR_TDRE       0x80                            // Transmit data register empty
147#define SCSR_INT        (SCSR_IDLE | SCSR_RDRF| \
148                     SCSR_TC | SCSR_TDRE)        // Interrupt sources
149149
150#define SCI_SCDR      4                        // Data register
150#define SCI_SCDR        4                               // Data register
151151
152152//-------------------------------------------------
153153//  SERIAL PERIPHERAL INTERFACE
154154//-------------------------------------------------
155155
156#define SPI_SPCR      0                        // Control register
157#define SPCR_SPR      0x03                     // SPI clock rate select
158#define SPCR_CPHA      0x04                     // Clock phase
159#define SPCR_CPOL      0x08                     // Clock polarity
160#define SPCR_MSTR      0x10                     // Master mode select
161#define SPCR_DWOM      0x20                     // Port D wire-or mode option
162#define SPCR_SPE      0x40                     // Serial peripheral system enable
163#define SPCR_SPIE      0x80                     // Serial peripheral interrupt enable
156#define SPI_SPCR        0                               // Control register
157#define SPCR_SPR        0x03                            // SPI clock rate select
158#define SPCR_CPHA       0x04                            // Clock phase
159#define SPCR_CPOL       0x08                            // Clock polarity
160#define SPCR_MSTR       0x10                            // Master mode select
161#define SPCR_DWOM       0x20                            // Port D wire-or mode option
162#define SPCR_SPE        0x40                            // Serial peripheral system enable
163#define SPCR_SPIE       0x80                            // Serial peripheral interrupt enable
164164
165#define SPI_SPSR      1                        // Status register
166#define SPSR_MODF      0x10                     // Mode fault flag
167#define SPSR_WCOL      0x40                     // Write collision
168#define SPSR_SPIF      0x80                     // SPI transfer complete
165#define SPI_SPSR        1                               // Status register
166#define SPSR_MODF       0x10                            // Mode fault flag
167#define SPSR_WCOL       0x40                            // Write collision
168#define SPSR_SPIF       0x80                            // SPI transfer complete
169169
170#define SPI_SPDR      2                        // Data I/O Register
170#define SPI_SPDR        2                               // Data I/O Register
171171
172172//**************************************************************************
173173//  DEVICE DEFINITIONS
r29404r29405
338338   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
339339
340340   PORT_START("KBD11")
341   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) 
342   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(";") PORT_CODE(KEYCODE_COLON)     
341   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH)
342   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(";") PORT_CODE(KEYCODE_COLON)
343343   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) // FIXME - duplicate "Return"
344344   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P)
345345   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0)
r29404r29405
363363   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("'") PORT_CODE(KEYCODE_QUOTE)
364364   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE)
365365   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Previous") PORT_CODE(KEYCODE_END)
366   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Do (F16)")
366   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Do (F16)")
367367   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS)
368368   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Insert Here") PORT_CODE(KEYCODE_HOME)
369369
r29404r29405
494494   sci_status |= SCSR_RDRF;
495495   update_interrupts();
496496   receive_register_extract();
497//   printf("lk201 got %02x\n", get_received_char());
497//  printf("lk201 got %02x\n", get_received_char());
498498}
499499
500500void lk201_device::tra_complete()
r29404r29405
527527
528528WRITE8_MEMBER( lk201_device::ddr_w )
529529{
530//   printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->pc());
530//  printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->pc());
531531
532532   send_port(space, offset, ports[offset] & data);
533533
r29404r29405
543543   // add in ddr-masked version of port writes
544544   incoming |= (ports[offset] & ddrs[offset]);
545545
546//   printf("PORT %c read = %02x (DDR = %02x latch = %02x) (PC=%x)\n", 'A' + offset, ports[offset], ddrs[offset], ports[offset], m_maincpu->pc());
546//  printf("PORT %c read = %02x (DDR = %02x latch = %02x) (PC=%x)\n", 'A' + offset, ports[offset], ddrs[offset], ports[offset], m_maincpu->pc());
547547
548548   return incoming;
549549}
r29404r29405
557557
558558void lk201_device::send_port(address_space &space, UINT8 offset, UINT8 data)
559559{
560//   printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->pc());
560//  printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->pc());
561561
562562   switch (offset)
563563   {
r29404r29405
609609
610610   switch (offset)
611611   {
612      case SCI_BAUD:   // Baud rate
612      case SCI_BAUD:  // Baud rate
613613         break;
614614
615      case SCI_SCCR1:   // Control 1
615      case SCI_SCCR1: // Control 1
616616         break;
617617
618      case SCI_SCCR2:   // Control 2
618      case SCI_SCCR2: // Control 2
619619         incoming = sci_ctl2;
620620         break;
621621
622      case SCI_SCSR:   // Status
622      case SCI_SCSR:  // Status
623623         incoming = sci_status;
624624         break;
625625
626      case SCI_SCDR:   // Data
626      case SCI_SCDR:  // Data
627627         incoming = get_received_char();
628628         sci_status &= ~SCSR_RDRF;
629629         m_maincpu->set_input_line(M68HC05EG_INT_CPI, 0);
r29404r29405
631631         break;
632632   }
633633
634//   printf("SCI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->pc());
634//  printf("SCI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->pc());
635635
636636   return incoming;
637637}
r29404r29405
640640{
641641   switch (offset)
642642   {
643      case SCI_BAUD:   // Baud rate
643      case SCI_BAUD:  // Baud rate
644644         break;
645645
646      case SCI_SCCR1:   // Control 1
646      case SCI_SCCR1: // Control 1
647647         break;
648648
649      case SCI_SCCR2:   // Control 2
649      case SCI_SCCR2: // Control 2
650650         sci_ctl2 = data;
651651         update_interrupts();
652652         break;
653653
654      case SCI_SCSR:   // Status
654      case SCI_SCSR:  // Status
655655         break;
656656
657      case SCI_SCDR:   // Data
658//         printf("LK201: sending %02x\n", data);
657      case SCI_SCDR:  // Data
658//          printf("LK201: sending %02x\n", data);
659659         transmit_register_setup(data);
660660         sci_status &= ~(SCSR_TC | SCSR_TDRE);
661661         m_maincpu->set_input_line(M68HC05EG_INT_CPI, 0);
r29404r29405
663663         break;
664664   }
665665
666//   printf("SCI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc());
666//  printf("SCI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc());
667667}
668668
669669READ8_MEMBER( lk201_device::spi_r )
r29404r29405
672672
673673   switch (offset)
674674   {
675      case SPI_SPCR:   // Control
675      case SPI_SPCR:  // Control
676676         break;
677677
678      case SPI_SPSR:   // Status
678      case SPI_SPSR:  // Status
679679         incoming = spi_status;
680680         spi_status &= ~SPSR_SPIF;
681681         break;
682682
683      case SPI_SPDR:   // Data I/O
683      case SPI_SPDR:  // Data I/O
684684         incoming = spi_data;
685685         break;
686686   }
687687
688//   printf("SPI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->pc());
688//  printf("SPI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->pc());
689689
690690   return incoming;
691691}
r29404r29405
694694{
695695   switch (offset)
696696   {
697      case SPI_SPCR:   // Control
697      case SPI_SPCR:  // Control
698698         break;
699699
700      case SPI_SPSR:   // Status (read only)
700      case SPI_SPSR:  // Status (read only)
701701         break;
702702
703      case SPI_SPDR:   // Data I/O
703      case SPI_SPDR:  // Data I/O
704704         spi_data = data;
705705
706706         // Transfer only allowed if transfer complete flag has been acknowleged
r29404r29405
718718         break;
719719   }
720720
721//   printf("SPI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc());
721//  printf("SPI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc());
722722}
723
trunk/src/mess/machine/atarifdc.c
r29404r29405
763763   m_serout_count(0),
764764   m_serout_offs(0),
765765   m_serout_chksum(0),
766//   m_serout_delay(0),
766//  m_serout_delay(0),
767767   m_serin_count(0),
768768   m_serin_offs(0),
769769   m_serin_chksum(0),
trunk/src/mess/machine/atarifdc.h
r29404r29405
5151   int  m_serout_offs;
5252   UINT8 m_serout_buff[512];
5353   UINT8 m_serout_chksum;
54//   int  m_serout_delay;
54//  int  m_serout_delay;
5555
5656   int  m_serin_count;
5757   int  m_serin_offs;
trunk/src/mess/machine/amstrad.c
r29404r29405
26692669               return (keyrow[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F]->read_safe(0) & 0x80) | 0x7f;
26702670            }
26712671         }
2672         
2672
26732673         return keyrow[m_ppi_port_outputs[amstrad_ppi_PortC] & 0x0F]->read_safe(0) & 0xFF;
26742674      }
26752675      return 0xFF;
trunk/src/mess/machine/sms.c
r29404r29405
698698      // a bunch of SG1000 carts (compatible with SG1000 Mark III) use their own RAM...
699699      // TODO: are BASIC and Music actually compatible with Mark III??
700700      if (m_cartslot->get_type() == SEGA8_BASIC_L3 ||
701          m_cartslot->get_type() == SEGA8_MUSIC_EDITOR ||
702          m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA ||
703          m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB)
701         m_cartslot->get_type() == SEGA8_MUSIC_EDITOR ||
702         m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA ||
703         m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB)
704704      {
705705         m_mem_device_enabled |= ENABLE_EXT_RAM;
706706      }
r29404r29405
773773      // the "call $4010" without a following RET statement. That is basically
774774      // a bug in the program code. The only way this cartridge could have run
775775      // successfully on a real unit is if the RAM would be initialized with
776      // a F0 pattern on power up; F0 = RET P.
777      // This initialization breaks the some Game Gear games though (e.g.
776      // a F0 pattern on power up; F0 = RET P.
777      // This initialization breaks the some Game Gear games though (e.g.
778778      // tempojr), suggesting that not all systems had the same initialization.
779      // For the moment we apply this to systems that have the Japanese SMS
779      // For the moment we apply this to systems that have the Japanese SMS
780780      // cartridge slot.
781781      if (m_has_jpn_sms_cart_slot)
782782      {
r29404r29405
888888// - the one with 16 cart slots and 3 card slots;
889889// - the one with 16 cart slots and 16 card slots.
890890//
891// On front panel of both models there are only 16 game switches,
891// On front panel of both models there are only 16 game switches,
892892// that seems to change the active cart/card slot pair or, for the 4th
893893// game switch onward of the 16-3 model, the active cart slot only.
894894
trunk/src/mess/machine/dgn_beta.c
r29404r29405
931931
932932/********************************* Machine/Driver Initialization ****************************************/
933933void dgn_beta_state::machine_reset()
934{   
934{
935935   wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
936936   pia6821_device *pia_0 = machine().device<pia6821_device>( PIA_0_TAG );
937937   pia6821_device *pia_1 = machine().device<pia6821_device>( PIA_1_TAG );
trunk/src/mess/machine/swtpc09.c
r29404r29405
11/***************************************************************************
2   swtpc09 machine file
3   Robert Justice ,2009-2014
2    swtpc09 machine file
3    Robert Justice ,2009-2014
44
55****************************************************************************/
66
r29404r29405
2121
2222#define VERBOSE 0
2323
24#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
24#define LOG(x)  do { if (VERBOSE) logerror x; } while (0)
2525
2626
2727/******* MC6840 PTM on MPID Board *******/
r29404r29405
4141
4242   m_pia_counter++;
4343   //pia_counter = pia_counter && 0xff;
44    if (m_pia_counter & 0x80) pia->ca1_w(1);
44   if (m_pia_counter & 0x80) pia->ca1_w(1);
4545}
4646
4747WRITE8_MEMBER( swtpc09_state::ptm_o3_callback )
r29404r29405
5454WRITE_LINE_MEMBER( swtpc09_state::ptm_irq )
5555{
5656   if (state)
57       swtpc09_irq_handler(PTM_IRQ, ASSERT_LINE);
57      swtpc09_irq_handler(PTM_IRQ, ASSERT_LINE);
5858   else
59       swtpc09_irq_handler(PTM_IRQ, CLEAR_LINE);
59      swtpc09_irq_handler(PTM_IRQ, CLEAR_LINE);
6060}
6161
6262/******* MC6821 PIA on MPID Board *******/
r29404r29405
6464
6565READ8_MEMBER( swtpc09_state::pia0_a_r )
6666{
67    return m_pia_counter;
67   return m_pia_counter;
6868}
6969
7070READ8_MEMBER( swtpc09_state::pia0_ca1_r )
r29404r29405
7474
7575WRITE_LINE_MEMBER( swtpc09_state::pia0_irq_a )
7676{
77        pia6821_device *pia = machine().device<pia6821_device>("pia");
77      pia6821_device *pia = machine().device<pia6821_device>("pia");
7878
7979      if ( pia->irq_a_state())
80           swtpc09_irq_handler(PIA_IRQ, ASSERT_LINE);
80         swtpc09_irq_handler(PIA_IRQ, ASSERT_LINE);
8181      else
82           swtpc09_irq_handler(PIA_IRQ, CLEAR_LINE);
82         swtpc09_irq_handler(PIA_IRQ, CLEAR_LINE);
8383
8484}
8585
r29404r29405
9090{
9191   if (state)
9292   {
93       swtpc09_irq_handler(ACIA_IRQ, ASSERT_LINE);
93      swtpc09_irq_handler(ACIA_IRQ, ASSERT_LINE);
9494      LOG(("swtpc09_acia_irq_assert\n"));
95   }
95   }
9696   else
9797   {
98        swtpc09_irq_handler(ACIA_IRQ, CLEAR_LINE);
98      swtpc09_irq_handler(ACIA_IRQ, CLEAR_LINE);
9999      LOG(("swtpc09_acia_irq_clear\n"));
100    }
100   }
101101}
102102
103103/*********************************************************************/
r29404r29405
107107/* DMF2 dma extended address register */
108108READ8_MEMBER ( swtpc09_state::dmf2_dma_address_reg_r )
109109{
110    return m_fdc_dma_address_reg;
110   return m_fdc_dma_address_reg;
111111}
112112
113113WRITE8_MEMBER ( swtpc09_state::dmf2_dma_address_reg_w )
114114{
115    m_fdc_dma_address_reg = data;
116   
115   m_fdc_dma_address_reg = data;
116
117117   // bit 4 controls a gate enable/disable for DMF2 fdc irq line
118118   if ((m_fdc_dma_address_reg & 0x10) && (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2))
119       swtpc09_irq_handler(FDC_IRQ, CLEAR_LINE); //then clear the irq to cpu
120   
119      swtpc09_irq_handler(FDC_IRQ, CLEAR_LINE); //then clear the irq to cpu
120
121121   LOG(("swtpc09_dmf2_dma_address_reg_w %02X\n", data));
122122}
123123
r29404r29405
134134
135135   switch (data & 0x0F)
136136   {
137       case 0x0e:
138          m_fdc->set_drive(0);
139           // need to set drive ready as sw checks before doing anything
140          machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
137      case 0x0e:
138         m_fdc->set_drive(0);
139            // need to set drive ready as sw checks before doing anything
140         machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
141141         break;
142       case 0x0d:
143          m_fdc->set_drive(1);
144          machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
142      case 0x0d:
143         m_fdc->set_drive(1);
144         machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
145145         break;
146146
147       case 0x0b:
148          m_fdc->set_drive(2);
149          machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
150           break;
147      case 0x0b:
148         m_fdc->set_drive(2);
149         machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
150         break;
151151
152       case 0x07:
153          m_fdc->set_drive(3);
154          machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
155           break;
152      case 0x07:
153         m_fdc->set_drive(3);
154         machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
155         break;
156156
157157      default:
158158      break;
159     }
159      }
160160
161    // ignore side select in emulation due to sector numbering
161   // ignore side select in emulation due to sector numbering
162162   ////side select
163163   //if (!(data & 0x10)) {
164164   //   wd17xx_set_side(fdc, 1);
r29404r29405
168168   //}
169169
170170
171    /* bit 5 dden select */
171   /* bit 5 dden select */
172172
173173   if (!(data & 0x20)) {
174      m_fdc->dden_w(0);
175      LOG(("Density single\n"));
174      m_fdc->dden_w(0);
175      LOG(("Density single\n"));
176176   }
177177   if (data & 0x20) {
178      m_fdc->dden_w(1);
179      LOG(("Density double\n"));
178      m_fdc->dden_w(1);
179      LOG(("Density double\n"));
180180   }
181181}
182182
r29404r29405
184184void swtpc09_state::swtpc09_fdc_dma_transfer()
185185{
186186   UINT8 *RAM = memregion("maincpu")->base();
187    UINT32 offset;
187   UINT32 offset;
188188   address_space &space = m_maincpu->space(AS_PROGRAM);
189189
190    offset = (m_fdc_dma_address_reg & 0x0f)<<16;
190   offset = (m_fdc_dma_address_reg & 0x0f)<<16;
191191
192192   if (m_m6844_channel[0].active == 1)  //active dma transfer
193193   {
r29404r29405
211211
212212      if (m_m6844_channel[0].counter == 0)    // dma transfer has finished
213213      {
214            m_m6844_channel[0].control |= 0x80; // set dend flag
215            if (m_m6844_interrupt & 0x01)       // interrupt for channel 0 is enabled?
216            {
217              m_m6844_interrupt   |= 0x80;      // set bit 7 to indicate active interrupt
218                swtpc09_irq_handler(DMAC_IRQ, ASSERT_LINE);
219          }
214         m_m6844_channel[0].control |= 0x80; // set dend flag
215         if (m_m6844_interrupt & 0x01)       // interrupt for channel 0 is enabled?
216         {
217            m_m6844_interrupt   |= 0x80;      // set bit 7 to indicate active interrupt
218            swtpc09_irq_handler(DMAC_IRQ, ASSERT_LINE);
219         }
220220      }
221221   }
222222
r29404r29405
230230   switch (state)
231231   {
232232      case ASSERT_LINE:
233          m_interrupt |= peripheral;
234          break;
233         m_interrupt |= peripheral;
234         break;
235235
236236      case CLEAR_LINE:
237          m_interrupt &= (~peripheral & 0x3f);
238          break;
239    }
237         m_interrupt &= (~peripheral & 0x3f);
238         break;
239   }
240240
241    if (!m_active_interrupt && m_interrupt)    //no active interrupt and it needs to be asserted
242    {
243        m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
244        m_active_interrupt=TRUE;
245        LOG(("swtpc09_irq_assert %02X\n", peripheral));
246    }
241   if (!m_active_interrupt && m_interrupt)    //no active interrupt and it needs to be asserted
242   {
243      m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
244      m_active_interrupt=TRUE;
245      LOG(("swtpc09_irq_assert %02X\n", peripheral));
246   }
247247   else if (m_active_interrupt && !m_interrupt)  //active interrupt and it needs to be cleared
248248   {
249249      m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
250250      LOG(("swtpc09_irq_clear %02X\n", peripheral));
251251      m_active_interrupt=FALSE;
252    }
252   }
253253}
254254
255255/******* WD1791 FDC *******/
r29404r29405
258258{
259259   DEVCB_NULL,
260260   DEVCB_DRIVER_LINE_MEMBER(swtpc09_state, fdc_intrq_w),
261    DEVCB_DRIVER_LINE_MEMBER(swtpc09_state, fdc_drq_w),
261   DEVCB_DRIVER_LINE_MEMBER(swtpc09_state, fdc_drq_w),
262262   {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 }
263263};
264264
265265/* handlers for fdc */
266266WRITE_LINE_MEMBER( swtpc09_state::fdc_intrq_w )
267267{
268    LOG(("swtpc09_fdc_intrq_w %02X\n", state));
268   LOG(("swtpc09_fdc_intrq_w %02X\n", state));
269269   if ( m_system_type == UNIFLEX_DMF3 )  //IRQ from 1791 is connect into VIA ca2
270270   {
271       if (state)
272       {
273          m_fdc_status |= 0x40;
271      if (state)
272      {
273         m_fdc_status |= 0x40;
274274         m_via->write_cb2(0);     //fdc interrupt is connected to CA1
275            m_dmf3_via_porta &= 0xfb; //clear pa3
275         m_dmf3_via_porta &= 0xfb; //clear pa3
276276         //m_via->write_porta(m_dmf3_via_porta);     //and connected to PA3
277           //swtpc09_irq_handler(FDC_IRQ, ASSERT_LINE);
277         //swtpc09_irq_handler(FDC_IRQ, ASSERT_LINE);
278278      }
279279      else
280280      {
281          m_fdc_status &= ~0x40;
281         m_fdc_status &= ~0x40;
282282         m_via->write_cb2(1);
283283         m_dmf3_via_porta |= 0x04;  //and connected to PA3
284284         //m_via->write_porta(m_dmf3_via_porta);     //and connected to PA3
285             //swtpc09_irq_handler(FDC_IRQ, CLEAR_LINE);
285         //swtpc09_irq_handler(FDC_IRQ, CLEAR_LINE);
286286      }
287    }
287   }
288288   else if ( m_system_type == FLEX_DC4_PIAIDE )  //for dc4 emulate irq jumper out
289289   {
290       if (state)
291       {
292          m_fdc_status |= 0x40;
290      if (state)
291      {
292         m_fdc_status |= 0x40;
293293      }
294294      else
295295      {
296          m_fdc_status &= ~0x40;
296         m_fdc_status &= ~0x40;
297297      }
298298   }
299299   else   //for dmf2 it is connected directly to cpu via a gate
300300   {
301       if (state)
302       {
303          m_fdc_status |= 0x40;
301      if (state)
302      {
303         m_fdc_status |= 0x40;
304304         if (!(m_fdc_dma_address_reg & 0x10))  // is dmf2 fdc irq enabled
305305         {
306               LOG(("swtpc09_fdc_int ** assert\n"));
306            LOG(("swtpc09_fdc_int ** assert\n"));
307307            swtpc09_irq_handler(FDC_IRQ, ASSERT_LINE);
308308         }
309309      }
310310      else
311311      {
312          m_fdc_status &= ~0x40;
313          if (!(m_fdc_dma_address_reg & 0x10)) // is dmf2 fdc irq enabled
312         m_fdc_status &= ~0x40;
313         if (!(m_fdc_dma_address_reg & 0x10)) // is dmf2 fdc irq enabled
314314         {
315                 LOG(("swtpc09_fdc_int ** clear\n"));
315            LOG(("swtpc09_fdc_int ** clear\n"));
316316            swtpc09_irq_handler(FDC_IRQ, CLEAR_LINE);
317317         }
318318      }
r29404r29405
323323{
324324   if (m_system_type == FLEX_DC4_PIAIDE)  //for dc4 no dma
325325   {
326        if (state)
327        {
328          m_fdc_status |= 0x80;
329        }
330       else
331             m_fdc_status &= 0x7f;
332    }
326      if (state)
327      {
328         m_fdc_status |= 0x80;
329      }
330      else
331         m_fdc_status &= 0x7f;
332   }
333333   else
334334   {
335        if (state)
336       {
337          m_fdc_status |= 0x80;
338          swtpc09_fdc_dma_transfer();
339        }
340       else
341           m_fdc_status &= 0x7f;
342    }
335      if (state)
336      {
337         m_fdc_status |= 0x80;
338         swtpc09_fdc_dma_transfer();
339      }
340      else
341         m_fdc_status &= 0x7f;
342   }
343343}
344344
345345/*********************************************************************/
r29404r29405
364364
365365//WRITE_LINE_MEMBER( swtpc09_state::dmf3_via_write_ca1 )
366366//{
367//   return m_via_ca1_input;
367//  return m_via_ca1_input;
368368//    LOG(("swtpc09_dmf3_via_write_ca1 %02X\n", state));
369369
370370//}
r29404r29405
372372WRITE_LINE_MEMBER( swtpc09_state::dmf3_via_irq )
373373{
374374   if (state)
375       swtpc09_irq_handler(VIA_IRQ, ASSERT_LINE);
376   else
377       swtpc09_irq_handler(VIA_IRQ, CLEAR_LINE);
375      swtpc09_irq_handler(VIA_IRQ, ASSERT_LINE);
376   else
377      swtpc09_irq_handler(VIA_IRQ, CLEAR_LINE);
378378}
379379
380380/* DMF3 dma extended address register */
381381READ8_MEMBER ( swtpc09_state::dmf3_dma_address_reg_r )
382382{
383    return m_fdc_dma_address_reg;
383   return m_fdc_dma_address_reg;
384384}
385385
386386WRITE8_MEMBER ( swtpc09_state::dmf3_dma_address_reg_w )
387387{
388    m_fdc_dma_address_reg = data;
389    LOG(("swtpc09_dmf3_dma_address_reg_w %02X\n", data));
388   m_fdc_dma_address_reg = data;
389   LOG(("swtpc09_dmf3_dma_address_reg_w %02X\n", data));
390390}
391391
392392/* DMF3 fdc control register */
r29404r29405
402402
403403   switch (data & 0x0F)
404404   {
405       case 0x01:
406          m_fdc->set_drive(0);
407           // need to set drive ready as sw checks before doing anything
408          machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
405      case 0x01:
406         m_fdc->set_drive(0);
407            // need to set drive ready as sw checks before doing anything
408         machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
409409         break;
410       case 0x02:
411          m_fdc->set_drive(1);
412          machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
410      case 0x02:
411         m_fdc->set_drive(1);
412         machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
413413         break;
414414
415       case 0x04:
416          m_fdc->set_drive(2);
417          machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
418           break;
415      case 0x04:
416         m_fdc->set_drive(2);
417         machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
418         break;
419419
420       case 0x08:
421          m_fdc->set_drive(3);
422          machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
423           break;
420      case 0x08:
421         m_fdc->set_drive(3);
422         machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
423         break;
424424
425425      default:
426426      break;
427     }
427      }
428428
429    // ignore side select in emulation due to sector numbering
429   // ignore side select in emulation due to sector numbering
430430   ////side select
431431   //if (!(data & 0x10)) {
432432   //   wd17xx_set_side(fdc, 1);
r29404r29405
436436   //}
437437
438438
439    /* bit 5 dden select */
439   /* bit 5 dden select */
440440
441441   if (data & 0x20) {
442      m_fdc->dden_w(0);
443      LOG(("Density single\n"));
442      m_fdc->dden_w(0);
443      LOG(("Density single\n"));
444444   }
445445   if (!(data & 0x20)) {
446      m_fdc->dden_w(1);
447      LOG(("Density double\n"));
446      m_fdc->dden_w(1);
447      LOG(("Density double\n"));
448448   }
449449}
450450
r29404r29405
456456
457457   switch (data & 0x03)
458458   {
459       case 0x00:
460          m_fdc->set_drive(0);
461           // need to set drive ready as sw checks before doing anything
462          machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
459      case 0x00:
460         m_fdc->set_drive(0);
461            // need to set drive ready as sw checks before doing anything
462         machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
463463         break;
464       case 0x01:
465          m_fdc->set_drive(1);
466          machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
464      case 0x01:
465         m_fdc->set_drive(1);
466         machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
467467         break;
468468
469       case 0x02:
470          m_fdc->set_drive(2);
471          machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
472           break;
469      case 0x02:
470         m_fdc->set_drive(2);
471         machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
472         break;
473473
474       case 0x03:
475          m_fdc->set_drive(3);
476          machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
477           break;
474      case 0x03:
475         m_fdc->set_drive(3);
476         machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
477         break;
478478
479479      default:
480480      break;
481     }
481      }
482482
483    // ignore side select in emulation due to sector numbering
483   // ignore side select in emulation due to sector numbering
484484}
485485
486486
r29404r29405
490490
491491READ8_MEMBER( swtpc09_state::piaide_a_r )
492492{
493    return m_piaide_porta;
493   return m_piaide_porta;
494494}
495495
496496READ8_MEMBER( swtpc09_state::piaide_b_r )
r29404r29405
500500
501501WRITE8_MEMBER( swtpc09_state::piaide_a_w )
502502{
503    m_piaide_porta = data;
503   m_piaide_porta = data;
504504}
505505
506506WRITE8_MEMBER( swtpc09_state::piaide_b_w )
507507{
508    int tempidedata;
508   int tempidedata;
509509
510    m_piaide_portb = data;
510   m_piaide_portb = data;
511511
512    if ((data & 0x40)&&(!(data&0x20)))  //cs0=0 cs1=1 bit 5&6
513    {
514        if (!(data & 0x02))  //rd line bit 1
515        {
516           tempidedata = m_ide->read_cs0(space, (data&0x1c)>>2, 0xffff);
517            LOG(("swtpc09_ide_bus_r: offset $%02X data %04X\n", (data&0x1c)>>2, tempidedata));
518            m_piaide_porta = tempidedata & 0x00ff;
519        }
520        else if (!(data & 0x01))  //wr line bit 0
512   if ((data & 0x40)&&(!(data&0x20)))  //cs0=0 cs1=1 bit 5&6
513   {
514      if (!(data & 0x02))  //rd line bit 1
521515      {
516         tempidedata = m_ide->read_cs0(space, (data&0x1c)>>2, 0xffff);
517         LOG(("swtpc09_ide_bus_r: offset $%02X data %04X\n", (data&0x1c)>>2, tempidedata));
518         m_piaide_porta = tempidedata & 0x00ff;
519      }
520      else if (!(data & 0x01))  //wr line bit 0
521      {
522522         m_ide->write_cs0(space, (data&0x1c)>>2, m_piaide_porta, 0xffff);
523           LOG(("swtpc09_ide_bus_w: offset $%02X data %04X\n", (data&0x1c)>>2, m_piaide_porta));
524       }
525    }
526    else if ((data & 0x20)&&(!(data&0x40)))  //cs0=1 cs1=0 bit 5&6
527    {
528        if (!(data & 0x02))  //rd line bit 1
529        {
530           tempidedata = m_ide->read_cs1(space, (data&0x1c)>>2, 0xffff);
531            LOG(("swtpc09_ide_bus_r: offset $%02X data %04X\n", (data&0x1c)>>2, tempidedata));
532            m_piaide_porta = tempidedata & 0x00ff;
533        }
534        else if (!(data & 0x01))  //wr line bit 0
523         LOG(("swtpc09_ide_bus_w: offset $%02X data %04X\n", (data&0x1c)>>2, m_piaide_porta));
524      }
525   }
526   else if ((data & 0x20)&&(!(data&0x40)))  //cs0=1 cs1=0 bit 5&6
527   {
528      if (!(data & 0x02))  //rd line bit 1
535529      {
530         tempidedata = m_ide->read_cs1(space, (data&0x1c)>>2, 0xffff);
531         LOG(("swtpc09_ide_bus_r: offset $%02X data %04X\n", (data&0x1c)>>2, tempidedata));
532         m_piaide_porta = tempidedata & 0x00ff;
533      }
534      else if (!(data & 0x01))  //wr line bit 0
535      {
536536         m_ide->write_cs1(space, (data&0x1c)>>2, m_piaide_porta, 0xffff);
537           LOG(("swtpc09_ide_bus_w: offset $%02X data %04X\n", (data&0x1c)>>2, m_piaide_porta));
538       }
539    }
537         LOG(("swtpc09_ide_bus_w: offset $%02X data %04X\n", (data&0x1c)>>2, m_piaide_porta));
538      }
539   }
540540}
541541
542542
r29404r29405
547547
548548WRITE8_MEMBER(swtpc09_state::dat_w)
549549{
550    UINT8 a16_to_a19, a12_to_a15;
551    UINT8 *RAM = memregion("maincpu")->base();
552    UINT32 physical_address, logical_address;
550   UINT8 a16_to_a19, a12_to_a15;
551   UINT8 *RAM = memregion("maincpu")->base();
552   UINT32 physical_address, logical_address;
553553
554    address_space &mem = m_maincpu->space(AS_PROGRAM);
554   address_space &mem = m_maincpu->space(AS_PROGRAM);
555555
556556   fd1793_device *fdc = machine().device<fd1793_device>("fdc");
557    pia6821_device *pia = machine().device<pia6821_device>("pia");
558    ptm6840_device *ptm = machine().device<ptm6840_device>("ptm");
559    acia6850_device *acia = machine().device<acia6850_device>("acia");
560    via6522_device *via = machine().device<via6522_device>("via");
561    pia6821_device *piaide = machine().device<pia6821_device>("piaide");
557   pia6821_device *pia = machine().device<pia6821_device>("pia");
558   ptm6840_device *ptm = machine().device<ptm6840_device>("ptm");
559   acia6850_device *acia = machine().device<acia6850_device>("acia");
560   via6522_device *via = machine().device<via6522_device>("via");
561   pia6821_device *piaide = machine().device<pia6821_device>("piaide");
562562
563    a16_to_a19 = data & 0xf0;
564    a12_to_a15 = ~data & 0x0f; //lower 4 bits are inverted
565    physical_address = ((a16_to_a19 + a12_to_a15) << 12);
566    logical_address = offset << 12;
567    LOG(("swtpc09_dat_bank_unmap Logical address:%04X\n", offset << 12 ));
568    LOG(("swtpc09_dat_bank_set dat:%02X Logical address:%04X Physical address:%05X\n", data, offset << 12,  physical_address ));
563   a16_to_a19 = data & 0xf0;
564   a12_to_a15 = ~data & 0x0f; //lower 4 bits are inverted
565   physical_address = ((a16_to_a19 + a12_to_a15) << 12);
566   logical_address = offset << 12;
567   LOG(("swtpc09_dat_bank_unmap Logical address:%04X\n", offset << 12 ));
568   LOG(("swtpc09_dat_bank_set dat:%02X Logical address:%04X Physical address:%05X\n", data, offset << 12,  physical_address ));
569569
570570
571    // unmap page to be changed
571   // unmap page to be changed
572572   mem.unmap_readwrite(offset << 12, (offset << 12)+0x0fff);
573573
574    // map in new page
575    if (a12_to_a15 == 0x0e)  // 0xE000 address range to be mapped in at this page
576    {
577        if (m_system_type == FLEX_DMF2)   // if flex/sbug, map in acia at 0xE004
578        {
574   // map in new page
575   if (a12_to_a15 == 0x0e)  // 0xE000 address range to be mapped in at this page
576   {
577      if (m_system_type == FLEX_DMF2)   // if flex/sbug, map in acia at 0xE004
578      {
579579         mem.nop_readwrite(logical_address+0x000, logical_address+0x003);
580             mem.install_readwrite_handler(logical_address+0x004, logical_address+0x004, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w),acia));
581             mem.install_readwrite_handler(logical_address+0x005, logical_address+0x005, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w),acia));
582            mem.nop_readwrite(logical_address+0x006, logical_address+0x07f);
583           mem.install_readwrite_handler(logical_address+0x080, logical_address+0x08f, read8_delegate(FUNC(pia6821_device::read), pia), write8_delegate(FUNC(pia6821_device::write), pia));
584           mem.install_readwrite_handler(logical_address+0x090, logical_address+0x09f, read8_delegate(FUNC(ptm6840_device::read), ptm), write8_delegate(FUNC(ptm6840_device::write), ptm));
585            mem.nop_readwrite(logical_address+0x0a0, logical_address+0xfff);
580         mem.install_readwrite_handler(logical_address+0x004, logical_address+0x004, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w),acia));
581         mem.install_readwrite_handler(logical_address+0x005, logical_address+0x005, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w),acia));
582         mem.nop_readwrite(logical_address+0x006, logical_address+0x07f);
583         mem.install_readwrite_handler(logical_address+0x080, logical_address+0x08f, read8_delegate(FUNC(pia6821_device::read), pia), write8_delegate(FUNC(pia6821_device::write), pia));
584         mem.install_readwrite_handler(logical_address+0x090, logical_address+0x09f, read8_delegate(FUNC(ptm6840_device::read), ptm), write8_delegate(FUNC(ptm6840_device::write), ptm));
585         mem.nop_readwrite(logical_address+0x0a0, logical_address+0xfff);
586586      }
587        else if (m_system_type == FLEX_DC4_PIAIDE)   // if flex/sbug and dc4 and piaide
588        {
587      else if (m_system_type == FLEX_DC4_PIAIDE)   // if flex/sbug and dc4 and piaide
588      {
589589         mem.nop_readwrite(logical_address+0x000, logical_address+0x003);
590             mem.install_readwrite_handler(logical_address+0x004, logical_address+0x004, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w),acia));
591             mem.install_readwrite_handler(logical_address+0x005, logical_address+0x005, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w),acia));
592           mem.install_write_handler(logical_address+0x014, logical_address+0x014, write8_delegate(FUNC(swtpc09_state::dc4_control_reg_w),this));
593            mem.install_readwrite_handler(logical_address+0x018, logical_address+0x01b, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
594            //mem.nop_readwrite(logical_address+0x01c, logical_address+0x05f);
595           mem.install_readwrite_handler(logical_address+0x060, logical_address+0x06f, read8_delegate(FUNC(pia6821_device::read), piaide), write8_delegate(FUNC(pia6821_device::write), piaide));
596            //mem.nop_readwrite(logical_address+0x070, logical_address+0x07f);
597           mem.install_readwrite_handler(logical_address+0x080, logical_address+0x08f, read8_delegate(FUNC(pia6821_device::read), pia), write8_delegate(FUNC(pia6821_device::write), pia));
598           mem.install_readwrite_handler(logical_address+0x090, logical_address+0x09f, read8_delegate(FUNC(ptm6840_device::read), ptm), write8_delegate(FUNC(ptm6840_device::write), ptm));
599            //mem.nop_readwrite(logical_address+0x0a0, logical_address+0x7ff);
600            mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xe800]); //piaide rom
590         mem.install_readwrite_handler(logical_address+0x004, logical_address+0x004, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w),acia));
591         mem.install_readwrite_handler(logical_address+0x005, logical_address+0x005, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w),acia));
592         mem.install_write_handler(logical_address+0x014, logical_address+0x014, write8_delegate(FUNC(swtpc09_state::dc4_control_reg_w),this));
593         mem.install_readwrite_handler(logical_address+0x018, logical_address+0x01b, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
594         //mem.nop_readwrite(logical_address+0x01c, logical_address+0x05f);
595         mem.install_readwrite_handler(logical_address+0x060, logical_address+0x06f, read8_delegate(FUNC(pia6821_device::read), piaide), write8_delegate(FUNC(pia6821_device::write), piaide));
596         //mem.nop_readwrite(logical_address+0x070, logical_address+0x07f);
597         mem.install_readwrite_handler(logical_address+0x080, logical_address+0x08f, read8_delegate(FUNC(pia6821_device::read), pia), write8_delegate(FUNC(pia6821_device::write), pia));
598         mem.install_readwrite_handler(logical_address+0x090, logical_address+0x09f, read8_delegate(FUNC(ptm6840_device::read), ptm), write8_delegate(FUNC(ptm6840_device::write), ptm));
599         //mem.nop_readwrite(logical_address+0x0a0, logical_address+0x7ff);
600         mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xe800]); //piaide rom
601601      }
602602      else        // assume unibug, map in acia at 0xE000
603603      {
604            mem.install_readwrite_handler(logical_address+0x000, logical_address+0x000, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w), acia));
605             mem.install_readwrite_handler(logical_address+0x001, logical_address+0x001, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w), acia));
604         mem.install_readwrite_handler(logical_address+0x000, logical_address+0x000, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w), acia));
605         mem.install_readwrite_handler(logical_address+0x001, logical_address+0x001, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w), acia));
606606         mem.nop_readwrite(logical_address+0x002, logical_address+0x07f);
607           mem.install_readwrite_handler(logical_address+0x080, logical_address+0x08f, read8_delegate(FUNC(pia6821_device::read), pia), write8_delegate(FUNC(pia6821_device::write), pia));
608           mem.install_readwrite_handler(logical_address+0x090, logical_address+0x09f, read8_delegate(FUNC(ptm6840_device::read), ptm), write8_delegate(FUNC(ptm6840_device::write), ptm));
609            mem.nop_readwrite(logical_address+0x0a0, logical_address+0xfff);
610        }
611    }
612    else if (a12_to_a15 == 0x0f)   // 0xF000 address range to be mapped in at this page
613    {
614        if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2)   // if DMF2 conroller this is the map
615        {
616            mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
617            mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
618           mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this));
619           mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this));
620            //mem.nop_readwrite(logical_address+0x042, logical_address+0x7ff);
621            mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xf800]);
622            mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
623       }
624        else if (m_system_type == FLEX_DC4_PIAIDE)   // 2k ram for piaide on s09 board
625        {
626            //mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
627            //mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
628           //mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this));
629           //mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this));
630            mem.install_ram(logical_address+0x000, logical_address+0x7ff, &RAM[0xf000]);
631            mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xf800]);
632            mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
633       }
634       else    // assume DMF3 controller
635        {           
607         mem.install_readwrite_handler(logical_address+0x080, logical_address+0x08f, read8_delegate(FUNC(pia6821_device::read), pia), write8_delegate(FUNC(pia6821_device::write), pia));
608         mem.install_readwrite_handler(logical_address+0x090, logical_address+0x09f, read8_delegate(FUNC(ptm6840_device::read), ptm), write8_delegate(FUNC(ptm6840_device::write), ptm));
609         mem.nop_readwrite(logical_address+0x0a0, logical_address+0xfff);
610      }
611   }
612   else if (a12_to_a15 == 0x0f)   // 0xF000 address range to be mapped in at this page
613   {
614      if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2)   // if DMF2 conroller this is the map
615      {
636616         mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
637            mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
638           mem.install_readwrite_handler(logical_address+0x024, logical_address+0x024, read8_delegate(FUNC(swtpc09_state::dmf3_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_control_reg_w),this));
639           mem.install_readwrite_handler(logical_address+0x025, logical_address+0x025, read8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_w),this));
640            //mem.nop_readwrite(logical_address+0x030, logical_address+0x03f);
641            mem.install_readwrite_handler(logical_address+0x040, logical_address+0x04f, read8_delegate(FUNC(via6522_device::read), via), write8_delegate(FUNC(via6522_device::write), via));
642            //mem.nop_readwrite(logical_address+0x050, logical_address+0x7ff);
643            mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xf800]);
644            mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
645        }
646    }
647    else if (offset==0x0f)  // then we need to leave in top part of ram and dat write
648    {
649        mem.install_ram(logical_address, logical_address+0x0eff, 0, 0, &RAM[physical_address]);
650       mem.install_rom(logical_address+0xf00, logical_address+0xfff, 0, 0, &RAM[0xff00]);
651        mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
617         mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
618         mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this));
619         mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this));
620         //mem.nop_readwrite(logical_address+0x042, logical_address+0x7ff);
621         mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xf800]);
622         mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
623      }
624      else if (m_system_type == FLEX_DC4_PIAIDE)   // 2k ram for piaide on s09 board
625      {
626         //mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
627         //mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
628         //mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this));
629         //mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this));
630         mem.install_ram(logical_address+0x000, logical_address+0x7ff, &RAM[0xf000]);
631         mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xf800]);
632         mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
633      }
634      else    // assume DMF3 controller
635      {
636         mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
637         mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
638         mem.install_readwrite_handler(logical_address+0x024, logical_address+0x024, read8_delegate(FUNC(swtpc09_state::dmf3_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_control_reg_w),this));
639         mem.install_readwrite_handler(logical_address+0x025, logical_address+0x025, read8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_w),this));
640         //mem.nop_readwrite(logical_address+0x030, logical_address+0x03f);
641         mem.install_readwrite_handler(logical_address+0x040, logical_address+0x04f, read8_delegate(FUNC(via6522_device::read), via), write8_delegate(FUNC(via6522_device::write), via));
642         //mem.nop_readwrite(logical_address+0x050, logical_address+0x7ff);
643         mem.install_rom(logical_address+0x800, logical_address+0xfff, &RAM[0xf800]);
644         mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
645      }
646   }
647   else if (offset==0x0f)  // then we need to leave in top part of ram and dat write
648   {
649      mem.install_ram(logical_address, logical_address+0x0eff, 0, 0, &RAM[physical_address]);
650      mem.install_rom(logical_address+0xf00, logical_address+0xfff, 0, 0, &RAM[0xff00]);
651      mem.install_write_handler(logical_address+0xff0, logical_address+0xfff, write8_delegate(FUNC(swtpc09_state::dat_w),this));
652652
653653   }
654    else   // all the rest is treated as ram, 1MB ram emulated
655    {
656        mem.install_ram(logical_address, logical_address+0x0fff, &RAM[physical_address]);
657    }
654   else   // all the rest is treated as ram, 1MB ram emulated
655   {
656      mem.install_ram(logical_address, logical_address+0x0fff, &RAM[physical_address]);
657   }
658658
659// unused code to limit to 256k ram   
659// unused code to limit to 256k ram
660660//    else if (!(a12_to_a15 & 0x0c) )  // limit ram to 256k || a12_to_a15 == 0x02
661661//    {
662662//        memory_install_ram(space, logical_address, logical_address+0x0fff, 0, 0, &RAM[physical_address]);
663//     }
663//    }
664664//
665//     else   // all the rest is treated as unallocated
665//    else   // all the rest is treated as unallocated
666666//    {
667667//        memory_nop_readwrite(space, logical_address, logical_address+0x0fff, 0, 0);
668//     }
668//    }
669669
670670}
671671
r29404r29405
720720
721721         /* a read here clears the DMA end flag */
722722         m_m6844_channel[offset - 0x10].control &= ~0x80;
723            if (m_m6844_interrupt & 0x80) // if interrupt is active, then clear
724            {
725                swtpc09_irq_handler(0x01, CLEAR_LINE);
726             m_m6844_interrupt &= 0x7f;  // clear interrupt indication bit 7
727             LOG(("swtpc09_6844_r interrupt cleared \n"));
723         if (m_m6844_interrupt & 0x80) // if interrupt is active, then clear
724         {
725            swtpc09_irq_handler(0x01, CLEAR_LINE);
726            m_m6844_interrupt &= 0x7f;  // clear interrupt indication bit 7
727            LOG(("swtpc09_6844_r interrupt cleared \n"));
728728         }
729729         break;
730730
r29404r29405
746746      /* 0x17-0x1f not used */
747747      default: break;
748748   }
749    //LOG(("swtpc09_6844_r %02X %02X\n", offset, result & 0xff));
749   //LOG(("swtpc09_6844_r %02X %02X\n", offset, result & 0xff));
750750
751    if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2)   // if DMF2 controller data bus is inverted to 6844
752    {
753        return ~result & 0xff;
751   if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2)   // if DMF2 controller data bus is inverted to 6844
752   {
753      return ~result & 0xff;
754754   }
755    else
756    {
757        return result & 0xff;
758    }
755   else
756   {
757      return result & 0xff;
758   }
759759}
760760
761761
r29404r29405
763763{
764764   int i;
765765
766    if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2)   // if DMF2 controller data bus is inverted to 6844
767        data = ~data & 0xff;
766   if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2)   // if DMF2 controller data bus is inverted to 6844
767      data = ~data & 0xff;
768768
769    LOG(("swtpc09_6844_w %02X %02X\n", offset, data));
769   LOG(("swtpc09_6844_w %02X %02X\n", offset, data));
770770   /* switch off the offset we were given */
771771   switch (offset)
772772   {
r29404r29405
849849      /* interrupt control */
850850      case 0x15:
851851         m_m6844_interrupt = (m_m6844_interrupt & 0x80) | (data & 0x7f);
852            LOG(("swtpc09_m_m6844_interrupt_w %02X\n", m_m6844_interrupt));
852         LOG(("swtpc09_m_m6844_interrupt_w %02X\n", m_m6844_interrupt));
853853         break;
854854
855855      /* chaining control */
r29404r29405
865865
866866DRIVER_INIT_MEMBER( swtpc09_state, swtpc09 )
867867{
868    int i;
869    m_pia_counter = 0;  // init ptm/pia counter to 0
870    m_term_data = 0;    // terminal keyboard input
871    m_fdc_status = 0;    // for floppy controller
872    m_system_type = FLEX_DMF2;
873    m_interrupt = 0;
874    m_active_interrupt = FALSE;
868   int i;
869   m_pia_counter = 0;  // init ptm/pia counter to 0
870   m_term_data = 0;    // terminal keyboard input
871   m_fdc_status = 0;    // for floppy controller
872   m_system_type = FLEX_DMF2;
873   m_interrupt = 0;
874   m_active_interrupt = FALSE;
875875
876876   /* reset the 6844 */
877877   for (i = 0; i < 4; i++)
r29404r29405
887887
888888DRIVER_INIT_MEMBER( swtpc09_state, swtpc09i )
889889{
890    int i;
891    m_pia_counter = 0;  // init ptm/pia counter to 0
892    m_term_data = 0;    // terminal keyboard input
893    m_fdc_status = 0;    // for floppy controller
894    m_system_type = FLEX_DC4_PIAIDE;
895    m_interrupt = 0;
896    m_active_interrupt = FALSE;
890   int i;
891   m_pia_counter = 0;  // init ptm/pia counter to 0
892   m_term_data = 0;    // terminal keyboard input
893   m_fdc_status = 0;    // for floppy controller
894   m_system_type = FLEX_DC4_PIAIDE;
895   m_interrupt = 0;
896   m_active_interrupt = FALSE;
897897
898898   /* reset the 6844 */
899899   for (i = 0; i < 4; i++)
r29404r29405
909909
910910DRIVER_INIT_MEMBER( swtpc09_state, swtpc09u )
911911{
912    int i;
913    m_pia_counter = 0;  //init ptm/pia counter to 0
914    m_term_data = 0;  //terminal keyboard input
915    m_fdc_status = 0;    // for floppy controller
916    m_system_type = UNIFLEX_DMF2;
917    m_interrupt = 0;
918    m_active_interrupt = FALSE;
912   int i;
913   m_pia_counter = 0;  //init ptm/pia counter to 0
914   m_term_data = 0;  //terminal keyboard input
915   m_fdc_status = 0;    // for floppy controller
916   m_system_type = UNIFLEX_DMF2;
917   m_interrupt = 0;
918   m_active_interrupt = FALSE;
919919
920920   /* reset the 6844 */
921921   for (i = 0; i < 4; i++)
r29404r29405
931931
932932DRIVER_INIT_MEMBER( swtpc09_state, swtpc09d3 )
933933{
934    int i;
935    m_pia_counter = 0;  //init ptm/pia counter to 0
936    m_term_data = 0;  //terminal keyboard input
937    m_fdc_status = 0;    // for floppy controller
938    m_via_ca1_input = 0;
939    m_system_type = UNIFLEX_DMF3;
940    m_interrupt = 0;
941    m_active_interrupt = FALSE;
934   int i;
935   m_pia_counter = 0;  //init ptm/pia counter to 0
936   m_term_data = 0;  //terminal keyboard input
937   m_fdc_status = 0;    // for floppy controller
938   m_via_ca1_input = 0;
939   m_system_type = UNIFLEX_DMF3;
940   m_interrupt = 0;
941   m_active_interrupt = FALSE;
942942
943943
944944   /* reset the 6844 */
trunk/src/mess/machine/apple2gs.c
r29404r29405
946946         result = 0;
947947         {
948948            UINT8 temp = m_kbspecial->read();
949            if (temp & 1)   // capslock
949            if (temp & 1)   // capslock
950950            {
951951               result |= 4;
952952            }
953            if (temp & 6)   // shift
953            if (temp & 6)   // shift
954954            {
955955               result |= 1;
956956            }
957            if (temp & 8)   // control
957            if (temp & 8)   // control
958958            {
959959               result |= 2;
960960            }
961            if (temp & 0x10)   // open apple/command
961            if (temp & 0x10)    // open apple/command
962962            {
963963               result |= 0x40;
964964            }
965            if (temp & 0x20)   // option
965            if (temp & 0x20)    // option
966966            {
967967               result |= 0x80;
968968            }
trunk/src/mess/machine/x68k_kbd.c
r29404r29405
355355         //m_mfp.rsr |= 0x80;  // Buffer full
356356         //if(ioport("options")->read() & 0x01)
357357         //{
358         //   m_current_vector[6] = 0x4c;
359         //   m_maincpu->set_input_line_and_vector(6,ASSERT_LINE,0x4c);
360         //   logerror("MFP: Receive buffer full IRQ sent\n");
358         //  m_current_vector[6] = 0x4c;
359         //  m_maincpu->set_input_line_and_vector(6,ASSERT_LINE,0x4c);
360         //  logerror("MFP: Receive buffer full IRQ sent\n");
361361         //}
362362      }
363363   }
trunk/src/mess/machine/hp48.c
r29404r29405
450450         bit 1: transmitting
451451         bit 2: irq enable on buffer empty
452452         bit 3: led on (direct mode)
453                     on HP49 G, flash ROM write enable
453                    on HP49 G, flash ROM write enable
454454
455455      - 0x1d: I/R output buffer
456456   */
r29404r29405
576576
577577READ8_MEMBER(hp48_state::hp48_bank_r)
578578{
579   /* HP48 GX
579   /* HP48 GX
580580      bit 0: ignored
581581      bits 2-5: bank number
582      bit 6: enable
582      bit 6: enable
583583   */
584584
585585   /* HP49 G
r29404r29405
746746      else
747747      {
748748         /* NCE3 */
749         nce3_enable = m_bank_switch >> 6;
749         nce3_enable = m_bank_switch >> 6;
750750         LOG(( "hp48_apply_modules: A19 disabled, NCE3 %s\n", nce3_enable ? "enabled" : "disabled" ));
751751         space.install_read_bank( 0, 0x7ffff, 0, 0x80000, "bank5" );
752752      }
r29404r29405
11301130   m_model = model;
11311131
11321132   /* internal RAM */
1133   ram_size =
1133   ram_size =
11341134      HP49_G_MODEL  ? (512 * 1024) :
11351135      HP48_GX_MODEL ? (128 * 1024) : (32 * 1024);
11361136
r29404r29405
11391139
11401140
11411141   /* ROM load */
1142   rom_size =
1142   rom_size =
11431143      HP49_G_MODEL  ? (2048 * 1024) :
11441144      HP48_S_SERIES ?  (256 * 1024) : (512 * 1024);
11451145   m_rom = auto_alloc_array(machine(), UINT8, 2 * rom_size);
trunk/src/mess/machine/apricotkb.c
r29404r29405
5252
5353#ifdef UPD7507_EMULATED
5454static ADDRESS_MAP_START( apricot_keyboard_io, AS_IO, 8, apricot_keyboard_device )
55    AM_RANGE(0x00, 0x00) AM_READ(kb_lo_r)
56    AM_RANGE(0x01, 0x01) AM_READ(kb_hi_r)
57    AM_RANGE(0x03, 0x03) AM_WRITE(kb_p3_w)
58    AM_RANGE(0x04, 0x04) AM_WRITE(kb_y0_w)
59    AM_RANGE(0x05, 0x05) AM_WRITE(kb_y4_w)
60    AM_RANGE(0x06, 0x06) AM_READWRITE(kb_p6_r, kb_yc_w)
61    AM_RANGE(0x07, 0x07) AM_WRITE(kb_y8_w)
55   AM_RANGE(0x00, 0x00) AM_READ(kb_lo_r)
56   AM_RANGE(0x01, 0x01) AM_READ(kb_hi_r)
57   AM_RANGE(0x03, 0x03) AM_WRITE(kb_p3_w)
58   AM_RANGE(0x04, 0x04) AM_WRITE(kb_y0_w)
59   AM_RANGE(0x05, 0x05) AM_WRITE(kb_y4_w)
60   AM_RANGE(0x06, 0x06) AM_READWRITE(kb_p6_r, kb_yc_w)
61   AM_RANGE(0x07, 0x07) AM_WRITE(kb_y8_w)
6262ADDRESS_MAP_END
6363#endif
6464
r29404r29405
6969
7070static MACHINE_CONFIG_FRAGMENT( apricot_keyboard )
7171#ifdef UPD7507_EMULATED
72    MCFG_CPU_ADD(UPD7507C_TAG, UPD7507, XTAL_32_768kHz)
73    MCFG_CPU_IO_MAP(apricot_keyboard_io)
72   MCFG_CPU_ADD(UPD7507C_TAG, UPD7507, XTAL_32_768kHz)
73   MCFG_CPU_IO_MAP(apricot_keyboard_io)
7474#endif
7575MACHINE_CONFIG_END
7676
trunk/src/mess/machine/sgi.c
r29404r29405
8888   }
8989
9090   timer_init();
91   
91
9292   save_item(NAME(m_nCPUControl0));
9393   save_item(NAME(m_nCPUControl1));
9494   save_item(NAME(m_nWatchdog));
trunk/src/mess/machine/apricotkb.h
r29404r29405
4646   apricot_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4747
4848   template<class _Object> static devcb2_base &set_txd_wr_callback(device_t &device, _Object object) { return downcast<apricot_keyboard_device &>(device).m_write_txd.set_callback(object); }
49   
49
5050   // optional information overrides
5151   virtual const rom_entry *device_rom_region() const;
5252   virtual machine_config_constructor device_mconfig_additions() const;
trunk/src/mess/machine/micropolis.h
r29404r29405
3838***************************************************************************/
3939
4040class micropolis_device : public device_t,
41                    public micropolis_interface
41                     public micropolis_interface
4242{
4343public:
4444   micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
trunk/src/mess/machine/bbc.c
r29404r29405
14451445WRITE_LINE_MEMBER(bbc_state::write_acia_clock)
14461446{
14471447   m_acia->write_txc(state);
1448   
1448
14491449   if (m_serproc_data & 0x40)
14501450      m_acia->write_rxc(state);
14511451}
r29404r29405
19651965   UINT8 *RAM = m_region_user1->base();
19661966   int size, read_;
19671967   int addr = 0x8000 + (0x4000 * index);
1968   
1968
19691969   if (image.software_entry() == NULL)
19701970   {
19711971      size = image.length();
19721972      logerror("loading rom %s, at %.4x size:%.4x\n", image.filename(), addr, size);
1973     
1973
19741974      switch (size)
19751975      {
19761976         case 0x2000:
r29404r29405
19881988            logerror("bad rom file size of %.4x\n", size);
19891989            break;
19901990      }
1991     
1991
19921992      if (read_ != size)
19931993         return IMAGE_INIT_FAIL;
19941994   }
r29404r29405
20052005
20062006   if (strcmp(image.device().tag(),":exp_rom3") == 0)
20072007      return exp_rom_load(image, 2);
2008   
2008
20092009   if (strcmp(image.device().tag(),":exp_rom4") == 0)
20102010      return exp_rom_load(image, 3);
20112011
r29404r29405
20382038         image.seterror(IMAGE_ERROR_UNSUPPORTED, "Invalid rom file size");
20392039         return IMAGE_INIT_FAIL;
20402040      }
2041     
2041
20422042      image.fread(RAM + addr, size);
20432043   }
20442044   else
trunk/src/mess/machine/sgi.h
r29404r29405
6666   UINT32 m_nDMAMode;
6767   UINT32 m_nDMAZoomByteCnt;
6868   UINT32 m_nDMARunning;
69   
69
7070   void update();
7171   TIMER_CALLBACK_MEMBER(update_callback);
7272   void timer_init();
trunk/src/mess/machine/smartmed.c
r29404r29405
7676
7777nand_device::nand_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7878   : device_t(mconfig, NAND, "NAND Flash Memory", tag, owner, clock, "nand", __FILE__),
79     m_write_rnb(*this)
79      m_write_rnb(*this)
8080{
8181}
8282nand_device::nand_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
8383   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
84     m_write_rnb(*this)
84      m_write_rnb(*this)
8585{
8686}
8787
trunk/src/mess/machine/zx8302.h
r29404r29405
6464
6565#define MCFG_ZX8302_OUT_NETOUT_CB(_devcb) \
6666   devcb = &zx8302_device::set_out_netout_callback(*device, DEVCB2_##_devcb);
67   
67
6868#define MCFG_ZX8302_OUT_MDSELCK_CB(_devcb) \
6969   devcb = &zx8302_device::set_out_mdselck_callback(*device, DEVCB2_##_devcb);
7070
r29404r29405
7979
8080#define MCFG_ZX8302_OUT_RAW1_CB(_devcb) \
8181   devcb = &zx8302_device::set_out_raw1_callback(*device, DEVCB2_##_devcb);
82   
82
8383#define MCFG_ZX8302_IN_RAW1_CB(_devcb) \
8484   devcb = &zx8302_device::set_in_raw1_callback(*device, DEVCB2_##_devcb);
8585
r29404r29405
102102public:
103103   // construction/destruction
104104   zx8302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
105   
105
106106   static void set_rtc_clock(device_t &device, int rtc_clock) { downcast<zx8302_device &>(device).m_rtc_clock = rtc_clock; }
107107   template<class _Object> static devcb2_base &set_out_ipl1l_callback(device_t &device, _Object object) { return downcast<zx8302_device &>(device).m_out_ipl1l_cb.set_callback(object); }
108108   template<class _Object> static devcb2_base &set_out_baudx4_callback(device_t &device, _Object object) { return downcast<zx8302_device &>(device).m_out_baudx4_cb.set_callback(object); }
r29404r29405
239239   UINT8 m_status;                 // status register
240240
241241   // IPC communication state
242   int m_comdata_from_ipc;         // pending data from IPC->68000
243   int m_comdata_to_cpu;         // communication data IPC->68000
244   int m_comdata_to_ipc;         // communication data 68000->IPC
242   int m_comdata_from_ipc;         // pending data from IPC->68000
243   int m_comdata_to_cpu;           // communication data IPC->68000
244   int m_comdata_to_ipc;           // communication data 68000->IPC
245245   int m_comctl;                   // communication control
246246   int m_ipc_state;                // communication state
247247   int m_ipc_busy;                 // IPC busy
trunk/src/mess/machine/apple2.c
r29404r29405
23742374
23752375static const UINT8 a2_key_remap[0x32][4] =
23762376{
2377/*     norm shft ctrl both */
2377/*    norm shft ctrl both */
23782378   { 0x33,0x23,0x33,0x23 },    /* 3 #     00     */
23792379   { 0x34,0x24,0x34,0x24 },    /* 4 $     01     */
23802380   { 0x35,0x25,0x35,0x25 },    /* 5 %     02     */
r29404r29405
24322432   if (state == ASSERT_LINE)
24332433   {
24342434      int mod = 0;
2435      m_lastchar = m_ay3600->b_r();
2435      m_lastchar = m_ay3600->b_r();
24362436
24372437      mod = (m_kbspecial->read() & 0x06) ? 0x01 : 0x00;
24382438      mod |= (m_kbspecial->read() & 0x08) ? 0x02 : 0x00;
r29404r29405
24422442      if (m_transchar != 0)
24432443      {
24442444         m_strobe = 0x80;
2445//         printf("new char = %04x (%02x)\n", m_lastchar&0x3f, m_transchar);
2445//          printf("new char = %04x (%02x)\n", m_lastchar&0x3f, m_transchar);
24462446      }
24472447   }
24482448}
r29404r29405
24562456
24572457      m_lastchar = m_ay3600->b_r();
24582458
2459      trans = m_lastchar & ~(0x1c0);   // clear the 3600's control/shift stuff
2460      trans |= (m_lastchar & 0x100)>>2;   // bring the 0x100 bit down to the 0x40 place
2461      trans <<= 2;               // 4 entries per key
2462      trans |= (m_kbspecial->read() & 0x06) ? 0x00 : 0x01;   // shift is bit 1 (active low)
2463      trans |= (m_kbspecial->read() & 0x08) ? 0x00 : 0x02;    // control is bit 2 (active low)
2464      trans |= (m_kbspecial->read() & 0x01) ? 0x0000 : 0x0200;    // caps lock is bit 9 (active low)
2459      trans = m_lastchar & ~(0x1c0);  // clear the 3600's control/shift stuff
2460      trans |= (m_lastchar & 0x100)>>2;   // bring the 0x100 bit down to the 0x40 place
2461      trans <<= 2;                    // 4 entries per key
2462      trans |= (m_kbspecial->read() & 0x06) ? 0x00 : 0x01;    // shift is bit 1 (active low)
2463      trans |= (m_kbspecial->read() & 0x08) ? 0x00 : 0x02;    // control is bit 2 (active low)
2464      trans |= (m_kbspecial->read() & 0x01) ? 0x0000 : 0x0200;    // caps lock is bit 9 (active low)
24652465
24662466      m_transchar = decode[trans];
24672467      m_strobe = 0x80;
24682468
2469//      printf("new char = %04x (%02x)\n", m_lastchar, m_transchar);
2469//      printf("new char = %04x (%02x)\n", m_lastchar, m_transchar);
24702470   }
24712471}
trunk/src/mess/machine/megacd.h
r29404r29405
111111
112112   // set some variables at start, depending on region (shall be moved to a device interface?)
113113   void set_framerate(int rate) { m_framerate = rate; }
114   void set_total_scanlines(int total) { m_base_total_scanlines = total; }      // this gets set at start only
115   void update_total_scanlines(bool mode3) { m_total_scanlines = mode3 ? (m_base_total_scanlines * 2) : m_base_total_scanlines; }   // this gets set at each EOF
114   void set_total_scanlines(int total) { m_base_total_scanlines = total; }     // this gets set at start only
115   void update_total_scanlines(bool mode3) { m_total_scanlines = mode3 ? (m_base_total_scanlines * 2) : m_base_total_scanlines; }  // this gets set at each EOF
116116
117117   void SCD_GET_TILE_INFO_16x16_1x1( int& tile_region, int& tileno, int tile_index );
118118   void SCD_GET_TILE_INFO_32x32_1x1( int& tile_region, int& tileno, int tile_index );
trunk/src/mess/machine/svi318.c
r29404r29405
741741   {
742742      return 0xff;
743743   }
744   
744
745745   fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
746746
747747   switch( offset )
r29404r29405
804804   {
805805      return;
806806   }
807   
807
808808   fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
809809
810810   switch( offset )
trunk/src/mess/machine/a7800.c
r29404r29405
1919                            added Activision bank select type
2020    19-Feb-2010 DanB        Added return values for TIA collision registers
2121
22    04-Apr-2014 Mike Saarna Fix to controller button RIOT behavior and 
23            expanded cart handling (bit 05).
22    04-Apr-2014 Mike Saarna Fix to controller button RIOT behavior and
23                expanded cart handling (bit 05).
2424***************************************************************************/
2525
2626#include "emu.h"
r29404r29405
406406      if(m_cart_type & 0x04)
407407      {
408408         //adjust write location if supercart bankram is in use
409         if(m_cart_type & 0x20)
409         if(m_cart_type & 0x20)
410410      {
411411         UINT8 *currentbank1 = (UINT8 *)m_bank1->base();
412412         currentbank1[offset] = data;
r29404r29405
435435      if( m_cart_size == 0x10000 )
436436      {
437437         data &= 0x03;
438            }
438            }
439439      else if( m_cart_size == 0x40000 )
440440      {
441441         data &= 0x0f;
trunk/src/mess/machine/mac.c
r29404r29405
12421242//  printf("VIA1 IN_A (PC %x)\n", m_maincpu->safe_pc());
12431243
12441244   #if LOG_ADB
1245//   printf("Read PM data %x\n", m_pm_data_recv);
1245//  printf("Read PM data %x\n", m_pm_data_recv);
12461246   #endif
12471247   return m_pm_data_recv;
12481248}
r29404r29405
13121312READ8_MEMBER(mac_state::mac_via_in_b_pmu)
13131313{
13141314   int val = 0;
1315//   printf("Read VIA B: PM_ACK %x\n", m_pm_ack);
1315//  printf("Read VIA B: PM_ACK %x\n", m_pm_ack);
13161316   val = 0x80 | 0x04 | m_pm_ack;   // SCC wait/request (bit 2 must be set at 900c1a or startup tests always fail)
13171317
13181318//  printf("VIA1 IN_B = %02x (PC %x)\n", val, m_maincpu->safe_pc());
r29404r29405
13581358//  printf("VIA1 OUT A: %02x (PC %x)\n", data, m_maincpu->safe_pc());
13591359
13601360   #if LOG_ADB
1361//   printf("%02x to PM\n", data);
1361//  printf("%02x to PM\n", data);
13621362   #endif
13631363   m_pm_data_send = data;
13641364   return;
r29404r29405
16571657
16581658WRITE8_MEMBER(mac_state::mac_via2_out_b_pmu)
16591659{
1660//   logerror("VIA2 OUT B PMU: %02x (PC %x)\n", data, m_maincpu->pc());
1660//  logerror("VIA2 OUT B PMU: %02x (PC %x)\n", data, m_maincpu->pc());
16611661
16621662   if ((data & 4) && !(m_pm_req & 4))
16631663   {
trunk/src/mess/machine/beta.h
r29404r29405
2020public:
2121   beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2222   ~beta_disk_device() {}
23   
23
2424   DECLARE_READ8_MEMBER(status_r);
2525   DECLARE_READ8_MEMBER(track_r);
2626   DECLARE_READ8_MEMBER(sector_r);
r29404r29405
3232   DECLARE_WRITE8_MEMBER(track_w);
3333   DECLARE_WRITE8_MEMBER(sector_w);
3434   DECLARE_WRITE8_MEMBER(data_w);
35   
35
3636   DECLARE_WRITE_LINE_MEMBER(wd179x_intrq_w);
3737   DECLARE_WRITE_LINE_MEMBER(wd179x_drq_w);
38   
38
3939   int is_active();
4040   void enable();
4141   void disable();
4242   void clear_status();
43   
43
4444   UINT8 m_betadisk_status;
4545   UINT8 m_betadisk_active;
46   
46
4747protected:
4848   // device-level overrides
4949   virtual void device_start();
trunk/src/mess/machine/nes.c
r29404r29405
159159
160160      // install additional handlers (read_h, read_ex, write_ex)
161161      if (m_cartslot->get_pcb_id() == STD_NROM368 || m_cartslot->get_pcb_id() == GG_NROM || m_cartslot->get_pcb_id() == CAMERICA_ALADDIN || m_cartslot->get_pcb_id() == SUNSOFT_DCS
162         || m_cartslot->get_pcb_id() == BANDAI_DATACH || m_cartslot->get_pcb_id() == BANDAI_KARAOKE || m_cartslot->get_pcb_id() == AVE_MAXI15
162         || m_cartslot->get_pcb_id() == BANDAI_DATACH || m_cartslot->get_pcb_id() == BANDAI_KARAOKE || m_cartslot->get_pcb_id() == AVE_MAXI15
163163         || m_cartslot->get_pcb_id() == KAISER_KS7022 || m_cartslot->get_pcb_id() == KAISER_KS7031 || m_cartslot->get_pcb_id() == BMC_VT5201
164164         || m_cartslot->get_pcb_id() == UNL_LH32 || m_cartslot->get_pcb_id() == UNL_LH10 || m_cartslot->get_pcb_id() == UNL_2708
165165         || m_cartslot->get_pcb_id() == UNL_43272 || m_cartslot->get_pcb_id() == BMC_G63IN1 || m_cartslot->get_pcb_id() == BMC_8157
trunk/src/mess/machine/mackbd.h
r29404r29405
1212//**************************************************************************
1313
1414#define MCFG_MACKBD_ADD(_tag) \
15    MCFG_DEVICE_ADD(_tag, MACKBD, 0)
15   MCFG_DEVICE_ADD(_tag, MACKBD, 0)
1616
1717#define MCFG_MACKBD_REPLACE(_tag) \
18    MCFG_DEVICE_REPLACE(_tag, MACKBD, 0)
18   MCFG_DEVICE_REPLACE(_tag, MACKBD, 0)
1919
2020#define MCFG_MACKBD_REMOVE(_tag) \
21    MCFG_DEVICE_REMOVE(_tag)
21   MCFG_DEVICE_REMOVE(_tag)
2222
2323#define MCFG_MACKBD_CLKOUT_HANDLER(_devcb) \
2424   devcb = &mackbd_device::set_clkout_handler(*device, DEVCB2_##_devcb);
trunk/src/mess/machine/oric.c
r29404r29405
5555   if (m_is_telestrat==0)
5656   {
5757      /* oric 1 or oric atmos */
58     
58
5959      /* if floppy disc hardware is disabled, do not allow interrupts from it */
6060      if ((m_io_floppy->manager().safe_to_read()) && ((m_io_floppy->read() & 0x07) == ORIC_FLOPPY_INTERFACE_NONE))
6161      {
trunk/src/mess/machine/mega32x.c
r29404r29405
15821582   _32x_check_framebuffer_swap(scanline >= irq6);
15831583
15841584   m_32x_hcount_compare_val++;
1585   
1585
15861586   if (m_32x_hcount_compare_val >= m_32x_hcount_reg)
15871587   {
15881588      m_32x_hcount_compare_val = -1;
1589     
1589
15901590      if (scanline < 224 || m_sh2_hint_in_vbl)
15911591      {
1592         if (m_sh2_master_hint_enable)
1592         if (m_sh2_master_hint_enable)
15931593            m_master_cpu->set_input_line(SH2_HINT_IRQ_LEVEL, ASSERT_LINE);
15941594         if (m_sh2_slave_hint_enable)
15951595            m_slave_cpu->set_input_line(SH2_HINT_IRQ_LEVEL, ASSERT_LINE);
trunk/src/mess/machine/apollo_kbd.c
r29404r29405
201201
202202int apollo_kbd_device::beeper::keyboard_has_beeper()
203203{
204   return true;   // driver has no facility to return false here, so go with it
204   return true;    // driver has no facility to return false here, so go with it
205205}
206206
207207void apollo_kbd_device::beeper::beeper_callback()
trunk/src/mess/includes/apollo.h
r29404r29405
301301   apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, device_type type, const char *name, const char *shortname, const char *source);
302302   ~apollo_graphics_15i();
303303
304   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);   
304   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
305305
306306   // monochrome control
307307   DECLARE_READ8_MEMBER( apollo_mcr_r );
r29404r29405
314314   // color control
315315   DECLARE_READ8_MEMBER( apollo_ccr_r );
316316   DECLARE_WRITE8_MEMBER( apollo_ccr_w );
317   
317
318318   DECLARE_READ16_MEMBER( apollo_mgm_r );
319319   DECLARE_WRITE16_MEMBER( apollo_mgm_w );
320320
321321   DECLARE_READ16_MEMBER( apollo_cgm_r );
322322   DECLARE_WRITE16_MEMBER( apollo_cgm_w );
323     
323
324324   void vblank_state_changed(screen_device &screen, bool vblank_state);
325325
326326   int is_mono() { return m_n_planes == 1; }
r29404r29405
347347   void set_lut_cr(UINT8 data);
348348
349349   void register_vblank_callback();
350   
350
351351   UINT32 set_msb0(UINT32 value, UINT8 data)
352352   {
353353      return (value & 0xffffff00) | data;
trunk/src/mess/includes/tvc.h
r29404r29405
3838// ======================> tvc_sound_device
3939
4040class tvc_sound_device : public device_t,
41                  public device_sound_interface
41                     public device_sound_interface
4242{
4343public:
4444   // construction/destruction
trunk/src/mess/includes/nascom1.h
r29404r29405
4141      m_ram(*this, RAM_TAG),
4242      m_videoram(*this, "videoram"),
4343      m_gfxdecode(*this, "gfxdecode"),
44      m_palette(*this, "palette")
44      m_palette(*this, "palette")
4545   { }
4646
4747   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/kaypro.h
r29404r29405
101101   required_device<floppy_connector> m_floppy1;
102102   optional_device<mc6845_device> m_crtc;
103103   required_device<beep_device> m_beep;
104public:   
104public:
105105   required_device<palette_device> m_palette;
106106};
107107
trunk/src/mess/includes/special.h
r29404r29405
169169public:
170170   specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
171171   ~specimx_sound_device() { }
172   
172
173173   DECLARE_WRITE_LINE_MEMBER(set_input_ch0);
174174   DECLARE_WRITE_LINE_MEMBER(set_input_ch1);
175175   DECLARE_WRITE_LINE_MEMBER(set_input_ch2);
176   
176
177177protected:
178178   // device-level overrides
179179   virtual void device_start();
trunk/src/mess/includes/p2000t.h
r29404r29405
2222         m_speaker(*this, "speaker"),
2323         m_videoram(*this, "videoram"),
2424         m_gfxdecode(*this, "gfxdecode"),
25         m_palette(*this, "palette")
25         m_palette(*this, "palette")
2626   { }
2727
2828   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/amstrad.h
r29404r29405
288288   optional_ioport m_io_analog4;
289289   required_device<screen_device> m_screen;
290290   required_device<palette_device> m_palette;
291   
291
292292   void amstrad_init_lookups();
293293   void amstrad_vh_update_mode();
294294   void amstrad_plus_dma_parse(int channel);
trunk/src/mess/includes/dm7000.h
r29404r29405
4141
4242   DECLARE_WRITE16_MEMBER ( dm7000_enet_w );
4343   DECLARE_READ16_MEMBER ( dm7000_enet_r );
44   
44
4545   DECLARE_READ32_MEMBER( dcr_r );
4646   DECLARE_WRITE32_MEMBER( dcr_w );
47   
48   
47
48
4949   UINT16          m_enet_regs[32];
5050
5151   UINT32          dcr[1024];
trunk/src/mess/includes/swtpc09.h
r29404r29405
11/***************************************************************************
2   swtpc09 include file
3   Robert Justice ,2009-2014
2    swtpc09 include file
3    Robert Justice ,2009-2014
44
55****************************************************************************/
66
r29404r29405
3232   swtpc09_state(const machine_config &mconfig, device_type type, const char *tag)
3333      : driver_device(mconfig, type, tag),
3434   m_maincpu(*this, "maincpu"),
35    m_pia(*this, "pia"),
36    m_ptm(*this, "ptm"),
35   m_pia(*this, "pia"),
36   m_ptm(*this, "ptm"),
3737   m_acia(*this, "acia"),
3838   m_fdc(*this, "fdc"),
3939   m_via(*this, "via"),
40    m_piaide(*this, "piaide"),
41    m_harddisk(*this, "harddisk"),
42    m_ide(*this, "ide")
40   m_piaide(*this, "piaide"),
41   m_harddisk(*this, "harddisk"),
42   m_ide(*this, "ide")
4343   { }
4444
4545   required_device<cpu_device> m_maincpu;
r29404r29405
5656   DECLARE_READ8_MEMBER(pia0_ca1_r);
5757   DECLARE_WRITE_LINE_MEMBER( pia0_irq_a );
5858
59    DECLARE_WRITE8_MEMBER( ptm_o1_callback );
60    DECLARE_WRITE8_MEMBER( ptm_o3_callback );
61    DECLARE_WRITE_LINE_MEMBER( ptm_irq );
59   DECLARE_WRITE8_MEMBER( ptm_o1_callback );
60   DECLARE_WRITE8_MEMBER( ptm_o3_callback );
61   DECLARE_WRITE_LINE_MEMBER( ptm_irq );
6262
6363   DECLARE_WRITE_LINE_MEMBER( acia_interrupt );
6464   DECLARE_WRITE_LINE_MEMBER( write_acia_clock );
6565
66    DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
67    DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
66   DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
67   DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
6868
6969   DECLARE_READ8_MEMBER( dmf3_via_read_porta );
7070   DECLARE_READ8_MEMBER( dmf3_via_read_portb );
r29404r29405
7474
7575   DECLARE_READ8_MEMBER(piaide_a_r);
7676   DECLARE_READ8_MEMBER(piaide_b_r);
77    DECLARE_WRITE8_MEMBER(piaide_a_w);
78    DECLARE_WRITE8_MEMBER(piaide_b_w);
77   DECLARE_WRITE8_MEMBER(piaide_a_w);
78   DECLARE_WRITE8_MEMBER(piaide_b_w);
7979
8080   DECLARE_WRITE8_MEMBER(swtpc09_kbd_put);
8181
82    DECLARE_READ8_MEMBER ( dmf2_dma_address_reg_r );
83    DECLARE_WRITE8_MEMBER ( dmf2_dma_address_reg_w );
84    DECLARE_READ8_MEMBER ( dmf2_control_reg_r );
85    DECLARE_WRITE8_MEMBER ( dmf2_control_reg_w );
82   DECLARE_READ8_MEMBER ( dmf2_dma_address_reg_r );
83   DECLARE_WRITE8_MEMBER ( dmf2_dma_address_reg_w );
84   DECLARE_READ8_MEMBER ( dmf2_control_reg_r );
85   DECLARE_WRITE8_MEMBER ( dmf2_control_reg_w );
8686
87    DECLARE_READ8_MEMBER ( dmf3_dma_address_reg_r );
88    DECLARE_WRITE8_MEMBER ( dmf3_dma_address_reg_w );
89    DECLARE_READ8_MEMBER ( dmf3_control_reg_r );
90    DECLARE_WRITE8_MEMBER ( dmf3_control_reg_w );
87   DECLARE_READ8_MEMBER ( dmf3_dma_address_reg_r );
88   DECLARE_WRITE8_MEMBER ( dmf3_dma_address_reg_w );
89   DECLARE_READ8_MEMBER ( dmf3_control_reg_r );
90   DECLARE_WRITE8_MEMBER ( dmf3_control_reg_w );
9191
92    DECLARE_WRITE8_MEMBER ( dc4_control_reg_w );
92   DECLARE_WRITE8_MEMBER ( dc4_control_reg_w );
9393
94    DECLARE_WRITE8_MEMBER(dat_w);
95   
96    DECLARE_DRIVER_INIT( swtpc09 );
97    DECLARE_DRIVER_INIT( swtpc09i );
98    DECLARE_DRIVER_INIT( swtpc09u );
99    DECLARE_DRIVER_INIT( swtpc09d3 );
100   
94   DECLARE_WRITE8_MEMBER(dat_w);
95
96   DECLARE_DRIVER_INIT( swtpc09 );
97   DECLARE_DRIVER_INIT( swtpc09i );
98   DECLARE_DRIVER_INIT( swtpc09u );
99   DECLARE_DRIVER_INIT( swtpc09d3 );
100
101101   void swtpc09_fdc_dma_transfer();
102    void swtpc09_irq_handler(UINT8 peripheral, UINT8 state);
102   void swtpc09_irq_handler(UINT8 peripheral, UINT8 state);
103103
104104   UINT8 m_term_data;               // terminal keyboard value
105105   UINT8 m_pia_counter;             // this is the counter on pia porta
r29404r29405
112112   UINT8 m_piaide_portb;
113113   UINT8 m_active_interrupt;
114114   UINT8 m_interrupt;
115   
116   
115
116
117117   // TODO: move this in proper device
118   
118
119119   /* channel_data structure holds info about each 6844 DMA channel */
120120   typedef struct m6844_channel_data
121121   {
r29404r29405
143143extern const ptm6840_interface swtpc09_6840_intf;
144144
145145#endif /* swtpc09_H_ */
146
147
148
trunk/src/mess/includes/ql.h
r29404r29405
3232#define X3 XTAL_4_436MHz
3333#define X4 XTAL_11MHz
3434
35#define QL_CONFIG_PORT        "config"
36#define QIMI_PORT_MASK         0x01
37#define QIMI_NONE            0x00
38#define QIMI_MOUSE            0x01
39#define DISK_TYPE_MASK        0x06
40#define DISK_TYPE_NONE        0x00
41#define DISK_TYPE_TRUMP       0x02
42#define DISK_TYPE_SANDY_SD       0x04
43#define DISK_TYPE_SANDY_SQB    0x06
44#define IS_SANDY_DISK(__dtype__)   ((__dtype__ == DISK_TYPE_SANDY_SD) || (__dtype__ == DISK_TYPE_SANDY_SQB))
35#define QL_CONFIG_PORT          "config"
36#define QIMI_PORT_MASK          0x01
37#define QIMI_NONE               0x00
38#define QIMI_MOUSE              0x01
39#define DISK_TYPE_MASK          0x06
40#define DISK_TYPE_NONE          0x00
41#define DISK_TYPE_TRUMP         0x02
42#define DISK_TYPE_SANDY_SD      0x04
43#define DISK_TYPE_SANDY_SQB     0x06
44#define IS_SANDY_DISK(__dtype__)    ((__dtype__ == DISK_TYPE_SANDY_SD) || (__dtype__ == DISK_TYPE_SANDY_SQB))
4545
46#define TRUMP_DRIVE1_MASK      0x01
47#define TRUMP_DRIVE0_MASK      0x02
48#define TRUMP_MOTOR_MASK       0x04
49#define TRUMP_SIDE_SHIFT       3
50#define TRUMP_SIDE_MASK        (1 << TRUMP_SIDE_SHIFT)
46#define TRUMP_DRIVE1_MASK       0x01
47#define TRUMP_DRIVE0_MASK       0x02
48#define TRUMP_MOTOR_MASK        0x04
49#define TRUMP_SIDE_SHIFT        3
50#define TRUMP_SIDE_MASK         (1 << TRUMP_SIDE_SHIFT)
5151
52#define CART_ROM_BASE         0x0c000
53#define CART_ROM_END          0x0ffff
52#define CART_ROM_BASE           0x0c000
53#define CART_ROM_END            0x0ffff
5454
55#define TRUMP_ROM_MBASE         0x10000
56#define TRUMP_ROM_BASE        0x14000
57#define TRUMP_ROM_LEN         0x08000
58#define TRUMP_ROM_END         (TRUMP_ROM_MBASE+(TRUMP_ROM_LEN-1))
55#define TRUMP_ROM_MBASE         0x10000
56#define TRUMP_ROM_BASE          0x14000
57#define TRUMP_ROM_LEN           0x08000
58#define TRUMP_ROM_END           (TRUMP_ROM_MBASE+(TRUMP_ROM_LEN-1))
5959
60#define TRUMP_IO_BASE         0x1c000
61#define TRUMP_IO_LEN          0x04000
62#define TRUMP_IO_END          (TRUMP_IO_BASE+(TRUMP_IO_LEN-1))
60#define TRUMP_IO_BASE           0x1c000
61#define TRUMP_IO_LEN            0x04000
62#define TRUMP_IO_END            (TRUMP_IO_BASE+(TRUMP_IO_LEN-1))
6363
64#define SANDY_ROM_BASE_SD        0x1c000
65#define SANDY_ROM_BASE_SQB       0x20000
66#define SANDY_IO_BASE         0xc3fc0
67#define SANDY_IO_LEN          0x00040
68#define SANDY_IO_END          (SANDY_IO_BASE+(SANDY_IO_LEN-1))
64#define SANDY_ROM_BASE_SD       0x1c000
65#define SANDY_ROM_BASE_SQB      0x20000
66#define SANDY_IO_BASE           0xc3fc0
67#define SANDY_IO_LEN            0x00040
68#define SANDY_IO_END            (SANDY_IO_BASE+(SANDY_IO_LEN-1))
6969
7070#define SANDY_DRIVE0_MASK       0x02
7171#define SANDY_DRIVE1_MASK       0x04
r29404r29405
7676#define SANDY_DDEN_MASK         (1 << SANDY_DDEN_SHIFT)
7777#define SANDY_PRINTER_STROBE    0x20
7878#define SANDY_PRINTER_INTMASK   0x40
79#define SANDY_MOUSE_INTMASK      0x80
79#define SANDY_MOUSE_INTMASK     0x80
8080
81#define   MOUSEX_TAG            "MOUSEX"
82#define   MOUSEY_TAG            "MOUSEY"
83#define   MOUSEB_TAG            "MOUSEB"
81#define MOUSEX_TAG              "MOUSEX"
82#define MOUSEY_TAG              "MOUSEY"
83#define MOUSEB_TAG              "MOUSEB"
8484
8585// Mouse bits in Sandy port order
86#define MOUSE_MIDDLE         0x02
87#define MOUSE_RIGHT            0x04
88#define MOUSE_LEFT            0x08
89#define MOUSE_DIRY            0x10
90#define MOUSE_DIRX            0x20
91#define MOUSE_INTY            0x40
92#define MOUSE_INTX            0x80
93#define MOUSE_INT_MASK         (MOUSE_INTX | MOUSE_INTY)
86#define MOUSE_MIDDLE            0x02
87#define MOUSE_RIGHT             0x04
88#define MOUSE_LEFT              0x08
89#define MOUSE_DIRY              0x10
90#define MOUSE_DIRX              0x20
91#define MOUSE_INTY              0x40
92#define MOUSE_INTX              0x80
93#define MOUSE_INT_MASK          (MOUSE_INTX | MOUSE_INTY)
9494
95#define QIMI_IO_BASE         0x1bf9c
96#define QIMI_IO_LEN            0x22
97#define QIMI_IO_END            (QIMI_IO_BASE + QIMI_IO_LEN )
95#define QIMI_IO_BASE            0x1bf9c
96#define QIMI_IO_LEN             0x22
97#define QIMI_IO_END             (QIMI_IO_BASE + QIMI_IO_LEN )
9898
99#define   QIMI_INTX            0x04
100#define   QIMI_INTY            0x20
101#define QIMI_DIRX            0x10
102#define QIMI_DIRY            0x01
103#define QIMI_LEFT            0x20
104#define QIMI_RIGHT            0x10
105#define QIMI_INT_MASK         (QIMI_INTX | QIMI_INTY)
99#define QIMI_INTX               0x04
100#define QIMI_INTY               0x20
101#define QIMI_DIRX               0x10
102#define QIMI_DIRY               0x01
103#define QIMI_LEFT               0x20
104#define QIMI_RIGHT              0x10
105#define QIMI_INT_MASK           (QIMI_INTX | QIMI_INTY)
106106
107107
108108class ql_state : public driver_device
r29404r29405
206206   void trump_card_set_control(UINT8 data);
207207   void sandy_set_control(UINT8 data);
208208   void sandy_print_char(UINT8 data);
209   
209
210210   UINT8   m_disk_type;
211211   int     m_disk_io_base;
212212   UINT8   m_disk_io_byte;
r29404r29405
214214   DECLARE_READ_LINE_MEMBER(disk_io_dden_r);
215215   DECLARE_WRITE_LINE_MEMBER(disk_io_intrq_w);
216216   DECLARE_WRITE_LINE_MEMBER(disk_io_drq_w);
217   
217
218218   DECLARE_WRITE_LINE_MEMBER( sandy_printer_busy );
219219
220220   // QIMI or Sandy mouse
221221   void mouse_tick();
222   
222
223223   DECLARE_READ8_MEMBER( qimi_io_r );
224224   DECLARE_WRITE8_MEMBER( qimi_io_w );
225   
226   UINT8   m_mouse_int;
227   
225
226   UINT8   m_mouse_int;
227
228228   emu_timer *m_mouse_timer;
229   
229
230230   UINT8 m_ql_mouse_x;
231231   UINT8 m_ql_mouse_y;
232232
233233protected:
234   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);   
234   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
235235
236236};
237237
trunk/src/mess/includes/apple2gs.h
r29404r29405
9999      #endif
100100      m_adb_mousex(*this, "adb_mouse_x"),
101101      m_adb_mousey(*this, "adb_mouse_y"),
102      m_palette(*this, "palette")
102      m_palette(*this, "palette")
103103      { }
104104
105105   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/tiki100.h
r29404r29405
6767      m_y10(*this, "Y10"),
6868      m_y11(*this, "Y11"),
6969      m_y12(*this, "Y12"),
70      m_palette(*this, "palette")
70      m_palette(*this, "palette")
7171   { }
7272
7373   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/bbc.h
r29404r29405
152152   DECLARE_WRITE_LINE_MEMBER(write_dcd_serial);
153153   DECLARE_WRITE_LINE_MEMBER(write_cts_serial);
154154   DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
155   
155
156156   DECLARE_WRITE_LINE_MEMBER(bbc_i8271_interrupt);
157157
158158   int exp_rom_load(device_image_interface &image, int index);
trunk/src/mess/includes/fm7.h
r29404r29405
141141      m_joy1(*this, "joy1"),
142142      m_joy2(*this, "joy2"),
143143      m_dsw(*this, "DSW"),
144      m_palette(*this, "palette")
144      m_palette(*this, "palette")
145145   {
146146   }
147147
trunk/src/mess/includes/genpc.h
r29404r29405
103103   DECLARE_WRITE_LINE_MEMBER( pc_dack3_w );
104104
105105   DECLARE_WRITE_LINE_MEMBER( pc_speaker_set_spkrdata );
106   
106
107107   DECLARE_READ8_MEMBER(pc_page_r);
108108   DECLARE_WRITE8_MEMBER(pc_page_w);
109109   DECLARE_WRITE8_MEMBER(nmi_enable_w);
r29404r29405
175175public:
176176   virtual DECLARE_READ8_MEMBER ( pc_ppi_portc_r );
177177   virtual DECLARE_WRITE8_MEMBER( pc_ppi_portb_w );
178   
178
179179   virtual DECLARE_WRITE_LINE_MEMBER( keyboard_clock_w );
180180};
181181
trunk/src/mess/includes/advision.h
r29404r29405
2121         m_maincpu(*this, I8048_TAG),
2222         m_soundcpu(*this, COP411_TAG),
2323         m_dac(*this, "dac"),
24         m_palette(*this, "palette")
24         m_palette(*this, "palette")
2525   { }
2626
2727   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/softbox.h
r29404r29405
2121#define I8255_1_TAG     "ic16"
2222#define COM8116_TAG     "ic14"
2323#define RS232_TAG       "rs232"
24#define CORVUS_HDC_TAG   "corvus"
24#define CORVUS_HDC_TAG  "corvus"
2525
2626class softbox_state : public driver_device
2727{
trunk/src/mess/includes/lisa.h
r29404r29405
120120      m_io_line7(*this, "LINE7"),
121121      m_io_mouse_x(*this, "MOUSE_X"),
122122      m_io_mouse_y(*this, "MOUSE_Y"),
123      m_palette(*this, "palette")
123      m_palette(*this, "palette")
124124   { }
125125
126126   required_device<m68000_base_device> m_maincpu;
r29404r29405
144144   required_ioport m_io_line7;
145145   required_ioport m_io_mouse_x;
146146   required_ioport m_io_mouse_y;
147   
147
148148   required_device<palette_device> m_palette;
149149
150150   UINT8 *m_ram_ptr;
trunk/src/mess/includes/aquarius.h
r29404r29405
5757   required_ioport m_y7;
5858   required_device<gfxdecode_device> m_gfxdecode;
5959   required_device<screen_device> m_screen;
60   required_device<palette_device> m_palette;   
60   required_device<palette_device> m_palette;
6161
6262   UINT8 m_scrambler;
6363   tilemap_t *m_tilemap;
trunk/src/mess/includes/svi318.h
r29404r29405
142142   required_ioport m_line10;
143143   required_ioport m_joysticks;
144144   required_ioport m_buttons;
145public:   
145public:
146146   optional_device<palette_device> m_palette;
147147protected:
148148   void svi318_set_banks();
trunk/src/mess/includes/a7800.h
r29404r29405
114114   required_ioport m_io_console_buttons;
115115   memory_bank *m_bank10;
116116   memory_bank *m_bank11;
117   required_device<screen_device> m_screen;   
117   required_device<screen_device> m_screen;
118118
119119   void maria_draw_scanline();
120120   int is_holey(unsigned int addr);
trunk/src/mess/includes/x68k.h
r29404r29405
248248   DECLARE_WRITE_LINE_MEMBER(mfp_irq_callback);
249249   DECLARE_WRITE_LINE_MEMBER(x68k_scsi_irq);
250250   DECLARE_WRITE_LINE_MEMBER(x68k_scsi_drq);
251   
251
252252   //dmac
253253   void dma_irq(int channel);
254254   DECLARE_WRITE8_MEMBER(dma_end);
trunk/src/mess/includes/vc4000.h
r29404r29405
136136#else
137137   required_ioport m_joys;
138138   required_ioport m_config;
139#endif   
139#endif
140140   inline UINT8 vc4000_joystick_return_to_centre(UINT8 joy);
141141   void vc4000_draw_digit(bitmap_ind16 &bitmap, int x, int y, int d, int line);
142142   inline void vc4000_collision_plot(UINT8 *collision, UINT8 data, UINT8 color, int scale);
trunk/src/mess/includes/mikromik.h
r29404r29405
3030#define RS232_A_TAG     "rs232a"
3131#define RS232_B_TAG     "rs232b"
3232#define RS232_C_TAG     "rs232c"
33#define KB_TAG         "kb"
33#define KB_TAG          "kb"
3434
3535class mm1_state : public driver_device
3636{
trunk/src/mess/includes/pocketc.h
r29404r29405
1616      : driver_device(mconfig, type, tag) { }
1717
1818   DECLARE_PALETTE_INIT(pocketc);
19   
19
2020   static const unsigned short pocketc_colortable[8][2];
2121   void pocketc_draw_special(bitmap_ind16 &bitmap,int x, int y, const POCKETC_FIGURE fig, int color);
2222};
trunk/src/mess/includes/z88.h
r29404r29405
4949      : driver_device(mconfig, type, tag),
5050         m_maincpu(*this, "maincpu"),
5151         m_ram(*this, RAM_TAG),
52         m_palette(*this, "palette")
52         m_palette(*this, "palette")
5353   { }
5454
5555   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/zx.h
r29404r29405
102102   required_ioport m_io_row7;
103103   optional_ioport m_io_config;
104104   required_device<screen_device> m_screen;
105   
105
106106   void zx_ula_r(int offs, memory_region *region, const UINT8 param);
107107   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
108108};
trunk/src/mess/includes/avigo.h
r29404r29405
3636         m_speaker(*this, "speaker"),
3737         m_uart(*this, "ns16550"),
3838         m_serport(*this, "serport"),
39         m_palette(*this, "palette")
39         m_palette(*this, "palette")
4040      { }
4141
4242   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/vector06.h
r29404r29405
3131   m_ppi(*this, "ppi8255"),
3232   m_ppi2(*this, "ppi8255_2"),
3333   m_ram(*this, RAM_TAG),
34   m_palette(*this, "palette")
34   m_palette(*this, "palette")
3535   { }
3636
3737   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/b2m.h
r29404r29405
4545   required_device<pit8253_device> m_pit;
4646   required_device<ram_device> m_ram;
4747   required_device<palette_device> m_palette;
48   
48
4949   /* devices */
5050   fd1793_t *m_fdc;
5151   pic8259_device *m_pic;
trunk/src/mess/includes/apple3.h
r29404r29405
3030#define VAR_EXTPOWER    0x0040
3131#define VAR_EXTSIDE     0x0080
3232
33#define SPEAKER_TAG   "a3spkr"
34#define DAC_TAG      "a3dac"
33#define SPEAKER_TAG "a3spkr"
34#define DAC_TAG     "a3dac"
3535
3636class apple3_state : public driver_device
3737{
r29404r29405
5050      m_speaker(*this, SPEAKER_TAG),
5151      m_dac(*this, DAC_TAG),
5252      m_kbspecial(*this, "keyb_special"),
53      m_palette(*this, "palette")
53      m_palette(*this, "palette")
5454   {
5555   }
5656
trunk/src/mess/includes/thomson.h
r29404r29405
306306   WRITE_LINE_MEMBER( fdc_index_3_w );
307307   void thomson_index_callback(legacy_floppy_image_device *device, int state);
308308   DECLARE_PALETTE_INIT(thom);
309   
309
310310   optional_device<mc6854_device> m_mc6854;
311311
312312   DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
trunk/src/mess/includes/super80.h
r29404r29405
4242         m_io_x6(*this, "X6"),
4343         m_io_x7(*this, "X7"),
4444         m_io_config(*this, "CONFIG"),
45         m_palette(*this, "palette")
45         m_palette(*this, "palette")
4646   { }
4747
4848   DECLARE_READ8_MEMBER( super80v_low_r );
trunk/src/mess/includes/atarist.h
r29404r29405
118118         m_ikbd_mouse_pc(0),
119119         m_ikbd_joy(1),
120120         m_monochrome(1),
121         m_palette(*this, "palette")
121         m_palette(*this, "palette")
122122   { }
123123
124124   required_device<cpu_device> m_maincpu;
trunk/src/mess/includes/mc1502.h
r29404r29405
3636      m_ram(*this, RAM_TAG) { }
3737
3838   required_device<cpu_device>  m_maincpu;
39   required_device<i8251_device> m_upd8251;     
39   required_device<i8251_device> m_upd8251;
4040   required_device<pic8259_device>  m_pic8259;
4141   required_device<pit8253_device>  m_pit8253;
4242   required_device<i8255_device>  m_ppi8255n1;
r29404r29405
8686        int         fdc_motor_on;
8787        emu_timer   *fdc_motor_timer;
8888    } m_motor;
89   const char *m_cputag;
89    const char *m_cputag;
9090*/
9191};
9292
trunk/src/mess/includes/apricotf.h
r29404r29405
5555         m_sio_int(CLEAR_LINE),
5656         m_p_scrollram(*this, "p_scrollram"),
5757         m_p_paletteram(*this, "p_paletteram"),
58         m_palette(*this, "palette")
58         m_palette(*this, "palette")
5959   { }
6060
6161   virtual void machine_start();
trunk/src/mess/includes/einstein.h
r29404r29405
151151   required_ioport m_buttons;
152152   required_ioport m_config;
153153   optional_ioport m_80column_dips;
154public:   
154public:
155155   optional_device<palette_device> m_palette;
156156
157157   void einstein_scan_keyboard();
trunk/src/mess/includes/intv.h
r29404r29405
142142   required_ioport m_io_options;
143143   optional_ioport m_io_ecs_cntrlsel;
144144   optional_ioport m_io_test;
145   
145
146146   optional_device<gfxdecode_device> m_gfxdecode;
147147   required_device<palette_device> m_palette;
148148
trunk/src/mess/includes/studio2.h
r29404r29405
4545   required_ioport m_a;
4646   required_ioport m_b;
4747   required_device<screen_device> m_screen;
48   
48
4949   virtual void machine_start();
5050   virtual void machine_reset();
5151
trunk/src/mess/includes/pcw.h
r29404r29405
124124   required_device<beep_device> m_beeper;
125125   required_device<screen_device> m_screen;
126126   required_device<palette_device> m_palette;
127   
127
128128   inline void pcw_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color);
129129   void pcw_update_interrupt_counter();
130130   void pcw_update_irqs();
trunk/src/mess/includes/rmnimbus.h
r29404r29405
398398      m_eeprom(*this, ER59256_TAG),
399399      m_via(*this, VIA_TAG),
400400      m_centronics(*this, CENTRONICS_TAG),
401      m_palette(*this, "palette")
401      m_palette(*this, "palette")
402402   {
403403   }
404404
trunk/src/mess/includes/partner.h
r29404r29405
3131   DECLARE_MACHINE_RESET(partner);
3232   DECLARE_WRITE_LINE_MEMBER(partner_wd17xx_drq_w);
3333   DECLARE_WRITE_LINE_MEMBER(hrq_w);
34   
34
3535   //to remove trampoline once it use new wd17xx core
3636   DECLARE_READ8_MEMBER(partner_fdc_r);
3737   DECLARE_WRITE8_MEMBER(partner_fdc_w);
38   
38
3939   void partner_window_1(UINT8 bank_num, UINT16 offset,UINT8 *rom);
4040   void partner_window_2(UINT8 bank_num, UINT16 offset,UINT8 *rom);
4141   void partner_iomap_bank(UINT8 *rom);
trunk/src/mess/video/nascom1.c
r29404r29405
1616
1717   for (sx = 0; sx < 48; sx++)
1818   {
19     
2019         m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x03ca + sx],
2120         1, 0, 0, sx * 8, 0);
2221   }
r29404r29405
2524   {
2625      for (sx = 0; sx < 48; sx++)
2726      {
28         
2927            m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x000a + (sy * 64) + sx],
3028            1, 0, 0, sx * 8, (sy + 1) * 16);
3129      }
r29404r29405
4038
4139   for (sx = 0; sx < 48; sx++)
4240   {
43     
4441         m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x03ca + sx],
4542         1, 0, 0, sx * 8, 0);
4643   }
r29404r29405
4946   {
5047      for (sx = 0; sx < 48; sx++)
5148      {
52         
5349            m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x000a + (sy * 64) + sx],
5450            1, 0, 0, sx * 8, (sy + 1) * 14);
5551      }
trunk/src/mess/video/gime.h
r29404r29405
2121//  GIME CONFIG/INTERFACE
2222//**************************************************************************
2323
24#define MCFG_GIME_HSYNC_CALLBACK   MCFG_MC6847_HSYNC_CALLBACK
24#define MCFG_GIME_HSYNC_CALLBACK    MCFG_MC6847_HSYNC_CALLBACK
2525
26#define MCFG_GIME_FSYNC_CALLBACK   MCFG_MC6847_FSYNC_CALLBACK
26#define MCFG_GIME_FSYNC_CALLBACK    MCFG_MC6847_FSYNC_CALLBACK
2727
2828#define MCFG_GIME_IRQ_CALLBACK(_write) \
2929   devcb = &gime_base_device::set_irq_wr_callback(*device, DEVCB2_##_write);
trunk/src/mess/video/zx8301.h
r29404r29405
103103   required_device<cpu_device> m_cpu;
104104
105105   devcb2_write_line   m_write_vsync;
106   
106
107107   //address_space *m_data;
108108
109109   int m_dispoff;                  // display off
trunk/src/mess/video/abc80.c
r29404r29405
203203   MCFG_SCREEN_UPDATE_DRIVER(abc80_state, screen_update)
204204
205205   MCFG_SCREEN_RAW_PARAMS(XTAL_11_9808MHz/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART)
206   
206
207207   MCFG_GFXDECODE_ADD("gfxdecode", "palette", abc80)
208208   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
209209MACHINE_CONFIG_END
trunk/src/mess/video/gb_lcd.c
r29404r29405
11661166         {
11671167            data = *((UINT16 *) &m_vram[((oam[3] & 0x8)<<10) + (oam[2] & tilemask) * 16 + (line - oam[0]) * 2]);
11681168         }
1169         
1169
11701170         data = LITTLE_ENDIANIZE_INT16(data);
11711171
11721172         switch (oam[3] & 0xA0)
trunk/src/mess/video/v1050.c
r29404r29405
132132   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
133133   MCFG_SCREEN_SIZE(640, 400)
134134   MCFG_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1)
135   
135
136136   MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
137137MACHINE_CONFIG_END
trunk/src/mess/video/a7800.c
r29404r29405
44
55  Routines to control the Atari 7800 video hardware
66
7    2014-03-24 Mike Saarna Fixed DMA regarding startup, shutdown and
7    2014-03-24 Mike Saarna Fixed DMA regarding startup, shutdown and
88                            cycle stealing.
99
1010    2013-05-08 huygens rewrite to emulate line ram buffers (mostly fixes Kung-Fu Master
r29404r29405
126126   int x, d, c, i, pixel_cell, cells;
127127   int maria_cycles;
128128
129     if ( m_maria_offset == 0 )
130        maria_cycles = 5+21; // DMA startup + last line shutdown
131    else
132         maria_cycles = 5+16; // DMA startup + other line shutdown
133     
129      if ( m_maria_offset == 0 )
130         maria_cycles = 5+21; // DMA startup + last line shutdown
131      else
132         maria_cycles = 5+16; // DMA startup + other line shutdown
133
134134   cells = 0;
135135
136136   /* Process this DLL entry */
r29404r29405
202202         }
203203      }
204204   }
205           // spin the CPU for Maria DMA, if it's not already spinning for WSYNC
206        if ( ! m_maria_wsync )
207                m_maincpu->spin_until_time(m_maincpu->cycles_to_attotime(maria_cycles/4)); // Maria clock rate is 4 times that of the CPU
205         // spin the CPU for Maria DMA, if it's not already spinning for WSYNC
206      if ( ! m_maria_wsync )
207            m_maincpu->spin_until_time(m_maincpu->cycles_to_attotime(maria_cycles/4)); // Maria clock rate is 4 times that of the CPU
208208
209209   // draw line buffer to screen
210210   m_active_buffer = !m_active_buffer; // switch buffers
trunk/src/mess/video/pc1251.c
r29404r29405
44#include "includes/pc1251.h"
55
66static const POCKETC_FIGURE /*busy={
7   "11  1 1  11 1 1",
8   "1 1 1 1 1   1 1",
9   "11  1 1  1  1 1",
10   "1 1 1 1   1  1",
11   "11   1  11   1e"
7    "11  1 1  11 1 1",
8    "1 1 1 1 1   1 1",
9    "11  1 1  1  1 1",
10    "1 1 1 1   1  1",
11    "11   1  11   1e"
1212},*/ def={
1313   "11  111 111",
1414   "1 1 1   1",
r29404r29405
2222   "  1 1 1 1 1    1",
2323   "11  1 1 1 1    1e"
2424}, /*hyp={
25   "1 1 1 1 11",
26   "1 1 1 1 1 1",
27   "111 1 1 11",
28   "1 1  1  1",
29   "1 1  1  1e"
25    "1 1 1 1 11",
26    "1 1 1 1 1 1",
27    "111 1 1 11",
28    "1 1  1  1",
29    "1 1  1  1e"
3030},*/ de={
3131   "11  111",
3232   "1 1 1",
r29404r29405
4646   "1 1 1 1 1 1",
4747   "1 1 1 1 11e"
4848}, /*braces={
49   " 1 1",
50   "1   1",
51   "1   1",
52   "1   1",
53   " 1 1e"
49    " 1 1",
50    "1   1",
51    "1   1",
52    "1   1",
53    " 1 1e"
5454}, m={
55   "1   1",
56   "11 11",
57   "1 1 1",
58   "1   1",
59   "1   1e"
55    "1   1",
56    "11 11",
57    "1 1 1",
58    "1   1",
59    "1   1e"
6060}, e={
61   "111",
62   "1",
63   "111",
64   "1",
65   "111e"
61    "111",
62    "1",
63    "111",
64    "1",
65    "111e"
6666},*/ run={
6767   "11  1 1 1  1",
6868   "1 1 1 1 11 1",
r29404r29405
7676   "1   1 1 1 1",
7777   "1   1 1  1e"
7878}, /*japan={
79   "  1  1  11   1  1  1",
80   "  1 1 1 1 1 1 1 11 1",
81   "  1 111 11  111 1 11",
82   "1 1 1 1 1   1 1 1  1",
83   " 1  1 1 1   1 1 1  1e"
79    "  1  1  11   1  1  1",
80    "  1 1 1 1 1 1 1 11 1",
81    "  1 111 11  111 1 11",
82    "1 1 1 1 1   1 1 1  1",
83    " 1  1 1 1   1 1 1  1e"
8484}, sml={
85   " 11 1 1 1",
86   "1   111 1",
87   " 1  1 1 1",
88   "  1 1 1 1",
89   "11  1 1 111e"
85    " 11 1 1 1",
86    "1   111 1",
87    " 1  1 1 1",
88    "  1 1 1 1",
89    "11  1 1 111e"
9090},*/ rsv={
9191   "11   11 1   1",
9292   "1 1 1   1   1",
trunk/src/mess/video/mikromik.c
r29404r29405
121121
122122   MCFG_DEVICE_ADD(UPD7220_TAG, UPD7220, XTAL_18_720MHz/8)
123123   MCFG_DEVICE_ADDRESS_MAP(AS_0, mm1_upd7220_map)
124   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(mm1_state, hgdc_display_pixels)   
124   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(mm1_state, hgdc_display_pixels)
125125   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
126126MACHINE_CONFIG_END
trunk/src/mess/video/pc1401.c
r29404r29405
9393   "1",
9494   "111e"
9595}/*, run={
96   "11  1 1 1  1",
97   "1 1 1 1 11 1",
98   "11  1 1 1 11",
99   "1 1 1 1 1  1",
100   "1 1  1  1  1e"
96    "11  1 1 1  1",
97    "1 1 1 1 11 1",
98    "11  1 1 1 11",
99    "1 1 1 1 1  1",
100    "1 1  1  1  1e"
101101}, pro={
102   "11  11   1  ",
103   "1 1 1 1 1 1",
104   "11  11  1 1",
105   "1   1 1 1 1",
106   "1   1 1  1e"
102    "11  11   1  ",
103    "1 1 1 1 1 1",
104    "11  11  1 1",
105    "1   1 1 1 1",
106    "1   1 1  1e"
107107}, japan={
108   "  1  1  11   1  1  1",
109   "  1 1 1 1 1 1 1 11 1",
110   "  1 111 11  111 1 11",
111   "1 1 1 1 1   1 1 1  1",
112   " 1  1 1 1   1 1 1  1e"
108    "  1  1  11   1  1  1",
109    "  1 1 1 1 1 1 1 11 1",
110    "  1 111 11  111 1 11",
111    "1 1 1 1 1   1 1 1  1",
112    " 1  1 1 1   1 1 1  1e"
113113}, sml={
114   " 11 1 1 1",
115   "1   111 1",
116   " 1  1 1 1",
117   "  1 1 1 1",
118   "11  1 1 111e"
114    " 11 1 1 1",
115    "1   111 1",
116    " 1  1 1 1",
117    "  1 1 1 1",
118    "11  1 1 111e"
119119}, rsv={
120   "11   11 1   1",
121   "1 1 1   1   1",
122   "11   1   1 1",
123   "1 1   1  1 1",
124   "1 1 11    1e"
120    "11   11 1   1",
121    "1 1 1   1   1",
122    "11   1   1 1",
123    "1 1   1  1 1",
124    "1 1 11    1e"
125125}*/;
126126
127127#define DOWN 57
trunk/src/mess/video/apple3.c
r29404r29405
1919#define DKGRAY  5
2020#define BLUE    6
2121#define LTBLUE  7
22#define BROWN   8                     
22#define BROWN   8
2323#define ORANGE  9
2424#define GRAY    10
2525#define PINK    11
r29404r29405
411411
412412UINT32 apple3_state::screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
413413{
414//   printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0));
414//  printf("gfx mode %x\n", m_flags & (VAR_VM3|VAR_VM1|VAR_VM0));
415415
416416   switch(m_flags & (VAR_VM3|VAR_VM1|VAR_VM0))
417417   {
trunk/src/mess/video/pc1350.c
r29404r29405
44#include "includes/pc1350.h"
55
66static const POCKETC_FIGURE /*busy={
7   "11  1 1  11 1 1",
8   "1 1 1 1 1   1 1",
9   "11  1 1  1  1 1",
10   "1 1 1 1   1  1",
11   "11   1  11   1e"
7    "11  1 1  11 1 1",
8    "1 1 1 1 1   1 1",
9    "11  1 1  1  1 1",
10    "1 1 1 1   1  1",
11    "11   1  11   1e"
1212},*/ def={
1313   "11  111 111",
1414   "1 1 1   1",
r29404r29405
2222   "  1 1 1 1 1    1",
2323   "11  1 1 1 1    1e"
2424}, /*hyp={
25   "1 1 1 1 11",
26   "1 1 1 1 1 1",
27   "111 1 1 11",
28   "1 1  1  1",
29   "1 1  1  1e"
25    "1 1 1 1 11",
26    "1 1 1 1 1 1",
27    "111 1 1 11",
28    "1 1  1  1",
29    "1 1  1  1e"
3030}, de={
31   "11  111",
32   "1 1 1",
33   "1 1 111",
34   "1 1 1",
35   "11  111e"
31    "11  111",
32    "1 1 1",
33    "1 1 111",
34    "1 1 1",
35    "11  111e"
3636}, g={
37   " 11",
38   "1",
39   "1 1",
40   "1 1",
41   " 11e"
37    " 11",
38    "1",
39    "1 1",
40    "1 1",
41    " 11e"
4242}, rad={
43   "11   1  11",
44   "1 1 1 1 1 1",
45   "11  111 1 1",
46   "1 1 1 1 1 1",
47   "1 1 1 1 11e"
43    "11   1  11",
44    "1 1 1 1 1 1",
45    "11  111 1 1",
46    "1 1 1 1 1 1",
47    "1 1 1 1 11e"
4848}, braces={
49   " 1 1",
50   "1   1",
51   "1   1",
52   "1   1",
53   " 1 1e"
49    " 1 1",
50    "1   1",
51    "1   1",
52    "1   1",
53    " 1 1e"
5454}, m={
55   "1   1",
56   "11 11",
57   "1 1 1",
58   "1   1",
59   "1   1e"
55    "1   1",
56    "11 11",
57    "1 1 1",
58    "1   1",
59    "1   1e"
6060}, e={
61   "111",
62   "1",
63   "111",
64   "1",
65   "111e"
61    "111",
62    "1",
63    "111",
64    "1",
65    "111e"
6666},*/ run={
6767   "11  1 1 1  1",
6868   "1 1 1 1 11 1",
r29404r29405
8888   "  1 1 1 1",
8989   "11  1 1 111e"
9090}/*, rsv={
91   "11   11 1   1",
92   "1 1 1   1   1",
93   "11   1   1 1",
94   "1 1   1  1 1",
95   "1 1 11    1e"
91    "11   11 1   1",
92    "1 1 1   1   1",
93    "11   1   1 1",
94    "1 1   1  1 1",
95    "1 1 11    1e"
9696}*/;
9797
9898READ8_MEMBER(pc1350_state::pc1350_lcd_read)
trunk/src/mess/video/intv.c
r29404r29405
8282         for(x=0;x<40;x++)
8383         {
8484            offs = current_row*64+x;
85           
85
8686               m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
8787               videoram[offs],
8888               7, /* white */
r29404r29405
9393         {
9494            /* draw the cursor as a solid white block */
9595            /* (should use a filled rect here!) */
96           
96
9797               m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
9898               191, /* a block */
9999               7,   /* white   */
trunk/src/mess/video/osi.c
r29404r29405
158158   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
159159   MCFG_SCREEN_REFRESH_RATE(50)
160160   MCFG_SCREEN_UPDATE_DRIVER(uk101_state, screen_update)
161   MCFG_SCREEN_SIZE(64*8, 16*16)   
161   MCFG_SCREEN_SIZE(64*8, 16*16)
162162   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
163163   MCFG_SCREEN_PALETTE("palette")
164164
trunk/src/mess/video/tmc600.c
r29404r29405
127127   // video hardware
128128   MCFG_CDP1869_SCREEN_PAL_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_PAL)
129129   MCFG_TIMER_DRIVER_ADD_PERIODIC("blink", tmc600_state, blink_tick, attotime::from_hz(2))
130   
130
131131   MCFG_GFXDECODE_ADD("gfxdecode", CDP1869_TAG":palette", tmc600)
132132
133133   // sound hardware
r29404r29405
135135   MCFG_CDP1869_ADD(CDP1869_TAG, CDP1869_DOT_CLK_PAL, cdp1869_page_ram)
136136   MCFG_CDP1869_COLOR_CLOCK(CDP1869_COLOR_CLK_PAL)
137137   MCFG_CDP1869_CHAR_PCB_READ_OWNER(tmc600_state, tmc600_pcb_r)
138   MCFG_CDP1869_CHAR_RAM_READ_OWNER(tmc600_state, tmc600_char_ram_r)   
138   MCFG_CDP1869_CHAR_RAM_READ_OWNER(tmc600_state, tmc600_char_ram_r)
139139   MCFG_CDP1869_PAL_NTSC_CALLBACK(VCC)
140140   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
141141MACHINE_CONFIG_END
trunk/src/mess/video/abc800.c
r29404r29405
7171void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
7272{
7373   const pen_t *pen = m_palette->pens();
74   
74
7575   UINT16 addr = 0;
7676
7777   for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 480); y += 2)
r29404r29405
201201void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
202202{
203203   UINT16 addr = 0;
204   
204
205205   const pen_t *pen = m_palette->pens();
206206
207207   for (int y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++)
trunk/src/mess/video/vtvideo.c
r29404r29405
1010    ----------------------------------
1111    - TESTS REQUIRED : do line and character attributes (plus combinations) match real hardware?
1212
13   - JUMPY SOFT SCROLL : Soft scroll *should* be synced with beam or DMA (line linking/unlinking is done during VBI, in less than 550ms).
13    - JUMPY SOFT SCROLL : Soft scroll *should* be synced with beam or DMA (line linking/unlinking is done during VBI, in less than 550ms).
1414                          See 4.7.4 and up in VT manual.
1515
1616    - UNDOCUMENTED FEATURES of DC011 / DC012 (CLUES WANTED)
r29404r29405
253253         // set higher part scroll
254254         m_scroll_latch = (m_scroll_latch & 0x03) | ((data & 0x03) << 2);
255255
256         m_scroll_latch_valid = 1; // MSB is written last.
256         m_scroll_latch_valid = 1; // MSB is written last.
257257      }
258258   }
259259   else
r29404r29405
570570      // Offset to bitmap in char-rom (used later below)
571571      int i = scan_line;
572572
573       // Affects 'i'  / 'y_preset' / 'scan_line' (= LOOP VARIABLE)
574        if ( m_scroll_latch_valid == 1)
575       {
576       // **** START IF SCROLL REGION:
577       if ( (old_scroll_region == 0) && (scroll_region == 1) )
578       {   
573      // Affects 'i'  / 'y_preset' / 'scan_line' (= LOOP VARIABLE)
574      if ( m_scroll_latch_valid == 1)
575      {
576         // **** START IF SCROLL REGION:
577         if ( (old_scroll_region == 0) && (scroll_region == 1) )
578         {
579579         if (scan_line == 0)  // * EXECUTED ONCE *
580         {   
581             scan_line = m_scroll_latch; // write less lines  ! SIDE EFFECT ON LOOP !
580         {
581            scan_line = m_scroll_latch; // write less lines  ! SIDE EFFECT ON LOOP !
582582            i = m_scroll_latch;         // set hard offset to char-rom
583583         }
584      }
584         }
585585
586       // **** MIDDLE OF REGION:
587       if ( (old_scroll_region == 1) && (scroll_region == 1) )
588       {
589         if (   ( y * 10 + scan_line - m_scroll_latch ) >=    0 )
590                  y_preset = y * 10 + scan_line - m_scroll_latch;
591       }
586         // **** MIDDLE OF REGION:
587         if ( (old_scroll_region == 1) && (scroll_region == 1) )
588         {
589         if (    ( y * 10 + scan_line - m_scroll_latch ) >=   0 )
590                  y_preset = y * 10 + scan_line - m_scroll_latch;
591         }
592592
593       // **** END OF SCROLL REGION:
594       if ( (old_scroll_region == 1) && (scroll_region == 0) )
595       {
593         // **** END OF SCROLL REGION:
594         if ( (old_scroll_region == 1) && (scroll_region == 0) )
595         {
596596         if (i > (9 - m_scroll_latch) )
597         {   old_scroll_region = m_scroll_latch_valid; // keep track
598            return;                     // WHAT HAPPENS WITH THE REST OF THE LINE (BLANK ?)
597         {   old_scroll_region = m_scroll_latch_valid; // keep track
598            return;                         // WHAT HAPPENS WITH THE REST OF THE LINE (BLANK ?)
599599         }
600       }
601       } // (IF) scroll latch valid
600         }
601      } // (IF) scroll latch valid
602602
603603      switch (display_type)
604604      {
trunk/src/mess/video/vtvideo.h
r29404r29405
115115   MCFG_DEVICE_ADD(_tag, RAINBOW_VIDEO, 0) \
116116   MCFG_DEVICE_CONFIG(_intrf) \
117117   MCFG_VIDEO_SET_SCREEN(_screen_tag)
118   
119118
120119
120
121121#endif
trunk/src/mess/video/apollo.c
r29404r29405
17251725   m_lut_fifo(NULL),
17261726   m_bt458(NULL)
17271727{
1728   
17291728}
17301729
17311730apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, UINT32 clock, device_type type,const char *name, const char *shortname, const char *source) :
r29404r29405
18841883   memset(m_image_memory, 0, m_image_memory_size * 2);
18851884
18861885   //  register_vblank_callback(this);
1887   
1886
18881887   /* FIXME: register for VBLANK callbacks */
18891888   register_vblank_callback();
18901889}
r29404r29405
19601959
19611960
19621961READ16_MEMBER( apollo_graphics_15i::apollo_mgm_r )
1963{   
1962{
19641963   if (is_mono())
19651964   {
19661965      return apollo_mem_r(space, offset, mem_mask);
trunk/src/mess/mess.lst
r29404r29405
18851885// SWTPC S/09
18861886swtpc09   // S09, DMF2 Floppy SBUG rom - FLEX
18871887swtpc09i  // S09, DC4 Floppy + PIA IDE SBUG rom - FLEX
1888swtpc09u  // S09, DMF2 Floppy UNIBUG rom - UniFLEX
1888swtpc09u  // S09, DMF2 Floppy UNIBUG rom - UniFLEX
18891889swtpc09d3 // S09, DMF3 Floppy UNIBUG U3 rom - UniFLEX U3
18901890
18911891
r29404r29405
19551955harriet // 1990
19561956
19571957// Fanuc
1958fanucspg   // 1983
1958fanucspg    // 1983
19591959fanucs15    // 1990
19601960
19611961//********** Misc **********************************************************
trunk/src/mess/layout/pve500.lay
r29404r29405
55         <color red="0.75" green="0.0" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <element name="led" defstate="0">
1010      <disk state="1">
1111         <color red="0.75" green="0.0" blue="0.0" />
r29404r29405
1414         <color red="0.09375" green="0.0" blue="0.0" />
1515      </disk>
1616   </element>
17   
17
1818   <element name="background">
1919      <rect>
20          <bounds left="0" top="0" right="1" bottom="1" />
20         <bounds left="0" top="0" right="1" bottom="1" />
2121         <color red="0.0" green="0.0" blue="0.0" />
22      </rect>     
22      </rect>
2323   </element>
2424
2525   <view name="Default Layout">
r29404r29405
126126      </bezel>
127127      <bezel name="digit23" element="digit">
128128         <bounds x="2302" y="15" width="50" height="80" />
129      </bezel>
129      </bezel>
130130   </view>
131131</mamelayout>
trunk/src/mess/layout/rainbow.lay
r29404r29405
9494      <text string="LOCK">
9595         <color red="1.0" green="1.0" blue="1.0" />
9696      </text>
97   </element>   
97   </element>
9898   <element name="l10_comp">
9999      <text string="COMP">
100100         <color red="1.0" green="1.0" blue="1.0" />
trunk/src/mess/drivers/z80ne.c
r29404r29405
513513   MCFG_CASSETTE_ADD( "cassette", z80ne_cassettea_config )
514514   MCFG_CASSETTE_ADD( "cassette2", z80ne_cassetteb_config )
515515
516    MCFG_DEVICE_ADD("lx388_kr2376", KR2376, 50000)
516   MCFG_DEVICE_ADD("lx388_kr2376", KR2376, 50000)
517517
518518   /* video hardware */
519519   MCFG_SCREEN_MC6847_PAL_ADD("lx388", "mc6847")
r29404r29405
541541   MCFG_CASSETTE_ADD( "cassette", z80ne_cassettea_config )
542542   MCFG_CASSETTE_ADD( "cassette2", z80ne_cassetteb_config )
543543
544    MCFG_DEVICE_ADD("lx388_kr2376", KR2376, 50000)
544   MCFG_DEVICE_ADD("lx388_kr2376", KR2376, 50000)
545545
546546   /* video hardware */
547547   MCFG_SCREEN_MC6847_PAL_ADD("lx388", "mc6847")
trunk/src/mess/drivers/apf.c
r29404r29405
318318static INPUT_PORTS_START( apfm1000 )
319319
320320/*
321      This simple Basic program can be used to read the joysticks and the keyboard:
321       This simple Basic program can be used to read the joysticks and the keyboard:
322322
323      10 PRINT KEY$(n);
324      20 GOTO 10
323       10 PRINT KEY$(n);
324       20 GOTO 10
325325
326      where n = 0, 1 or 2 - 0 = keyboard, 1,2 = joysticks #1 and #2
326       where n = 0, 1 or 2 - 0 = keyboard, 1,2 = joysticks #1 and #2
327327
328      When reading the keyboard KEY$(0) returns the character associated to the key, with the
329      following exceptions:
328       When reading the keyboard KEY$(0) returns the character associated to the key, with the
329       following exceptions:
330330
331      Ctrl =    CHR$(1)
332      Rept =    CHR$(2)
333      Here Is = CHR$(4)
334      Rubout =  CHR$(8)
331       Ctrl =    CHR$(1)
332       Rept =    CHR$(2)
333       Here Is = CHR$(4)
334       Rubout =  CHR$(8)
335335
336      When reading the joysticks, KEY$() = "N", "S", "E", "W" for the directions
337                                           "0" - "9" for the keypad digits
338                                           "?" for "Cl"
339                                           "!" for "En"
336       When reading the joysticks, KEY$() = "N", "S", "E", "W" for the directions
337                                            "0" - "9" for the keypad digits
338                                            "?" for "Cl"
339                                            "!" for "En"
340340
341341
342342  ? player right is player 1
trunk/src/mess/drivers/paso1600.c
r29404r29405
352352   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
353353   MCFG_SCREEN_UPDATE_DRIVER(paso1600_state, screen_update_paso1600)
354354   MCFG_SCREEN_PALETTE("palette")
355   
355
356356   MCFG_GFXDECODE_ADD("gfxdecode", "palette", paso1600)
357357   MCFG_PALETTE_ADD("palette", 8)
358358//  MCFG_PALETTE_INIT(black_and_white)
trunk/src/mess/drivers/vt320.c
r29404r29405
9494   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
9595   MCFG_SCREEN_UPDATE_DRIVER(vt320_state, screen_update_vt320)
9696   MCFG_SCREEN_PALETTE("palette")
97   
97
9898   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
9999
100100   /* internal ram */
trunk/src/mess/drivers/mbc200.c
r29404r29405
271271   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
272272   MCFG_SCREEN_UPDATE_DRIVER(mbc200_state, screen_update_mbc200)
273273   MCFG_SCREEN_PALETTE("palette")
274   
274
275275   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mbc200)
276276   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
277277
trunk/src/mess/drivers/dct11em.c
r29404r29405
6262   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
6363   MCFG_SCREEN_UPDATE_DRIVER(dct11em_state, screen_update_dct11em)
6464   MCFG_SCREEN_PALETTE("palette")
65   
65
6666   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
6767MACHINE_CONFIG_END
6868
trunk/src/mess/drivers/ptcsol.c
r29404r29405
758758   MCFG_SCREEN_SIZE(576, 208)
759759   MCFG_SCREEN_VISIBLE_AREA(0, 575, 0, 207)
760760   MCFG_SCREEN_PALETTE("palette")
761   
761
762762   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sol20)
763763   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
764764
trunk/src/mess/drivers/victor9k.c
r29404r29405
629629
630630/*
631631
632   bit     description
632    bit     description
633633
634   PA0     E0
635   PA1     E1
636   PA2     I1
637   PA3     E2
638   PA4     E4
639   PA5     E5
640   PA6     I7
641   PA7     E6
634    PA0     E0
635    PA1     E1
636    PA2     I1
637    PA3     E2
638    PA4     E4
639    PA5     E5
640    PA6     I7
641    PA7     E6
642642
643643*/
644644
trunk/src/mess/drivers/ip22.c
r29404r29405
110110   m_dac(*this, "dac"),
111111   m_kbdc8042(*this, "kbdc")
112112   { }
113   
113
114114   required_device<cpu_device> m_maincpu;
115115   required_device<wd33c93_device> m_wd33c93;
116116   required_shared_ptr<UINT32> m_unkpbus0;
r29404r29405
16231623   MCFG_PALETTE_ADD("palette", 65536)
16241624
16251625   MCFG_NEWPORT_ADD("newport")
1626   
1626
16271627   MCFG_DEVICE_ADD("sgi_mc", SGI_MC, 0)
16281628
16291629   MCFG_DEVICE_ADD("lpt_0", PC_LPT, 0)
trunk/src/mess/drivers/socrates.c
r29404r29405
127127   required_device<cpu_device> m_maincpu;
128128   required_device<socrates_snd_device> m_sound;
129129   required_device<screen_device> m_screen;
130   
130
131131   rgb_t m_palette_val[256];
132132
133133   UINT8 m_data[8];
r29404r29405
14591459   MCFG_SCREEN_SIZE(256, 224)
14601460   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1)
14611461   MCFG_SCREEN_PALETTE("palette")
1462   
1462
14631463   MCFG_PALETTE_ADD("palette", 256)
14641464   MCFG_PALETTE_INIT_OWNER(socrates_state, socrates)
14651465
trunk/src/mess/drivers/amstrad.c
r29404r29405
361361
362362static INPUT_PORTS_START( amx_mouse )
363363   PORT_START("mouse_input1")
364   PORT_BIT(0xff , 0, IPT_MOUSE_X)   PORT_SENSITIVITY(100) PORT_KEYDELTA(10)   PORT_PLAYER(1) PORT_CONDITION("controller_type", 0x01, EQUALS, 0x01)
364   PORT_BIT(0xff , 0, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) PORT_CONDITION("controller_type", 0x01, EQUALS, 0x01)
365365
366366   PORT_START("mouse_input2")
367   PORT_BIT(0xff , 0, IPT_MOUSE_Y)   PORT_SENSITIVITY(100) PORT_KEYDELTA(10)   PORT_PLAYER(1) PORT_CONDITION("controller_type", 0x01, EQUALS, 0x01)
367   PORT_BIT(0xff , 0, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) PORT_CONDITION("controller_type", 0x01, EQUALS, 0x01)
368368
369369   PORT_START("mouse_input3")
370370   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("Left mouse button") PORT_CODE(MOUSECODE_BUTTON1) PORT_CONDITION("controller_type", 0x01, EQUALS, 0x01)
r29404r29405
10521052   MCFG_SOUND_REPLACE("ay", AY8912, XTAL_16MHz / 16)
10531053   MCFG_SOUND_CONFIG(ay8912_interface)
10541054   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1055   
1055
10561056   MCFG_PALETTE_MODIFY("palette")
10571057   MCFG_PALETTE_ENTRIES(32+64)
10581058   MCFG_PALETTE_INIT_OWNER(amstrad_state,aleste)
trunk/src/mess/drivers/portfoli.c
r29404r29405
844844   MCFG_SCREEN_SIZE(240, 64)
845845   MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 64-1)
846846   MCFG_SCREEN_PALETTE("palette")
847   
847
848848   MCFG_DEFAULT_LAYOUT(layout_lcd)
849849
850850   MCFG_PALETTE_ADD("palette", 2)
trunk/src/mess/drivers/pcw16.c
r29404r29405
10811081   MCFG_RAM_DEFAULT_SIZE("2M")
10821082   MCFG_INTEL_E28F008SA_ADD("flash0")
10831083   MCFG_INTEL_E28F008SA_ADD("flash1")
1084   
1084
10851085   MCFG_AT_KEYB_ADD("at_keyboard", 3, WRITELINE(pcw16_state, pcw16_keyboard_callback))
10861086
10871087   /* video ints */
trunk/src/mess/drivers/swtpc09.c
r29404r29405
11/**************************************************************************
22
3   SWTPC S/09 Mess driver
4   Robert Justice ,2009-2014
5   
6   Emulates four different fixed combinations of hardware
7   1. swtpc09
8      MP-09 with SBUG rom, MP-ID, MP-S2, DMF2.
9      Will boot Flex operating system
10   2. swtpc09i
11      MP-09 with SBUG rom + HDrom, MP-ID, MP-S2, DMF2, PIAIDE.
12      Will boot Flex operating system
13      TODO: finish ide part and get this one working.
14   3. swtpc09u
15      MP-09 with UniBUG rom, MP-ID, MP-S2, DMF2.
16      Will boot UniFlex operating system
17   4. swtpc09d3
18      MP-09 with UniBUG U3 rom, MP-ID, MP-S2, DMF3.
19      Will boot UniFlex operating system
20      TODO: add Harddisk support, DMF3 has WD1000 interface
21     
3    SWTPC S/09 Mess driver
4    Robert Justice ,2009-2014
5
6    Emulates four different fixed combinations of hardware
7    1. swtpc09
8       MP-09 with SBUG rom, MP-ID, MP-S2, DMF2.
9       Will boot Flex operating system
10    2. swtpc09i
11       MP-09 with SBUG rom + HDrom, MP-ID, MP-S2, DMF2, PIAIDE.
12       Will boot Flex operating system
13       TODO: finish ide part and get this one working.
14    3. swtpc09u
15       MP-09 with UniBUG rom, MP-ID, MP-S2, DMF2.
16       Will boot UniFlex operating system
17    4. swtpc09d3
18       MP-09 with UniBUG U3 rom, MP-ID, MP-S2, DMF3.
19       Will boot UniFlex operating system
20       TODO: add Harddisk support, DMF3 has WD1000 interface
21
2222***************************************************************************/
2323
2424#include "emu.h"
r29404r29405
5252 F024 - F024  DMF3 Drive select register
5353 F025 - F025  DMF3 DMA Address register
5454 F040 - F04F  DMF3 6522 VIA
55
55
5656***************************************************************************/
5757
5858/* Address map is dynamically setup when DAT memory is written to  */
5959/* only ROM from FF00-FFFF and DAT memory at FFF0-FFFF (write only) is guaranteed always*/
6060
6161static ADDRESS_MAP_START(swtpc09_mem, AS_PROGRAM, 8, swtpc09_state)
62    AM_RANGE(0xff00, 0xffef) AM_ROM
63    AM_RANGE(0xfff0, 0xffff) AM_ROM AM_WRITE(dat_w)
62   AM_RANGE(0xff00, 0xffef) AM_ROM
63   AM_RANGE(0xfff0, 0xffff) AM_ROM AM_WRITE(dat_w)
6464ADDRESS_MAP_END
6565
6666
r29404r29405
146146/* Machine driver */
147147/* MPU09, MPID, MPS2 DMF2 */
148148static MACHINE_CONFIG_START( swtpc09, swtpc09_state )
149    /* basic machine hardware */
150    MCFG_CPU_ADD("maincpu", M6809, 1000000)
151    MCFG_CPU_PROGRAM_MAP(swtpc09_mem)
149   /* basic machine hardware */
150   MCFG_CPU_ADD("maincpu", M6809, 1000000)
151   MCFG_CPU_PROGRAM_MAP(swtpc09_mem)
152152
153153   /* video hardware */
154154   MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal")
155155   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd))
156156   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts))
157   
158     MCFG_PTM6840_ADD("ptm", swtpc09_6840_intf)
159     
157
158   MCFG_PTM6840_ADD("ptm", swtpc09_6840_intf)
159
160160   MCFG_DEVICE_ADD("pia", PIA6821, 0)
161161   MCFG_PIA_READPA_HANDLER(READ8(swtpc09_state, pia0_a_r))
162162   MCFG_PIA_READPA_HANDLER(READ8(swtpc09_state, pia0_ca1_r))
163163   MCFG_PIA_IRQA_HANDLER(WRITELINE(swtpc09_state, pia0_irq_a))
164164
165     MCFG_DEVICE_ADD("acia", ACIA6850, 0)
165   MCFG_DEVICE_ADD("acia", ACIA6850, 0)
166166   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
167167   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts))
168    MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(swtpc09_state, acia_interrupt))
168   MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(swtpc09_state, acia_interrupt))
169169
170170   MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
171171   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock))
172   
173    MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface )
174    MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
175172
173   MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface )
174   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
176175
176
177177MACHINE_CONFIG_END
178178
179179/* MPU09, MPID, MPS2 DC4 PIAIDE*/
180180static MACHINE_CONFIG_START( swtpc09i, swtpc09_state )
181    /* basic machine hardware */
182    MCFG_CPU_ADD("maincpu", M6809, 1000000)
183    MCFG_CPU_PROGRAM_MAP(swtpc09_mem)
181   /* basic machine hardware */
182   MCFG_CPU_ADD("maincpu", M6809, 1000000)
183   MCFG_CPU_PROGRAM_MAP(swtpc09_mem)
184184
185185   /* video hardware */
186186   MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal")
187187   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd))
188188   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts))
189189
190     MCFG_PTM6840_ADD("ptm", swtpc09_6840_intf)
190   MCFG_PTM6840_ADD("ptm", swtpc09_6840_intf)
191191
192192   MCFG_DEVICE_ADD("pia", PIA6821, 0)
193193   MCFG_PIA_READPA_HANDLER(READ8(swtpc09_state, pia0_a_r))
194194   MCFG_PIA_READPA_HANDLER(READ8(swtpc09_state, pia0_ca1_r))
195195   MCFG_PIA_IRQA_HANDLER(WRITELINE(swtpc09_state, pia0_irq_a))
196196
197     MCFG_DEVICE_ADD("acia", ACIA6850, 0)
197   MCFG_DEVICE_ADD("acia", ACIA6850, 0)
198198   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
199199   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts))
200    MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(swtpc09_state, acia_interrupt))
200   MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(swtpc09_state, acia_interrupt))
201201
202202   MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
203203   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock))
204204
205    MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface )
206    MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
205   MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface )
206   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
207207
208     MCFG_DEVICE_ADD("piaide", PIA6821, 0)
208   MCFG_DEVICE_ADD("piaide", PIA6821, 0)
209209
210210/* old start to adding ide support, needs major updating */
211211/* this is to support an add on card driving IDE from a PIA */
212//    MCFG_HARDDISK_ADD("harddisk")
213//   MCFG_IDE_CONTROLLER_ADD("ide", NULL)
214//   MCFG_IDE_CONTROLLER_REGIONS("harddisk", NULL)
215//    MCFG_IDE_CONTROLLER_ADD( "ide", ide_intf, "hdd", NULL, false )   /* FIXME */ bebox
212//  MCFG_HARDDISK_ADD("harddisk")
213//  MCFG_IDE_CONTROLLER_ADD("ide", NULL)
214//  MCFG_IDE_CONTROLLER_REGIONS("harddisk", NULL)
215//  MCFG_IDE_CONTROLLER_ADD( "ide", ide_intf, "hdd", NULL, false )  /* FIXME */ bebox
216216
217217
218218MACHINE_CONFIG_END
r29404r29405
220220
221221/* MPU09, MPID, MPS2 DMF3 */
222222static MACHINE_CONFIG_START( swtpc09d3, swtpc09_state )
223    /* basic machine hardware */
224    MCFG_CPU_ADD("maincpu", M6809, 2000000)
225    MCFG_CPU_PROGRAM_MAP(swtpc09_mem)
223   /* basic machine hardware */
224   MCFG_CPU_ADD("maincpu", M6809, 2000000)
225   MCFG_CPU_PROGRAM_MAP(swtpc09_mem)
226226
227227   /* video hardware */
228228   MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal")
229229   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd))
230230   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts))
231231
232     MCFG_PTM6840_ADD("ptm", swtpc09_6840_intf)
233     
232   MCFG_PTM6840_ADD("ptm", swtpc09_6840_intf)
233
234234   MCFG_DEVICE_ADD("pia", PIA6821, 0)
235235   MCFG_PIA_READPA_HANDLER(READ8(swtpc09_state, pia0_a_r))
236236   MCFG_PIA_READPA_HANDLER(READ8(swtpc09_state, pia0_ca1_r))
237237   MCFG_PIA_IRQA_HANDLER(WRITELINE(swtpc09_state, pia0_irq_a))
238   
239     MCFG_DEVICE_ADD("acia", ACIA6850, 0)
238
239   MCFG_DEVICE_ADD("acia", ACIA6850, 0)
240240   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
241241   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts))
242    MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(swtpc09_state, acia_interrupt))
242   MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(swtpc09_state, acia_interrupt))
243243   MCFG_ACIA6850_IRQ_HANDLER(DEVWRITELINE("maincpu", m6809_device, irq_line))
244   
244
245245   MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
246246   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock))
247247
248    MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface )
249    MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
248   MCFG_FD1793_ADD("fdc", swtpc09_wd17xx_interface )
249   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
250250
251     MCFG_DEVICE_ADD("via", VIA6522, XTAL_4MHz / 4)
251   MCFG_DEVICE_ADD("via", VIA6522, XTAL_4MHz / 4)
252252   MCFG_VIA6522_READPA_HANDLER(READ8(swtpc09_state, dmf3_via_read_porta))
253253   MCFG_VIA6522_READPB_HANDLER(READ8(swtpc09_state, dmf3_via_read_portb))
254254   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(swtpc09_state, dmf3_via_write_porta))
255255   //MCFG_VIA6522_CA1_HANDLER(WRITELINE(swtpc09_state, dmf3_via_write_ca1))
256256   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(swtpc09_state, dmf3_via_irq))
257   
258257
258
259259MACHINE_CONFIG_END
260260
261261
262262/* ROM definition */
263263ROM_START( swtpc09 )
264    ROM_REGION( 0x100000, "maincpu", 0 )
265    ROM_LOAD ( "sbugh1-8.bin", 0xf800, 0x0800, CRC(10a045a7) SHA1(de547b77653951c7424a069520d52c5b0432e98d) )
264   ROM_REGION( 0x100000, "maincpu", 0 )
265   ROM_LOAD ( "sbugh1-8.bin", 0xf800, 0x0800, CRC(10a045a7) SHA1(de547b77653951c7424a069520d52c5b0432e98d) )
266266ROM_END
267267
268268ROM_START( swtpc09i )
269    ROM_REGION( 0x100000, "maincpu", 0 )
270    ROM_LOAD ( "hd-rom.bin", 0xe800, 0x0800, CRC(b898b4d7) SHA1(2806633eda7da4e9a243fc534f15526ee928b6bc) )
271    ROM_LOAD ( "sbugh1-8.bin", 0xf800, 0x0800, CRC(10a045a7) SHA1(de547b77653951c7424a069520d52c5b0432e98d) )
269   ROM_REGION( 0x100000, "maincpu", 0 )
270   ROM_LOAD ( "hd-rom.bin", 0xe800, 0x0800, CRC(b898b4d7) SHA1(2806633eda7da4e9a243fc534f15526ee928b6bc) )
271   ROM_LOAD ( "sbugh1-8.bin", 0xf800, 0x0800, CRC(10a045a7) SHA1(de547b77653951c7424a069520d52c5b0432e98d) )
272272ROM_END
273273
274274ROM_START( swtpc09u )
275    ROM_REGION( 0x100000, "maincpu", 0 )
276    ROM_LOAD ( "unibug.bin", 0xf800, 0x0800, CRC(92e1cbf2) SHA1(db00f17ee9accdbfa1775fe0162d3556159b8e70) )
275   ROM_REGION( 0x100000, "maincpu", 0 )
276   ROM_LOAD ( "unibug.bin", 0xf800, 0x0800, CRC(92e1cbf2) SHA1(db00f17ee9accdbfa1775fe0162d3556159b8e70) )
277277ROM_END
278278
279279ROM_START( swtpc09d3 )
280    ROM_REGION( 0x100000, "maincpu", 0 )
281    ROM_LOAD ( "uos3.bin", 0xf800, 0x0800, CRC(e95eb3e0) SHA1(3e971d3b7e143bc87e4b506e18a8c928c089c25a) )
280   ROM_REGION( 0x100000, "maincpu", 0 )
281   ROM_LOAD ( "uos3.bin", 0xf800, 0x0800, CRC(e95eb3e0) SHA1(3e971d3b7e143bc87e4b506e18a8c928c089c25a) )
282282ROM_END
283283
284284/* Driver */
trunk/src/mess/drivers/tandy1t.c
r29404r29405
434434   PORT_MODIFY("pc_keyboard_2")
435435   PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Cursor Up") PORT_CODE(KEYCODE_UP) /*                             29  A9 */
436436   PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Cursor Left") PORT_CODE(KEYCODE_LEFT) /*                             2B  AB */
437   
437
438438   PORT_MODIFY("pc_keyboard_3")
439439   PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE   /* Caps Lock                   3A  BA */
440440
r29404r29405
566566
567567   MCFG_ISA8_SLOT_ADD("mb:isa", "isa_fdc", pc_isa8_cards, "fdc_xt", true)
568568   MCFG_SLOT_OPTION_MACHINE_CONFIG("fdc_xt", cfg_fdc_35)
569   
569
570570   MCFG_ISA8_SLOT_ADD("mb:isa", "isa_lpt", pc_isa8_cards, "lpt", true)
571571   MCFG_ISA8_SLOT_ADD("mb:isa", "isa_com", pc_isa8_cards, "com", true)
572   
572
573573   MCFG_PC_JOY_ADD("pc_joy")
574574   MCFG_PC_KEYB_ADD("pc_keyboard", DEVWRITELINE("mb:pic8259", pic8259_device, ir1_w))
575575
r29404r29405
579579MACHINE_CONFIG_END
580580
581581static MACHINE_CONFIG_START( t1000hx, tandy1000_state )
582   MCFG_CPU_ADD("maincpu", I8088, 8000000)
582   MCFG_CPU_ADD("maincpu", I8088, 8000000)
583583   MCFG_CPU_PROGRAM_MAP(tandy1000_map)
584584   MCFG_CPU_IO_MAP(tandy1000_io)
585585
586586   MCFG_FRAGMENT_ADD(tandy1000_common)
587   
587
588588   // plus cards are isa with a nonstandard conntector
589589   MCFG_ISA8_SLOT_ADD("mb:isa", "plus1", pc_isa8_cards, NULL, false)
590590MACHINE_CONFIG_END
r29404r29405
809809COMP( 1989, t1000rl,    ibm5150,    0,          t1000_16,   tandy1t, tandy1000_state,    t1000hx,    "Tandy Radio Shack", "Tandy 1000 RL", 0)
810810COMP( 1989, t1000tl2,   ibm5150,    0,          t1000_286,  tandy1t, tandy1000_state,    t1000hx,    "Tandy Radio Shack", "Tandy 1000 TL/2", 0)
811811COMP( 1988, t1000sl2,   ibm5150,    0,          t1000_16_8, tandy1t, tandy1000_state,    t1000sl,    "Tandy Radio Shack", "Tandy 1000 SL/2", 0)
812
trunk/src/mess/drivers/pc9801.c
r29404r29405
452452      m_beeper(*this, "beeper"),
453453      m_ram(*this, RAM_TAG),
454454      m_gfxdecode(*this, "gfxdecode"),
455      m_palette(*this, "palette")
455      m_palette(*this, "palette")
456456   {
457457   }
458458
r29404r29405
683683   DECLARE_WRITE8_MEMBER(pc9821_ext2_video_ff_w);
684684
685685   DECLARE_FLOPPY_FORMATS( floppy_formats );
686    UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels );
687    UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text );
686   UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels );
687   UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text );
688688
689689private:
690690   UINT8 m_sdip_read(UINT16 port, UINT8 sdip_offset);
r29404r29405
726726   DECLARE_WRITE8_MEMBER(ppi_fdd_portc_w);
727727
728728   DECLARE_WRITE_LINE_MEMBER(fdc_2dd_irq);
729    DECLARE_WRITE_LINE_MEMBER(pc9801rs_fdc_irq);
730    DECLARE_WRITE_LINE_MEMBER(pc9801rs_fdc_drq);
729   DECLARE_WRITE_LINE_MEMBER(pc9801rs_fdc_irq);
730   DECLARE_WRITE_LINE_MEMBER(pc9801rs_fdc_drq);
731731
732732   DECLARE_READ8_MEMBER(ppi_mouse_porta_r);
733733   DECLARE_WRITE8_MEMBER(ppi_mouse_porta_w);
r29404r29405
35663566}
35673567
35683568static MACHINE_CONFIG_FRAGMENT( pc9801_keyboard )
3569    MCFG_DEVICE_ADD("keyb", PC9801_KBD, 53)
3570    MCFG_PC9801_KBD_IRQ_CALLBACK(WRITELINE(pc9801_state, keyboard_irq))
3569   MCFG_DEVICE_ADD("keyb", PC9801_KBD, 53)
3570   MCFG_PC9801_KBD_IRQ_CALLBACK(WRITELINE(pc9801_state, keyboard_irq))
35713571MACHINE_CONFIG_END
35723572
35733573static MACHINE_CONFIG_FRAGMENT( pc9801_mouse )
r29404r29405
36273627   MCFG_DEVICE_ADD(UPD8251_TAG, I8251, 0)
36283628
36293629   MCFG_UPD765A_ADD("upd765_2hd", false, true)
3630    MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("pic8259_slave", pic8259_device, ir3_w))
3631    MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8237", am9517a_device, dreq2_w)) MCFG_DEVCB_INVERT
3630   MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("pic8259_slave", pic8259_device, ir3_w))
3631   MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8237", am9517a_device, dreq2_w)) MCFG_DEVCB_INVERT
36323632   MCFG_UPD765A_ADD("upd765_2dd", false, true)
3633    MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(pc9801_state, fdc_2dd_irq))
3634    MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8237", am9517a_device, dreq3_w)) MCFG_DEVCB_INVERT
3633   MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(pc9801_state, fdc_2dd_irq))
3634   MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8237", am9517a_device, dreq3_w)) MCFG_DEVCB_INVERT
36353635   MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
36363636   MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
36373637   MCFG_FLOPPY_DRIVE_ADD("upd765_2dd:0", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
r29404r29405
36543654   MCFG_SCREEN_SIZE(640, 480)
36553655   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
36563656
3657    MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
3658    MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
3659    MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
3660    MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))   
3657   MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
3658   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
3659   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
3660   MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))
36613661
3662    MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
3663    MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
3664    MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
3662   MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
3663   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
3664   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
36653665
36663666   MCFG_PALETTE_ADD("palette", 16)
36673667   MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
r29404r29405
37113711   MCFG_DEVICE_ADD(UPD8251_TAG, I8251, 0)
37123712
37133713   MCFG_UPD765A_ADD("upd765_2hd", false, true)
3714    MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(pc9801_state, pc9801rs_fdc_irq))
3715    MCFG_UPD765_DRQ_CALLBACK(WRITELINE(pc9801_state, pc9801rs_fdc_drq))
3714   MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(pc9801_state, pc9801rs_fdc_irq))
3715   MCFG_UPD765_DRQ_CALLBACK(WRITELINE(pc9801_state, pc9801rs_fdc_drq))
37163716   //"upd765_2dd"
37173717   MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
37183718   MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
r29404r29405
37323732   MCFG_SCREEN_SIZE(640, 480)
37333733   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
37343734
3735    MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
3736    MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
3737    MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
3738    MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))   
3735   MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
3736   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
3737   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
3738   MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))
37393739
3740    MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
3741    MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
3742    MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
3740   MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
3741   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
3742   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
37433743
37443744   MCFG_PALETTE_ADD("palette", 16+16)
37453745   MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
r29404r29405
38033803   MCFG_DEVICE_ADD(UPD8251_TAG, I8251, 0)
38043804
38053805   MCFG_UPD765A_ADD("upd765_2hd", false, true)
3806    MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("pic8259_slave", pic8259_device, ir3_w))
3807    MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8237", am9517a_device, dreq2_w)) MCFG_DEVCB_INVERT
3806   MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("pic8259_slave", pic8259_device, ir3_w))
3807   MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8237", am9517a_device, dreq2_w)) MCFG_DEVCB_INVERT
38083808   //"upd765_2dd"
38093809   MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
38103810   MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", pc9801_state::floppy_formats)
r29404r29405
38243824   MCFG_SCREEN_SIZE(640, 480)
38253825   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
38263826
3827    MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
3828    MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
3829    MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
3830    MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))   
3827   MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
3828   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
3829   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
3830   MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))
38313831
3832    MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
3833    MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
3834    MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
3832   MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
3833   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
3834   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
38353835
38363836   MCFG_PALETTE_ADD("palette", 16+16+256)
38373837   MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
trunk/src/mess/drivers/qx10.c
r29404r29405
7070      m_vram_bank(0),
7171      m_maincpu(*this, "maincpu"),
7272      m_ram(*this, RAM_TAG),
73      m_palette(*this, "palette")
73      m_palette(*this, "palette")
7474   {
7575   }
7676
r29404r29405
849849   MCFG_I8255_ADD("i8255", qx10_i8255_interface)
850850   MCFG_I8237_ADD("8237dma_1", MAIN_CLK/4, qx10_dma8237_1_interface)
851851   MCFG_I8237_ADD("8237dma_2", MAIN_CLK/4, qx10_dma8237_2_interface)
852   
852
853853   MCFG_DEVICE_ADD("upd7220", UPD7220, MAIN_CLK/6) // unk clock
854854   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_map)
855855   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(qx10_state, hgdc_display_pixels)
trunk/src/mess/drivers/uknc.c
r29404r29405
7373   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
7474   MCFG_SCREEN_UPDATE_DRIVER(uknc_state, screen_update_uknc)
7575   MCFG_SCREEN_PALETTE("palette")
76   
76
7777   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
7878MACHINE_CONFIG_END
7979
trunk/src/mess/drivers/sv8000.c
r29404r29405
274274
275275static I8255_INTERFACE( sv8000_i8255_interface )
276276{
277    DEVCB_DRIVER_MEMBER(sv8000_state, i8255_porta_r),   /* port A read */
278    DEVCB_DRIVER_MEMBER(sv8000_state, i8255_porta_w),   /* port A write */
279    DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portb_r),   /* port B read */
280    DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portb_w),   /* port B write */
281    DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portc_r),   /* port C read */
282    DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portc_w)    /* port C write */
277   DEVCB_DRIVER_MEMBER(sv8000_state, i8255_porta_r),   /* port A read */
278   DEVCB_DRIVER_MEMBER(sv8000_state, i8255_porta_w),   /* port A write */
279   DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portb_r),   /* port B read */
280   DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portb_w),   /* port B write */
281   DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portc_r),   /* port C read */
282   DEVCB_DRIVER_MEMBER(sv8000_state, i8255_portc_w)    /* port C write */
283283};
284284
285285
r29404r29405
379379         offset = ( ( offset & 0x1fc0 ) >> 1 ) | ( offset & 0x1f );
380380         return m_videoram[offset % 0xc00];
381381      }
382       else
382      else
383383      {
384384         // 256 x 96 / 3KB
385385         return m_videoram[offset % 0xc00];
r29404r29405
455455
456456/*    YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT   INIT                  COMPANY   FULLNAME                            FLAGS */
457457CONS( 1979, sv8000, 0,      0,       sv8000,  sv8000, driver_device,   0,   "Bandai", "Super Vision 8000 (TV Jack 8000)", 0 )
458
trunk/src/mess/drivers/rm380z.c
r29404r29405
158158   MCFG_SCREEN_VISIBLE_AREA(0, (RM380Z_SCREENCOLS*(RM380Z_CHDIMX+1))-1, 0, (RM380Z_SCREENROWS*(RM380Z_CHDIMY+1))-1)
159159   MCFG_SCREEN_UPDATE_DRIVER(rm380z_state, screen_update_rm380z)
160160   MCFG_SCREEN_PALETTE("palette")
161   
161
162162   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
163163
164164   /* RAM configurations */
trunk/src/mess/drivers/apricotf.c
r29404r29405
312312   MCFG_SCREEN_SIZE(640, 256)
313313   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)
314314   MCFG_SCREEN_PALETTE("palette")
315   
315
316316   MCFG_PALETTE_ADD("palette", 16)
317317   MCFG_GFXDECODE_ADD("gfxdecode", "palette", act_f1)
318318
trunk/src/mess/drivers/hprot1.c
r29404r29405
158158/*
159159WRITE8_MEMBER(hprot1_state::henry_io_w)
160160{
161   static UINT8 p0=0, p1=0, p2=0, p3=0; 
162   switch (offset)
163   {
164      case 0x00:
165      {
166         if (data != p0)
167         {
168            p0=data;
161    static UINT8 p0=0, p1=0, p2=0, p3=0;
162    switch (offset)
163    {
164        case 0x00:
165        {
166            if (data != p0)
167            {
168                p0=data;
169169#if LOG_IO_PORTS
170            printf("Write to P0: %02X\n", data);
170                printf("Write to P0: %02X\n", data);
171171#endif
172         }
173         break;
174      }
175      case 0x01:
176      {
177         if (data != p1)
178         {
179            p1=data;
180            if (data != 0xFF && data != 0xEF)
172            }
173            break;
174        }
175        case 0x01:
176        {
177            if (data != p1)
178            {
179                p1=data;
180                if (data != 0xFF && data != 0xEF)
181181#if LOG_IO_PORTS
182            printf("Write to P1: %02X\n", data);
182                printf("Write to P1: %02X\n", data);
183183#endif
184         }
185         break;
186      }
187      case 0x02:
188      {
189         if (data != p2)
190         {
191            p2=data;
184            }
185            break;
186        }
187        case 0x02:
188        {
189            if (data != p2)
190            {
191                p2=data;
192192#if LOG_IO_PORTS
193            printf("Write to P2: %02X\n", data);
193                printf("Write to P2: %02X\n", data);
194194#endif
195         }
196         break;
197      }
198      case 0x03:
199      {
200         if (data != p3)
201         {
202            p3=data;
195            }
196            break;
197        }
198        case 0x03:
199        {
200            if (data != p3)
201            {
202                p3=data;
203203#if LOG_IO_PORTS
204            printf("Write to P3: %02X\n", data);
204                printf("Write to P3: %02X\n", data);
205205#endif
206         }
207         break;
208      }
209   }
206            }
207            break;
208        }
209    }
210210}
211211*/
212212
r29404r29405
245245   MCFG_SCREEN_SIZE(6*16, 9*2)
246246   MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
247247   MCFG_SCREEN_PALETTE("palette")
248   
248
249249   MCFG_DEFAULT_LAYOUT(layout_lcd)
250250   MCFG_PALETTE_ADD("palette", 2)
251251   MCFG_PALETTE_INIT_OWNER(hprot1_state, hprot1)
trunk/src/mess/drivers/pcm.c
r29404r29405
327327   MCFG_SCREEN_SIZE(64*8, 16*8)
328328   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*8-1)
329329   MCFG_SCREEN_PALETTE("palette")
330   
330
331331   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pcm)
332332   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
333333
trunk/src/mess/drivers/pipbug.c
r29404r29405
7171ADDRESS_MAP_END
7272
7373static ADDRESS_MAP_START(pipbug_io, AS_IO, 8, pipbug_state)
74//   ADDRESS_MAP_UNMAP_HIGH
74//  ADDRESS_MAP_UNMAP_HIGH
7575   AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_WRITE(pipbug_ctrl_w)
7676   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READNOP // this has to return zero or the parameter to write_sense is ignored
7777ADDRESS_MAP_END
trunk/src/mess/drivers/bml3.c
r29404r29405
153153   required_device<speaker_sound_device> m_speaker;
154154   optional_device<ym2203_device> m_ym2203;
155155   required_device<acia6850_device> m_acia6850;
156public:   
156public:
157157   required_device<palette_device> m_palette;
158158};
159159
trunk/src/mess/drivers/esqasr.c
r29404r29405
5959
6060   virtual void machine_reset();
6161
62   DECLARE_DRIVER_INIT(asr);   
62   DECLARE_DRIVER_INIT(asr);
6363   DECLARE_WRITE_LINE_MEMBER(esq5506_otto_irq);
64   DECLARE_READ16_MEMBER(esq5506_read_adc);   
64   DECLARE_READ16_MEMBER(esq5506_read_adc);
6565};
6666
6767void esqasr_state::machine_reset()
trunk/src/mess/drivers/pve500.c
r29404r29405
7373static const z80sio_interface external_sio_intf =
7474{
7575   DEVCB_NULL, /* interrupt handler */
76  DEVCB_NULL, /* DTR changed handler */
76   DEVCB_NULL, /* DTR changed handler */
7777   DEVCB_NULL, /* RTS changed handler */
7878   DEVCB_NULL, /* BREAK changed handler */
7979   DEVCB_NULL, /* transmit handler */
r29404r29405
151151{
152152   //printf("dualport_ram: Right WRITE\n");
153153   dualport_7FE_data = data;
154   m_maincpu->ctc_trg1(0);   //(INT_Left)
154   m_maincpu->ctc_trg1(0); //(INT_Left)
155155}
156156
157157READ8_MEMBER(pve500_state::io_expander_r)
r29404r29405
203203                  case 128: output_set_digit_value(8*i + 7, io_LD & 0x7F); break;
204204                  default:
205205                     /*software should not do it.
206                  any idea how to emulate that in case it does? */ break;
206               any idea how to emulate that in case it does? */ break;
207207               }
208208            }
209209         }
trunk/src/mess/drivers/softbox.c
r29404r29405
413413   MCFG_COM8116_FT_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_txc))
414414
415415   MCFG_CBM_IEEE488_ADD("c8050")
416   
416
417417   MCFG_DEVICE_ADD(CORVUS_HDC_TAG, CORVUS_HDC, 0)
418418   MCFG_HARDDISK_CONFIG_ADD("harddisk1", corvus_hdc_t::hd_intf)
419419   MCFG_HARDDISK_CONFIG_ADD("harddisk2", corvus_hdc_t::hd_intf)
trunk/src/mess/drivers/geniusiq.c
r29404r29405
811811   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
812812   MCFG_SCREEN_UPDATE_DRIVER( geniusiq_state, screen_update )
813813   MCFG_SCREEN_PALETTE("palette")
814   
814
815815   MCFG_PALETTE_ADD("palette", 16)
816816   MCFG_PALETTE_INIT_OWNER(geniusiq_state, geniusiq)
817817
r29404r29405
847847   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
848848   MCFG_SCREEN_SIZE(512, 256)
849849   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
850   MCFG_SCREEN_UPDATE_DRIVER( gl8008cx_state, screen_update )   
850   MCFG_SCREEN_UPDATE_DRIVER( gl8008cx_state, screen_update )
851851MACHINE_CONFIG_END
852852
853853/* ROM definition */
trunk/src/mess/drivers/smc777.c
r29404r29405
5757   m_sn(*this, "sn1"),
5858   m_beeper(*this, "beeper"),
5959   m_gfxdecode(*this, "gfxdecode"),
60      m_palette(*this, "palette")
60      m_palette(*this, "palette")
6161   { }
6262
6363   required_device<cpu_device> m_maincpu;
r29404r29405
10951095   MCFG_PALETTE_INIT_OWNER(smc777_state, smc777)
10961096
10971097   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
1098   
1098
10991099   MCFG_MC6845_ADD("crtc", H46505, "screen", MASTER_CLOCK/2, mc6845_intf)    /* unknown clock, hand tuned to get ~60 fps */
11001100
11011101   MCFG_MB8876_ADD("fdc",smc777_mb8876_interface)
trunk/src/mess/drivers/alphatro.c
r29404r29405
8585private:
8686   UINT8 m_timer_bit;
8787   UINT8 m_cass_data[4];
88   bool m_cass_state;   
88   bool m_cass_state;
8989   emu_timer* m_sys_timer;
9090   virtual void video_start();
9191   virtual void machine_start();
r29404r29405
9797   required_device<cassette_image_device> m_cass;
9898   required_device<beep_device> m_beep;
9999   required_shared_ptr<UINT8> m_p_ram;
100public:   
100public:
101101   required_device<palette_device> m_palette;
102102};
103103
trunk/src/mess/drivers/hp9k.c
r29404r29405
161161   DECLARE_WRITE8_MEMBER(kbd_put);
162162
163163   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
164   
164
165165   required_device<gfxdecode_device> m_gfxdecode;
166166};
167167
trunk/src/mess/drivers/fanucs15.c
r29404r29405
22// copyright-holders:R. Belmont
33/***************************************************************************
44
5   Fanuc System 15
5    Fanuc System 15
66
7   2014-01-04 Skeleton driver.
7    2014-01-04 Skeleton driver.
88
9   This is a circa-1990 CNC machine with a very custom GUI, made of a
10   bunch of boards plugged into a passive backplane.
9    This is a circa-1990 CNC machine with a very custom GUI, made of a
10    bunch of boards plugged into a passive backplane.
1111
12   Possible boards include:
13   A16B-2200-0020/04B : Base 2 Board (contains 12 MHz 68020 "CNC CPU" and 1 or 2 MB of DRAM)
14   A16B-2200-0090/07A : Digital Servo 4-Axis Controller Board (no ROMs on this board)
15   A16B-2200-0121/06C : Base 0 Board (1 ROM location but position is empty. -0120 has 6081 001A)
12    Possible boards include:
13    A16B-2200-0020/04B : Base 2 Board (contains 12 MHz 68020 "CNC CPU" and 1 or 2 MB of DRAM)
14    A16B-2200-0090/07A : Digital Servo 4-Axis Controller Board (no ROMs on this board)
15    A16B-2200-0121/06C : Base 0 Board (1 ROM location but position is empty. -0120 has 6081 001A)
1616
17   A16B-2200-0131/11B : Base 1 Board (15 ROMs on this board, 4040, 9030, AB02)
18       See detailed layout and description below.
19 
20   A16B-2200-0150/03A : Conversational Board (4 ROMs on this board, 5A00, probably for Mill)
21   or
22   A16B-2200-0150/03A : Conversational Board (4 ROMs on this board, 5C30. 5C for 2 axis Lathe)
23   or
24   A16B-2200-0150/03A : Conversational Board (4 ROMs on this board, 5D30. 5D for 4 axis (twin Turret) lathe)
25      Fanuc FBI-A MB605111 (QFP100)
26      MB1422A (DIP42 - DRAM Controller)
27      51256-10 (x18)
28      MB89259A (SOP28)
29      Intel 80286-8
30      Intel 80287-8
31      MBL82288-8 (DIP10)
32      uPB8284 (DIP18)
33      24MHz & 32MHz OSC's
34      4 EPROMs
17    A16B-2200-0131/11B : Base 1 Board (15 ROMs on this board, 4040, 9030, AB02)
18        See detailed layout and description below.
3519
36   A16B-2200-0160/07B : Graphic Board (3 ROMs on this board, 6082 001A, 600B 001D, 600B 002D. 600B is for Mill)
37   or
38   A16B-2200-0160/07B : Graphic Board (3 ROMs on this board, 6082 001A, 600A 001C, 600A 001D. 600A is for Lathe)
39   Fanuc FBI-A MB605111 (QFP100)
40      HD68HC000P10 (68000 @10MHz, PLCC68)
41      HM62256-10 (x2)
42      HM53461-12 (x3)
43      HD63484 (PLCC68)
44      HD6445 (PLCC44)
45      Fanuc GBC MB652147 (PGA135)
46      MB81464-12 (x12)
47      20MHz OSC
48      3 EPROMs. 6082 is common to both mills and lathes.
49      600A is a known EPROM version required for lathes with FAPT conversational graphics.
50      600B is unknown. Possibly for mills with FAPT.
20    A16B-2200-0150/03A : Conversational Board (4 ROMs on this board, 5A00, probably for Mill)
21    or
22    A16B-2200-0150/03A : Conversational Board (4 ROMs on this board, 5C30. 5C for 2 axis Lathe)
23    or
24    A16B-2200-0150/03A : Conversational Board (4 ROMs on this board, 5D30. 5D for 4 axis (twin Turret) lathe)
25        Fanuc FBI-A MB605111 (QFP100)
26        MB1422A (DIP42 - DRAM Controller)
27        51256-10 (x18)
28        MB89259A (SOP28)
29        Intel 80286-8
30        Intel 80287-8
31        MBL82288-8 (DIP10)
32        uPB8284 (DIP18)
33        24MHz & 32MHz OSC's
34        4 EPROMs
5135
52   A20B-1003-0230/09C : Motherboard (dumb backplane, contains only slots)
53   A20B-1003-0500/01A : Additional Graphic Board for 15TTF only (for TT, connects to A16B-2200-0160 Board. No info on this PCB)
54   A20B-1003-0240/07B : Connector Assembly Unit / IO Board
55   A20B-1003-0580/01A : PMC Cassette C (16000 Step + Pascal 128KB, small PCB in a yellow plastic box, contains just 2 EPROMs)
56 
57 
58   Fanuc System 15A Base 1 Board A16B-2200-013
36    A16B-2200-0160/07B : Graphic Board (3 ROMs on this board, 6082 001A, 600B 001D, 600B 002D. 600B is for Mill)
37    or
38    A16B-2200-0160/07B : Graphic Board (3 ROMs on this board, 6082 001A, 600A 001C, 600A 001D. 600A is for Lathe)
39    Fanuc FBI-A MB605111 (QFP100)
40        HD68HC000P10 (68000 @10MHz, PLCC68)
41        HM62256-10 (x2)
42        HM53461-12 (x3)
43        HD63484 (PLCC68)
44        HD6445 (PLCC44)
45        Fanuc GBC MB652147 (PGA135)
46        MB81464-12 (x12)
47        20MHz OSC
48        3 EPROMs. 6082 is common to both mills and lathes.
49        600A is a known EPROM version required for lathes with FAPT conversational graphics.
50        600B is unknown. Possibly for mills with FAPT.
5951
60   PCB Layout
61   ----------
52    A20B-1003-0230/09C : Motherboard (dumb backplane, contains only slots)
53    A20B-1003-0500/01A : Additional Graphic Board for 15TTF only (for TT, connects to A16B-2200-0160 Board. No info on this PCB)
54    A20B-1003-0240/07B : Connector Assembly Unit / IO Board
55    A20B-1003-0580/01A : PMC Cassette C (16000 Step + Pascal 128KB, small PCB in a yellow plastic box, contains just 2 EPROMs)
6256
63   A16B-2200-0131/03B (note 1 and 03B have been added/printed later)
64         |--------------|     |---|
65   |------|     CA34     |-----|CA4|-------------------------------------|
66   |      |--------------|75463|---|    LL  LL                   MB81C79A|
67   |                       (x6)         LL  LL              |--------|   |
68   |                                             HM53461(x5)|MB605117|   |
69   |                                   FA8191               |        |   |
70   |4040002E.M27 4040001E.M23          FA8191               |        |   |
71   |                                                        |--------|   |
72   |                                                                     |
73   |                                    MC-122-41256A9A-12  |--------|   |
74   |AB02142A.K27 AB02141A.K23           MC-122-41256A9A-12  |MB661128|   |
75   |                         9030001E.J18                   |        |   |
76   |                                                        |        |   |
77   |                                                        |--------|   |
78   |AB02102A.H27 AB02101A.H23                                            |
79   |                                                                     |
80   |                                                                     |
81   |                                                                     |
82   |AB020C2A.F27 AB020C1A.F23              24MHz                         |
83   |                                                                     |
84   |                                                                     |
85   |                                                        |--------|   |
86   |AB02082A.E27 AB02081A.E23      |------|                 |MB605111|   |
87   |                               |68000 |                 |        |   |
88   |                               |      |                 |        |   |
89   |   |---------|                 |      |                 |--------|   |
90   |   |---------|                 |------|                              |
91   |      CNM1                                |-----------------------|  |
92   |------------------------------------------|          CNA          |--|
93                                    |-----------------------|
94   Notes:
95        MC-122-41256- NEC MC-122-41256A9A-12 256k RAM SIP module (with parity) containing NEC D41256L-12 32k x8 SRAM
96                  2 SIP modules populated, 9 chips per module, 18 total RAMs, total 512k
97        68000       - Hitachi HD68HC000-12 68000 CPU. Clock 24/2 (PLCC68)
98        MB661128    - Fujitsu Fanuc SLC01 MB661128 (Serial Data Link Controller, PLCC68)
99        MB605117    - Fujitsu Fanuc BOC MB605117U (DRAM/SRAM Interface Controller, QFP100)
100        MB605111    - Fujitsu Fanuc FBI-A MB605111 (Global/Local Interface Controller, QFP100)
101        HM53461     - Hitachi HM53461-12 64k x4-bit multiport CMOS video RAM (x5, SOJ24)
102        MB81C79A    - Fujitsu MB81C79A-35 8k x 9-bit (72k) CMOS Static RAM (SOP28)
103        FA8191      - Fanuc FA8191 RV07 custom ceramic module (contains resistors and transistors, SIL16)
104        75463       - Texas Instruments SN75463 Dual High-Voltage, High-Current Peripheral Driver (DIP8)
105        L           - LED
106        CA34        - Connector for PMC Cassette C A02B-0094-C103 (holds 2 EPROMs containing the PMC Ladder)
107                  The Ladder is specific and unique to each CNC machine, depending on capability and options.
108        CA4         - Connector for cable joined to Servo Control Board A16B-2200-0090 or 16B-2200-0091
109        CNA         - Connector plugs into motherboard slot CNA2 (BASE 1)
110        CNM1        - 40 pin flat cable joined to optional board A16B-1600-0280/02A
11157
112        Note about EPROMs:
113                     Software Series is denoted by the first 4 digits
114                     ROM # (possibly relating to the memory location in hex) is the next 3 digits
115                     Software Revision is the last letter
116                     Both IC locations and ROM # are printed on this board
58    Fanuc System 15A Base 1 Board A16B-2200-013
11759
118        ROM         IC         Memory     EPROM     Used
119        Label       Location   Location   Type      For...
120        -----------------------------------------------------------------------------------------
121        9030001E    J18        381        27256     Digital Servo Control Program Version 9030 Revision E
60    PCB Layout
61    ----------
12262
123        4040001E    M23        001        27C1001   PMC Control Program Version 4040 Revision E
124        4040002E    M27        002        27C1001
63    A16B-2200-0131/03B (note 1 and 03B have been added/printed later)
64           |--------------|     |---|
65    |------|     CA34     |-----|CA4|-------------------------------------|
66    |      |--------------|75463|---|    LL  LL                   MB81C79A|
67    |                       (x6)         LL  LL              |--------|   |
68    |                                             HM53461(x5)|MB605117|   |
69    |                                   FA8191               |        |   |
70    |4040002E.M27 4040001E.M23          FA8191               |        |   |
71    |                                                        |--------|   |
72    |                                                                     |
73    |                                    MC-122-41256A9A-12  |--------|   |
74    |AB02142A.K27 AB02141A.K23           MC-122-41256A9A-12  |MB661128|   |
75    |                         9030001E.J18                   |        |   |
76    |                                                        |        |   |
77    |                                                        |--------|   |
78    |AB02102A.H27 AB02101A.H23                                            |
79    |                                                                     |
80    |                                                                     |
81    |                                                                     |
82    |AB020C2A.F27 AB020C1A.F23              24MHz                         |
83    |                                                                     |
84    |                                                                     |
85    |                                                        |--------|   |
86    |AB02082A.E27 AB02081A.E23      |------|                 |MB605111|   |
87    |                               |68000 |                 |        |   |
88    |                               |      |                 |        |   |
89    |   |---------|                 |      |                 |--------|   |
90    |   |---------|                 |------|                              |
91    |      CNM1                                |-----------------------|  |
92    |------------------------------------------|          CNA          |--|
93                                               |-----------------------|
94    Notes:
95          MC-122-41256- NEC MC-122-41256A9A-12 256k RAM SIP module (with parity) containing NEC D41256L-12 32k x8 SRAM
96                        2 SIP modules populated, 9 chips per module, 18 total RAMs, total 512k
97          68000       - Hitachi HD68HC000-12 68000 CPU. Clock 24/2 (PLCC68)
98          MB661128    - Fujitsu Fanuc SLC01 MB661128 (Serial Data Link Controller, PLCC68)
99          MB605117    - Fujitsu Fanuc BOC MB605117U (DRAM/SRAM Interface Controller, QFP100)
100          MB605111    - Fujitsu Fanuc FBI-A MB605111 (Global/Local Interface Controller, QFP100)
101          HM53461     - Hitachi HM53461-12 64k x4-bit multiport CMOS video RAM (x5, SOJ24)
102          MB81C79A    - Fujitsu MB81C79A-35 8k x 9-bit (72k) CMOS Static RAM (SOP28)
103          FA8191      - Fanuc FA8191 RV07 custom ceramic module (contains resistors and transistors, SIL16)
104          75463       - Texas Instruments SN75463 Dual High-Voltage, High-Current Peripheral Driver (DIP8)
105          L           - LED
106          CA34        - Connector for PMC Cassette C A02B-0094-C103 (holds 2 EPROMs containing the PMC Ladder)
107                        The Ladder is specific and unique to each CNC machine, depending on capability and options.
108          CA4         - Connector for cable joined to Servo Control Board A16B-2200-0090 or 16B-2200-0091
109          CNA         - Connector plugs into motherboard slot CNA2 (BASE 1)
110          CNM1        - 40 pin flat cable joined to optional board A16B-1600-0280/02A
125111
126        AB02081A    E23        081        27C1001   Boot Software Version AB02 Revision A
127        AB02082A    E27        082        27C1001
128        AB020C1A    F23        0C1        27C1001
129        AB020C2A    F27        0C2        27C1001
130        AB02101A    H23        101        27C1001
131        AB02102A    H27        102        27C1001
132        AB02141A    K23        141        27C1001
133        AB02142A    K27        142        27C1001
112          Note about EPROMs:
113                            Software Series is denoted by the first 4 digits
114                            ROM # (possibly relating to the memory location in hex) is the next 3 digits
115                            Software Revision is the last letter
116                            Both IC locations and ROM # are printed on this board
134117
118          ROM         IC         Memory     EPROM     Used
119          Label       Location   Location   Type      For...
120          -----------------------------------------------------------------------------------------
121          9030001E    J18        381        27256     Digital Servo Control Program Version 9030 Revision E
135122
136   Another identical board from a different machine contains the following EPROMs....
137   9030001F (known revisions exist up to at least rev M)
138   4040001D, 4040002D (known revisions exist up to at least rev I)
139   A202081G, A202082G
140   A2020C1G, A2020C2G
141   A202101G, A202102G
123          4040001E    M23        001        27C1001   PMC Control Program Version 4040 Revision E
124          4040002E    M27        002        27C1001
142125
143   The complete boot software series is listed below:
126          AB02081A    E23        081        27C1001   Boot Software Version AB02 Revision A
127          AB02082A    E27        082        27C1001
128          AB020C1A    F23        0C1        27C1001
129          AB020C2A    F27        0C2        27C1001
130          AB02101A    H23        101        27C1001
131          AB02102A    H27        102        27C1001
132          AB02141A    K23        141        27C1001
133          AB02142A    K27        142        27C1001
144134
145   15TA SOFTWARE SERIES (Single Turret 2 Axis Lathe)
146   |------+----+---------+---+---+---+---|
147   |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|
148   |SERIES|    |         |   |   |   |   |
149   |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|
150   +------+----+---------+---+---+---+---+
151   |A201  |X   | X       |   |   |   |   |
152   |A202  |X   |    X    |   |   |   |   |
153   |A211  |   X| X       | X | X |   |X  |
154   |A212  |   X|    X    | X | X |   |X  |
155   |A219  |   X| X       | X | X | X |   |
156   |A220  |   X|    X    | X | X | X |   |
157   |A215  |   X| X       | X | X |   |  X|
158   |A216  |   X|    X    | X | X |   |  X|
159   |A217  |   X| X       | X | X | X |  X|
160   |A218  |   X|    X    | X | X | X |  X|
161   |A221  |   X|       X | X | X | ? |  ?|
162   |------+----+---------+---+---+---+---|
163   Notes:
164        9M      - 9" Monochrome
165        9C      - 9" Color
166        14      - 14" Color
167        SER SPN - Serial Spindle
168        SER FB  - Serial FB ?
169        DNC 1/2 - DNC (Direct NC) type 1 or type 2 for Direct PC to CNC program transfer operation
170135
136    Another identical board from a different machine contains the following EPROMs....
137    9030001F (known revisions exist up to at least rev M)
138    4040001D, 4040002D (known revisions exist up to at least rev I)
139    A202081G, A202082G
140    A2020C1G, A2020C2G
141    A202101G, A202102G
171142
172   15TTA SOFTWARE SERIES (Twin Turret 4 Axis Lathe)
173   |------+----+---------+---+---+---+---|
174   |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|
175   |SERIES|    |         |   |   |   |   |
176   |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|
177   +------+----+---------+---+---+---+---+
178   |A401  |X   | X       |   |   |   |   |
179   |A402  |X   |    X    |   |   |   |   |
180   |A411  |   X| X       | X | X |   |X  |
181   |A412  |   X|    X    | X | X |   |X  |
182   |A419  |   X| X       | X | X | X |   |
183   |A420  |   X|    X    | X | X | X |   |
184   |------+----+---------+---+---+---+---|
143    The complete boot software series is listed below:
185144
145    15TA SOFTWARE SERIES (Single Turret 2 Axis Lathe)
146    |------+----+---------+---+---+---+---|
147    |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|
148    |SERIES|    |         |   |   |   |   |
149    |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|
150    +------+----+---------+---+---+---+---+
151    |A201  |X   | X       |   |   |   |   |
152    |A202  |X   |    X    |   |   |   |   |
153    |A211  |   X| X       | X | X |   |X  |
154    |A212  |   X|    X    | X | X |   |X  |
155    |A219  |   X| X       | X | X | X |   |
156    |A220  |   X|    X    | X | X | X |   |
157    |A215  |   X| X       | X | X |   |  X|
158    |A216  |   X|    X    | X | X |   |  X|
159    |A217  |   X| X       | X | X | X |  X|
160    |A218  |   X|    X    | X | X | X |  X|
161    |A221  |   X|       X | X | X | ? |  ?|
162    |------+----+---------+---+---+---+---|
163    Notes:
164          9M      - 9" Monochrome
165          9C      - 9" Color
166          14      - 14" Color
167          SER SPN - Serial Spindle
168          SER FB  - Serial FB ?
169          DNC 1/2 - DNC (Direct NC) type 1 or type 2 for Direct PC to CNC program transfer operation
186170
187   15TTF SOFTWARE SERIES (Twin Turret 4 Axis Lathe with FAPT)
188   |------+----+---------+---+---+---+---|
189   |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|
190   |SERIES|    |         |   |   |   |   |
191   |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|
192   +------+----+---------+---+---+---+---+
193   |A502  |X   |       X |   |   |   |   |
194   |A512  |   X|       X | X | X |   |X  |
195   |A520  |   X|       X | X | X | X |   |
196   |------+----+---------+---+---+---+---|
197171
172    15TTA SOFTWARE SERIES (Twin Turret 4 Axis Lathe)
173    |------+----+---------+---+---+---+---|
174    |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|
175    |SERIES|    |         |   |   |   |   |
176    |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|
177    +------+----+---------+---+---+---+---+
178    |A401  |X   | X       |   |   |   |   |
179    |A402  |X   |    X    |   |   |   |   |
180    |A411  |   X| X       | X | X |   |X  |
181    |A412  |   X|    X    | X | X |   |X  |
182    |A419  |   X| X       | X | X | X |   |
183    |A420  |   X|    X    | X | X | X |   |
184    |------+----+---------+---+---+---+---|
198185
199   15MA SOFTWARE SERIES (Mill With 3 Axes minimum XYZ)
200   |------+----+---------+---+---+---+---|---|
201   |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|SUB|
202   |SERIES|    |         |   |   |   |   |   |
203   |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|CPU|
204   +------+----+---------+---+---+---+---+---|
205   |A001  |X   | X       |   |   |   |   |   |
206   |A002  |X   |    X    |   |   |   |   |   |
207   |A00A  |X   | X       |   |   |   |   |   |
208   |A00B  |X   |    X    |   |   |   |   |   |
209   |AA01  |X   | X       |   |   |   |   | X |
210   |AA02  |X   |    X    |   |   |   |   | X |
211   |A011  |   X| X       | X | X |   |X  |   |
212   |A012  |   X|    X    | X | X |   |X  |   |
213   |AA11  |   X| X       | X | X |   |X  | X |
214   |AA12  |   X|    X    | X | X |   |X  | X |
215   |A017  |   X| X       | X | X | X |  X|   |
216   |A018  |   X|    X    | X | X | X |  X|   |
217   |A019  |   X| X       | X | X | X |   |   |
218   |A01A  |   X| X       | X | X |   |X  |   |
219   |A01B  |   X|    X    | X | X |   |X  |   |
220   |A020  |   X|    X    | X | X | X |   |   |
221   |A021  |   X|        X| X | X | X |  ?|   |
222   |A027 (NEW STANDARD)  |   |   |   |   |   |
223   |A028 (NEW STANDARD)  |   |   |   |   |   |
224   |A041 (FOR OSI ONLY)  |   |   |   |   |   |
225   |A042 (FOR OSI ONLY)  |   |   |   |   |   |
226   |AA19  |   X| X       | X | X | X |   | X |
227   |AA20  |   X|    X    | X | X | X |   | X |
228   |AA13  |   X| X       | X | X | X |  X| X |
229   |AA14  |   X|    X    | X | X | X |  X| X |
230   |AA23  |   X| X       | X | X | X |   | X |
231   |AA24  |   X|    X    | X | X | X |   | X |
232   |AA26  |   X|    X    | X | X | X |  ?| X |
233   |AA27 (NEW STD)       |   |   |   |   |   |
234   |AA28 (NEW STD)       |   |   |   |   |   |
235   |AA41 (FOR OSI ONLY)  |   |   |   |   |   |
236   |AA42 (FOR OSI ONLY)  |   |   |   |   |   |
237   |---------------------+---+---+---+---+---|
238186
187    15TTF SOFTWARE SERIES (Twin Turret 4 Axis Lathe with FAPT)
188    |------+----+---------+---+---+---+---|
189    |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|
190    |SERIES|    |         |   |   |   |   |
191    |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|
192    +------+----+---------+---+---+---+---+
193    |A502  |X   |       X |   |   |   |   |
194    |A512  |   X|       X | X | X |   |X  |
195    |A520  |   X|       X | X | X | X |   |
196    |------+----+---------+---+---+---+---|
239197
240   Optional PCB A16B-1600-0280/02A
241   -------------------------------
242198
243   |---------------------------|
244   |    181          182       |
245   |                           |
246   |                           |
247   |                           |
248   |    1C1          1C2       |
249   |                           |
250   |                           |
251   |                           |
252   |    201          202       |
253   |                           |
254   |                           |
255   |                           |
256   |    241          242       |
257   |                           |
258   |                           |
259   |                           |
260   |    281          282       |
261   |                           |
262   |                           |
263   |                           |
264   |    2C1          2C2       |
265   |                           |
266   |                           |
267   |   |---------|             |
268   |   |---------|             |
269   |      CNM1                 |
270   |---------------------------|
271   Notes:
272        The A16B-1600-0280/02A board contains only 12 DIP32 sockets and some logic and
273        bolts to the back of the BASE 1 board. The board extends the boot software memory
274        storage space if additional EPROMS are required. Not all sockets are populated.
275        Connector CNM1 joins with a 40 pin flat cable to the BASE 1 board connector CNM1
276        IC locations are not printed on this board. Only the ROM # is printed at each
277        socket location.
199    15MA SOFTWARE SERIES (Mill With 3 Axes minimum XYZ)
200    |------+----+---------+---+---+---+---|---|
201    |S/W   |STEP|   CRT   |I/O|SER|SER|DNC|SUB|
202    |SERIES|    |         |   |   |   |   |   |
203    |      |1  2| 9M 14 9C|LNK|SPN|FB |1 2|CPU|
204    +------+----+---------+---+---+---+---+---|
205    |A001  |X   | X       |   |   |   |   |   |
206    |A002  |X   |    X    |   |   |   |   |   |
207    |A00A  |X   | X       |   |   |   |   |   |
208    |A00B  |X   |    X    |   |   |   |   |   |
209    |AA01  |X   | X       |   |   |   |   | X |
210    |AA02  |X   |    X    |   |   |   |   | X |
211    |A011  |   X| X       | X | X |   |X  |   |
212    |A012  |   X|    X    | X | X |   |X  |   |
213    |AA11  |   X| X       | X | X |   |X  | X |
214    |AA12  |   X|    X    | X | X |   |X  | X |
215    |A017  |   X| X       | X | X | X |  X|   |
216    |A018  |   X|    X    | X | X | X |  X|   |
217    |A019  |   X| X       | X | X | X |   |   |
218    |A01A  |   X| X       | X | X |   |X  |   |
219    |A01B  |   X|    X    | X | X |   |X  |   |
220    |A020  |   X|    X    | X | X | X |   |   |
221    |A021  |   X|        X| X | X | X |  ?|   |
222    |A027 (NEW STANDARD)  |   |   |   |   |   |
223    |A028 (NEW STANDARD)  |   |   |   |   |   |
224    |A041 (FOR OSI ONLY)  |   |   |   |   |   |
225    |A042 (FOR OSI ONLY)  |   |   |   |   |   |
226    |AA19  |   X| X       | X | X | X |   | X |
227    |AA20  |   X|    X    | X | X | X |   | X |
228    |AA13  |   X| X       | X | X | X |  X| X |
229    |AA14  |   X|    X    | X | X | X |  X| X |
230    |AA23  |   X| X       | X | X | X |   | X |
231    |AA24  |   X|    X    | X | X | X |   | X |
232    |AA26  |   X|    X    | X | X | X |  ?| X |
233    |AA27 (NEW STD)       |   |   |   |   |   |
234    |AA28 (NEW STD)       |   |   |   |   |   |
235    |AA41 (FOR OSI ONLY)  |   |   |   |   |   |
236    |AA42 (FOR OSI ONLY)  |   |   |   |   |   |
237    |---------------------+---+---+---+---+---|
278238
279        ROM         IC         Memory     EPROM     Used For
280        Label       Location   Location   Type
281        ---------------------------------------------------------------------------------
282        AB02281A    N/A        281        27C1001   Boot Software Version AB02 Revision A
283        AB02282A    N/A        282        27C1001
284        AB022C1A    N/A        2C1        27C1001
285        AB022C2A    N/A        2C2        27C1001
286239
240    Optional PCB A16B-1600-0280/02A
241    -------------------------------
287242
288   15A EPROM population and option type
289   ----------------+---------+-------------------------------------------
290   PCB NAME        |ROM #    | Option Type (Basic, Option A1/A2/A3 etc)
291   ----------------|---------+-------------------------------------------
292   BASE 1 main     |081, 082 | B
293   BASE 1 main     |0C1, 0C2 | B
294   BASE 1 main     |101, 102 | A1 if step1 software, B if step2 software
295   BASE 1 main     |141, 142 | A2 (only used for foreign language option)
296   BASE 1 daughter |181, 182 | A3 (if used)
297   BASE 1 daughter |1C1, 1C2 | not used
298   BASE 1 daughter |201, 202 | not used
299   BASE 1 daughter |241, 242 | A6 (if used)
300   BASE 1 daughter |281, 282 | B when subcpu used
301   BASE 1 daughter |2C1, 2C2 | B when subcpu used
302   --------------------------+-------------------------------------------
303   Note: 2 MEG DRAM is required on BASE2 PCB when A3 or A6 is used
304 
243    |---------------------------|
244    |    181          182       |
245    |                           |
246    |                           |
247    |                           |
248    |    1C1          1C2       |
249    |                           |
250    |                           |
251    |                           |
252    |    201          202       |
253    |                           |
254    |                           |
255    |                           |
256    |    241          242       |
257    |                           |
258    |                           |
259    |                           |
260    |    281          282       |
261    |                           |
262    |                           |
263    |                           |
264    |    2C1          2C2       |
265    |                           |
266    |                           |
267    |   |---------|             |
268    |   |---------|             |
269    |      CNM1                 |
270    |---------------------------|
271    Notes:
272          The A16B-1600-0280/02A board contains only 12 DIP32 sockets and some logic and
273          bolts to the back of the BASE 1 board. The board extends the boot software memory
274          storage space if additional EPROMS are required. Not all sockets are populated.
275          Connector CNM1 joins with a 40 pin flat cable to the BASE 1 board connector CNM1
276          IC locations are not printed on this board. Only the ROM # is printed at each
277          socket location.
278
279          ROM         IC         Memory     EPROM     Used For
280          Label       Location   Location   Type
281          ---------------------------------------------------------------------------------
282          AB02281A    N/A        281        27C1001   Boot Software Version AB02 Revision A
283          AB02282A    N/A        282        27C1001
284          AB022C1A    N/A        2C1        27C1001
285          AB022C2A    N/A        2C2        27C1001
286
287
288    15A EPROM population and option type
289    ----------------+---------+-------------------------------------------
290    PCB NAME        |ROM #    | Option Type (Basic, Option A1/A2/A3 etc)
291    ----------------|---------+-------------------------------------------
292    BASE 1 main     |081, 082 | B
293    BASE 1 main     |0C1, 0C2 | B
294    BASE 1 main     |101, 102 | A1 if step1 software, B if step2 software
295    BASE 1 main     |141, 142 | A2 (only used for foreign language option)
296    BASE 1 daughter |181, 182 | A3 (if used)
297    BASE 1 daughter |1C1, 1C2 | not used
298    BASE 1 daughter |201, 202 | not used
299    BASE 1 daughter |241, 242 | A6 (if used)
300    BASE 1 daughter |281, 282 | B when subcpu used
301    BASE 1 daughter |2C1, 2C2 | B when subcpu used
302    --------------------------+-------------------------------------------
303    Note: 2 MEG DRAM is required on BASE2 PCB when A3 or A6 is used
304
305305****************************************************************************/
306306
307307#include "emu.h"
r29404r29405
313313public:
314314   fanucs15_state(const machine_config &mconfig, device_type type, const char *tag)
315315      : driver_device(mconfig, type, tag)
316      , m_maincpu(*this, "maincpu")      // main 68020
317      , m_pmccpu(*this, "pmccpu")         // sub 68000-12
318      , m_gfxcpu(*this, "gfxcpu")         // gfx 68000-10
319      , m_convcpu(*this, "convcpu")      // conversational 80286-8
316      , m_maincpu(*this, "maincpu")       // main 68020
317      , m_pmccpu(*this, "pmccpu")         // sub 68000-12
318      , m_gfxcpu(*this, "gfxcpu")         // gfx 68000-10
319      , m_convcpu(*this, "convcpu")       // conversational 80286-8
320320   { }
321321
322322   required_device<m68020_device> m_maincpu;
r29404r29405
330330
331331static ADDRESS_MAP_START(maincpu_mem, AS_PROGRAM, 32, fanucs15_state)
332332   AM_RANGE(0x00000000, 0x0017ffff) AM_ROM AM_REGION("base1b", 0)
333   AM_RANGE(0x000f8000, 0x000fffff) AM_RAM   // filled with 0x96 on boot
334   AM_RANGE(0xffff0000, 0xffffffff) AM_RAM   // initial stack
333   AM_RANGE(0x000f8000, 0x000fffff) AM_RAM // filled with 0x96 on boot
334   AM_RANGE(0xffff0000, 0xffffffff) AM_RAM // initial stack
335335ADDRESS_MAP_END
336336
337337static ADDRESS_MAP_START(pmccpu_mem, AS_PROGRAM, 16, fanucs15_state)
r29404r29405
369369   MCFG_CPU_PROGRAM_MAP(pmccpu_mem)
370370   MCFG_DEVICE_DISABLE()
371371
372   MCFG_CPU_ADD("gfxcpu", M68000, XTAL_10MHz)      // wants bit 15 of 70500 to be set
372   MCFG_CPU_ADD("gfxcpu", M68000, XTAL_10MHz)      // wants bit 15 of 70500 to be set
373373   MCFG_CPU_PROGRAM_MAP(gfxcpu_mem)
374374   MCFG_DEVICE_DISABLE()
375375
376   MCFG_CPU_ADD("convcpu", I80286, XTAL_8MHz)      // wants 70500 to return 0x8000 (same as what gfxcpu looks for, basically)
376   MCFG_CPU_ADD("convcpu", I80286, XTAL_8MHz)      // wants 70500 to return 0x8000 (same as what gfxcpu looks for, basically)
377377   MCFG_CPU_PROGRAM_MAP(convcpu_mem)
378378MACHINE_CONFIG_END
379379
380380/* ROM definition */
381ROM_START( fanucs15 )   
382   ROM_REGION16_BE( 0x50000, "base1a", 0 )   // 68000 sub CPU code and data on base 1 board (verified)
383   ROM_LOAD16_BYTE( "4040_001e_001.23m", 0x000001, 0x020000, CRC(2e12109f) SHA1(83ed846d3d59ab0d81b2e2e2231d1a444e462590) )
384   ROM_LOAD16_BYTE( "4040_002e_002.27m", 0x000000, 0x020000, CRC(a5469692) SHA1(31c44edb36fb69d3d418a97e32e4a2769d1ec9e7) )
381ROM_START( fanucs15 )
382   ROM_REGION16_BE( 0x50000, "base1a", 0 ) // 68000 sub CPU code and data on base 1 board (verified)
383   ROM_LOAD16_BYTE( "4040_001e_001.23m", 0x000001, 0x020000, CRC(2e12109f) SHA1(83ed846d3d59ab0d81b2e2e2231d1a444e462590) )
384   ROM_LOAD16_BYTE( "4040_002e_002.27m", 0x000000, 0x020000, CRC(a5469692) SHA1(31c44edb36fb69d3d418a97e32e4a2769d1ec9e7) )
385385   ROM_LOAD16_BYTE( "9030_001e_381.18j", 0x040001, 0x008000, CRC(9f10a022) SHA1(dc4a242f7611143cc2d9564993fd5fa52f0ac13a) )
386386
387   ROM_REGION32_BE( 0x180000, "base1b", 0 )   // 68020 main CPU code and data on base 1 board (verified)
388   ROM_LOAD16_BYTE( "ab02_081a_081.23e", 0x000001, 0x020000, CRC(5328b023) SHA1(661f2908f3287f7cd2b215cd29962f2789f7d99a) )
389   ROM_LOAD16_BYTE( "ab02_082a_082.27e", 0x000000, 0x020000, CRC(ad37740f) SHA1(e65cc0a8b4e515fcf5fcefde99e95d100d310018) )
390   ROM_LOAD16_BYTE( "ab02_0c1a_0c1.23f", 0x040001, 0x020000, CRC(62566569) SHA1(dd85b6e7875d996759b833552b00e1b3a0e3696b) )
391   ROM_LOAD16_BYTE( "ab02_0c2a_0c2.27f", 0x040000, 0x020000, CRC(a4ade1fe) SHA1(44ef5358b34d3538fb061f235b8a14bac6b5faa8) )
392   ROM_LOAD16_BYTE( "ab02_101a_101.23h", 0x080001, 0x020000, CRC(96f5d00e) SHA1(f5de3621df536435d27a0aac1c9d25e69601bd40) )
393   ROM_LOAD16_BYTE( "ab02_102a_102.27h", 0x080000, 0x020000, CRC(e23a5414) SHA1(f6aff51dfd6d976b7cd33399c7aa3d06c7c06919) )
394   ROM_LOAD16_BYTE( "ab02_141a_141.23k", 0x0c0001, 0x020000, CRC(3ceb6809) SHA1(7e37b18847b35f81c08b7b2ab62e99fa3a737c32) )
387   ROM_REGION32_BE( 0x180000, "base1b", 0 )    // 68020 main CPU code and data on base 1 board (verified)
388   ROM_LOAD16_BYTE( "ab02_081a_081.23e", 0x000001, 0x020000, CRC(5328b023) SHA1(661f2908f3287f7cd2b215cd29962f2789f7d99a) )
389   ROM_LOAD16_BYTE( "ab02_082a_082.27e", 0x000000, 0x020000, CRC(ad37740f) SHA1(e65cc0a8b4e515fcf5fcefde99e95d100d310018) )
390   ROM_LOAD16_BYTE( "ab02_0c1a_0c1.23f", 0x040001, 0x020000, CRC(62566569) SHA1(dd85b6e7875d996759b833552b00e1b3a0e3696b) )
391   ROM_LOAD16_BYTE( "ab02_0c2a_0c2.27f", 0x040000, 0x020000, CRC(a4ade1fe) SHA1(44ef5358b34d3538fb061f235b8a14bac6b5faa8) )
392   ROM_LOAD16_BYTE( "ab02_101a_101.23h", 0x080001, 0x020000, CRC(96f5d00e) SHA1(f5de3621df536435d27a0aac1c9d25e69601bd40) )
393   ROM_LOAD16_BYTE( "ab02_102a_102.27h", 0x080000, 0x020000, CRC(e23a5414) SHA1(f6aff51dfd6d976b7cd33399c7aa3d06c7c06919) )
394   ROM_LOAD16_BYTE( "ab02_141a_141.23k", 0x0c0001, 0x020000, CRC(3ceb6809) SHA1(7e37b18847b35f81c08b7b2ab62e99fa3a737c32) )
395395   ROM_LOAD16_BYTE( "ab02_142a_142.27k", 0x0c0000, 0x020000, CRC(1d8a4d7d) SHA1(580322e2927742bbcbf0bb2757730e2817b320e1) )
396396   // this appears to be a different version of the 081a/0c1a ROM program.  it's definitely for a 68020 (32-bit pointers everywhere)
397397   ROM_LOAD16_BYTE( "ab02_281a_281.8a",  0x100001, 0x020000, CRC(cec79742) SHA1(1233ff920d607206a80c8d187745e3d657a8635d) )
398   ROM_LOAD16_BYTE( "ab02_282a_282.8d",  0x100000, 0x020000, CRC(63eacc0e) SHA1(1f25b99280112c720d778219b4610f556f33a7f1) )
399   ROM_LOAD16_BYTE( "ab02_2c1a_2c1.10a", 0x140001, 0x020000, CRC(66eb74dd) SHA1(f256763cb15b4524c09bd09b88df46a1498846ef) )
400   ROM_LOAD16_BYTE( "ab02_2c2a_2c2.10d", 0x140000, 0x020000, CRC(6edf4ff3) SHA1(9cbf7c6555cc27def3b580f5a7b0ff580984206d) )
398   ROM_LOAD16_BYTE( "ab02_282a_282.8d",  0x100000, 0x020000, CRC(63eacc0e) SHA1(1f25b99280112c720d778219b4610f556f33a7f1) )
399   ROM_LOAD16_BYTE( "ab02_2c1a_2c1.10a", 0x140001, 0x020000, CRC(66eb74dd) SHA1(f256763cb15b4524c09bd09b88df46a1498846ef) )
400   ROM_LOAD16_BYTE( "ab02_2c2a_2c2.10d", 0x140000, 0x020000, CRC(6edf4ff3) SHA1(9cbf7c6555cc27def3b580f5a7b0ff580984206d) )
401401
402   ROM_REGION16_LE( 0x80000, "conversational", 0 )   // 80286 ROMs, 5a00 for Mill
403   ROM_LOAD16_BYTE( "5a00_041b.041", 0x000000, 0x020000, CRC(bf22c0a3) SHA1(56ab70bfd5794cb4db1d87c8becf7af522687564) )
404   ROM_LOAD16_BYTE( "5a00_042b.042", 0x000001, 0x020000, CRC(7abc9d6b) SHA1(5cb6ad08ce93aa99391d1ce46ac8db8ba2e0f94a) )
405   ROM_LOAD16_BYTE( "5a00_001b.001", 0x040000, 0x020000, CRC(cd2a2839) SHA1(bc20fd9ae9d071e1df835244aea85648d1bd1dbc) )
406   ROM_LOAD16_BYTE( "5a00_002b.002", 0x040001, 0x020000, CRC(d9ebbb4a) SHA1(9c3d96e9b88848472210beacdf9d300ddd42d16e) )
402   ROM_REGION16_LE( 0x80000, "conversational", 0 ) // 80286 ROMs, 5a00 for Mill
403   ROM_LOAD16_BYTE( "5a00_041b.041", 0x000000, 0x020000, CRC(bf22c0a3) SHA1(56ab70bfd5794cb4db1d87c8becf7af522687564) )
404   ROM_LOAD16_BYTE( "5a00_042b.042", 0x000001, 0x020000, CRC(7abc9d6b) SHA1(5cb6ad08ce93aa99391d1ce46ac8db8ba2e0f94a) )
405   ROM_LOAD16_BYTE( "5a00_001b.001", 0x040000, 0x020000, CRC(cd2a2839) SHA1(bc20fd9ae9d071e1df835244aea85648d1bd1dbc) )
406   ROM_LOAD16_BYTE( "5a00_002b.002", 0x040001, 0x020000, CRC(d9ebbb4a) SHA1(9c3d96e9b88848472210beacdf9d300ddd42d16e) )
407407
408   ROM_REGION16_BE( 0x50000, "gfxboard", 0 )   // graphics board 68000 code/data.  600a for lathe, 600b for mill, 6082 common to both
409   ROM_LOAD16_BYTE( "600b_001d_low.3l",  0x000001, 0x010000, CRC(50566c5c) SHA1(966c8d90d09a9c50c5dedebe9c67f1755846b234) )
410   ROM_LOAD16_BYTE( "600b_002d_high.3j", 0x000000, 0x010000, CRC(304e1ecb) SHA1(1e4b149b306550750fc03bd80bd399f239f68657) )
411   ROM_LOAD16_BYTE( "600a_001c.bin",     0x020001, 0x010000, CRC(63d9fc2f) SHA1(280e825ba7b79e7c38282a4f4b762d2219fd873b) )
412   ROM_LOAD16_BYTE( "600a_002c.bin",     0x020000, 0x010000, CRC(4d78e702) SHA1(a89bd07dc1ae030bdee5a541777825eaadbc2307) )
408   ROM_REGION16_BE( 0x50000, "gfxboard", 0 )   // graphics board 68000 code/data.  600a for lathe, 600b for mill, 6082 common to both
409   ROM_LOAD16_BYTE( "600b_001d_low.3l",  0x000001, 0x010000, CRC(50566c5c) SHA1(966c8d90d09a9c50c5dedebe9c67f1755846b234) )
410   ROM_LOAD16_BYTE( "600b_002d_high.3j", 0x000000, 0x010000, CRC(304e1ecb) SHA1(1e4b149b306550750fc03bd80bd399f239f68657) )
411   ROM_LOAD16_BYTE( "600a_001c.bin",     0x020001, 0x010000, CRC(63d9fc2f) SHA1(280e825ba7b79e7c38282a4f4b762d2219fd873b) )
412   ROM_LOAD16_BYTE( "600a_002c.bin",     0x020000, 0x010000, CRC(4d78e702) SHA1(a89bd07dc1ae030bdee5a541777825eaadbc2307) )
413413   // font or tilemap data?
414   ROM_LOAD( "6082_001a_cg.12b", 0x040000, 0x010000, CRC(f3d10cf9) SHA1(bc5bc88dcb5f347e1442aa4a0897747958a53413) )
414   ROM_LOAD( "6082_001a_cg.12b", 0x040000, 0x010000, CRC(f3d10cf9) SHA1(bc5bc88dcb5f347e1442aa4a0897747958a53413) )
415415
416   ROM_REGION16_BE( 0x40000, "cassette", 0 )   // "PMC Cassette C", ROM cartridge that plugs into the Base 1 board
417   ROM_LOAD16_BYTE( "pmc_high.a2",  0x000000, 0x020000, CRC(7b8f9a96) SHA1(08d828b612c45bb3f2f7a56df418cd8e34731bf4) )
418   ROM_LOAD16_BYTE( "pmc_low.a1",   0x000001, 0x020000, CRC(3ab261f8) SHA1(20b7eef96deb91a3a867f9ac4165b0c188fbcff3) )
416   ROM_REGION16_BE( 0x40000, "cassette", 0 )   // "PMC Cassette C", ROM cartridge that plugs into the Base 1 board
417   ROM_LOAD16_BYTE( "pmc_high.a2",  0x000000, 0x020000, CRC(7b8f9a96) SHA1(08d828b612c45bb3f2f7a56df418cd8e34731bf4) )
418   ROM_LOAD16_BYTE( "pmc_low.a1",   0x000001, 0x020000, CRC(3ab261f8) SHA1(20b7eef96deb91a3a867f9ac4165b0c188fbcff3) )
419419ROM_END
420420
421421/* Driver */
422422/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT     CLASS          INIT COMPANY  FULLNAME       FLAGS */
423423COMP( 1990, fanucs15, 0,      0,     fanucs15,  fanucs15, driver_device, 0,   "Fanuc", "System 15", GAME_NOT_WORKING | GAME_NO_SOUND)
424
425
trunk/src/mess/drivers/phunsy.c
r29404r29405
1515    The tape must already be playing the leader when you press the Enter
1616       key, or it errors immediately.
1717
18    Rom banking (in U bank):   
18    Rom banking (in U bank):
1919    0U: RAM
2020    1U: MDCR program
2121    2U: Disassembler
r29404r29405
110110   // U-bank
111111   data >>= 4;
112112
113   if (data < 4)   
113   if (data < 4)
114114      membank("bankru")->set_entry(data);
115115}
116116
r29404r29405
354354   MCFG_SCREEN_RAW_PARAMS(XTAL_8MHz, 480, 0, 64*6, 313, 0, 256)
355355   MCFG_SCREEN_UPDATE_DRIVER(phunsy_state, screen_update)
356356   MCFG_SCREEN_PALETTE("palette")
357   
357
358358   MCFG_GFXDECODE_ADD("gfxdecode", "palette", phunsy)
359359   MCFG_PALETTE_ADD("palette", 8)
360360   MCFG_PALETTE_INIT_OWNER(phunsy_state, phunsy)
trunk/src/mess/drivers/coco12.c
r29404r29405
301301   MCFG_MC6847_ADD(VDG_TAG, MC6847_NTSC, XTAL_3_579545MHz, coco12_state::mc6847_config)
302302   MCFG_MC6847_HSYNC_CALLBACK(WRITELINE(coco12_state, horizontal_sync))
303303   MCFG_MC6847_FSYNC_CALLBACK(WRITELINE(coco12_state, field_sync))
304   
304
305305   // sound hardware
306306   MCFG_FRAGMENT_ADD( coco_sound )
307307
trunk/src/mess/drivers/esqkt.c
r29404r29405
1818    0x280000-0x2801FF   ES5510
1919    0x300000-0x30000F   68681 DUART
2020    0xFF0000-0xFFFFFF   OS RAM
21
21
2222    Ensoniq KT-76
23   Ensoniq 1994
23    Ensoniq 1994
2424
25   This is a wavetable-based synth keyboard made by Ensoniq in 1994
25    This is a wavetable-based synth keyboard made by Ensoniq in 1994
2626
27   PCB Layout
28   ----------
27    PCB Layout
28    ----------
2929
30   KT-76
31   |---------------------------------------------|
32   |J12 J3      J11                         J10  |
33   |                                  LM393 LM358|
34   |                                     74HC4051|
35   |ADM691                                       |
36   |              62256                          |
37   |                                             |
38   |3V_BATTERY  KT76_0590_LO.U5          ROM0    |
39   |                                             |
40   |   68EC020    62256       OTTOR2     ROM1    |
41   |                                             |
42   |            KT76_690B_HI.U6          ROM2    |
43   | PAL1                                        |
44   |       HP_6N138                              |
45   | PAL2                     OTTOR2           J6|
46   |      7407                                   |
47   |                                             |
48   |          D41464 D41464                      |
49   |                                             |
50   | SCN2681  D41464 D41464                      |
51   |                         137000402           |
52   |                                             |
53   |                                18.432MHz    |
54   |       ESPR6                    16MHz        |
55   |    POT                                      |
56   |                                  R1136-11   |
57   |                                             |
58   |                                LM339 LM339  |
59   |    J13             J5  J1            J2  J4 |
60   |---------------------------------------------|
61   Notes:
62        J1         - connector for digital jacks
63        J2         - connector for keyboard
64        J3         - connector for LCD display
65        J4         - connector for keyboard
66        J5         - connector for power input
67        J6         - connector for wave expansion
68        J10        - connector for wheels/pressure
69        J11        - connector for memory card
70        J12        - connector for headphones
71        J13        - connector for analog jacks
72        68EC020    - Motorola MC68EC020FG16 CPU. Clock input 16MHz
73        1370000402 - Unknown PLCC44 IC stamped with the Ensoniq logo. Likely CPLD or gate array.
74        ESPR6      - Ensoniq ESPR6 (ES5510) sound chip
75        OTTOR2     - Ensoniq OTTOR2 (ES5506) sound chip
76        POT        - ESP adjustment pot
77        KT76*      - 27C2048/27C210 EPROM
78        ROM*       - 2M x8-bit SOP44 mask ROM
79        R1136-11   - DIP40 IC manufactured by Rockwell - believed to be some type of MCU.
80        D41464     - NEC D41464 64k x4-bit DRAM
81        62256      - 32k x8-bit SRAM
82        SCN2681    - Philips SCN2681 Dual Universal Asynchronous Receiver/Transmitter (DUART)
83        HP_6N138   - HP/Agilent HP 6N138 Low Input Current High Gain Optocoupler
84        PAL1       - MMI PAL20L8ACN stamped 'KT-76 MMU 6A0A'. Printing is faint so 0 could be a B or a D.
85        PAL2       - MMI PAL20L8ACN stamped 'KT-76 BCU 73D6'
30    KT-76
31    |---------------------------------------------|
32    |J12 J3      J11                         J10  |
33    |                                  LM393 LM358|
34    |                                     74HC4051|
35    |ADM691                                       |
36    |              62256                          |
37    |                                             |
38    |3V_BATTERY  KT76_0590_LO.U5          ROM0    |
39    |                                             |
40    |   68EC020    62256       OTTOR2     ROM1    |
41    |                                             |
42    |            KT76_690B_HI.U6          ROM2    |
43    | PAL1                                        |
44    |       HP_6N138                              |
45    | PAL2                     OTTOR2           J6|
46    |      7407                                   |
47    |                                             |
48    |          D41464 D41464                      |
49    |                                             |
50    | SCN2681  D41464 D41464                      |
51    |                         137000402           |
52    |                                             |
53    |                                18.432MHz    |
54    |       ESPR6                    16MHz        |
55    |    POT                                      |
56    |                                  R1136-11   |
57    |                                             |
58    |                                LM339 LM339  |
59    |    J13             J5  J1            J2  J4 |
60    |---------------------------------------------|
61    Notes:
62          J1         - connector for digital jacks
63          J2         - connector for keyboard
64          J3         - connector for LCD display
65          J4         - connector for keyboard
66          J5         - connector for power input
67          J6         - connector for wave expansion
68          J10        - connector for wheels/pressure
69          J11        - connector for memory card
70          J12        - connector for headphones
71          J13        - connector for analog jacks
72          68EC020    - Motorola MC68EC020FG16 CPU. Clock input 16MHz
73          1370000402 - Unknown PLCC44 IC stamped with the Ensoniq logo. Likely CPLD or gate array.
74          ESPR6      - Ensoniq ESPR6 (ES5510) sound chip
75          OTTOR2     - Ensoniq OTTOR2 (ES5506) sound chip
76          POT        - ESP adjustment pot
77          KT76*      - 27C2048/27C210 EPROM
78          ROM*       - 2M x8-bit SOP44 mask ROM
79          R1136-11   - DIP40 IC manufactured by Rockwell - believed to be some type of MCU.
80          D41464     - NEC D41464 64k x4-bit DRAM
81          62256      - 32k x8-bit SRAM
82          SCN2681    - Philips SCN2681 Dual Universal Asynchronous Receiver/Transmitter (DUART)
83          HP_6N138   - HP/Agilent HP 6N138 Low Input Current High Gain Optocoupler
84          PAL1       - MMI PAL20L8ACN stamped 'KT-76 MMU 6A0A'. Printing is faint so 0 could be a B or a D.
85          PAL2       - MMI PAL20L8ACN stamped 'KT-76 BCU 73D6'
8686
8787***************************************************************************/
8888
r29404r29405
263263   ROM_LOAD32_WORD( "kt76_162_hi.bin", 0x000002, 0x040000, CRC(de16d236) SHA1(c55fca86453e90e8c34a048bed45817063237370) )
264264
265265   ROM_REGION(0x400000, "waverom", ROMREGION_ERASE00)
266   ROM_LOAD16_BYTE( "1351000401_rom0.u103", 0x000001, 0x200000, CRC(425047af) SHA1(9680d1fc222b29ba24f0fbf6136982bee87a60ef) )
266   ROM_LOAD16_BYTE( "1351000401_rom0.u103", 0x000001, 0x200000, CRC(425047af) SHA1(9680d1fc222b29ba24f0fbf6136982bee87a60ef) )
267267
268268   ROM_REGION(0x400000, "waverom2", ROMREGION_ERASE00)
269   ROM_LOAD16_BYTE( "1351000402_rom1.u102", 0x000001, 0x200000, CRC(64459185) SHA1(0fa20b16847fc02a384057fc3d385226eb3e7527) )
269   ROM_LOAD16_BYTE( "1351000402_rom1.u102", 0x000001, 0x200000, CRC(64459185) SHA1(0fa20b16847fc02a384057fc3d385226eb3e7527) )
270270
271271   ROM_REGION(0x400000, "waverom3", ROMREGION_ERASE00)
272   ROM_LOAD16_BYTE( "1351000403_rom2.u104", 0x000001, 0x200000, CRC(c2aacc5d) SHA1(7fab518ba92ddb23cdc4dcb04751b26d25c298c0) )
272   ROM_LOAD16_BYTE( "1351000403_rom2.u104", 0x000001, 0x200000, CRC(c2aacc5d) SHA1(7fab518ba92ddb23cdc4dcb04751b26d25c298c0) )
273273
274274   ROM_REGION(0x200000, "waverom4", ROMREGION_ERASE00)
275275ROM_END
trunk/src/mess/drivers/sgi_ip2.c
r29404r29405
378378   AM_RANGE(0x30800000, 0x30800003) AM_READWRITE8(sgi_ip2_m_but_r,         sgi_ip2_m_but_w,        0xffffffff)
379379   AM_RANGE(0x31000000, 0x31000003) AM_READWRITE16(sgi_ip2_m_quad_r,       sgi_ip2_m_quad_w,       0xffffffff)
380380   AM_RANGE(0x31800000, 0x31800003) AM_READ16(sgi_ip2_swtch_r,                                     0xffffffff)
381   AM_RANGE(0x32000000, 0x3200000f) AM_DEVREADWRITE8("duart68681a", mc68681_device, read, write,    0xffffffff)
382   AM_RANGE(0x32800000, 0x3280000f) AM_DEVREADWRITE8("duart68681b", mc68681_device, read, write,    0xffffffff)
381   AM_RANGE(0x32000000, 0x3200000f) AM_DEVREADWRITE8("duart68681a", mc68681_device, read, write,   0xffffffff)
382   AM_RANGE(0x32800000, 0x3280000f) AM_DEVREADWRITE8("duart68681b", mc68681_device, read, write,   0xffffffff)
383383   AM_RANGE(0x33000000, 0x330007ff) AM_RAM
384384   AM_RANGE(0x34000000, 0x34000003) AM_READWRITE8(sgi_ip2_clock_ctl_r,     sgi_ip2_clock_ctl_w,    0xffffffff)
385385   AM_RANGE(0x35000000, 0x35000003) AM_READWRITE8(sgi_ip2_clock_data_r,    sgi_ip2_clock_data_w,   0xffffffff)
r29404r29405
423423   MCFG_CPU_PROGRAM_MAP(sgi_ip2_map)
424424
425425   MCFG_MC68681_ADD( "duart68681a", XTAL_3_6864MHz ) /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */
426   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(sgi_ip2_state, duarta_irq_handler))
426   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(sgi_ip2_state, duarta_irq_handler))
427427   MCFG_MC68681_B_TX_CALLBACK(DEVWRITELINE("rs232", rs232_port_device, write_txd))
428428
429429   MCFG_MC68681_ADD( "duart68681b", XTAL_3_6864MHz ) /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */
430   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(sgi_ip2_state, duartb_irq_handler))
430   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(sgi_ip2_state, duartb_irq_handler))
431431
432432   MCFG_MC146818_ADD( "rtc", XTAL_4_194304Mhz )
433433
trunk/src/mess/drivers/europc.c
r29404r29405
3232
3333   DECLARE_READ8_MEMBER( europc_rtc_r );
3434   DECLARE_WRITE8_MEMBER( europc_rtc_w );
35   
35
3636   DECLARE_DRIVER_INIT(europc);
3737
3838   void europc_rtc_set_time();
r29404r29405
4747
4848   void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4949   emu_timer* m_rtc_timer;
50   
50
5151   enum
5252   {
5353      TIMER_RTC
r29404r29405
345345   m_rtc_timer = timer_alloc();
346346   m_rtc_timer->adjust(attotime::zero, 0, attotime(1,0));
347347   //  europc_rtc_set_time();
348   
348
349349   machine().device<nvram_device>("nvram")->set_base(m_rtc_data, sizeof(m_rtc_data));
350   m_aga = machine().device<isa8_aga_device>("aga:aga");     
350   m_aga = machine().device<isa8_aga_device>("aga:aga");
351351
352352}
353353
r29404r29405
402402\ and ~ had to be swapped
403403i am not sure if keypad enter delivers the mf2 keycode
404404 */
405
405
406406static INPUT_PORTS_START( europc )
407407   PORT_START("DSW0") /* IN1 */
408408
r29404r29405
476476ADDRESS_MAP_END
477477
478478static MACHINE_CONFIG_START( europc, europc_pc_state )
479   MCFG_CPU_ADD("maincpu", I8088, 4772720*2)
479   MCFG_CPU_ADD("maincpu", I8088, 4772720*2)
480480   MCFG_CPU_PROGRAM_MAP(europc_map)
481481   MCFG_CPU_IO_MAP(europc_io)
482482
483483   MCFG_PCNOPPI_MOTHERBOARD_ADD("mb", "maincpu")
484   
484
485485   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "aga", false)
486486   MCFG_ISA8_SLOT_ADD("mb:isa", "isa2", pc_isa8_cards, "lpt", false)
487487   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, "com", false)
488488   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, "fdc_xt", false)
489   
489
490490   MCFG_PC_KEYB_ADD("pc_keyboard", DEVWRITELINE("mb:pic8259", pic8259_device, ir1_w))
491491
492492   MCFG_NVRAM_ADD_0FILL("nvram");
493   
493
494494   /* internal ram */
495495   MCFG_RAM_ADD(RAM_TAG)
496496   MCFG_RAM_DEFAULT_SIZE("640K")
r29404r29405
502502   ROM_LOAD("50145", 0xf8000, 0x8000, CRC(1775a11d) SHA1(54430d4d0462860860397487c9c109e6f70db8e3)) // V2.07
503503ROM_END
504504
505COMP( 1988, europc,     ibm5150,    0,          europc,     europc, europc_pc_state,     europc,     "Schneider Rdf. AG", "EURO PC", GAME_NOT_WORKING)
No newline at end of file
505COMP( 1988, europc,     ibm5150,    0,          europc,     europc, europc_pc_state,     europc,     "Schneider Rdf. AG", "EURO PC", GAME_NOT_WORKING)
trunk/src/mess/drivers/iq151.c
r29404r29405
434434   MCFG_SCREEN_SIZE(64*8, 32*8)
435435   MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1)
436436   MCFG_SCREEN_PALETTE("palette")
437   
437
438438   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
439439
440440   /* sound hardware */
trunk/src/mess/drivers/mirage.c
r29404r29405
215215   MCFG_ES5503_OUTPUT_CHANNELS(2)
216216   MCFG_ES5503_IRQ_FUNC(WRITELINE(mirage_state, mirage_doc_irq))
217217   MCFG_ES5503_ADC_FUNC(READ8(mirage_state, mirage_adc_read))
218   
218
219219   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
220220   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
221221
trunk/src/mess/drivers/avigo.c
r29404r29405
893893   MCFG_SCREEN_SIZE(AVIGO_SCREEN_WIDTH, AVIGO_SCREEN_HEIGHT + AVIGO_PANEL_HEIGHT)
894894   MCFG_SCREEN_VISIBLE_AREA(0, AVIGO_SCREEN_WIDTH-1, 0, AVIGO_SCREEN_HEIGHT + AVIGO_PANEL_HEIGHT -1)
895895   MCFG_SCREEN_PALETTE("palette")
896   
896
897897   MCFG_DEFAULT_LAYOUT(layout_avigo)
898898
899899   MCFG_GFXDECODE_ADD("gfxdecode", "palette", avigo)
trunk/src/mess/drivers/zrt80.c
r29404r29405
6060   required_device<mc6845_device> m_crtc;
6161   required_device<ins8250_device> m_8250;
6262   required_device<beep_device> m_beep;
63public:   
63public:
6464   required_device<palette_device> m_palette;
6565};
6666
trunk/src/mess/drivers/svmu.c
r29404r29405
314314   MCFG_SCREEN_VISIBLE_AREA(0, 48*(PIXEL_SIZE + PIXEL_DISTANCE) - 1, 0, 32*(PIXEL_SIZE + PIXEL_DISTANCE) - 1)
315315   MCFG_SCREEN_UPDATE_DEVICE("maincpu", lc8670_cpu_device, screen_update)
316316   MCFG_SCREEN_PALETTE("palette")
317   
317
318318   MCFG_DEFAULT_LAYOUT(layout_svmu)
319319   MCFG_PALETTE_ADD("palette", 2)
320320   MCFG_PALETTE_INIT_OWNER(svmu_state, svmu)
trunk/src/mess/drivers/mz2500.c
r29404r29405
7171      m_pit(*this, "pit"),
7272      m_beeper(*this, "beeper"),
7373      m_gfxdecode(*this, "gfxdecode"),
74      m_palette(*this, "palette")
74      m_palette(*this, "palette")
7575   { }
7676
7777   required_device<cpu_device> m_maincpu;
r29404r29405
21272127   MCFG_Z80SIO0_ADD( "z80sio", 6000000, mz2500_sio_intf )
21282128   MCFG_DEVICE_ADD(RP5C15_TAG, RP5C15, XTAL_32_768kHz)
21292129   MCFG_RP5C15_OUT_ALARM_CB(WRITELINE(mz2500_state, mz2500_rtc_alarm_irq))
2130   
2130
21312131   MCFG_DEVICE_ADD("pit", PIT8253, 0)
21322132   MCFG_PIT8253_CLK0(31250)
21332133   MCFG_PIT8253_OUT0_HANDLER(WRITELINE(mz2500_state, pit8253_clk0_irq))
trunk/src/mess/drivers/m20.c
r29404r29405
6565      m_floppy0(*this, "fd1797:0:5dd"),
6666      m_floppy1(*this, "fd1797:1:5dd"),
6767      m_p_videoram(*this, "p_videoram"),
68      m_palette(*this, "palette")
68      m_palette(*this, "palette")
6969   {
7070   }
7171
r29404r29405
163163      m_kbrecv_data = (m_kbrecv_data >> 1) | (state ? (1<<10) : 0);
164164      if (m_kbrecv_bitcount == 11) {
165165         data = (m_kbrecv_data >> 1) & 0xff;
166//         printf ("0x%02X received by keyboard\n", data);
166//          printf ("0x%02X received by keyboard\n", data);
167167         switch (data) {
168168            case 0x03: m_kbdi8251->receive_character(2); printf ("sending 2 back from kb...\n"); break;
169169            case 0x0a: break;
r29404r29405
173173         m_kbrecv_in_progress = 0;
174174      }
175175   }
176   else
176   else
177177   {
178178      if (state == 0)
179179      {
180         m_kbrecv_in_progress = 1;
180         m_kbrecv_in_progress = 1;
181181         m_kbrecv_bitcount = 1;
182182         m_kbrecv_data = state ? (1<<10) : 0;
183183      }
r29404r29405
388388
389389void m20_state::install_memory()
390390{
391
392391   m_memsize = m_ram->size();
393392   UINT8 *memptr = m_ram->pointer();
394393   address_space& pspace = m_maincpu->space(AS_PROGRAM);
r29404r29405
811810
812811void m20_state::machine_start()
813812{
814
815813   install_memory();
816814}
817815
r29404r29405
937935
938936   /* Devices */
939937   MCFG_FD1797x_ADD("fd1797", 1000000)
940   MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("i8259", pic8259_device, ir0_w))   
938   MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("i8259", pic8259_device, ir0_w))
941939   MCFG_FLOPPY_DRIVE_ADD("fd1797:0", m20_floppies, "5dd", m20_state::floppy_formats)
942940   MCFG_FLOPPY_DRIVE_ADD("fd1797:1", m20_floppies, "5dd", m20_state::floppy_formats)
943941   MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK/8, mc6845_intf) /* hand tuned to get ~50 fps */
r29404r29405
991989/*    YEAR  NAME   PARENT  COMPAT  MACHINE INPUT   INIT COMPANY     FULLNAME        FLAGS */
992990COMP( 1981, m20,   0,      0,      m20,    m20, m20_state,    m20,  "Olivetti", "Olivetti L1 M20", GAME_NOT_WORKING | GAME_NO_SOUND)
993991COMP( 1981, m40,   m20,    0,      m20,    m20, m20_state,    m20, "Olivetti", "Olivetti L1 M40", GAME_NOT_WORKING | GAME_NO_SOUND)
994
trunk/src/mess/drivers/super80.c
r29404r29405
697697   MCFG_CPU_PROGRAM_MAP(super80m_map)
698698
699699   MCFG_GFXDECODE_MODIFY("gfxdecode", super80m)
700   
700
701701   MCFG_PALETTE_MODIFY("palette")
702702   MCFG_PALETTE_ENTRIES(16)
703703   MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
r29404r29405
721721   MCFG_SCREEN_SIZE(SUPER80V_SCREEN_WIDTH, SUPER80V_SCREEN_HEIGHT)
722722   MCFG_SCREEN_VISIBLE_AREA(0, SUPER80V_SCREEN_WIDTH-1, 0, SUPER80V_SCREEN_HEIGHT-1)
723723   MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80v)
724   MCFG_SCREEN_VBLANK_DRIVER(super80_state, screen_eof_super80m)   
724   MCFG_SCREEN_VBLANK_DRIVER(super80_state, screen_eof_super80m)
725725
726726   MCFG_PALETTE_ADD("palette", 16)
727727   MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
trunk/src/mess/drivers/tk80bs.c
r29404r29405
3838      m_maincpu(*this, "maincpu"),
3939      m_ppi(*this, "ppi"),
4040      m_gfxdecode(*this, "gfxdecode"),
41      m_palette(*this, "palette")
41      m_palette(*this, "palette")
4242   {
4343   }
4444
r29404r29405
196196   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 128-1)
197197   MCFG_SCREEN_UPDATE_DRIVER(tk80bs_state, screen_update_tk80bs)
198198   MCFG_SCREEN_PALETTE("palette")
199   
199
200200   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
201201   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tk80bs)
202202
trunk/src/mess/drivers/multi8.c
r29404r29405
674674   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
675675   MCFG_SCREEN_UPDATE_DRIVER(multi8_state, screen_update_multi8)
676676   MCFG_SCREEN_PALETTE("palette")
677   
677
678678   MCFG_PALETTE_ADD("palette", 8)
679679   MCFG_PALETTE_INIT_OWNER(multi8_state, multi8)
680680   MCFG_GFXDECODE_ADD("gfxdecode", "palette", multi8)
trunk/src/mess/drivers/esqmr.c
r29404r29405
1212    Memory map:
1313
1414    0x000000-0x0FFFFF   OS ROM
15
15
1616    MR Rack
17   Ensoniq, 1995
17    Ensoniq, 1995
1818
19   This is a 64-voice expandable synth module made by Ensoniq in 1995.
20   It is shipped with 12MB of 16-bit 44.1kHz wave data and can be expanded
21   with up to 3 ENSONIQ EXP Series Wave Expansion Boards containing up to a
22   maximum of 84MB of additional wave data.
19    This is a 64-voice expandable synth module made by Ensoniq in 1995.
20    It is shipped with 12MB of 16-bit 44.1kHz wave data and can be expanded
21    with up to 3 ENSONIQ EXP Series Wave Expansion Boards containing up to a
22    maximum of 84MB of additional wave data.
2323
2424
25   PCB Layout
26   ----------
25    PCB Layout
26    ----------
2727
28   PN: 4001028501 REV C
29   |--------------------------------------------------------|
30   | J6  J7          J12  J13               J21   J23    J22|
31   |                                                      J5|
32   |       4565  4565                          HP_6N138     |
33   |                                                        |
34   |                                      BATTERY   7407    |
35   |     4565                                               |
36   |                                                        |
37   |          OTTOR2  OTTOR2                                |
38   |AD1861                                                  |
39   |AD1861                                                  |
40   |AD1861                                                  |
41   |AD1861                                    |--J3-----|   |
42   | HC04                                     |EXPANSION|   |
43   |                                          |BOARD #3 |   |
44   |                                          |         |   |
45   |            1370001501                    |         |   |
46   |                                          |         |   |
47   |                                          |--J8-----|   |
48   |     ESP2                         ROM2                  |
49   |                                          |--J2-----|   |
50   |                                          |EXPANSION|   |
51   |                                  ROM0    |BOARD #2 |   |
52   |                                          |         |   |
53   | D43256               IDT7130             |         |   |
54   | D43256  35MHz  16MHz             ROM1    |         |   |
55   | D43256               J14                 |--J9-----|   |
56   | D43256     22.5792MHz                            ADM691|
57   | D43256             MC68340               |--J1-----|   |
58   | D43256                                   |EXPANSION|   |
59   |                    6MHz                  |BOARD #1 |   |
60   |                          EPROM_UP        |         |   |
61   |         MC68HC705C4A                KM681000       |   |
62   |J4                        EPROM_LO   KM681000       |J11|
63   |       J19        J18                     |--J10----|   |
64   |--------------------------------------------------------|
65   Notes:
66        J4/J18/J19   - Connectors to front panel buttons, LCD etc
67        J1/J10       - Connectors for expansion board #1
68        J2/J9        - Connectors for expansion board #2
69        J3/J8        - Connectors for expansion board #3
70        J11          - Memory card connector
71        J14          - JTAG connector
72        J6           - Main left/mono jack
73        J7           - Main right jack
74        J12          - Aux left/mono jack
75        J13          - Aux right jack
76        J21          - MIDI in connector
77        J23          - MIDI out connector
78        J22          - MIDI thru connector
79        J5           - Power input connector
80        1370001501   - Unknown TQFP144 IC stamped with the Ensoniq logo. Possibly CPLD?
81        ESP2         - Ensoniq ESP2 sound chip
82        OTTOR2       - Ensoniq OTTOR2 sound chip
83        ROM*         - 4M x8-bit SOP44 mask ROM
84        D43256       - NEC D43256 32k x8-bit Static RAM
85        HP_6N138     - HP/Agilent HP 6N138 Low Input Current High Gain Optocoupler
86        4565         - JRC4565 Dual Operational Amplifier
87        AD1861       - Analog Devices AD1861 16-bit/18-bit PCM Audio DAC
88        MC68HC705C4A - Motorola MC68HC705C4A Microcontroller. Clock input is tied to the TQFP CPLD
89        MC68340      - Motorola MC68340PV16E 68000-compatible 32-bit processor with on-board peripherals. Clock input 6.000MHz
90        EPROM*       - 27C4001 EPROM
91        IDT7130      - IDT7130 High Speed 1k x8-bit Dual Port Static RAM
92        KM681000     - Samsung KM681000 128k x8-bit Static RAM
93        ADM691       - Analog Devices ADM691 Microprocessor Supervisory Circuit with Automatic Battery Backup Switching
94   
28    PN: 4001028501 REV C
29    |--------------------------------------------------------|
30    | J6  J7          J12  J13               J21   J23    J22|
31    |                                                      J5|
32    |       4565  4565                          HP_6N138     |
33    |                                                        |
34    |                                      BATTERY   7407    |
35    |     4565                                               |
36    |                                                        |
37    |          OTTOR2  OTTOR2                                |
38    |AD1861                                                  |
39    |AD1861                                                  |
40    |AD1861                                                  |
41    |AD1861                                    |--J3-----|   |
42    | HC04                                     |EXPANSION|   |
43    |                                          |BOARD #3 |   |
44    |                                          |         |   |
45    |            1370001501                    |         |   |
46    |                                          |         |   |
47    |                                          |--J8-----|   |
48    |     ESP2                         ROM2                  |
49    |                                          |--J2-----|   |
50    |                                          |EXPANSION|   |
51    |                                  ROM0    |BOARD #2 |   |
52    |                                          |         |   |
53    | D43256               IDT7130             |         |   |
54    | D43256  35MHz  16MHz             ROM1    |         |   |
55    | D43256               J14                 |--J9-----|   |
56    | D43256     22.5792MHz                            ADM691|
57    | D43256             MC68340               |--J1-----|   |
58    | D43256                                   |EXPANSION|   |
59    |                    6MHz                  |BOARD #1 |   |
60    |                          EPROM_UP        |         |   |
61    |         MC68HC705C4A                KM681000       |   |
62    |J4                        EPROM_LO   KM681000       |J11|
63    |       J19        J18                     |--J10----|   |
64    |--------------------------------------------------------|
65    Notes:
66          J4/J18/J19   - Connectors to front panel buttons, LCD etc
67          J1/J10       - Connectors for expansion board #1
68          J2/J9        - Connectors for expansion board #2
69          J3/J8        - Connectors for expansion board #3
70          J11          - Memory card connector
71          J14          - JTAG connector
72          J6           - Main left/mono jack
73          J7           - Main right jack
74          J12          - Aux left/mono jack
75          J13          - Aux right jack
76          J21          - MIDI in connector
77          J23          - MIDI out connector
78          J22          - MIDI thru connector
79          J5           - Power input connector
80          1370001501   - Unknown TQFP144 IC stamped with the Ensoniq logo. Possibly CPLD?
81          ESP2         - Ensoniq ESP2 sound chip
82          OTTOR2       - Ensoniq OTTOR2 sound chip
83          ROM*         - 4M x8-bit SOP44 mask ROM
84          D43256       - NEC D43256 32k x8-bit Static RAM
85          HP_6N138     - HP/Agilent HP 6N138 Low Input Current High Gain Optocoupler
86          4565         - JRC4565 Dual Operational Amplifier
87          AD1861       - Analog Devices AD1861 16-bit/18-bit PCM Audio DAC
88          MC68HC705C4A - Motorola MC68HC705C4A Microcontroller. Clock input is tied to the TQFP CPLD
89          MC68340      - Motorola MC68340PV16E 68000-compatible 32-bit processor with on-board peripherals. Clock input 6.000MHz
90          EPROM*       - 27C4001 EPROM
91          IDT7130      - IDT7130 High Speed 1k x8-bit Dual Port Static RAM
92          KM681000     - Samsung KM681000 128k x8-bit Static RAM
93          ADM691       - Analog Devices ADM691 Microprocessor Supervisory Circuit with Automatic Battery Backup Switching
9594
96   Additional notes from the manual:
97   ---------------------------------
9895
99   The MR-Rack can play special demonstration songs to give you an idea of how terrific it sounds.
96    Additional notes from the manual:
97    ---------------------------------
10098
101   To Play the MR-Rack Main Demo
102   1. Press the Audition button, and hold it down.
103   2. While still holding Audition, press the Save button.
104   3. Let go of both buttons.
99    The MR-Rack can play special demonstration songs to give you an idea of how terrific it sounds.
105100
106   In an unexpanded MR-Rack, the display shows:
101    To Play the MR-Rack Main Demo
102    1. Press the Audition button, and hold it down.
103    2. While still holding Audition, press the Save button.
104    3. Let go of both buttons.
107105
108   Hit ENTER to Play:
109   MAINDEMO:MR Internal
106    In an unexpanded MR-Rack, the display shows:
110107
111   If you've installed any Expansion boards or a ROM card containing MAINDEMO-type
112   demonstration songs, your display will differ. Turn the Value knob counter-clockwise
113   until the display looks as it does above.
108    Hit ENTER to Play:
109    MAINDEMO:MR Internal
114110
115   Note: When MR-Rack demos are being viewed or playing, MIDI In is disabled.
111    If you've installed any Expansion boards or a ROM card containing MAINDEMO-type
112    demonstration songs, your display will differ. Turn the Value knob counter-clockwise
113    until the display looks as it does above.
116114
117   4. Press Enter to play the demo.
118   5. Press Enter again to stop the demo.
119   6. When you're done listening to the demo song, press Exit to return to normal MR-Rack
115    Note: When MR-Rack demos are being viewed or playing, MIDI In is disabled.
120116
117    4. Press Enter to play the demo.
118    5. Press Enter again to stop the demo.
119    6. When you're done listening to the demo song, press Exit to return to normal MR-Rack
121120
122   The Version Number of Your MR-Rack Operating System:
123   You can easily find out what operating system (or O.S.) your MR-Rack is currently using.
124   To Find the Operating System:
125   1. Press the Save button and hold it down.
126   2. While still holding the Save button, press the System button.
127   The display briefly shows your current Operating System:
128121
129   ENSONIQ MR-RACK
130   O.S. Version: #.##
122    The Version Number of Your MR-Rack Operating System:
123    You can easily find out what operating system (or O.S.) your MR-Rack is currently using.
124    To Find the Operating System:
125    1. Press the Save button and hold it down.
126    2. While still holding the Save button, press the System button.
127    The display briefly shows your current Operating System:
131128
129    ENSONIQ MR-RACK
130    O.S. Version: #.##
132131
133132
134   ENSONIQ EXP Series Wave Expansion Boards
135   ----------------------------------------
136133
137   These are small plug-in boards containing a 256k x8-bit EPROM (27C020) and from 1 to 6
138   SOP44 mask ROMs. These add additional digital sound waves. These can be used with the MR
139   Rack, the full-size MR Keyboards and a few other models.
134    ENSONIQ EXP Series Wave Expansion Boards
135    ----------------------------------------
140136
141   PCB Layout
142   ----------
137    These are small plug-in boards containing a 256k x8-bit EPROM (27C020) and from 1 to 6
138    SOP44 mask ROMs. These add additional digital sound waves. These can be used with the MR
139    Rack, the full-size MR Keyboards and a few other models.
143140
144   PN: 4001033401 REV B
145   |------------------|
146   |                  |
147   |    U6       U7   |
148   |-                 |
149   ||                 |
150   ||            U1   |
151   ||    U2          -|
152   ||                ||
153   ||                ||
154   ||    U3          ||
155   ||                ||
156   ||             U8 ||
157   ||    U4          ||
158   ||                ||
159   ||                ||
160   ||    U5          ||
161   |-                -|
162   |------------------|
163   Notes:
164        U1       - AC138 logic chip
165        U2 to U7 - 4M x 8-bit or 2M x 8-bit SOP44 mask ROM
166        U8       - 27C020 EPROM
141    PCB Layout
142    ----------
167143
168   The EXP boards dumped so far are....
144    PN: 4001033401 REV B
145    |------------------|
146    |                  |
147    |    U6       U7   |
148    |-                 |
149    ||                 |
150    ||            U1   |
151    ||    U2          -|
152    ||                ||
153    ||                ||
154    ||    U3          ||
155    ||                ||
156    ||             U8 ||
157    ||    U4          ||
158    ||                ||
159    ||                ||
160    ||    U5          ||
161    |-                -|
162    |------------------|
163    Notes:
164          U1       - AC138 logic chip
165          U2 to U7 - 4M x 8-bit or 2M x 8-bit SOP44 mask ROM
166          U8       - 27C020 EPROM
169167
170                      MROM  # of
171   Name            Version  Size  MROMs
172   -----------------------------------
173   Piano           V1.00    4M    4 (multisampled pianos, aka "The Perfect Piano")
174   The Real World  V1.01    4M    6 (non-Western percusson and other "world music" sounds)
175   Drum            V1.00    2M    1 (additional drum kits that are built in to the MR keyboards)
168    The EXP boards dumped so far are....
176169
170                             MROM  # of
171    Name            Version  Size  MROMs
172    -----------------------------------
173    Piano           V1.00    4M    4 (multisampled pianos, aka "The Perfect Piano")
174    The Real World  V1.01    4M    6 (non-Western percusson and other "world music" sounds)
175    Drum            V1.00    2M    1 (additional drum kits that are built in to the MR keyboards)
177176
178   Additional notes from the manual:
179   ---------------------------------
180177
181   The MR-Rack provides three displays which can identify any EXP Wave Expansion boards
182   you have installed.
178    Additional notes from the manual:
179    ---------------------------------
183180
184   To Identify an Installed Expansion Board
185   1. Press the System button.
186   2. Turn the Parameter knob until the display shows:
181    The MR-Rack provides three displays which can identify any EXP Wave Expansion boards
182    you have installed.
187183
188   System parameters:
189   WaveEXP1:xxxxxxxxxxx
184    To Identify an Installed Expansion Board
185    1. Press the System button.
186    2. Turn the Parameter knob until the display shows:
190187
191   When an Expansion Board is installed, this read-only display will show the name of the
192   Expansion Board located in the first slot.
188    System parameters:
189    WaveEXP1:xxxxxxxxxxx
193190
194   3. Turning the Parameter knob two more times will reveal two more displays which show
195   the names of the Expansion Boards in Wave EXP Slots 2 and 3 (if they're installed).
196   If there are no Expansion Boards installed, the display will show "WaveEXP1= **EMPTY**."
197 
191    When an Expansion Board is installed, this read-only display will show the name of the
192    Expansion Board located in the first slot.
193
194    3. Turning the Parameter knob two more times will reveal two more displays which show
195    the names of the Expansion Boards in Wave EXP Slots 2 and 3 (if they're installed).
196    If there are no Expansion Boards installed, the display will show "WaveEXP1= **EMPTY**."
197
198198***************************************************************************/
199199
200200#include "emu.h"
r29404r29405
220220public:
221221   DECLARE_DRIVER_INIT(mr);
222222   DECLARE_WRITE_LINE_MEMBER(esq5506_otto_irq);
223   DECLARE_READ16_MEMBER(esq5506_read_adc);   
223   DECLARE_READ16_MEMBER(esq5506_read_adc);
224224};
225225
226226void esqmr_state::machine_reset()
r29404r29405
302302ROM_START( mrrack )
303303   // 68340 main MCU
304304   ROM_REGION(0x100000, "maincpu", 0)
305   ROM_LOAD16_BYTE( "mr_r_ec51_lo_1.50.u36", 0x000001, 0x080000, CRC(b29988a1) SHA1(986c2def11de27fa2b9be55ac32f7fec0c414bca) )
306   ROM_LOAD16_BYTE( "mr_r_9dac_up_1.50.u35", 0x000000, 0x080000, CRC(71511692) SHA1(54744f16f1db1ac5abb2f70b6e04aebf1e0e029d) )
305   ROM_LOAD16_BYTE( "mr_r_ec51_lo_1.50.u36", 0x000001, 0x080000, CRC(b29988a1) SHA1(986c2def11de27fa2b9be55ac32f7fec0c414bca) )
306   ROM_LOAD16_BYTE( "mr_r_9dac_up_1.50.u35", 0x000000, 0x080000, CRC(71511692) SHA1(54744f16f1db1ac5abb2f70b6e04aebf1e0e029d) )
307307
308308   // 68705 display/front panel MCU
309309   ROM_REGION(0x2000, "mcu", 0)
310   ROM_LOAD( "68hc705.u40",  0x000000, 0x002000, CRC(7b0291a7) SHA1(c92c19ce9289b7b21dbc915475cdff8930e3c677) )
310   ROM_LOAD( "68hc705.u40",  0x000000, 0x002000, CRC(7b0291a7) SHA1(c92c19ce9289b7b21dbc915475cdff8930e3c677) )
311311
312312   ROM_REGION(0x400000, "waverom", ROMREGION_ERASE00)
313   ROM_LOAD( "1351000901_h-rom0.u5", 0x000000, 0x400000, CRC(89654b42) SHA1(4bdffd8060eb20cdb01f6178222aeb32fdbfd703) )
313   ROM_LOAD( "1351000901_h-rom0.u5", 0x000000, 0x400000, CRC(89654b42) SHA1(4bdffd8060eb20cdb01f6178222aeb32fdbfd703) )
314314
315315   ROM_REGION(0x400000, "waverom2", ROMREGION_ERASE00)
316   ROM_LOAD( "1351000902_h-rom1.u23", 0x000000, 0x400000, CRC(4a19e517) SHA1(e819f1e0b50c4911c4855ad95ed505998a2bbe86) )
316   ROM_LOAD( "1351000902_h-rom1.u23", 0x000000, 0x400000, CRC(4a19e517) SHA1(e819f1e0b50c4911c4855ad95ed505998a2bbe86) )
317317
318318   ROM_REGION(0x400000, "waverom3", ROMREGION_ERASE00)
319   ROM_LOAD( "1351000903_h-rom2.u24", 0x000000, 0x400000, CRC(c9ab1214) SHA1(92f48b068bbe49eacbffd03e428599e3ab21b8ec) )
319   ROM_LOAD( "1351000903_h-rom2.u24", 0x000000, 0x400000, CRC(c9ab1214) SHA1(92f48b068bbe49eacbffd03e428599e3ab21b8ec) )
320320
321321   ROM_REGION(0x200000, "waverom4", ROMREGION_ERASE00)
322322ROM_END
trunk/src/mess/drivers/psion.c
r29404r29405
388388   m_nvram2->set_base(m_ram, m_ram.bytes());
389389   if (m_nvram3)
390390      m_nvram3->set_base(m_paged_ram, m_ram_bank_count * 0x4000);
391   
391
392392   save_item(NAME(m_kb_counter));
393393   save_item(NAME(m_enable_nmi));
394394   save_item(NAME(m_tcsr_value));
r29404r29405
467467   MCFG_SCREEN_SIZE(6*16, 9*2)
468468   MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
469469   MCFG_SCREEN_PALETTE("palette")
470   
470
471471   MCFG_DEFAULT_LAYOUT(layout_lcd)
472472   MCFG_PALETTE_ADD("palette", 2)
473473   MCFG_PALETTE_INIT_OWNER(psion_state, psion)
r29404r29405
481481   MCFG_SOUND_ADD( "beeper", BEEP, 0 )
482482   MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 )
483483
484   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram1", psion_state, nvram_init)      // sys_regs
484   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram1", psion_state, nvram_init)     // sys_regs
485485   MCFG_NVRAM_ADD_0FILL("nvram2")                                      // RAM
486486
487487   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", psion_state, nmi_timer, attotime::from_seconds(1))
trunk/src/mess/drivers/vtech1.c
r29404r29405
923923static const mc6847_interface vtech1_mc6847_intf =
924924{
925925   "screen",
926   DEVCB_DRIVER_MEMBER(vtech1_state,vtech1_mc6847_videoram_r),   
926   DEVCB_DRIVER_MEMBER(vtech1_state,vtech1_mc6847_videoram_r),
927927
928928   DEVCB_NULL,                                 /* AG */
929929   DEVCB_LINE_GND,                             /* GM2 */
r29404r29405
963963   /* video hardware */
964964   MCFG_SCREEN_MC6847_PAL_ADD("screen", "mc6847")
965965   MCFG_MC6847_ADD("mc6847", MC6847_PAL, XTAL_4_433619MHz, vtech1_mc6847_bw_intf)
966   MCFG_MC6847_FSYNC_CALLBACK(INPUTLINE("maincpu", 0))   
966   MCFG_MC6847_FSYNC_CALLBACK(INPUTLINE("maincpu", 0))
967967
968968   /* sound hardware */
969969   MCFG_SPEAKER_STANDARD_MONO("mono")
r29404r29405
999999static MACHINE_CONFIG_DERIVED( laser200, laser110 )
10001000   MCFG_DEVICE_REMOVE("mc6847")
10011001   MCFG_MC6847_ADD("mc6847", MC6847_PAL, XTAL_4_433619MHz, vtech1_mc6847_intf)
1002   MCFG_MC6847_FSYNC_CALLBACK(INPUTLINE("maincpu", 0))   
1002   MCFG_MC6847_FSYNC_CALLBACK(INPUTLINE("maincpu", 0))
10031003MACHINE_CONFIG_END
10041004
10051005static MACHINE_CONFIG_DERIVED( laser210, laser200 )
r29404r29405
10281028   MCFG_CPU_IO_MAP(vtech1_shrg_io)
10291029   MCFG_DEVICE_REMOVE("mc6847")
10301030   MCFG_MC6847_ADD("mc6847", MC6847_PAL, XTAL_4_433619MHz, vtech1_shrg_mc6847_intf)
1031   MCFG_MC6847_FSYNC_CALLBACK(INPUTLINE("maincpu", 0))   
1031   MCFG_MC6847_FSYNC_CALLBACK(INPUTLINE("maincpu", 0))
10321032MACHINE_CONFIG_END
10331033
10341034
trunk/src/mess/drivers/pda600.c
r29404r29405
209209   MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 320-1)
210210   MCFG_SCREEN_UPDATE_DRIVER( pda600_state, screen_update )
211211   MCFG_SCREEN_PALETTE("palette")
212   
212
213213   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pda600)
214214   MCFG_DEFAULT_LAYOUT(layout_lcd)
215215   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
trunk/src/mess/drivers/apricot.c
r29404r29405
170170
171171WRITE8_MEMBER( apricot_state::i8255_portc_w )
172172{
173//   schematic page 294 says pc4 outputs to centronics pin 13, which is the "select" output from the printer.
173//  schematic page 294 says pc4 outputs to centronics pin 13, which is the "select" output from the printer.
174174   m_centronics->write_strobe(BIT(data, 5));
175//   schematic page 294 says pc6 outputs to centronics pin 15, which is unused
175//  schematic page 294 says pc6 outputs to centronics pin 15, which is unused
176176}
177177
178178static const i8255_interface apricot_i8255a_intf =
trunk/src/mess/drivers/vt520.c
r29404r29405
8585   MCFG_SCREEN_VISIBLE_AREA(0, 802-1, 0, 480-1)
8686   MCFG_SCREEN_UPDATE_DRIVER(vt520_state, screen_update_vt520)
8787   MCFG_SCREEN_PALETTE("palette")
88   
88
8989   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
9090
9191   // On the board there are two M5M44256BJ-7 chips
trunk/src/mess/drivers/sym1.c
r29404r29405
324324
325325   // devices
326326   MCFG_RIOT6532_ADD("riot", SYM1_CLOCK, sym1_r6532_interface)
327   
327
328328   MCFG_DEVICE_ADD("ttl74145", TTL74145, 0)
329329   MCFG_TTL74145_OUTPUT_LINE_0_CB(WRITELINE(sym1_state, sym1_74145_output_0_w))
330330   MCFG_TTL74145_OUTPUT_LINE_1_CB(WRITELINE(sym1_state, sym1_74145_output_1_w))
r29404r29405
334334   MCFG_TTL74145_OUTPUT_LINE_5_CB(WRITELINE(sym1_state, sym1_74145_output_5_w))
335335   MCFG_TTL74145_OUTPUT_LINE_6_CB(DEVWRITELINE("speaker", speaker_sound_device, level_w))
336336   // lines 7-9 not connected
337   
337
338338   MCFG_DEVICE_ADD("via6522_0", VIA6522, 0)
339339   MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m6502_device, irq_line))
340340
trunk/src/mess/drivers/v6809.c
r29404r29405
108108   required_device<speaker_sound_device> m_speaker;
109109   required_device<acia6850_device> m_acia0;
110110   required_device<acia6850_device> m_acia1;
111public:   
111public:
112112   required_device<palette_device> m_palette;
113113};
114114
trunk/src/mess/drivers/x68k.c
r29404r29405
10571057   m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
10581058   m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
10591059   timer_set(m_maincpu->cycles_to_attotime(16), TIMER_X68K_BUS_ERROR); // let rmw cycles complete
1060   logerror("%s: Bus error: Unused RAM access [%08x]\n", machine().describe_context(), address);   
1060   logerror("%s: Bus error: Unused RAM access [%08x]\n", machine().describe_context(), address);
10611061}
10621062
10631063READ16_MEMBER(x68k_state::x68k_rom0_r)
r29404r29405
18731873   MCFG_SCREEN_VISIBLE_AREA(0, 767, 0, 511)
18741874   MCFG_SCREEN_UPDATE_DRIVER(x68k_state, screen_update_x68000)
18751875   MCFG_SCREEN_PALETTE("palette")
1876   
1876
18771877   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
18781878
18791879   MCFG_PALETTE_ADD("palette", 65536)
trunk/src/mess/drivers/special.c
r29404r29405
375375   MCFG_VIDEO_START_OVERRIDE(special_state,special)
376376   MCFG_SCREEN_UPDATE_DRIVER(special_state, screen_update_special)
377377   MCFG_SCREEN_PALETTE("palette")
378   
378
379379   MCFG_PALETTE_ADD("palette", 2)
380380
381381   /* audio hardware */
r29404r29405
419419   MCFG_SCREEN_MODIFY("screen")
420420   MCFG_SCREEN_UPDATE_DRIVER(special_state, screen_update_specimx)
421421   MCFG_VIDEO_START_OVERRIDE(special_state,specimx)
422   
422
423423   MCFG_PALETTE_MODIFY("palette")
424424   MCFG_PALETTE_ENTRIES(16)
425425   MCFG_PALETTE_INIT_OWNER(special_state, specimx )
r29404r29405
436436   MCFG_PIT8253_OUT1_HANDLER(DEVWRITELINE("custom", specimx_sound_device, set_input_ch1))
437437   MCFG_PIT8253_CLK2(2000000)
438438   MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("custom", specimx_sound_device, set_input_ch2))
439   
439
440440   MCFG_DEVICE_REMOVE("ppi8255")
441441   MCFG_I8255_ADD( "ppi8255", specimx_ppi8255_interface )
442442   MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
r29404r29405
467467   MCFG_VIDEO_START_OVERRIDE(special_state,erik)
468468   MCFG_SCREEN_UPDATE_DRIVER(special_state, screen_update_erik)
469469   MCFG_SCREEN_PALETTE("palette")
470   
470
471471   MCFG_PALETTE_ADD("palette", 8)
472472   MCFG_PALETTE_INIT_OWNER(special_state,erik)
473473
trunk/src/mess/drivers/jupiter.c
r29404r29405
290290   MCFG_SCREEN_SIZE(512, 320)
291291   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 320-1)
292292   MCFG_SCREEN_PALETTE("palette")
293   
294   
293
294
295295   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
296296
297297   // devices
trunk/src/mess/drivers/mes.c
r29404r29405
117117   MCFG_SCREEN_SIZE(640, 250)
118118   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
119119   MCFG_SCREEN_PALETTE("palette")
120   
120
121121   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
122122MACHINE_CONFIG_END
123123
trunk/src/mess/drivers/sm1800.c
r29404r29405
189189   MCFG_PALETTE_ADD("palette", 3)
190190   MCFG_PALETTE_INIT_OWNER(sm1800_state, sm1800)
191191
192   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sm1800)   
192   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sm1800)
193193
194194   /* Devices */
195195   MCFG_I8255_ADD ("i8255", sm1800_ppi8255_interface )
trunk/src/mess/drivers/compis.c
r29404r29405
712712   MCFG_SCREEN_SIZE(640, 400)
713713   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
714714   MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update)
715   
715
716716   MCFG_DEVICE_ADD("upd7220", UPD7220, XTAL_4_433619MHz/2) // unknown clock
717717   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_map)
718   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(compis_state, hgdc_display_pixels)   
718   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(compis_state, hgdc_display_pixels)
719719   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
720   
720
721721   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
722722
723723   // devices
trunk/src/mess/drivers/megadriv.c
r29404r29405
286286{
287287   MACHINE_START_CALL_MEMBER( md_common );
288288
289   // the segaCD introduces some kind of DMA 'lag', which we have to compensate for,
289   // the segaCD introduces some kind of DMA 'lag', which we have to compensate for,
290290   // at least when reading wordram? we might need to check what mode we're in the DMA...
291291   m_vdp->set_dma_delay(2);
292292}
r29404r29405
295295{
296296   m_maincpu->reset();
297297   MACHINE_RESET_CALL_MEMBER( megadriv );
298   
298
299299   // if the system has a 32x, pause the extra CPUs until they are actually turned on
300300   if (m_32x)
301301      m_32x->pause_cpu();
r29404r29405
306306{
307307   if (m_io_reset->read_safe(0x00) & 0x01)
308308      m_maincpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
309   
309
310310   // rising edge
311311   if (state)
312312   {
r29404r29405
315315         bool mode3 = (m_vdp->get_imode() == 3);
316316         m_vdp->vdp_handle_eof();
317317         m_vdp->m_megadriv_scanline_timer->adjust(attotime::zero);
318         
318
319319         if (m_32x)
320320         {
321321            m_32x->m_32x_vblank_flag = 0;
r29404r29405
410410      m_segacd->set_framerate(60);
411411      m_segacd->set_total_scanlines(262);
412412   }
413   
414   m_version_hi_nibble = 0x80;   // Export NTSC
413
414   m_version_hi_nibble = 0x80; // Export NTSC
415415   if (!m_segacd)
416416      m_version_hi_nibble |= 0x20;
417417}
r29404r29405
420420{
421421   DRIVER_INIT_CALL(megadrie);
422422   DRIVER_INIT_CALL(mess_md_common);
423   
423
424424   if (m_32x)
425425   {
426426      m_32x->set_32x_pal(TRUE);
r29404r29405
432432      m_segacd->set_framerate(50);
433433      m_segacd->set_total_scanlines(313);
434434   }
435   
436   m_version_hi_nibble = 0xc0;   // Export PAL
435
436   m_version_hi_nibble = 0xc0; // Export PAL
437437   if (!m_segacd)
438438      m_version_hi_nibble |= 0x20;
439439}
r29404r29405
442442{
443443   DRIVER_INIT_CALL(megadrij);
444444   DRIVER_INIT_CALL(mess_md_common);
445   
445
446446   if (m_32x)
447447   {
448448      m_32x->set_32x_pal(FALSE);
r29404r29405
454454      m_segacd->set_framerate(60);
455455      m_segacd->set_total_scanlines(262);
456456   }
457   
458   m_version_hi_nibble = 0x00;   // JPN NTSC
457
458   m_version_hi_nibble = 0x00; // JPN NTSC
459459   if (!m_segacd)
460460      m_version_hi_nibble |= 0x20;
461461}
r29404r29405
728728   MCFG_SCREEN_VBLANK_DRIVER(md_cons_state, screen_eof_console)
729729
730730   MCFG_DEVICE_ADD("segacd", SEGA_SEGACD_JAPAN, 0)
731   
731
732732   MCFG_CDROM_ADD( "cdrom",scd_cdrom )
733733
734734   MCFG_SOFTWARE_LIST_ADD("cd_list","megacdj")
trunk/src/mess/drivers/d6800.c
r29404r29405
392392   MCFG_SCREEN_UPDATE_DRIVER(d6800_state, screen_update_d6800)
393393   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(25))
394394   MCFG_SCREEN_PALETTE("palette")
395   
395
396396   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
397397
398398   /* sound hardware */
trunk/src/mess/drivers/rx78.c
r29404r29405
5757      m_maincpu(*this, "maincpu"),
5858      m_cass(*this, "cassette"),
5959      m_ram(*this, RAM_TAG),
60      m_palette(*this, "palette")
60      m_palette(*this, "palette")
6161   { }
6262
6363   DECLARE_READ8_MEMBER( key_r );
r29404r29405
472472   MCFG_SCREEN_SIZE(192, 184)
473473   MCFG_SCREEN_VISIBLE_AREA(0, 192-1, 0, 184-1)
474474   MCFG_SCREEN_PALETTE("palette")
475   
475
476476   MCFG_PALETTE_ADD("palette", 16+1) //+1 for the background color
477477   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rx78)
478478
trunk/src/mess/drivers/tim100.c
r29404r29405
1818   tim100_state(const machine_config &mconfig, device_type type, const char *tag)
1919      : driver_device(mconfig, type, tag),
2020         m_maincpu(*this, "maincpu"),
21         m_palette(*this, "palette")
21         m_palette(*this, "palette")
2222      { }
2323
2424   required_device<cpu_device> m_maincpu;
trunk/src/mess/drivers/psx.c
r29404r29405
623623   ROM_FILL( 0x0400, 0x0c00, 0xff )
624624   ROM_LOAD( "scea.ic304",   0x001000, 0x004000, CRC(82729934) SHA1(7d5f52eb9df1243dcdab32cb763a9eb6a22706d7) )
625625   ROM_FILL( 0x5000, 0xae00, 0xff )
626   ROM_LOAD( "test.ic304",   0x00fe00, 0x000200, CRC(3b2f8041) SHA1(d7127cb4a9b5efe9deffab3b72ab4451cb30675b) )   
626   ROM_LOAD( "test.ic304",   0x00fe00, 0x000200, CRC(3b2f8041) SHA1(d7127cb4a9b5efe9deffab3b72ab4451cb30675b) )
627627ROM_END
628628
629629ROM_START( pse )
trunk/src/mess/drivers/pv1000.c
r29404r29405
470470
471471   MCFG_PALETTE_ADD( "palette", 8 )
472472   MCFG_PALETTE_INIT_OWNER(pv1000_state, pv1000)
473   
473
474474   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pv1000 )
475475
476476   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/bigbord2.c
r29404r29405
163163   required_memory_bank m_bankr;
164164   required_memory_bank m_bankv;
165165   required_memory_bank m_banka;
166public:   
166public:
167167   required_device<palette_device> m_palette;
168168};
169169
trunk/src/mess/drivers/applix.c
r29404r29405
195195   required_ioport m_io_k3b0;
196196   required_ioport m_io_k0b;
197197   required_shared_ptr<UINT16> m_expansion;
198public:   
198public:
199199   required_device<palette_device> m_palette;
200200};
201201
trunk/src/mess/drivers/sitcom.c
r29404r29405
113113   MCFG_CPU_IO_MAP(sitcom_io)
114114   MCFG_I8085A_SID(READLINE(sitcom_state, sid_line))
115115   MCFG_I8085A_SOD(WRITELINE(sitcom_state, sod_led))
116   
116
117117   MCFG_DEFAULT_LAYOUT(layout_sitcom)
118118
119119   /* video hardware */
trunk/src/mess/drivers/plus4.c
r29404r29405
690690   {
691691      m_acia->write_cts(0);
692692   }
693   
693
694694   m_spi_kb->write_p0(1);
695695   m_spi_kb->write_p1(1);
696696   m_spi_kb->write_p2(1);
trunk/src/mess/drivers/tim011.c
r29404r29405
145145   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
146146   MCFG_SCREEN_UPDATE_DRIVER(tim011_state, screen_update_tim011)
147147   MCFG_SCREEN_PALETTE("palette")
148   
148
149149   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
150150MACHINE_CONFIG_END
151151
trunk/src/mess/drivers/intv.c
r29404r29405
817817   MCFG_SCREEN_SIZE((STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTV_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTV_Y_SCALE)
818818   MCFG_SCREEN_VISIBLE_AREA(0, (STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTV_X_SCALE-1, 0, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTV_Y_SCALE-1)
819819   MCFG_SCREEN_PALETTE("palette")
820   
820
821821   MCFG_PALETTE_ADD("palette", 0x400)
822822   MCFG_PALETTE_INDIRECT_ENTRIES(32)
823823   MCFG_PALETTE_INIT_OWNER(intv_state, intv)
r29404r29405
874874   MCFG_GFXDECODE_ADD("gfxdecode", "palette", intvkbd)
875875   MCFG_PALETTE_MODIFY("palette")
876876   MCFG_PALETTE_INIT_OWNER(intv_state, intv)
877   
877
878878   MCFG_SCREEN_MODIFY("screen")
879879   MCFG_SCREEN_SIZE((STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTVKBD_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTVKBD_Y_SCALE)
880880   MCFG_SCREEN_VISIBLE_AREA(0, (STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTVKBD_X_SCALE-1, 0, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTVKBD_Y_SCALE-1)
trunk/src/mess/drivers/phc25.c
r29404r29405
266266   {
267267      return m_video_ram[offset];
268268   }
269   else   // text
269   else    // text
270270   {
271271      offset &= 0x7ff;
272272      m_vdg->inv_w(BIT(m_video_ram[offset | 0x800], 0)); // cursor attribute
trunk/src/mess/drivers/compucolor.c
r29404r29405
1010
1111/*
1212
13   TODO:
13    TODO:
1414
15   - floppy
16   - interlaced video
17   - add-on ROM
18   - add-on RAM
19   - add-on unit
15    - floppy
16    - interlaced video
17    - add-on ROM
18    - add-on RAM
19    - add-on unit
2020
2121*/
2222
23#define I8080_TAG   "ua2"
24#define TMS5501_TAG   "ud2"
25#define CRT5027_TAG   "uf9"
26#define RS232_TAG   "rs232"
23#define I8080_TAG   "ua2"
24#define TMS5501_TAG "ud2"
25#define CRT5027_TAG "uf9"
26#define RS232_TAG   "rs232"
2727
2828#include "bus/rs232/rs232.h"
2929#include "cpu/i8085/i8085.h"
r29404r29405
3737public:
3838   compucolor2_state(const machine_config &mconfig, device_type type, const char *tag)
3939      : driver_device(mconfig, type, tag),
40        m_maincpu(*this, I8080_TAG),
41        m_mioc(*this, TMS5501_TAG),
42        m_vtac(*this, CRT5027_TAG),
43        m_rs232(*this, RS232_TAG),
44        m_floppy0(*this, "cd0"),
45        m_floppy1(*this, "cd1"),
46        m_char_rom(*this, "chargen"),
47        m_video_ram(*this, "videoram"),
48        m_y0(*this, "Y0"),
49        m_y1(*this, "Y1"),
50        m_y2(*this, "Y2"),
51        m_y3(*this, "Y3"),
52        m_y4(*this, "Y4"),
53        m_y5(*this, "Y5"),
54        m_y6(*this, "Y6"),
55        m_y7(*this, "Y7"),
56        m_y8(*this, "Y8"),
57        m_y9(*this, "Y9"),
58        m_y10(*this, "Y10"),
59        m_y11(*this, "Y11"),
60        m_y12(*this, "Y12"),
61        m_y13(*this, "Y13"),
62        m_y14(*this, "Y14"),
63        m_y15(*this, "Y15"),
64        m_y128(*this, "Y128")
40         m_maincpu(*this, I8080_TAG),
41         m_mioc(*this, TMS5501_TAG),
42         m_vtac(*this, CRT5027_TAG),
43         m_rs232(*this, RS232_TAG),
44         m_floppy0(*this, "cd0"),
45         m_floppy1(*this, "cd1"),
46         m_char_rom(*this, "chargen"),
47         m_video_ram(*this, "videoram"),
48         m_y0(*this, "Y0"),
49         m_y1(*this, "Y1"),
50         m_y2(*this, "Y2"),
51         m_y3(*this, "Y3"),
52         m_y4(*this, "Y4"),
53         m_y5(*this, "Y5"),
54         m_y6(*this, "Y6"),
55         m_y7(*this, "Y7"),
56         m_y8(*this, "Y8"),
57         m_y9(*this, "Y9"),
58         m_y10(*this, "Y10"),
59         m_y11(*this, "Y11"),
60         m_y12(*this, "Y12"),
61         m_y13(*this, "Y13"),
62         m_y14(*this, "Y14"),
63         m_y15(*this, "Y15"),
64         m_y128(*this, "Y128")
6565   { }
6666
6767   required_device<cpu_device> m_maincpu;
r29404r29405
9393   virtual void machine_start();
9494   virtual void machine_reset();
9595   DECLARE_PALETTE_INIT(compucolor2);
96   
96
9797   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9898
9999   DECLARE_READ8_MEMBER( xi_r );
r29404r29405
299299      {
300300         UINT8 code = m_video_ram[offset++];
301301         UINT8 attr = m_video_ram[offset++];
302         
302
303303         offs_t char_offs = ((code & 0x7f) << 3) | (y & 0x07);
304304         if (BIT(code, 7)) char_offs = ((code & 0x7f) << 3) | ((y >> 1) & 0x07);
305305
r29404r29405
458458
459459   MCFG_PALETTE_ADD("palette", 8)
460460   MCFG_PALETTE_INIT_OWNER(compucolor2_state, compucolor2)
461   
461
462462   // video hardware
463463   MCFG_SCREEN_ADD("screen", RASTER)
464464   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mess/drivers/octopus.c
r29404r29405
178178   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
179179   MCFG_SCREEN_UPDATE_DRIVER(octopus_state, screen_update_octopus)
180180   MCFG_SCREEN_PALETTE("palette")
181   
181
182182   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
183183MACHINE_CONFIG_END
184184
trunk/src/mess/drivers/mz3500.c
r29404r29405
5050         m_fdc(*this, "upd765a"),
5151         m_video_ram(*this, "video_ram"),
5252         m_beeper(*this, "beeper"),
53         m_palette(*this, "palette")
53         m_palette(*this, "palette")
5454   { }
5555
5656   // devices
r29404r29405
837837   MCFG_DEVICE_ADD("upd7220_chr", UPD7220, MAIN_CLOCK/5)
838838   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
839839   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(mz3500_state, hgdc_draw_text)
840   MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_gfx", upd7220_device, ext_sync_w))   
840   MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_gfx", upd7220_device, ext_sync_w))
841841
842842   MCFG_DEVICE_ADD("upd7220_gfx", UPD7220, MAIN_CLOCK/5)
843843   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
trunk/src/mess/drivers/mz80.c
r29404r29405
290290   MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 199)
291291   MCFG_SCREEN_UPDATE_DRIVER(mz80_state, screen_update_mz80k)
292292   MCFG_SCREEN_PALETTE("palette")
293   
293
294294   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mz80k)
295295   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
296296
trunk/src/mess/drivers/rainbow.c
r29404r29405
66
77    STATE AS OF MARCH 2014
88    ----------------------
9   Driver is based entirely on the DEC-100 'B' variant (DEC-190 and DEC-100 A models are treated as clones).
10   While this is OK for the compatible -190, it doesn't do justice to ancient '100 A' hardware.
9    Driver is based entirely on the DEC-100 'B' variant (DEC-190 and DEC-100 A models are treated as clones).
10    While this is OK for the compatible -190, it doesn't do justice to ancient '100 A' hardware.
1111
12   Currently, there are 2 showstoppers:
13   (1) IRQ logic for 100-B needs further work (text in RBCONVERT.ZIP has details concerning -A versus -B)
12    Currently, there are 2 showstoppers:
13    (1) IRQ logic for 100-B needs further work (text in RBCONVERT.ZIP has details concerning -A versus -B)
1414    (2) Keyboard emulation incomplete (inhibits the system from booting with ERROR 50 on cold or ERROR 13 on warm boot).
1515
1616    - FLOPPY TIMING: 'wd17xx_complete_command' * must * be hard wired to about 13 usecs.
r29404r29405
3535            * Extended communication option (same as BUNDLE_OPTION ?)
3636
3737    - OTHER HARDWARE UPGRADES:
38         * Suitable Solutions ClikClok (real time clock)
39         
38            * Suitable Solutions ClikClok (real time clock)
39
4040            * Suitable Solutions TURBOW286: 12 Mhz, 68-pin, low power AMD N80L286-12 and WAYLAND/EDSUN EL286-88-10-B ( 80286 to 8088 Processor Signal Converter )
4141              plus DC 7174 or DT 7174 (barely readable). Add-on card, replaces main 8088 cpu (via ribbon cable). Altered BOOT ROM labeled 'TBSS1.3 - 3ED4'.
4242
r29404r29405
269269private:
270270   enum
271271   {
272      IRQ_8088_MAILBOX = 0,   // vector 0x27/a7
273      IRQ_8088_VBL,         // vector 0x20/a0
274      IRQ_8088_KBD,         // vector 0x26/a6
272      IRQ_8088_MAILBOX = 0,   // vector 0x27/a7
273      IRQ_8088_VBL,           // vector 0x20/a0
274      IRQ_8088_KBD,           // vector 0x26/a6
275275
276276      IRQ_8088_MAX
277277   };
r29404r29405
441441   //   BOOT LOADERS:
442442   //   - the DEC boot loader (and FDISK from DOS 3.10) initially allowed a maximum hard disc size of 20 MB.
443443   //   - the custom boot loader that comes with 'WUTIL 3.2' allows 117 MB and 8 surfaces.
444   //   SOFTWARE:
444   //   SOFTWARE:
445445   //   - MS-DOS 2 allows a maximum partition size of 16 MB (sizes > 15 MB are incompatible to DOS 3)
446446   //   - MS-DOS 3 has a global 1024 cylinder limit (32 MB).
447447   AM_RANGE (0x68, 0x68) AM_READ(hd_status_68_r)
r29404r29405
528528      PORT_DIPSETTING(    0x02, DEF_STR( On ) )
529529INPUT_PORTS_END
530530
531// Native 400K format (80 T * 10 S * 512 bytes) on 'quad density' RX50 drives
531// Native 400K format (80 T * 10 S * 512 bytes) on 'quad density' RX50 drives
532532// ( 5.25" single sided; 300 rpm; MFM 250 kbps; 96 - 100 tpi ).
533//     
533//
534534// Additionally, the BIOS can *read* VT-180 disks and MS-DOS 160 k disks
535535// - MS-DOS: FORMAT A: /F:160 and MEDIACHK ON
536536// ( 40 tracks; single sided with 9 or 8 sectors per track )
537537static LEGACY_FLOPPY_OPTIONS_START( dec100_floppy )
538538   LEGACY_FLOPPY_OPTION( dec100_floppy, "td0", "Teledisk floppy disk image", td0_dsk_identify, td0_dsk_construct, td0_dsk_destruct, NULL )
539   LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default,    NULL,             
539   LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default,    NULL,
540540      HEADS([1])
541541      TRACKS(40/[80])
542542      SECTORS(8/9/[10])
r29404r29405
578578   output_set_value("led7", 1);
579579
580580   // GREEN KEYBOARD LEDs (1 = on, 0 = off):
581   output_set_value("led_wait", 0);    // led8
581   output_set_value("led_wait", 0);    // led8
582582   output_set_value("led_compose", 0); // led9
583583   output_set_value("led_lock", 0);    // led10
584584   output_set_value("led_hold", 0);    // led11
r29404r29405
654654   }
655655   else
656656   {
657      m_i8088->set_input_line(INPUT_LINE_INT0, CLEAR_LINE); 
657      m_i8088->set_input_line(INPUT_LINE_INT0, CLEAR_LINE);
658658   }
659659}
660660
r29404r29405
12101210   MCFG_SCREEN_UPDATE_DRIVER(rainbow_state, screen_update_rainbow)
12111211   MCFG_SCREEN_PALETTE("vt100_video:palette")
12121212   MCFG_GFXDECODE_ADD("gfxdecode", "vt100_video:palette", rainbow)
1213   
1213
12141214   MCFG_RAINBOW_VIDEO_ADD("vt100_video", "screen", video_interface)
12151215   MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r))
12161216   MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt))
r29404r29405
12361236   MCFG_NVRAM_ADD_0FILL("nvram")
12371237MACHINE_CONFIG_END
12381238
1239// 'Rainbow 100-A' (introduced May 1982) is first-generation hardware with ROM 04.03.11
1239// 'Rainbow 100-A' (introduced May 1982) is first-generation hardware with ROM 04.03.11
12401240// - 64 K base RAM on board (instead of 128 K on 'B' model).  832 K RAM max.
12411241// - inability to boot from hard disc (mind the inadequate PSU)
12421242// - cannot control bit 7 of IRQ vector (prevents DOS 2.0x from booting on unmodified hardware)
r29404r29405
12981298/* Driver */
12991299
13001300/*    YEAR  NAME         PARENT   COMPAT  MACHINE       INPUT      STATE          INIT COMPANY                         FULLNAME       FLAGS */
1301COMP( 1982, rainbow100 , rainbow,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 100-A", GAME_IS_SKELETON                  )
1301COMP( 1982, rainbow100 , rainbow,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 100-A", GAME_IS_SKELETON                        )
13021302COMP( 1983, rainbow   , 0      ,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 100-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
13031303COMP( 1985, rainbow190 , rainbow,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 190-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
1304
trunk/src/mess/drivers/pc1500.c
r29404r29405
277277   MCFG_SCREEN_SIZE(156, 8)
278278   MCFG_SCREEN_VISIBLE_AREA(0, 156-1, 0, 7-1)
279279   MCFG_SCREEN_PALETTE("palette")
280   
280
281281   MCFG_DEFAULT_LAYOUT(layout_pc1500)
282282   MCFG_PALETTE_ADD("palette", 2)
283283   MCFG_PALETTE_INIT_OWNER(pc1500_state, pc1500)
trunk/src/mess/drivers/ut88.c
r29404r29405
201201   MCFG_VIDEO_START_OVERRIDE(ut88_state,ut88)
202202   MCFG_SCREEN_UPDATE_DRIVER(ut88_state, screen_update_ut88)
203203   MCFG_SCREEN_PALETTE("palette")
204   
204
205205   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
206206   MCFG_GFXDECODE_ADD("gfxdecode", "palette", ut88 )
207207
trunk/src/mess/drivers/unistar.c
r29404r29405
100100   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
101101   MCFG_SCREEN_UPDATE_DRIVER(unistar_state, screen_update_unistar)
102102   MCFG_SCREEN_PALETTE("palette")
103   
103
104104   MCFG_GFXDECODE_ADD("gfxdecode", "palette", unistar)
105105   MCFG_PALETTE_ADD("palette", 3)
106106   MCFG_PALETTE_INIT_OWNER(unistar_state, unistar)
trunk/src/mess/drivers/rd110.c
r29404r29405
241241   MCFG_SCREEN_SIZE(16*6-1, (16*6-1)*3/4)
242242   MCFG_SCREEN_VISIBLE_AREA(0, 16*6-2, 0, (16*6-1)*3/4-1)
243243   MCFG_SCREEN_PALETTE("palette")
244   
244
245245   MCFG_PALETTE_ADD("palette", 2)
246246   MCFG_PALETTE_INIT_OWNER(d110_state, d110)
247247
trunk/src/mess/drivers/casloopy.c
r29404r29405
497497   MCFG_SCREEN_PALETTE("palette")
498498
499499   MCFG_PALETTE_ADD("palette", 512)
500   
500
501501   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
502502
503503   MCFG_CARTSLOT_ADD("cart")
trunk/src/mess/drivers/replicator.c
r29404r29405
179179   UINT8 m_port_k;
180180   UINT8 m_port_l;
181181
182  UINT8 shift_register_value;
182   UINT8 shift_register_value;
183183
184184   required_device<avr8_device> m_maincpu;
185185   required_device<hd44780_device> m_lcdc;
r29404r29405
201201   switch( offset )
202202   {
203203      case AVR8_IO_PORTA:
204    {
204   {
205205#if LOG_PORTS
206      printf("[%08X] Port A READ (A-axis signals + B-axis STEP&DIR)\n", m_maincpu->m_shifted_pc);
206      printf("[%08X] Port A READ (A-axis signals + B-axis STEP&DIR)\n", m_maincpu->m_shifted_pc);
207207#endif
208       return 0x00;
209      break;
210    }
208      return 0x00;
209      break;
210   }
211211      case AVR8_IO_PORTB:
212    {
212   {
213213#if LOG_PORTS
214      printf("[%08X] Port B READ (SD-CS; 1280-MISO/MOSI/SCK; EX2-FAN/HEAT/PWR-CHECK; BLINK)\n", m_maincpu->m_shifted_pc);
214      printf("[%08X] Port B READ (SD-CS; 1280-MISO/MOSI/SCK; EX2-FAN/HEAT/PWR-CHECK; BLINK)\n", m_maincpu->m_shifted_pc);
215215#endif
216       return 0x00;
217      break;
218    }
216      return 0x00;
217      break;
218   }
219219      case AVR8_IO_PORTC:
220    {
220   {
221221#if LOG_PORTS
222      printf("[%08X] Port C READ (1280-EX1/EX2; LCD-signals; R&G-LED; DETECT)\n", m_maincpu->m_shifted_pc);
222      printf("[%08X] Port C READ (1280-EX1/EX2; LCD-signals; R&G-LED; DETECT)\n", m_maincpu->m_shifted_pc);
223223#endif
224       return DETECT; //indicated that the Interface board is present.
225      break;
226    }
224      return DETECT; //indicated that the Interface board is present.
225      break;
226   }
227227      case AVR8_IO_PORTD:
228    {
228   {
229229#if LOG_PORTS
230      printf("[%08X] Port D READ (SDA/SCL; 1280-EX-TX/RX)\n", m_maincpu->m_shifted_pc);
230      printf("[%08X] Port D READ (SDA/SCL; 1280-EX-TX/RX)\n", m_maincpu->m_shifted_pc);
231231#endif
232       return 0x00;
233      break;
234    }
232      return 0x00;
233      break;
234   }
235235      case AVR8_IO_PORTE:
236    {
236   {
237237#if LOG_PORTS
238      printf("[%08X] Port E READ (1280-TX/RX; THERMO-signals)\n", m_maincpu->m_shifted_pc);
238      printf("[%08X] Port E READ (1280-TX/RX; THERMO-signals)\n", m_maincpu->m_shifted_pc);
239239#endif
240       return 0x00;
241      break;
242    }
240      return 0x00;
241      break;
242   }
243243      case AVR8_IO_PORTF:
244    {
244   {
245245#if LOG_PORTS
246      printf("[%08X] Port F READ (X-axis & Y-axis signals)\n", m_maincpu->m_shifted_pc);
246      printf("[%08X] Port F READ (X-axis & Y-axis signals)\n", m_maincpu->m_shifted_pc);
247247#endif
248       return 0x00;
249      break;
250    }
248      return 0x00;
249      break;
250   }
251251      case AVR8_IO_PORTG:
252    {
252   {
253253#if LOG_PORTS
254      printf("[%08X] Port G READ (BUZZ; Cutoff-sr-check; B-axis EN; 1280-EX3/EX4)\n", m_maincpu->m_shifted_pc);
254      printf("[%08X] Port G READ (BUZZ; Cutoff-sr-check; B-axis EN; 1280-EX3/EX4)\n", m_maincpu->m_shifted_pc);
255255#endif
256       return 0x00;
257      break;
258    }
256      return 0x00;
257      break;
258   }
259259      case AVR8_IO_PORTH:
260    {
260   {
261261#if LOG_PORTS
262      printf("[%08X] Port H READ (cuttoff-text/reset; EX1-FAN/HEAT/PWR-CHECK; SD-CD/SD-WP)\n", m_maincpu->m_shifted_pc);
262      printf("[%08X] Port H READ (cuttoff-text/reset; EX1-FAN/HEAT/PWR-CHECK; SD-CD/SD-WP)\n", m_maincpu->m_shifted_pc);
263263#endif
264       return 0x00;
265      break;
266    }
264      return 0x00;
265      break;
266   }
267267      case AVR8_IO_PORTJ:
268    {
268   {
269269#if LOG_PORTS
270      printf("[%08X] Port J READ (Interface buttons; POTS-SCL; B-axis-POT)\n", m_maincpu->m_shifted_pc);
270      printf("[%08X] Port J READ (Interface buttons; POTS-SCL; B-axis-POT)\n", m_maincpu->m_shifted_pc);
271271#endif
272       return ioport("keypad")->read();
273      break;
274    }
272      return ioport("keypad")->read();
273      break;
274   }
275275      case AVR8_IO_PORTK:
276    {
276   {
277277#if LOG_PORTS
278      printf("[%08X] Port K READ (Z-axis signals; HBP-THERM; 1280-EX5/6/7)\n", m_maincpu->m_shifted_pc);
278      printf("[%08X] Port K READ (Z-axis signals; HBP-THERM; 1280-EX5/6/7)\n", m_maincpu->m_shifted_pc);
279279#endif
280       return 0x00;
281      break;
282    }
280      return 0x00;
281      break;
282   }
283283      case AVR8_IO_PORTL:
284    {
284   {
285285#if LOG_PORTS
286      printf("[%08X] Port L READ (HBP; EXTRA-FET; X-MIN/MAX; Y-MIN/MAX; Z-MIN/MAX)\n", m_maincpu->m_shifted_pc);
286      printf("[%08X] Port L READ (HBP; EXTRA-FET; X-MIN/MAX; Y-MIN/MAX; Z-MIN/MAX)\n", m_maincpu->m_shifted_pc);
287287#endif
288       return 0x00;
289      break;
290    }
288      return 0x00;
289      break;
291290   }
291   }
292292   return 0;
293293}
294294
r29404r29405
297297   switch( offset )
298298   {
299299      case AVR8_IO_PORTA:
300    {
301      if (data == m_port_a) break;
300   {
301      if (data == m_port_a) break;
302302
303303#if LOG_PORTS
304304         UINT8 old_port_a = m_port_a;
305305         UINT8 changed = data ^ old_port_a;
306306
307      printf("[%08X] ", m_maincpu->m_shifted_pc);
307      printf("[%08X] ", m_maincpu->m_shifted_pc);
308308         if(changed & A_AXIS_DIR) printf("[A] A_AXIS_DIR: %s\n", data & A_AXIS_DIR ? "HIGH" : "LOW");
309309         if(changed & A_AXIS_STEP) printf("[A] A_AXIS_STEP: %s\n", data & A_AXIS_STEP ? "HIGH" : "LOW");
310310         if(changed & A_AXIS_EN) printf("[A] A_AXIS_EN: %s\n", data & A_AXIS_EN ? "HIGH" : "LOW");
r29404r29405
313313         if(changed & B_AXIS_STEP) printf("[A] B_AXIS_STEP: %s\n", data & B_AXIS_STEP ? "HIGH" : "LOW");
314314#endif
315315
316      m_port_a = data;
317      break;
318    }
316      m_port_a = data;
317      break;
318   }
319319      case AVR8_IO_PORTB:
320    {
321      if (data == m_port_b) break;
320   {
321      if (data == m_port_b) break;
322322
323323#if LOG_PORTS
324324         UINT8 old_port_b = m_port_b;
325325         UINT8 changed = data ^ old_port_b;
326326
327      printf("[%08X] ", m_maincpu->m_shifted_pc);
327      printf("[%08X] ", m_maincpu->m_shifted_pc);
328328         if(changed & SD_CS) printf("[B] SD Card Chip Select: %s\n", data & SD_CS ? "HIGH" : "LOW");
329329         if(changed & SCK_1280) printf("[B] 1280-SCK: %s\n", data & SCK_1280 ? "HIGH" : "LOW");
330330         if(changed & MOSI_1280) printf("[B] 1280-MOSI: %s\n", data & MOSI_1280 ? "HIGH" : "LOW");
r29404r29405
335335         if(changed & BLINK) printf("[B] BLINK: %s\n", data & BLINK ? "HIGH" : "LOW");
336336#endif
337337
338      m_port_b = data;
339      break;
340    }
338      m_port_b = data;
339      break;
340   }
341341      case AVR8_IO_PORTC:
342    {
343      if (data == m_port_c) break;
342   {
343      if (data == m_port_c) break;
344344
345345         UINT8 old_port_c = m_port_c;
346346         UINT8 changed = data ^ old_port_c;
347347#if LOG_PORTS
348      printf("[%08X] ", m_maincpu->m_shifted_pc);
348      printf("[%08X] ", m_maincpu->m_shifted_pc);
349349         if(changed & EX2_1280) printf("[C] EX2_1280: %s\n", data & EX2_1280 ? "HIGH" : "LOW");
350350         if(changed & EX1_1280) printf("[C] EX1_1280: %s\n", data & EX1_1280 ? "HIGH" : "LOW");
351351         if(changed & LCD_CLK) printf("[C] LCD_CLK: %s\n", data & LCD_CLK ? "HIGH" : "LOW");
r29404r29405
357357#endif
358358
359359         if (changed & LCD_CLK){
360        /* The LCD is interfaced by an 8-bit shift register (74HC4094). */
361        if (data & LCD_CLK){//CLK positive edge
362          shift_register_value = (shift_register_value << 1) | ((data & LCD_DATA) >> 3);
363          //printf("[%08X] ", m_maincpu->m_shifted_pc);
364          //printf("[C] LCD CLK positive edge. shift_register=0x%02X\n", shift_register_value);
365           }
366      }
360      /* The LCD is interfaced by an 8-bit shift register (74HC4094). */
361      if (data & LCD_CLK){//CLK positive edge
362         shift_register_value = (shift_register_value << 1) | ((data & LCD_DATA) >> 3);
363         //printf("[%08X] ", m_maincpu->m_shifted_pc);
364         //printf("[C] LCD CLK positive edge. shift_register=0x%02X\n", shift_register_value);
365            }
366      }
367367
368368         if(changed & LCD_STROBE){
369        if (data & LCD_STROBE){ //STROBE positive edge
370          bool RS = (shift_register_value >> 1) & 1;
371          bool RW = (shift_register_value >> 2) & 1;
372          bool enable = (shift_register_value >> 3) & 1;
373          UINT8 lcd_data = shift_register_value & 0xF0;
369      if (data & LCD_STROBE){ //STROBE positive edge
370         bool RS = (shift_register_value >> 1) & 1;
371         bool RW = (shift_register_value >> 2) & 1;
372         bool enable = (shift_register_value >> 3) & 1;
373         UINT8 lcd_data = shift_register_value & 0xF0;
374374
375          if (enable && RW==0){
376            if (RS==0){
377                 m_lcdc->control_write(space, 0, lcd_data);
378            } else {
379                 m_lcdc->data_write(space, 0, lcd_data);
380            }
381          }
382           }
383      }
375         if (enable && RW==0){
376         if (RS==0){
377               m_lcdc->control_write(space, 0, lcd_data);
378         } else {
379               m_lcdc->data_write(space, 0, lcd_data);
380         }
381         }
382            }
383      }
384384         m_port_c = data;
385385
386386         break;
387387      }
388388      case AVR8_IO_PORTD:
389    {
390      if (data == m_port_d) break;
389   {
390      if (data == m_port_d) break;
391391
392392#if LOG_PORTS
393393         UINT8 old_port_d = m_port_d;
394394         UINT8 changed = data ^ old_port_d;
395395
396      printf("[%08X] ", m_maincpu->m_shifted_pc);
396      printf("[%08X] ", m_maincpu->m_shifted_pc);
397397         if(changed & PORTD_SCL) printf("[D] PORTD_SCL: %s\n", data & PORTD_SCL ? "HIGH" : "LOW");
398398         if(changed & PORTD_SDA) printf("[D] PORTD_SDA: %s\n", data & PORTD_SDA ? "HIGH" : "LOW");
399399         if(changed & EX_RX_1280) printf("[D] EX_RX_1280: %s\n", data & EX_RX_1280 ? "HIGH" : "LOW");
r29404r29405
401401#endif
402402
403403         m_port_d = data;
404      break;
405    }
404      break;
405   }
406406      case AVR8_IO_PORTE:
407    {
408      if (data == m_port_e) break;
407   {
408      if (data == m_port_e) break;
409409
410410#if LOG_PORTS
411411         UINT8 old_port_e = m_port_e;
412412         UINT8 changed = data ^ old_port_e;
413413
414      printf("[%08X] ", m_maincpu->m_shifted_pc);
414      printf("[%08X] ", m_maincpu->m_shifted_pc);
415415         if(changed & RX_1280) printf("[E] 1280-RX: %s\n", data & RX_1280 ? "HIGH" : "LOW");
416416         if(changed & TX_1280) printf("[E] 1280-TX: %s\n", data & TX_1280 ? "HIGH" : "LOW");
417417         if(changed & THERMO_SCK) printf("[E] THERMO-SCK: %s\n", data & THERMO_SCK ? "HIGH" : "LOW");
r29404r29405
421421#endif
422422
423423         m_port_e = data;
424      break;
425    }
424      break;
425   }
426426      case AVR8_IO_PORTF:
427    {
428      if (data == m_port_f) break;
427   {
428      if (data == m_port_f) break;
429429
430430#if LOG_PORTS
431431         UINT8 old_port_f = m_port_f;
432432         UINT8 changed = data ^ old_port_f;
433433
434      printf("[%08X] ", m_maincpu->m_shifted_pc);
434      printf("[%08X] ", m_maincpu->m_shifted_pc);
435435         if(changed & X_AXIS_DIR) printf("[F] X_AXIS_DIR: %s\n", data & X_AXIS_DIR ? "HIGH" : "LOW");
436436         if(changed & X_AXIS_STEP) printf("[F] X_AXIS_STEP: %s\n", data & X_AXIS_STEP ? "HIGH" : "LOW");
437437         if(changed & X_AXIS_EN) printf("[F] X_AXIS_EN: %s\n", data & X_AXIS_EN ? "HIGH" : "LOW");
r29404r29405
443443#endif
444444
445445         m_port_f = data;
446      break;
447    }
446      break;
447   }
448448      case AVR8_IO_PORTG:
449    {
450      if (data == m_port_g) break;
449   {
450      if (data == m_port_g) break;
451451
452452         UINT8 old_port_g = m_port_g;
453453         UINT8 changed = data ^ old_port_g;
454454
455455#if LOG_PORTS
456      printf("[%08X] ", m_maincpu->m_shifted_pc);
456      printf("[%08X] ", m_maincpu->m_shifted_pc);
457457         if(changed & EX4_1280) printf("[G] EX4_1280: %s\n", data & EX4_1280 ? "HIGH" : "LOW");
458458         if(changed & EX3_1280) printf("[G] EX3_1280: %s\n", data & EX3_1280 ? "HIGH" : "LOW");
459459         if(changed & B_AXIS_EN) printf("[G] B_AXIS_EN: %s\n", data & B_AXIS_EN ? "HIGH" : "LOW");
r29404r29405
462462#endif
463463
464464         if(changed & BUZZ){
465      /* FIX-ME: What is the largest sample value allowed?
466         I'm using 0x3F based on what I see in src/mess/drivers/craft.c
467         But as the method is called "write_unsigned8", I guess we could have samples with values up to 0xFF, right?
468         Anyway... With the 0x3F value we'll get a sound that is not so loud, which may be less annoying... :-)
469      */
470           UINT8 audio_sample = (data & BUZZ) ? 0x3F : 0;
471           m_dac->write_unsigned8(audio_sample << 1);
472      }
465      /* FIX-ME: What is the largest sample value allowed?
466       I'm using 0x3F based on what I see in src/mess/drivers/craft.c
467       But as the method is called "write_unsigned8", I guess we could have samples with values up to 0xFF, right?
468       Anyway... With the 0x3F value we'll get a sound that is not so loud, which may be less annoying... :-)
469      */
470            UINT8 audio_sample = (data & BUZZ) ? 0x3F : 0;
471            m_dac->write_unsigned8(audio_sample << 1);
472      }
473473
474474         m_port_g = data;
475      break;
476    }
475      break;
476   }
477477      case AVR8_IO_PORTH:
478    {
479      if (data == m_port_h) break;
478   {
479      if (data == m_port_h) break;
480480
481481#if LOG_PORTS
482482         UINT8 old_port_h = m_port_h;
483483         UINT8 changed = data ^ old_port_h;
484484
485      printf("[%08X] ", m_maincpu->m_shifted_pc);
485      printf("[%08X] ", m_maincpu->m_shifted_pc);
486486         if(changed & CUTOFF_TEST) printf("[H] CUTOFF_TEST: %s\n", data & CUTOFF_TEST ? "HIGH" : "LOW");
487487         if(changed & CUTOFF_RESET) printf("[H] CUTOFF_RESET: %s\n", data & CUTOFF_RESET ? "HIGH" : "LOW");
488488         if(changed & EX1_PWR_CHECK) printf("[H] EX1_PWR_CHECK: %s\n", data & EX1_PWR_CHECK ? "HIGH" : "LOW");
r29404r29405
492492         if(changed & SD_CD) printf("[H] SD_CD: %s\n", data & SD_CD ? "HIGH" : "LOW");
493493#endif
494494
495      m_port_h = data;
496      break;
497    }
495      m_port_h = data;
496      break;
497   }
498498      case AVR8_IO_PORTJ:
499    {
500      if (data == m_port_j) break;
499   {
500      if (data == m_port_j) break;
501501
502502#if LOG_PORTS
503503         UINT8 old_port_j = m_port_j;
504504         UINT8 changed = data ^ old_port_j;
505505
506      printf("[%08X] ", m_maincpu->m_shifted_pc);
506      printf("[%08X] ", m_maincpu->m_shifted_pc);
507507
508508         if(changed & BUTTON_CENTER) printf("[J] BUTTON_CENTER: %s\n", data & BUTTON_CENTER ? "HIGH" : "LOW");
509509         if(changed & BUTTON_RIGHT) printf("[J] BUTTON_RIGHT: %s\n", data & BUTTON_RIGHT ? "HIGH" : "LOW");
r29404r29405
514514         if(changed & B_AXIS_POT) printf("[J] B_AXIS_POT: %s\n", data & B_AXIS_POT ? "HIGH" : "LOW");
515515#endif
516516
517      m_port_j = data;
518      break;
519    }
517      m_port_j = data;
518      break;
519   }
520520      case AVR8_IO_PORTK:
521    {
522      if (data == m_port_k) break;
521   {
522      if (data == m_port_k) break;
523523
524524#if LOG_PORTS
525525         UINT8 old_port_k = m_port_k;
526526         UINT8 changed = data ^ old_port_k;
527527
528      printf("[%08X] ", m_maincpu->m_shifted_pc);
528      printf("[%08X] ", m_maincpu->m_shifted_pc);
529529
530530         if(changed & Z_AXIS_DIR) printf("[K] Z_AXIS_DIR: %s\n", data & Z_AXIS_DIR ? "HIGH" : "LOW");
531531         if(changed & Z_AXIS_STEP) printf("[K] Z_AXIS_STEP: %s\n", data & Z_AXIS_STEP ? "HIGH" : "LOW");
r29404r29405
537537         if(changed & HBP_THERM) printf("[K] HBP_THERM: %s\n", data & HBP_THERM ? "HIGH" : "LOW");
538538#endif
539539
540      m_port_k = data;
541      break;
542    }
540      m_port_k = data;
541      break;
542   }
543543      case AVR8_IO_PORTL:
544    {
545      if (data == m_port_l) break;
544   {
545      if (data == m_port_l) break;
546546
547547#if LOG_PORTS
548548         UINT8 old_port_l = m_port_l;
549549         UINT8 changed = data ^ old_port_l;
550550
551      printf("[%08X] ", m_maincpu->m_shifted_pc);
551      printf("[%08X] ", m_maincpu->m_shifted_pc);
552552
553553         if(changed & X_MIN) printf("[L] X_MIN: %s\n", data & X_MIN ? "HIGH" : "LOW");
554554         if(changed & X_MAX) printf("[L] X_MAX: %s\n", data & X_MAX ? "HIGH" : "LOW");
r29404r29405
560560         if(changed & Z_MAX) printf("[L] Z_MAX: %s\n", data & Z_MAX ? "HIGH" : "LOW");
561561#endif
562562
563      m_port_l = data;
564      break;
565    }
563      m_port_l = data;
564      break;
566565   }
566   }
567567}
568568
569569/****************************************************\
r29404r29405
605605
606606void replicator_state::machine_reset()
607607{
608  shift_register_value = 0;
609  m_port_a = 0;
610  m_port_b = 0;
611  m_port_c = 0;
612  m_port_d = 0;
613  m_port_e = 0;
614  m_port_f = 0;
615  m_port_g = 0;
616  m_port_h = 0;
617  m_port_j = 0;
618  m_port_k = 0;
619  m_port_l = 0;
608   shift_register_value = 0;
609   m_port_a = 0;
610   m_port_b = 0;
611   m_port_c = 0;
612   m_port_d = 0;
613   m_port_e = 0;
614   m_port_f = 0;
615   m_port_g = 0;
616   m_port_h = 0;
617   m_port_j = 0;
618   m_port_k = 0;
619   m_port_l = 0;
620620}
621621
622622const avr8_config atmega1280_config =
r29404r29405
659659   MCFG_CPU_AVR8_EFUSE(0xF4)
660660   MCFG_CPU_AVR8_LOCK(0x0F)
661661
662  /*TODO: Add an ATMEGA8U2 for USB-Serial communications */
662   /*TODO: Add an ATMEGA8U2 for USB-Serial communications */
663663
664664   /* video hardware */
665665   MCFG_SCREEN_ADD("screen", LCD)
r29404r29405
679679   MCFG_HD44780_LCD_SIZE(4, 20)
680680
681681   /* sound hardware */
682  /* A piezo is connected to the PORT G bit 5 (OC0B pin driven by Timer/Counter #4) */
682   /* A piezo is connected to the PORT G bit 5 (OC0B pin driven by Timer/Counter #4) */
683683   MCFG_SPEAKER_STANDARD_MONO("buzzer")
684684   MCFG_SOUND_ADD("dac", DAC, 0)
685685   MCFG_SOUND_ROUTE(0, "buzzer", 1.00)
trunk/src/mess/drivers/amstr_pc.c
r29404r29405
531531   MCFG_CPU_ADD("maincpu", V30, 8000000)
532532   MCFG_CPU_PROGRAM_MAP(ppc512_map)
533533   MCFG_CPU_IO_MAP(ppc512_io)
534   
534
535535   MCFG_DEVICE_REMOVE("isa1")
536536   MCFG_DEVICE_REMOVE("isa2")
537537
trunk/src/mess/drivers/sapi1.c
r29404r29405
8787   required_ioport m_line3;
8888   required_ioport m_line4;
8989   required_device<cpu_device> m_maincpu;
90public:   
90public:
9191   optional_device<palette_device> m_palette;
9292};
9393
r29404r29405
572572   MCFG_SCREEN_VISIBLE_AREA(0, 40*6-1, 0, 24*9-1)
573573   MCFG_SCREEN_UPDATE_DRIVER(sapi1_state, screen_update_sapi1)
574574   MCFG_SCREEN_PALETTE("palette")
575   
575
576576   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
577577
578578   /* internal ram */
trunk/src/mess/drivers/pasopia7.c
r29404r29405
4545   m_floppy(*this, "fdc:0:525hd"),
4646   m_sn1(*this, "sn1"),
4747   m_sn2(*this, "sn2"),
48   m_palette(*this, "palette")
48   m_palette(*this, "palette")
4949   { }
5050
5151   required_device<cpu_device> m_maincpu;
r29404r29405
6060   required_device<sn76489a_device> m_sn1;
6161   required_device<sn76489a_device> m_sn2;
6262   required_device<palette_device> m_palette;
63   
63
6464   DECLARE_READ8_MEMBER(vram_r);
6565   DECLARE_WRITE8_MEMBER(vram_w);
6666   DECLARE_WRITE8_MEMBER(pasopia7_memory_ctrl_w);
r29404r29405
10171017   MCFG_SCREEN_SIZE(640, 480)
10181018   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 32-1)
10191019   MCFG_SCREEN_PALETTE("palette")
1020   
1020
10211021   MCFG_VIDEO_START_OVERRIDE(pasopia7_state,pasopia7)
10221022   MCFG_SCREEN_UPDATE_DRIVER(pasopia7_state, screen_update_pasopia7)
10231023   MCFG_PALETTE_ADD("palette", 8)
r29404r29405
10371037   MCFG_VIDEO_START_OVERRIDE(pasopia7_state,pasopia7)
10381038   MCFG_SCREEN_UPDATE_DRIVER(pasopia7_state, screen_update_pasopia7)
10391039   MCFG_SCREEN_PALETTE("palette")
1040   
1040
10411041   MCFG_PALETTE_ADD("palette", 8)
10421042   MCFG_PALETTE_INIT_OWNER(pasopia7_state,p7_lcd)
10431043   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pasopia7 )
trunk/src/mess/drivers/ngp.c
r29404r29405
841841
842842   MCFG_SCREEN_MODIFY("screen")
843843   MCFG_SCREEN_PALETTE("k1ge:palette")
844   
844
845845   MCFG_CARTSLOT_ADD("cart")
846846   MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc")
847847   MCFG_CARTSLOT_NOT_MANDATORY
r29404r29405
860860
861861   MCFG_SCREEN_MODIFY("screen")
862862   MCFG_SCREEN_PALETTE("k1ge:palette")
863   
863
864864   MCFG_CARTSLOT_ADD("cart")
865865   MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc")
866866   MCFG_CARTSLOT_NOT_MANDATORY
trunk/src/mess/drivers/univac.c
r29404r29405
149149   MCFG_SCREEN_SIZE(640, 250)
150150   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
151151   MCFG_SCREEN_PALETTE("palette")
152   
152
153153   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
154154MACHINE_CONFIG_END
155155
trunk/src/mess/drivers/hunter2.c
r29404r29405
103103   ADDRESS_MAP_UNMAP_HIGH
104104   ADDRESS_MAP_GLOBAL_MASK(0xff)
105105   AM_RANGE(0x00, 0x1f) AM_DEVREADWRITE("iotimer", nsc810_device, read, write) // device not yet emulated
106//   AM_RANGE(0x00, 0x00) AM_READ(port00_r)
107//   AM_RANGE(0x01, 0x01) AM_WRITE(port01_w)
108//   AM_RANGE(0x02, 0x02) AM_READ(port02_r)
109//   AM_RANGE(0x03, 0x1F) AM_WRITENOP
106//  AM_RANGE(0x00, 0x00) AM_READ(port00_r)
107//  AM_RANGE(0x01, 0x01) AM_WRITE(port01_w)
108//  AM_RANGE(0x02, 0x02) AM_READ(port02_r)
109//  AM_RANGE(0x03, 0x1F) AM_WRITENOP
110110   AM_RANGE(0x20, 0x20) AM_DEVWRITE("lcdc", hd61830_device, data_w)
111111   AM_RANGE(0x21, 0x21) AM_DEVREADWRITE("lcdc", hd61830_device, status_r, control_w)
112112   AM_RANGE(0x3e, 0x3e) AM_DEVREAD("lcdc", hd61830_device, data_r)
r29404r29405
255255WRITE8_MEMBER( hunter2_state::port81_w )
256256{
257257   m_rs232->write_txd(data & 0x01);
258//   logerror("TXD write %02x\n",data);
258//  logerror("TXD write %02x\n",data);
259259}
260260
261261WRITE8_MEMBER( hunter2_state::port82_w )
262262{
263263   m_rs232->write_dtr(data & 0x01);
264//   logerror("DTR write %02x\n",data);
264//  logerror("DTR write %02x\n",data);
265265}
266266
267267WRITE8_MEMBER( hunter2_state::port84_w )
268268{
269269   m_rs232->write_rts(data & 0x01);
270//   logerror("RTS write %02x\n",data);
270//  logerror("RTS write %02x\n",data);
271271}
272272
273273WRITE8_MEMBER( hunter2_state::port86_w )
r29404r29405
277277
278278/*
279279Bit 0 = Enable normal interrupts
280Bit 1 = Enable RSTC interrupts
280Bit 1 = Enable RSTC interrupts
281281Bit 2 = Enable RSTB interrupts
282282Bit 3 = Enable RSTA interrupts
283283*/
r29404r29405
399399   MCFG_SCREEN_SIZE(240, 128)
400400   MCFG_SCREEN_VISIBLE_AREA(0, 239, 0, 63)
401401   MCFG_SCREEN_PALETTE("palette")
402   
402
403403   MCFG_DEFAULT_LAYOUT(layout_lcd)
404404   MCFG_PALETTE_ADD("palette", 2)
405405   MCFG_PALETTE_INIT_OWNER(hunter2_state, hunter2)
trunk/src/mess/drivers/jonos.c
r29404r29405
131131   MCFG_SCREEN_SIZE(640, 300)
132132   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 299)
133133   MCFG_SCREEN_PALETTE("palette")
134   
134
135135   MCFG_GFXDECODE_ADD("gfxdecode", "palette", jonos)
136136   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
137137MACHINE_CONFIG_END
trunk/src/mess/drivers/at.c
r29404r29405
2424ADDRESS_MAP_END
2525
2626static ADDRESS_MAP_START( ps2m30286_map, AS_PROGRAM, 16, at_state)
27        AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10")
27      AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10")
2828   AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM
2929   AM_RANGE(0x0c8000, 0x0cffff) AM_ROM
3030   AM_RANGE(0x0d0000, 0x0dffff) AM_RAM
r29404r29405
130130
131131READ8_MEMBER( at_state::ps1_kbdc_r )
132132{
133        UINT8 ret;
134    if(offset == 0) ret = at_keybc_r(space, offset, mem_mask);
135    else ret = ps2_portb_r(space,offset, mem_mask);
133      UINT8 ret;
134   if(offset == 0) ret = at_keybc_r(space, offset, mem_mask);
135   else ret = ps2_portb_r(space,offset, mem_mask);
136136   return ret;
137137}
138138
r29404r29405
461461
462462   MCFG_QUANTUM_TIME(attotime::from_hz(60))
463463   MCFG_FRAGMENT_ADD( pcvideo_vga )
464   
464
465465   MCFG_FRAGMENT_ADD( at_motherboard )
466466
467467   MCFG_ISA16_BUS_ADD("isabus", ":maincpu", isabus_intf)
trunk/src/mess/drivers/ql.c
r29404r29405
289289      case 0x0002 : result=m_fdc->read(space, offset); break;
290290      case 0x0003 : result=m_fdc->read(space, offset); break;
291291      case 0x000C : if(IS_SANDY_DISK(m_disk_type))
292                   result = (m_mouse_int ^ MOUSE_DIRX) | m_mouseb->read() | 0x01; break;
292                  result = (m_mouse_int ^ MOUSE_DIRX) | m_mouseb->read() | 0x01; break;
293293      case 0x0010 : if(IS_SANDY_DISK(m_disk_type))
294                      m_mouse_int &= ~MOUSE_INT_MASK; break;
294                  m_mouse_int &= ~MOUSE_INT_MASK; break;
295295      default     : logerror("%s DiskIO undefined read : from %08X\n",machine().describe_context(),m_disk_io_base+offset); break;
296296   }
297297
r29404r29405
314314      case 0x0008 : if(IS_SANDY_DISK(m_disk_type))
315315                  sandy_print_char(data); break;
316316      case 0x0010 : if(IS_SANDY_DISK(m_disk_type))
317                      m_mouse_int &= ~MOUSE_INT_MASK; break;
317                  m_mouse_int &= ~MOUSE_INT_MASK; break;
318318      case 0x2000 : if(m_disk_type==DISK_TYPE_TRUMP)
319319                  trump_card_set_control(data);break;
320320      default     : logerror("%s DiskIO undefined write : %02X to %08X\n",machine().describe_context(),data,m_disk_io_base+offset); break;
r29404r29405
382382      if(data & SANDY_PRINTER_INTMASK)
383383         m_zx8302->extint_w(ASSERT_LINE);
384384   }
385
385
386386   m_disk_io_byte=data;
387387}
388388
r29404r29405
390390{
391391   // latch the data until it's  strobed out
392392   m_printer_char=data;
393   
394//   m_centronics->write(data);
393
394//  m_centronics->write(data);
395395}
396396
397397WRITE_LINE_MEMBER( ql_state::sandy_printer_busy )
r29404r29405
423423
424424void ql_state::mouse_tick()
425425{
426   UINT8 x       = m_mousex->read();
427   UINT8 y       = m_mousey->read();
428   UINT8 do_int   = 0;
426   UINT8 x         = m_mousex->read();
427   UINT8 y         = m_mousey->read();
428   UINT8 do_int    = 0;
429429
430430   //m_mouse_int = 0;
431431
432432   // Set X interupt flag and direction if x has changed
433   if (x > m_ql_mouse_x)
433   if (x > m_ql_mouse_x)
434434   {
435435      m_mouse_int |= MOUSE_INTX;
436436      m_mouse_int |= MOUSE_DIRX;
r29404r29405
442442   }
443443
444444   // Set Y interupt flag and direction if y has changed
445   if (y > m_ql_mouse_y)
445   if (y > m_ql_mouse_y)
446446   {
447447      m_mouse_int |= MOUSE_INTY;
448448      m_mouse_int &= ~MOUSE_DIRY;
r29404r29405
463463      do_int = 1;
464464   else
465465      do_int = IS_SANDY_DISK(m_disk_type) && (m_disk_io_byte & SANDY_MOUSE_INTMASK);
466   
466
467467   //logerror("m_mouse_int=%02X, MOUSE_INT_MASK=%02X, m_disk_io_byte=%02X, (m_disk_io_byte & SANDY_MOUSE_INTMASK)=%02x\n",m_mouse_int,MOUSE_INT_MASK,m_disk_io_byte,(m_disk_io_byte & SANDY_MOUSE_INTMASK));
468   
468
469469   // if mouse moved trigger external int
470470   if((m_mouse_int & MOUSE_INT_MASK) && do_int)
471471   {
r29404r29405
477477{
478478   UINT8 result = 0;
479479   UINT8 buttons;
480   
480
481481   switch (offset)
482482   {
483483      // 0x1bf9c, button status
484      case 0x00   :
484      case 0x00   :
485485         buttons = m_mouseb->read();
486486         result = ((buttons & MOUSE_RIGHT) << 2) | ((buttons & MOUSE_LEFT) << 2);
487487         break;
488     
488
489489      // 0x1bfbc, direction status
490      case 0x20   :
490      case 0x20   :
491491         result = ((m_mouse_int & MOUSE_INTX) >> 5) | ((m_mouse_int & MOUSE_INTY) >> 1) |
492                 ((m_mouse_int & MOUSE_DIRX) >> 1) | ((m_mouse_int & MOUSE_DIRY) >> 4);
492                  ((m_mouse_int & MOUSE_DIRX) >> 1) | ((m_mouse_int & MOUSE_DIRY) >> 4);
493493         break;
494      case 0x22    :
494      case 0x22   :
495495         m_mouse_int &= ~MOUSE_INT_MASK;
496496         break;
497497   }
498   
498
499499   return result;
500500}
501501
r29404r29405
664664   PORT_CONFNAME( QIMI_PORT_MASK, QIMI_NONE, "QIMI enabled")
665665   PORT_CONFSETTING( QIMI_NONE, "No" )
666666   PORT_CONFSETTING( QIMI_MOUSE, "Yes" )
667   
667
668668   PORT_CONFNAME( DISK_TYPE_MASK, DISK_TYPE_NONE, "Disk interface select" )
669669   PORT_CONFSETTING(DISK_TYPE_NONE,     DEF_STR( None ))
670670   PORT_CONFSETTING(DISK_TYPE_TRUMP,    "Miracle Trump card")
671671   PORT_CONFSETTING(DISK_TYPE_SANDY_SD, "Sandy Superdisk")
672672   PORT_CONFSETTING(DISK_TYPE_SANDY_SQB,"Sandy SuperQBoard")
673673
674   
674
675675   PORT_START(MOUSEX_TAG)
676   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
676   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
677677
678678   PORT_START(MOUSEY_TAG)
679   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
679   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)
680680
681681   PORT_START(MOUSEB_TAG)  /* Mouse buttons */
682   PORT_BIT( MOUSE_RIGHT, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_CODE(MOUSECODE_BUTTON1)
683   PORT_BIT( MOUSE_LEFT,  IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_CODE(MOUSECODE_BUTTON2)
684   PORT_BIT( MOUSE_MIDDLE, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Mouse Button 3") PORT_CODE(MOUSECODE_BUTTON3)
682   PORT_BIT( MOUSE_RIGHT, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_CODE(MOUSECODE_BUTTON1)
683   PORT_BIT( MOUSE_LEFT,  IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_CODE(MOUSECODE_BUTTON2)
684   PORT_BIT( MOUSE_MIDDLE, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Mouse Button 3") PORT_CODE(MOUSECODE_BUTTON3)
685685
686686INPUT_PORTS_END
687687
r29404r29405
10311031   m_printer_char=0;
10321032   m_disk_io_byte=0;
10331033   m_mouse_int = 0;
1034   
1034
10351035   logerror("Configuring RAM %d\n",m_ram->size() / 1024);
1036   
1036
10371037   // configure RAM
10381038   switch (m_ram->size())
10391039   {
r29404r29405
10861086         break;
10871087   }
10881088
1089   
1089
10901090   // QIMI QL Internal Mouse Interface
10911091   if (m_config->read() & QIMI_MOUSE)
1092   {   
1092   {
10931093      logerror("QIMI enabled\n");
10941094      program.install_read_handler(QIMI_IO_BASE, QIMI_IO_END, 0, 0, read8_delegate(FUNC(ql_state::qimi_io_r), this));
1095      program.install_write_handler(QIMI_IO_BASE, QIMI_IO_END, 0, 0, write8_delegate(FUNC(ql_state::qimi_io_w), this));   
1095      program.install_write_handler(QIMI_IO_BASE, QIMI_IO_END, 0, 0, write8_delegate(FUNC(ql_state::qimi_io_w), this));
10961096   }
10971097}
10981098
r29404r29405
11291129   MCFG_DEVICE_ADD(ZX8301_TAG, ZX8301, X1)
11301130   MCFG_ZX8301_CPU(M68008_TAG)
11311131   MCFG_ZX8301_VSYNC_CALLBACK(DEVWRITELINE(ZX8302_TAG, zx8302_device, vsync_w))
1132   
1132
11331133   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
1134   
1134
11351135   MCFG_DEVICE_ADD(ZX8302_TAG, ZX8302, X1)
11361136   MCFG_ZX8302_RTC_CLOCK(X2)
11371137   MCFG_ZX8302_OUT_IPL1L_CB(INPUTLINE(M68008_TAG, M68K_IRQ_2))
r29404r29405
11491149   MCFG_ZX8302_OUT_RAW2_CB(WRITELINE(ql_state, zx8302_raw2_w))
11501150   MCFG_ZX8302_IN_RAW2_CB(READLINE(ql_state, zx8302_raw2_r))
11511151   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ql_floppy_interface)
1152   
1152
11531153   MCFG_WD1772_ADD(WD1772_TAG,ql_wd17xx_interface)
11541154   MCFG_MICRODRIVE_ADD(MDV_1, mdv1_config)
11551155   MCFG_MICRODRIVE_COMMS_OUT_CALLBACK(DEVWRITELINE(MDV_2, microdrive_image_device, comms_in_w))
trunk/src/mess/drivers/saturn.c
r29404r29405
8787
8888   required_device<sat_cart_slot_device> m_exp;
8989   required_device<nvram_device> m_nvram;
90   required_device<nvram_device> m_smpc_nv;   // TODO: move this in the base class saturn_state and add it to stv in MAME
90   required_device<nvram_device> m_smpc_nv;    // TODO: move this in the base class saturn_state and add it to stv in MAME
9191};
9292
9393
r29404r29405
548548/* TODO: if you change the driver configuration then NVRAM contents gets screwed, needs mods in MAME framework */
549549void sat_console_state::nvram_init(nvram_device &nvram, void *data, size_t size)
550550{
551   static const UINT8 init[64] = {
551   static const UINT8 init[64] = {
552552   'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't',
553553   'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't',
554554   'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't',
555555   'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't', };
556   
556
557557   memset(data, 0x00, size);
558558   memcpy(data, init, sizeof(init));
559559}
r29404r29405
894894ROM_START(hisaturn)
895895   ROM_REGION( 0x480000, "maincpu", ROMREGION_ERASEFF ) /* SH2 code */
896896   ROM_SYSTEM_BIOS(0, "102", "v1.02 (950519)")
897   ROMX_LOAD( "mpr-18100.bin", 0x000000, 0x080000, CRC(3408dbf4) SHA1(8a22710e09ce75f39625894366cafe503ed1942d), ROM_BIOS(1))
897   ROMX_LOAD( "mpr-18100.bin", 0x000000, 0x080000, CRC(3408dbf4) SHA1(8a22710e09ce75f39625894366cafe503ed1942d), ROM_BIOS(1))
898898   ROM_SYSTEM_BIOS(1, "101", "v1.01 (950130)")
899899   ROMX_LOAD("hisaturn.bin", 0x00000000, 0x00080000, CRC(721e1b60) SHA1(49d8493008fa715ca0c94d99817a5439d6f2c796), ROM_BIOS(2))
900900   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
trunk/src/mess/drivers/apple2gs.c
r29404r29405
380380   MCFG_ES5503_OUTPUT_CHANNELS(2)
381381   MCFG_ES5503_IRQ_FUNC(WRITELINE(apple2gs_state, apple2gs_doc_irq))
382382   MCFG_ES5503_ADC_FUNC(READ8(apple2gs_state, apple2gs_adc_read))
383   
383
384384   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
385385   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
386386
trunk/src/mess/drivers/lola8a.c
r29404r29405
5656private:
5757   UINT8 m_portb;
5858   required_device<cassette_image_device> m_cass;
59public:   
59public:
6060   required_device<palette_device> m_palette;
6161};
6262
trunk/src/mess/drivers/molecular.c
r29404r29405
8888
8989   UINT8 app_ram_enable;
9090   UINT8 file_ram_enable;
91   
91
9292   DECLARE_PALETTE_INIT(molecula);
9393
9494protected:
trunk/src/mess/drivers/hp48.c
r29404r29405
767767   keyboard layout for 49 G model
768768
769769   -------------------------------------------------
770   |   F1  |   F2  |   F3  |   F4  |   F5  |  F6   |
770   |   F1  |   F2  |   F3  |   F4  |   F5  |  F6   |
771771   |-----------------------------------------------|
772772   |   APPS  |  MODE  |  TOOL  |        up         |
773773   |---------+--------+--------| left        right |
774774   |   VAR   |  STO   |  NXT   |       down        |
775775   |---------+--------+--------+-------------------|
776   |   HIST  |  CAT   |  EQW   |  SYMB   |   <=    |
776   |   HIST  |  CAT   |  EQW   |  SYMB   |   <=    |
777777   |---------+--------+--------+---------+---------|
778   |   y^x   |  sqrt  |  SIN   |  COS    |   TAN   |
778   |   y^x   |  sqrt  |  SIN   |  COS    |   TAN   |
779779   |---------+--------+--------+---------+---------|
780   |   EEX   |  +/-   |   X    |  1/x    |    /    |
780   |   EEX   |  +/-   |   X    |  1/x    |    /    |
781781   |---------+--------+--------+---------+---------|
782   |  alpha  |   7    |   8    |   9     |    *    |
782   |  alpha  |   7    |   8    |   9     |    *    |
783783   |---------+--------+--------+---------+---------|
784   |   blue  |   4    |   5    |   6     |    -    |
784   |   blue  |   4    |   5    |   6     |    -    |
785785   |---------+--------+--------+---------+---------|
786   |   red   |   1    |   2    |   3     |    +    |
786   |   red   |   1    |   2    |   3     |    +    |
787787   |---------+--------+--------+---------+---------|
788   |   ON    |   0    |    .   |  SPC    |  ENTER  |
788   |   ON    |   0    |    .   |  SPC    |  ENTER  |
789789   -------------------------------------------------
790790
791791   * 51 keys
r29404r29405
798798
799799static INPUT_PORTS_START( hp49g_kbd )
800800
801        PORT_START( "LINE0" ) /* OUT = 0x001 */
801      PORT_START( "LINE0" ) /* OUT = 0x001 */
802802
803803   PORT_BIT  ( 1, IP_ACTIVE_HIGH, IPT_KEYBOARD )
804804   PORT_NAME ( "ENTER   ANS  NUM")
805805   PORT_CODE ( KEYCODE_ENTER )
806806
807807   PORT_BIT  ( 2, IP_ACTIVE_HIGH, IPT_KEYBOARD )
808        PORT_NAME ( "+  { }  \xC2\xAB \xC2\xBB")  /* << >> */
808      PORT_NAME ( "+  { }  \xC2\xAB \xC2\xBB")  /* << >> */
809809   PORT_CODE ( KEYCODE_EQUALS )
810810   PORT_CODE ( KEYCODE_PLUS_PAD )
811811
r29404r29405
826826   PORT_CODE ( KEYCODE_Z)
827827
828828   PORT_BIT  ( 32, IP_ACTIVE_HIGH, IPT_KEYBOARD )
829        PORT_NAME ( "TAN  ATAN  \xE2\x88\xAB  U") /* integral */
829      PORT_NAME ( "TAN  ATAN  \xE2\x88\xAB  U") /* integral */
830830   PORT_CODE ( KEYCODE_U )
831831
832832   PORT_BIT  ( 64, IP_ACTIVE_HIGH, IPT_KEYBOARD )
833        PORT_NAME ( "\xE2\x87\x90  DEL  CLEAR") /* double left arrow */
833      PORT_NAME ( "\xE2\x87\x90  DEL  CLEAR") /* double left arrow */
834834   PORT_CODE ( KEYCODE_BACKSPACE )
835835   PORT_CODE ( KEYCODE_DEL )
836836   PORT_CODE ( KEYCODE_DEL_PAD )
r29404r29405
839839   PORT_NAME ( "NXT  PREV  PASTE  L")
840840   PORT_CODE ( KEYCODE_L )
841841
842        PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
842      PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
843843
844844
845        PORT_START( "LINE1" ) /* OUT = 0x002 */
845      PORT_START( "LINE1" ) /* OUT = 0x002 */
846846
847847   PORT_BIT  ( 1, IP_ACTIVE_HIGH, IPT_KEYBOARD )
848        PORT_NAME ( "SPC  \xCF\x80  ,")  /* pi */
848      PORT_NAME ( "SPC  \xCF\x80  ,")  /* pi */
849849   PORT_CODE ( KEYCODE_SPACE )
850850
851851   PORT_BIT  ( 2, IP_ACTIVE_HIGH, IPT_KEYBOARD )
r29404r29405
864864   PORT_CODE ( KEYCODE_9_PAD )
865865
866866   PORT_BIT  ( 16, IP_ACTIVE_HIGH, IPT_KEYBOARD )
867        PORT_NAME ( "1/x  \xE2\x89\xA5  >  Y") /* >= */
867      PORT_NAME ( "1/x  \xE2\x89\xA5  >  Y") /* >= */
868868   PORT_CODE ( KEYCODE_Y )
869869
870870   PORT_BIT  ( 32, IP_ACTIVE_HIGH, IPT_KEYBOARD )
871        PORT_NAME ( "COS  ACOS  \xE2\x88\x82  T") /* delta */
871      PORT_NAME ( "COS  ACOS  \xE2\x88\x82  T") /* delta */
872872   PORT_CODE ( KEYCODE_T )
873873
874874   PORT_BIT  ( 64, IP_ACTIVE_HIGH, IPT_KEYBOARD )
r29404r29405
879879   PORT_NAME ( "STO\xE2\x8A\xB3  RCL  CUT  K")
880880   PORT_CODE ( KEYCODE_K )
881881
882        PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
882      PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
883883
884884
885        PORT_START( "LINE2" ) /* OUT = 0x004 */
885      PORT_START( "LINE2" ) /* OUT = 0x004 */
886886
887887   PORT_BIT  ( 1, IP_ACTIVE_HIGH, IPT_KEYBOARD )
888888   PORT_NAME ( ".  : :  \xE2\x86\xb5") /* return arrow */
r29404r29405
904904   PORT_CODE ( KEYCODE_8_PAD )
905905
906906   PORT_BIT  ( 16, IP_ACTIVE_HIGH, IPT_KEYBOARD )
907        PORT_NAME ( "X  \xE2\x89\xA4  <  X") /* <= */
907      PORT_NAME ( "X  \xE2\x89\xA4  <  X") /* <= */
908908   PORT_CODE ( KEYCODE_X )
909909
910910   PORT_BIT  ( 32, IP_ACTIVE_HIGH, IPT_KEYBOARD )
r29404r29405
919919   PORT_NAME ( "VAR  UPDIR  COPY  J")
920920   PORT_CODE ( KEYCODE_J )
921921
922        PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
922      PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
923923
924924
925        PORT_START( "LINE3" ) /* OUT = 0x008 */
925      PORT_START( "LINE3" ) /* OUT = 0x008 */
926926
927927   PORT_BIT  ( 1, IP_ACTIVE_HIGH, IPT_KEYBOARD )
928        PORT_NAME ( "0  \xE2\x88\x9E  \xE2\x86\x92") /* infinity, right arrow */
928      PORT_NAME ( "0  \xE2\x88\x9E  \xE2\x86\x92") /* infinity, right arrow */
929929   PORT_CODE ( KEYCODE_0 )
930930   PORT_CODE ( KEYCODE_0_PAD )
931931
r29404r29405
945945   PORT_CODE ( KEYCODE_7_PAD )
946946
947947   PORT_BIT  ( 16, IP_ACTIVE_HIGH, IPT_KEYBOARD )
948        PORT_NAME ( "+/-  \xE2\x89\xA0  =  W") /* =/ */
948      PORT_NAME ( "+/-  \xE2\x89\xA0  =  W") /* =/ */
949949   PORT_CODE ( KEYCODE_W )
950950
951951   PORT_BIT  ( 32, IP_ACTIVE_HIGH, IPT_KEYBOARD )
952        PORT_NAME ( "\xE2\x88\x9A  x^2  sqrt(x,y)  R") /* square root */
952      PORT_NAME ( "\xE2\x88\x9A  x^2  sqrt(x,y)  R") /* square root */
953953   PORT_CODE ( KEYCODE_R )
954954
955955   PORT_BIT  ( 64, IP_ACTIVE_HIGH, IPT_KEYBOARD )
r29404r29405
960960   PORT_NAME ( "TOOL i  |  I")
961961   PORT_CODE ( KEYCODE_I )
962962
963        PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
963      PORT_BIT ( 0x7f00, 0, IPT_UNUSED )
964964
965965
966        PORT_START( "LINE4" ) /* OUT = 0x010 */
966      PORT_START( "LINE4" ) /* OUT = 0x010 */
967967
968968   PORT_BIT  ( 16, IP_ACTIVE_HIGH, IPT_KEYBOARD )
969969   PORT_NAME ( "EEX  10^x  LOG  V")
r29404r29405
981981   PORT_NAME ( "MODE  CUSTOM  END  H")
982982   PORT_CODE ( KEYCODE_H )
983983
984        PORT_BIT ( 0x7f0f, 0, IPT_UNUSED )
984      PORT_BIT ( 0x7f0f, 0, IPT_UNUSED )
985985
986986
987        PORT_START( "LINE5" ) /* OUT = 0x020 */
987      PORT_START( "LINE5" ) /* OUT = 0x020 */
988988
989989   PORT_BIT  ( 1, IP_ACTIVE_HIGH, IPT_KEYBOARD )
990990   PORT_NAME ( "F1  Y=  A")
r29404r29405
10201020   PORT_NAME ( "APPS  FILES  BEGIN  G")
10211021   PORT_CODE ( KEYCODE_G )
10221022
1023        PORT_BIT ( 0x7f40, 0, IPT_UNUSED )
1023      PORT_BIT ( 0x7f40, 0, IPT_UNUSED )
10241024
10251025
1026        PORT_START( "LINE6" ) /* OUT = 0x040 */
1026      PORT_START( "LINE6" ) /* OUT = 0x040 */
10271027
10281028   PORT_BIT  ( 1, IP_ACTIVE_HIGH, IPT_KEYBOARD )
10291029   PORT_NAME ( "\xE2\x86\x92") /* right arrow */
r29404r29405
10341034   PORT_CODE ( KEYCODE_DOWN )
10351035
10361036   PORT_BIT  ( 4, IP_ACTIVE_HIGH, IPT_KEYBOARD )
1037   PORT_NAME ( "\xE2\x86\x90") /* left arrow */
1037   PORT_NAME ( "\xE2\x86\x90") /* left arrow */
10381038   PORT_CODE ( KEYCODE_LEFT )
10391039
10401040   PORT_BIT  ( 8, IP_ACTIVE_HIGH, IPT_KEYBOARD )
10411041   PORT_NAME ( "\xE2\x86\x91") /* up arrow */
10421042   PORT_CODE ( KEYCODE_UP )
10431043
1044        PORT_BIT ( 0x7ff0, 0, IPT_UNUSED )
1044      PORT_BIT ( 0x7ff0, 0, IPT_UNUSED )
10451045
10461046
1047        PORT_START( "LINE7" ) /* OUT = 0x080 */
1047      PORT_START( "LINE7" ) /* OUT = 0x080 */
10481048
10491049   PORT_BIT  ( 2, IP_ACTIVE_HIGH, IPT_KEYBOARD )
10501050   PORT_NAME ( "right shift")
r29404r29405
10551055   PORT_CODE ( KEYCODE_LSHIFT )
10561056
10571057   PORT_BIT  ( 8, IP_ACTIVE_HIGH, IPT_KEYBOARD )
1058        PORT_NAME ( "\xCE\xB1  USER  ENTRY") /* alpha */
1058      PORT_NAME ( "\xCE\xB1  USER  ENTRY") /* alpha */
10591059   PORT_CODE ( KEYCODE_LALT )
10601060
1061        PORT_BIT ( 0x7ff1, 0, IPT_UNUSED )
1061      PORT_BIT ( 0x7ff1, 0, IPT_UNUSED )
10621062
10631063
1064        PORT_START( "LINE8" ) /* OUT = 0x100 */
1064      PORT_START( "LINE8" ) /* OUT = 0x100 */
10651065
1066        PORT_BIT ( 0xffff, 0, IPT_UNUSED )
1066      PORT_BIT ( 0xffff, 0, IPT_UNUSED )
10671067
10681068
1069        PORT_START( "ON" ) /* ON key, appears on all OUT lines */
1069      PORT_START( "ON" ) /* ON key, appears on all OUT lines */
10701070
10711071   PORT_BIT  ( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD )
10721072   PORT_NAME ( "ON  CONT  OFF  CANCEL" )
10731073   PORT_CODE ( KEYCODE_ESC )
10741074   PORT_CODE ( KEYCODE_HOME )
10751075
1076        PORT_BIT ( 0x7fff, 0, IPT_UNUSED )
1076      PORT_BIT ( 0x7fff, 0, IPT_UNUSED )
10771077
10781078INPUT_PORTS_END
10791079
r29404r29405
11091109INPUT_PORTS_END
11101110
11111111static INPUT_PORTS_START( hp49g )
1112        PORT_INCLUDE( hp49g_kbd )
1113        PORT_INCLUDE( hp48_battery )
1112      PORT_INCLUDE( hp49g_kbd )
1113      PORT_INCLUDE( hp48_battery )
11141114INPUT_PORTS_END
11151115
11161116
r29404r29405
13561356   MCFG_DEFAULT_LAYOUT ( layout_hp49g )
13571357
13581358   /* serial I/O */
1359        //MCFG_XMODEM_ADD( "rs232_x", hp48_xmodem_rs232_conf )
1360        //MCFG_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
1359      //MCFG_XMODEM_ADD( "rs232_x", hp48_xmodem_rs232_conf )
1360      //MCFG_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
13611361MACHINE_CONFIG_END
13621362
13631363
trunk/src/mess/drivers/z100.c
r29404r29405
163163      m_pics(*this, "pic8259_slave"),
164164      m_fdc(*this, "z207_fdc"),
165165      m_crtc(*this, "crtc"),
166      m_palette(*this, "palette")
166      m_palette(*this, "palette")
167167   { }
168168
169169   required_device<cpu_device> m_maincpu;
r29404r29405
174174   required_device<fd1797_device> m_fdc;
175175   required_device<mc6845_device> m_crtc;
176176   required_device<palette_device> m_palette;
177   
177
178178   DECLARE_READ8_MEMBER(z100_vram_r);
179179   DECLARE_WRITE8_MEMBER(z100_vram_w);
180180   DECLARE_READ8_MEMBER(keyb_data_r);
r29404r29405
737737   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
738738   MCFG_SCREEN_UPDATE_DRIVER(z100_state, screen_update_z100)
739739   MCFG_SCREEN_PALETTE("palette")
740   
740
741741   MCFG_PALETTE_ADD("palette", 8)
742742
743743   /* Devices */
trunk/src/mess/drivers/stratos.c
r29404r29405
1616public:
1717   stratos_state(const machine_config &mconfig, device_type type, const char *tag)
1818      : driver_device(mconfig, type, tag),
19        maincpu(*this, "maincpu"),
20        nvram(*this, "nvram"),
21        bank_8000(*this, "bank_8000"),
22        bank_4000(*this, "bank_4000"),
23        nvram_bank(*this, "nvram_bank")
19         maincpu(*this, "maincpu"),
20         nvram(*this, "nvram"),
21         bank_8000(*this, "bank_8000"),
22         bank_4000(*this, "bank_4000"),
23         nvram_bank(*this, "nvram_bank")
2424   { }
2525
2626   required_device<m65c02_device> maincpu;
r29404r29405
255255   // 0f08 Bi
256256   // 1008 Kn
257257   // 1108 Pa
258   // 0108
259   // 0208
260   // 0308
261   // 0408
258   // 0108
259   // 0208
260   // 0308
261   // 0408
262262   // 0617 8
263263   // 0016 7
264264   // 0015 6
trunk/src/mess/drivers/adam.c
r29404r29405
289289
290290    TODO:
291291
292   - spinner INT
292    - spinner INT
293293    - printer
294294    - SPI
295295
r29404r29405
443443      case 5:
444444         cs2 = 0;
445445         break;
446         
446
447447      case 6:
448448         cs3 = 0;
449449         break;
450         
450
451451      case 7:
452452         cs4 = 0;
453453         break;
trunk/src/mess/drivers/atarist.c
r29404r29405
24092409   MCFG_MC68901_OUT_IRQ_CB(INPUTLINE(M68000_TAG, M68K_IRQ_6))
24102410   MCFG_MC68901_OUT_TDO_CB(WRITELINE(st_state, mfp_tdo_w))
24112411   MCFG_MC68901_OUT_SO_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
2412   
2412
24132413   MCFG_WD1772x_ADD(WD1772_TAG, U517/2)
24142414   MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
24152415   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(st_state, fdc_drq_w))
trunk/src/mess/drivers/mc80.c
r29404r29405
174174   MCFG_VIDEO_START_OVERRIDE(mc80_state,mc8020)
175175   MCFG_SCREEN_UPDATE_DRIVER(mc80_state, screen_update_mc8020)
176176   MCFG_SCREEN_PALETTE("palette")
177   
177
178178   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
179179
180180   /* Devices */
r29404r29405
201201   MCFG_VIDEO_START_OVERRIDE(mc80_state,mc8030)
202202   MCFG_SCREEN_UPDATE_DRIVER(mc80_state, screen_update_mc8030)
203203   MCFG_SCREEN_PALETTE("palette")
204   
204
205205   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
206206
207207   /* Devices */
trunk/src/mess/drivers/px4.c
r29404r29405
6666//**************************************************************************
6767
6868class px4_state : public driver_device,
69              public device_serial_interface
69               public device_serial_interface
7070{
7171public:
7272   px4_state(const machine_config &mconfig, device_type type, const char *tag) :
r29404r29405
8383   m_isr(0), m_ier(0), m_str(0), m_sior(0xbf),
8484   m_artdir(0xff), m_artdor(0xff), m_artsr(0), m_artcr(0),
8585   m_swr(0),
86   m_one_sec_int_enabled(true), m_alarm_int_enabled(true),   m_key_int_enabled(true),
86   m_one_sec_int_enabled(true), m_alarm_int_enabled(true), m_key_int_enabled(true),
8787   m_ramdisk_address(0),
8888   m_ear_last_state(0)
8989   { }
trunk/src/mess/drivers/pentagon.c
r29404r29405
160160}
161161static ADDRESS_MAP_START (pentagon_io, AS_IO, 8, pentagon_state )
162162   ADDRESS_MAP_UNMAP_HIGH
163   AM_RANGE(0x0000, 0x0000) AM_WRITE(pentagon_port_7ffd_w)  AM_MIRROR(0x7ffd)   // (A15 | A1) == 0
163   AM_RANGE(0x0000, 0x0000) AM_WRITE(pentagon_port_7ffd_w)  AM_MIRROR(0x7ffd)  // (A15 | A1) == 0
164164   AM_RANGE(0x001f, 0x001f) AM_DEVREADWRITE(BETA_DISK_TAG, beta_disk_device, status_r, command_w) AM_MIRROR(0xff00)
165165   AM_RANGE(0x003f, 0x003f) AM_DEVREADWRITE(BETA_DISK_TAG, beta_disk_device, track_r, track_w) AM_MIRROR(0xff00)
166166   AM_RANGE(0x005f, 0x005f) AM_DEVREADWRITE(BETA_DISK_TAG, beta_disk_device, sector_r, sector_w) AM_MIRROR(0xff00)
trunk/src/mess/drivers/k8915.c
r29404r29405
168168   MCFG_SCREEN_SIZE(640, 250)
169169   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
170170   MCFG_SCREEN_PALETTE("palette")
171   
171
172172   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
173173
174174   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
trunk/src/mess/drivers/pc4.c
r29404r29405
225225   MCFG_SCREEN_SIZE(240, 36)
226226   MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 36-1)
227227   MCFG_SCREEN_PALETTE("palette")
228   
228
229229   MCFG_DEFAULT_LAYOUT(layout_lcd)
230230   MCFG_PALETTE_ADD("palette", 2)
231231   MCFG_PALETTE_INIT_OWNER(pc4_state, pc4)
trunk/src/mess/drivers/palm.c
r29404r29405
201201   MCFG_SCREEN_VISIBLE_AREA( 0, 159, 0, 219 )
202202   MCFG_SCREEN_UPDATE_DEVICE(MC68328_TAG, mc68328_device, screen_update)
203203   MCFG_SCREEN_PALETTE("palette")
204   
204
205205   MCFG_PALETTE_ADD( "palette", 2 )
206206   MCFG_PALETTE_INIT_OWNER(palm_state, palm)
207207   MCFG_DEFAULT_LAYOUT(layout_lcd)
trunk/src/mess/drivers/rex6000.c
r29404r29405
652652   MCFG_SCREEN_SIZE(240, 120)
653653   MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 120-1)
654654   MCFG_SCREEN_PALETTE("palette")
655   
655
656656   MCFG_DEFAULT_LAYOUT(layout_lcd)
657657   MCFG_PALETTE_ADD("palette", 2)
658658   MCFG_PALETTE_INIT_OWNER(rex6000_state, rex6000)
trunk/src/mess/drivers/mx2178.c
r29404r29405
5252   UINT8 m_term_data;
5353   required_device<z80_device> m_maincpu;
5454   required_device<acia6850_device> m_acia;
55public:   
55public:
5656   required_device<palette_device> m_palette;
5757};
5858
trunk/src/mess/drivers/apple2.c
r29404r29405
358358
359359   /*
360360     Apple IIe & IIc key matrix (from "Sams ComputerFacts: Apple IIe" and "Sams ComputerFacts: Apple IIc")
361                                                 
361
362362         | Y0  | Y1  | Y2  | Y3  | Y4  | Y5  | Y6  | Y7  | Y8  | Y9  |
363363         |     |     |     |     |     |     |     |     |     |     |
364364     ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
r29404r29405
382382
383383   /*
384384     Apple IIe platinum key matrix
385                                                 
385
386386         | Y0  | Y1  | Y2  | Y3  | Y4  | Y5  | Y6  | Y7  | Y8  | Y9  |
387387         |     |     |     |     |     |     |     |     |     |     |
388388     ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
r29404r29405
617617
618618   PORT_START("X6")
619619   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
620   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
621   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
622   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
623   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
624   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
620   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
621   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
622   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
623   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
624   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
625625   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return")   PORT_CODE(KEYCODE_ENTER)    PORT_CHAR(13)
626626   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP)        PORT_CODE(KEYCODE_UP)
627627   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE)  PORT_CHAR(' ')
r29404r29405
671671   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc")      PORT_CODE(KEYCODE_ESC)      PORT_CHAR(27)
672672   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)  PORT_CHAR('1') PORT_CHAR('!')
673673   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2)  PORT_CHAR('2') PORT_CHAR('\"')
674   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)  PORT_CHAR('3') PORT_CHAR(0xa3)   // a3 is Unicode for the pound sign
674   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)  PORT_CHAR('3') PORT_CHAR(0xa3)  // a3 is Unicode for the pound sign
675675   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4)  PORT_CHAR('4') PORT_CHAR('$')
676676   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6)  PORT_CHAR('6') PORT_CHAR('&')
677677   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5)  PORT_CHAR('5') PORT_CHAR('%')
r29404r29405
741741
742742   PORT_START("X6")
743743   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
744   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
745   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
746   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
747   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
748   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
744   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
745   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
746   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
747   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
748   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
749749   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return")   PORT_CODE(KEYCODE_ENTER)    PORT_CHAR(13)
750750   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP)        PORT_CODE(KEYCODE_UP)
751751   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE)  PORT_CHAR(' ')
r29404r29405
862862
863863   PORT_START("X6")
864864   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK)    PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))
865   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
865   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
866866   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD)       PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
867867   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD)       PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
868868   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD)     PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
r29404r29405
997997   SLOT_INTERFACE("ultraterm", A2BUS_ULTRATERM)    /* Videx UltraTerm (original) */
998998   SLOT_INTERFACE("ultratermenh", A2BUS_ULTRATERMENH)    /* Videx UltraTerm (enhanced //e) */
999999   SLOT_INTERFACE("aevm80", A2BUS_VTC2)    /* Applied Engineering ViewMaster 80 */
1000   SLOT_INTERFACE("parallel", A2BUS_PIC)   /* Apple Parallel Interface Card */
1001   SLOT_INTERFACE("corvus", A2BUS_CORVUS)   /* Corvus flat-cable HDD interface (must go in slot 6) */
1000   SLOT_INTERFACE("parallel", A2BUS_PIC)   /* Apple Parallel Interface Card */
1001   SLOT_INTERFACE("corvus", A2BUS_CORVUS)  /* Corvus flat-cable HDD interface (must go in slot 6) */
10021002SLOT_INTERFACE_END
10031003
10041004static SLOT_INTERFACE_START(apple2eaux_cards)
r29404r29405
13211321
13221322/*
13231323    J-Plus ROM numbers confirmed by:
1324   http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/Apple%20II/Apple%20II%20j-plus/Photos/Apple%20II%20j-plus%20-%20Motherboard.jpg
1324    http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/Apple%20II/Apple%20II%20j-plus/Photos/Apple%20II%20j-plus%20-%20Motherboard.jpg
13251325*/
13261326
13271327ROM_START(apple2jp)
r29404r29405
15661566   ROM_CONTINUE(0x1000, 0x1000)
15671567   ROM_LOAD( "ultra2.bin", 0x3000, 0x1000, CRC(1ac1e17e) SHA1(a5b8adec37da91970c303905b5e2c4d1b715ee4e))
15681568
1569   ROM_REGION(0x800, "kbmcu", 0)   // 6802 code for keyboard MCU (very unlike real Apples, will require some reverse-engineering)
1569   ROM_REGION(0x800, "kbmcu", 0)   // 6802 code for keyboard MCU (very unlike real Apples, will require some reverse-engineering)
15701570   ROM_LOAD( "ultra4.bin", 0x0000, 0x0800, CRC(3dce51ac) SHA1(676b6e775d5159049cae5b6143398ec7b2bf437a) )
15711571ROM_END
15721572
r29404r29405
16271627COMP( 1980, apple2jp, apple2,   0,        apple2p,     apple2p, driver_device,  0,        "Apple Computer",    "Apple ][ J-Plus", GAME_SUPPORTS_SAVE )
16281628COMP( 1982, ace100,   apple2,   0,        apple2,      apple2e, driver_device,  0,        "Franklin Computer", "Franklin Ace 100", GAME_SUPPORTS_SAVE )
16291629COMP( 1983, apple2e,  0,        apple2,   apple2e,     apple2e, driver_device,  0,        "Apple Computer",    "Apple //e", GAME_SUPPORTS_SAVE )
1630COMP( 1983, apple2euk,apple2e,    0,        apple2e,     apple2euk,driver_device, 0,        "Apple Computer",    "Apple //e (UK)", GAME_SUPPORTS_SAVE )
1630COMP( 1983, apple2euk,apple2e, 0,        apple2e,     apple2euk,driver_device, 0,        "Apple Computer",    "Apple //e (UK)", GAME_SUPPORTS_SAVE )
16311631COMP( 1983, mprof3,   apple2e,  0,        mprof3,      apple2e, driver_device,  0,        "Multitech",         "Microprofessor III", GAME_SUPPORTS_SAVE )
16321632COMP( 1985, apple2ee, apple2e,  0,        apple2ee,    apple2e, driver_device,  0,        "Apple Computer",    "Apple //e (enhanced)", GAME_SUPPORTS_SAVE )
16331633COMP( 1985, apple2eeuk,apple2e, 0,        apple2ee,    apple2euk, driver_device,0,        "Apple Computer",    "Apple //e (enhanced, UK)", GAME_SUPPORTS_SAVE )
trunk/src/mess/drivers/bcs3.c
r29404r29405
446446   MCFG_SCREEN_VISIBLE_AREA(0,28*8-1,0,12*10-1)
447447   MCFG_SCREEN_UPDATE_DRIVER(bcs3_state, screen_update_bcs3)
448448   MCFG_SCREEN_PALETTE("palette")
449   
449
450450   MCFG_GFXDECODE_ADD("gfxdecode", "palette", bcs3)
451451   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
452452MACHINE_CONFIG_END
trunk/src/mess/drivers/fmtowns.c
r29404r29405
624624}
625625
626626READ16_MEMBER(towns_state::towns_fdc_dma_r)
627{   UINT16 data = m_fdc->data_r(generic_space(), 0);
627{   UINT16 data = m_fdc->data_r(generic_space(), 0);
628628   return data;
629629}
630630
trunk/src/mess/drivers/c128.c
r29404r29405
14681468   MCFG_SCREEN_SIZE(VIC6567_COLUMNS, VIC6567_LINES)
14691469   MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1)
14701470   MCFG_SCREEN_UPDATE_DEVICE(MOS8564_TAG, mos8564_device, screen_update)
1471   
1471
14721472   MCFG_GFXDECODE_ADD("gfxdecode", MOS8563_TAG":palette", c128)
14731473
14741474   // sound hardware
r29404r29405
16321632   MCFG_SCREEN_SIZE(VIC6569_COLUMNS, VIC6569_LINES)
16331633   MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1)
16341634   MCFG_SCREEN_UPDATE_DEVICE(MOS8566_TAG, mos8566_device, screen_update)
1635   
1635
16361636   MCFG_GFXDECODE_ADD("gfxdecode", MOS8563_TAG":palette", c128)
16371637
16381638   // sound hardware
trunk/src/mess/drivers/kyocera.c
r29404r29405
3030
3131    TODO:
3232
33   - bar code reader (!RxDB -> RST5.5, Hewlett-Packard HREDS-3050 interface)
33    - bar code reader (!RxDB -> RST5.5, Hewlett-Packard HREDS-3050 interface)
3434    - un-Y2K-hack tandy200
3535    - keyboard is unresponsive for couple of seconds after boot
3636    - soft power on/off
trunk/src/mess/drivers/pb1000.c
r29404r29405
514514   MCFG_SCREEN_SIZE(192, 32)
515515   MCFG_SCREEN_VISIBLE_AREA(0, 192-1, 0, 32-1)
516516   MCFG_SCREEN_PALETTE("palette")
517   
517
518518   MCFG_DEFAULT_LAYOUT(layout_lcd)
519519   MCFG_PALETTE_ADD("palette", 2)
520520   MCFG_PALETTE_INIT_OWNER(pb1000_state, pb1000)
trunk/src/mess/drivers/plan80.c
r29404r29405
242242   MCFG_SCREEN_SIZE(48*6, 32*8)
243243   MCFG_SCREEN_VISIBLE_AREA(0, 48*6-1, 0, 32*8-1)
244244   MCFG_SCREEN_PALETTE("palette")
245   
245
246246   MCFG_GFXDECODE_ADD("gfxdecode", "palette", plan80)
247247   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
248248MACHINE_CONFIG_END
trunk/src/mess/drivers/ssem.c
r29404r29405
2222   required_device<ssem_device> m_maincpu;
2323   required_shared_ptr<UINT8> m_store;
2424   required_device<screen_device> m_screen;
25   
25
2626   UINT8 m_store_line;
2727   virtual void machine_reset();
2828   UINT32 screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
trunk/src/mess/drivers/rmt32.c
r29404r29405
360360   MCFG_SCREEN_SIZE(20*6-1, (20*6-1)*3/4)
361361   MCFG_SCREEN_VISIBLE_AREA(0, 20*6-2, 0, (20*6-1)*3/4-1)
362362   MCFG_SCREEN_PALETTE("palette")
363   
363
364364   MCFG_PALETTE_ADD("palette", 2)
365365   MCFG_PALETTE_INIT_OWNER(mt32_state, mt32)
366366
trunk/src/mess/drivers/vt100.c
r29404r29405
421421   MCFG_SCREEN_PALETTE("vt100_video:palette")
422422
423423   MCFG_GFXDECODE_ADD("gfxdecode", "vt100_video:palette", vt100)
424//   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
424//  MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
425425
426426   MCFG_DEFAULT_LAYOUT( layout_vt100 )
427427
trunk/src/mess/drivers/supracan.c
r29404r29405
19251925   MCFG_SCREEN_RAW_PARAMS(XTAL_10_738635MHz/2, 348, 0, 256, 256, 0, 240 )  /* No idea if this is correct */
19261926   MCFG_SCREEN_UPDATE_DRIVER(supracan_state, screen_update_supracan)
19271927   MCFG_SCREEN_PALETTE("palette")
1928   
1928
19291929   MCFG_PALETTE_ADD( "palette", 32768 )
19301930   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
19311931   MCFG_PALETTE_INIT_OWNER(supracan_state, supracan)
1932   
1932
19331933   MCFG_GFXDECODE_ADD("gfxdecode", "palette", supracan)
19341934
19351935   MCFG_CARTSLOT_ADD("cart")
trunk/src/mess/drivers/zorba.c
r29404r29405
9898   required_device<fd1793_t> m_fdc;
9999   required_device<floppy_connector> m_floppy0;
100100   required_device<floppy_connector> m_floppy1;
101public:   
101public:
102102   required_device<palette_device> m_palette;
103103};
104104
r29404r29405
361361   MCFG_SCREEN_SIZE(640, 276)
362362   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 275)
363363   MCFG_SCREEN_PALETTE("palette")
364   
364
365365   MCFG_PALETTE_ADD("palette", 3)
366366   MCFG_PALETTE_INIT_OWNER(zorba_state, zorba)
367367
trunk/src/mess/drivers/mz700.c
r29404r29405
366366   MCFG_PIT8253_OUT2_HANDLER(WRITELINE(mz_state, pit_irq_2))
367367
368368   MCFG_I8255_ADD("ppi8255", mz700_ppi8255_interface)
369   
369
370370   MCFG_DEVICE_ADD("ls145", TTL74145, 0)
371371
372372   MCFG_CASSETTE_ADD( "cassette", mz700_cassette_interface )
trunk/src/mess/drivers/mk90.c
r29404r29405
7979   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
8080   MCFG_SCREEN_UPDATE_DRIVER(mk90_state, screen_update_mk90)
8181   MCFG_SCREEN_PALETTE("palette")
82   
82
8383   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
8484MACHINE_CONFIG_END
8585
trunk/src/mess/drivers/apple3.c
r29404r29405
33    drivers/apple3.c
44
55    Apple ///
6
6
77    driver by Nathan Woods and R. Belmont
8
8
99    Special thanks to Chris Smolinski (author of the Sara emulator)
1010    for his input about this poorly known system.
11
11
1212    Also thanks to Washington Apple Pi for the "Apple III DVD" containing the
1313    technical manual, schematics, and software.
1414
r29404r29405
176176   */
177177
178178/*
179   Esc
180   0x00
179    Esc
180    0x00
181181
182     `    1   2    3    4    5   6    7    8    9   0    -   =   BACKSPACE
183   0x38 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x30 0x31 0x2f 0x104
182      `    1    2    3    4    5    6    7    8    9    0    -   =   BACKSPACE
183    0x38 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x30 0x31 0x2f 0x104
184184
185    Tab   Q   W    E    R    T   Y    U   I     O   P    [    ]    \
186   0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x3a 0x3b 0x39 0x2e
185     Tab   Q    W    E    R    T    Y    U   I     O    P    [    ]    \
186    0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 0x11 0x12 0x13 0x3a 0x3b 0x39 0x2e
187187
188     A    S   D    F    G    H   J    K    L    ;   '   ENTER
189   0x14 0x15 0x16 0x17 0x19 0x18 0x1a 0x1b 0x1d 0x1c 0x105 0x102
190 
191      Z    X   C    V    B    N    M   ,     .    /
188      A    S    D    F    G    H    J    K    L    ;    '   ENTER
189    0x14 0x15 0x16 0x17 0x19 0x18 0x1a 0x1b 0x1d 0x1c 0x105 0x102
190
191      Z    X    C    V    B    N    M   ,     .    /
192192    0x1e 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27
193 
194    SPACE   UP    LT    DN    RT   KP-   KP7  KP8  KP9
193
194    SPACE   UP    LT    DN    RT   KP-   KP7  KP8  KP9
195195    0x109  0x103 0x10e 0x10d 0x10c 0x10b 0x2d 0x2b 0x29
196
196
197197    KP4  KP5  KP6   KP1  KP2  KP3  KPEN  KP0   KP.
198198    0x37 0x35 0x33 0x101 0x3f 0x3d 0x108 0x100 0x3e
199199*/
r29404r29405
310310   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift")   PORT_CODE(KEYCODE_LSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)
311311   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift")  PORT_CODE(KEYCODE_RSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)
312312   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control")      PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
313   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple")   PORT_CODE(KEYCODE_LALT)
314   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple")  PORT_CODE(KEYCODE_RALT)
313   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple")   PORT_CODE(KEYCODE_LALT)
314   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple")  PORT_CODE(KEYCODE_RALT)
315315   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET")        PORT_CODE(KEYCODE_F12)
316316INPUT_PORTS_END
317317
r29404r29405
322322
323323/*     YEAR     NAME        PARENT  COMPAT  MACHINE    INPUT    INIT    COMPANY             FULLNAME */
324324COMP( 1980, apple3,     0,      0,      apple3,    apple3, apple3_state,    apple3,     "Apple Computer",   "Apple ///", GAME_SUPPORTS_SAVE )
325
trunk/src/mess/drivers/homez80.c
r29404r29405
293293   MCFG_SCREEN_SIZE(344, 32*8)
294294   MCFG_SCREEN_VISIBLE_AREA(0, 344-1, 0, 32*8-1)
295295   MCFG_SCREEN_PALETTE("palette")
296   
296
297297   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
298298   MCFG_GFXDECODE_ADD("gfxdecode", "palette", homez80 )
299299MACHINE_CONFIG_END
trunk/src/mess/drivers/abc1600.c
r29404r29405
936936   MCFG_FD1797x_ADD(SAB1797_02P_TAG, XTAL_64MHz/64)
937937   MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z8536B1_TAG, z8536_device, pb7_w))
938938   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(abc1600_state, fdc_drq_w))
939   
939
940940   MCFG_FLOPPY_DRIVE_ADD(SAB1797_02P_TAG":0", abc1600_floppies, NULL,    floppy_image_device::default_floppy_formats)
941941   MCFG_FLOPPY_DRIVE_ADD(SAB1797_02P_TAG":1", abc1600_floppies, NULL,    floppy_image_device::default_floppy_formats)
942942   MCFG_FLOPPY_DRIVE_ADD(SAB1797_02P_TAG":2", abc1600_floppies, "525qd", floppy_image_device::default_floppy_formats)
trunk/src/mess/drivers/nc.c
r29404r29405
14171417
14181418   MCFG_PALETTE_ADD("palette", NC_NUM_COLOURS)
14191419   MCFG_PALETTE_INIT_OWNER(nc_state, nc)
1420   
1420
14211421   MCFG_DEFAULT_LAYOUT(layout_lcd)
14221422
14231423   /* sound hardware */
r29404r29405
14841484   MCFG_SCREEN_MODIFY("screen")
14851485   MCFG_SCREEN_SIZE(NC200_SCREEN_WIDTH, NC200_SCREEN_HEIGHT)
14861486   MCFG_SCREEN_VISIBLE_AREA(0, NC200_SCREEN_WIDTH-1, 0, NC200_SCREEN_HEIGHT-1)
1487   
1487
14881488   MCFG_PALETTE_MODIFY("palette")
14891489   MCFG_PALETTE_ENTRIES(NC200_NUM_COLOURS)
14901490   MCFG_PALETTE_INIT_OWNER(nc_state, nc)
trunk/src/mess/drivers/pt68k4.c
r29404r29405
88    2013-09-30 Connected to a terminal
99    2014-01-03 Connect real DUARTs, FDC, and TimeKeeper.  Settings now save properly, floppies can be read.
1010    2014-01-19 ISA bus and compatible cards, PC keyboard support, speaker support
11
11
1212This has the appearance of a PC, including pc power supply, slots, etc
1313on a conventional pc-like motherboard and case.
1414
1515Some pics: http://www.wormfood.net/old_computers/
1616
17Chips:
17Chips:
1818    68230 Parallel Interface/Timer @ FE0081
1919    68681 DUART/Timer (x2) @ FE0001 and FE0041
2020    WD37C65 FDC (PC FDC compatible, even mapped as an ISA device)
2121    MK48T02 TimeKeeper @ odd bytes from FF0001 to FF0FFF.  even bytes in that range are a standard SRAM chip which is not backed up.
2222    Keyboard at FE01C1 (status/IRQ clear)/FE01C3 (AT scan codes)
2323    WD1002 HDD controller @ FE0141-FE014F.  "Monk" BIOS also supports an 8-bit ISA IDE card.
24
24
2525Video: ISA MDA or CGA/EGA/VGA-style boards
2626    ISA memory is C00001-DFFFFF odd bytes only.  So the MDA B0000 framebuffer becames (B0000*2) + C00001 = D60001.
2727    ISA I/O is at FA0001-FBFFFF odd bytes only, and the mapping is similar.
28
28
2929    HUMBUG BIOS tests MDA and CGA VRAM to determine existence, falls back to serial console if neither exists.  If both exist, MDA is used.
3030    VRAM is every other byte for ISA cards.  (Only 8 bit cards are supported).
31
31
3232    OP3 on DUART1 drives a speaker.
3333    IP2 on DUART1 signals if a new keyboard scan code is available.
34 
35IRQs:
34
35IRQs:
3636    2: 68230 PIT
3737    4: DUART2
3838    5: DUART1
3939    6: PC FDC IRQ
40
40
4141TODO: 68230 device.  Better hardware documentation would be nice too, and working OS disks.
42
42
4343****************************************************************************/
4444
4545#include "emu.h"
r29404r29405
5555#include "sound/speaker.h"
5656
5757#define M68K_TAG "maincpu"
58#define DUART1_TAG   "duart1"
59#define DUART2_TAG   "duart2"
60#define TIMEKEEPER_TAG   "timekpr"
58#define DUART1_TAG  "duart1"
59#define DUART2_TAG  "duart2"
60#define TIMEKEEPER_TAG  "timekpr"
6161#define ISABUS_TAG "isa"
6262#define KBDC_TAG "pc_kbdc"
6363#define SPEAKER_TAG "speaker"
r29404r29405
109109// XT keyboard interface - done in TTL instead of an 804x
110110WRITE_LINE_MEMBER(pt68k4_state::keyboard_clock_w)
111111{
112//   printf("KCLK: %d\n", state ? 1 : 0);
112//  printf("KCLK: %d\n", state ? 1 : 0);
113113
114114   // rising edge?
115115   if ((state == ASSERT_LINE) && (!m_kclk))
r29404r29405
123123      // stop bit?
124124      if (m_kbit == 9)
125125      {
126//         printf("scancode %02x\n", m_scancode);
126//          printf("scancode %02x\n", m_scancode);
127127         m_kbit = 0;
128128         m_kbdflag = 0x80;
129129         m_duart1->ip2_w(CLEAR_LINE);
r29404r29405
139139
140140WRITE_LINE_MEMBER(pt68k4_state::keyboard_data_w)
141141{
142//   printf("KDATA: %d\n", state ? 1 : 0);
142//  printf("KDATA: %d\n", state ? 1 : 0);
143143   m_kdata = (state == ASSERT_LINE) ? 0x80 : 0x00;
144144}
145145
r29404r29405
228228   SLOT_INTERFACE("mda", ISA8_MDA)
229229   SLOT_INTERFACE("cga", ISA8_CGA)
230230   SLOT_INTERFACE("ega", ISA8_EGA) // Monk only
231   SLOT_INTERFACE("vga", ISA8_VGA)   // Monk only
231   SLOT_INTERFACE("vga", ISA8_VGA) // Monk only
232232   SLOT_INTERFACE("fdc_at", ISA8_FDC_AT)
233233   SLOT_INTERFACE("wdxt_gen", ISA8_WDXT_GEN)
234234   SLOT_INTERFACE("lpt", ISA8_LPT)
235   SLOT_INTERFACE("xtide", ISA8_XTIDE)   // Monk only
235   SLOT_INTERFACE("xtide", ISA8_XTIDE) // Monk only
236236SLOT_INTERFACE_END
237237
238238static const isa8bus_interface pt68k4_isabus_intf =
r29404r29405
309309/* Driver */
310310/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT   CLASS          INIT     COMPANY             FULLNAME       FLAGS */
311311COMP( 1990, pt68k4,  0,       0,     pt68k4,    pt68k4, driver_device, 0,  "Peripheral Technology", "PT68K4", GAME_NOT_WORKING )
312
trunk/src/mess/drivers/itt3030.c
r29404r29405
233233      , m_keyrow16(*this, "ROW16")
234234      , m_vram(*this, "vram"),
235235      m_gfxdecode(*this, "gfxdecode"),
236      m_palette(*this, "palette")
236      m_palette(*this, "palette")
237237   { }
238238
239239   // devices
trunk/src/mess/drivers/pc6001.c
r29404r29405
23672367
23682368   MCFG_SCREEN_MODIFY("screen")
23692369   MCFG_SCREEN_UPDATE_DRIVER(pc6001_state, screen_update_pc6001m2)
2370   
2370
23712371   MCFG_PALETTE_MODIFY("palette")
23722372   MCFG_PALETTE_ENTRIES(16+16)
23732373   MCFG_PALETTE_INIT_OWNER(pc6001_state,pc6001m2)
trunk/src/mess/drivers/tandy2k.c
r29404r29405
1111    TODO:
1212
1313    - floppy
14       - HDL is also connected to WP/TS input where TS is used to detect motor status
15       - 3 second motor off delay timer
14        - HDL is also connected to WP/TS input where TS is used to detect motor status
15        - 3 second motor off delay timer
1616    - DMA
17   - video (video RAM is at memory top - 0x1400, i.e. 0x1ec00)
17    - video (video RAM is at memory top - 0x1400, i.e. 0x1ec00)
1818    - keyboard ROM
1919    - hires graphics board
2020    - WD1010
r29404r29405
187187   int dme = (drq0 > 2) || (drq1 > 2);
188188
189189   m_pic1->ir6_w(dme);
190   
190
191191   update_drq();
192192}
193193
r29404r29405
339339{
340340   const pen_t *pen = m_palette->pens();
341341   address_space &program = m_maincpu->space(AS_PROGRAM);
342   
342
343343   for (int y = 0; y < 400; y++)
344344   {
345345      UINT8 cgra = y % 16;
r29404r29405
355355            int color = BIT(data, 7);
356356            bitmap.pix32(y, (sx * 8) + x) = pen[color];
357357            data <<= 1;
358         }         
358         }
359359      }
360360   }
361361
r29404r29405
398398WRITE_LINE_MEMBER( tandy2k_state::vpac_sld_w )
399399{
400400   m_sld = state;
401   
401
402402   m_vac->sld_w(state);
403403}
404404
r29404r29405
758758   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
759759   //MCFG_SCREEN_UPDATE_DEVICE(CRT9021B_TAG, crt9021_t, screen_update)
760760   MCFG_SCREEN_UPDATE_DRIVER(tandy2k_state, screen_update)
761   
761
762762   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
763763
764764   MCFG_DEVICE_ADD(CRT9007_TAG, CRT9007, XTAL_16MHz*28/20/8)
r29404r29405
816816   MCFG_PIT8253_OUT2_HANDLER(WRITELINE(tandy2k_state, rfrqpulse_w))
817817
818818   MCFG_PIC8259_ADD(I8259A_0_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w), VCC, NULL)
819   
819
820820   MCFG_PIC8259_ADD(I8259A_1_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int1_w), VCC, NULL)
821   
821
822822   MCFG_I8272A_ADD(I8272A_TAG, true)
823823   downcast<i8272a_device *>(device)->set_select_lines_connected(true);
824824   MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE(I8259A_0_TAG, pic8259_device, ir4_w))
trunk/src/mess/drivers/vboy.c
r29404r29405
106106      : driver_device(mconfig, type, tag),
107107         m_maintimer(*this, "timer_main"),
108108         m_maincpu(*this, "maincpu"),
109      m_palette(*this, "palette")
109      m_palette(*this, "palette")
110110   {
111111      m_vip_regs.INTPND = 0;
112112      m_vip_regs.INTENB = 0;
trunk/src/mess/drivers/vip.c
r29404r29405
503503
504504WRITE8_MEMBER( vip_state::sc_w )
505505{
506    m_exp->sc_w(data);
506   m_exp->sc_w(data);
507507}
508508
509509
r29404r29405
726726   MCFG_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_3_52128MHz/2)
727727   MCFG_CPU_PROGRAM_MAP(vip_mem)
728728   MCFG_CPU_IO_MAP(vip_io)
729    MCFG_COSMAC_WAIT_CALLBACK(VCC)
730    MCFG_COSMAC_CLEAR_CALLBACK(READLINE(vip_state, clear_r))
731    MCFG_COSMAC_EF1_CALLBACK(READLINE(vip_state, ef1_r))
732    MCFG_COSMAC_EF2_CALLBACK(READLINE(vip_state, ef2_r))
733    MCFG_COSMAC_EF3_CALLBACK(READLINE(vip_state, ef3_r))
734    MCFG_COSMAC_EF4_CALLBACK(READLINE(vip_state, ef4_r))
735    MCFG_COSMAC_Q_CALLBACK(WRITELINE(vip_state, q_w))
736    MCFG_COSMAC_DMAR_CALLBACK(READ8(vip_state, dma_r))
737    MCFG_COSMAC_DMAW_CALLBACK(WRITE8(vip_state, dma_w))
738    MCFG_COSMAC_SC_CALLBACK(WRITE8(vip_state, sc_w))
729   MCFG_COSMAC_WAIT_CALLBACK(VCC)
730   MCFG_COSMAC_CLEAR_CALLBACK(READLINE(vip_state, clear_r))
731   MCFG_COSMAC_EF1_CALLBACK(READLINE(vip_state, ef1_r))
732   MCFG_COSMAC_EF2_CALLBACK(READLINE(vip_state, ef2_r))
733   MCFG_COSMAC_EF3_CALLBACK(READLINE(vip_state, ef3_r))
734   MCFG_COSMAC_EF4_CALLBACK(READLINE(vip_state, ef4_r))
735   MCFG_COSMAC_Q_CALLBACK(WRITELINE(vip_state, q_w))
736   MCFG_COSMAC_DMAR_CALLBACK(READ8(vip_state, dma_r))
737   MCFG_COSMAC_DMAW_CALLBACK(WRITE8(vip_state, dma_w))
738   MCFG_COSMAC_SC_CALLBACK(WRITE8(vip_state, sc_w))
739739
740740   // video hardware
741    MCFG_DEVICE_ADD(CDP1861_TAG, CDP1861, XTAL_3_52128MHz/2)
742    MCFG_CDP1861_IRQ_CALLBACK(WRITELINE(vip_state, vdc_int_w))
743    MCFG_CDP1861_DMA_OUT_CALLBACK(WRITELINE(vip_state, vdc_dma_out_w))
744    MCFG_CDP1861_EFX_CALLBACK(WRITELINE(vip_state, vdc_ef1_w))
745    MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL_3_52128MHz/2)
746    MCFG_SCREEN_UPDATE_DRIVER(vip_state, screen_update)
741   MCFG_DEVICE_ADD(CDP1861_TAG, CDP1861, XTAL_3_52128MHz/2)
742   MCFG_CDP1861_IRQ_CALLBACK(WRITELINE(vip_state, vdc_int_w))
743   MCFG_CDP1861_DMA_OUT_CALLBACK(WRITELINE(vip_state, vdc_dma_out_w))
744   MCFG_CDP1861_EFX_CALLBACK(WRITELINE(vip_state, vdc_ef1_w))
745   MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL_3_52128MHz/2)
746   MCFG_SCREEN_UPDATE_DRIVER(vip_state, screen_update)
747747
748748   // sound hardware
749749   MCFG_SPEAKER_STANDARD_MONO("mono")
r29404r29405
754754
755755   MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, NULL, WRITELINE(vip_state, byteio_inst_w))
756756   MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
757    MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vip_state, exp_int_w))
758    MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vip_state, exp_dma_out_w))
759    MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vip_state, exp_dma_in_w))
757   MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vip_state, exp_int_w))
758   MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vip_state, exp_dma_out_w))
759   MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vip_state, exp_dma_in_w))
760760
761761   // devices
762762   MCFG_QUICKLOAD_ADD("quickload", vip_state, vip, "bin,c8,c8x", 0)
trunk/src/mess/drivers/indiana.c
r29404r29405
22
33        Indiana University 68030 board
44
5       08/12/2009 Skeleton driver.
6       01/20/2014 Added ISA bus and peripherals
7 
8       TODO: Text appears in VGA f/b (0x6B8000), but doesn't display?
9 
5        08/12/2009 Skeleton driver.
6        01/20/2014 Added ISA bus and peripherals
7
8        TODO: Text appears in VGA f/b (0x6B8000), but doesn't display?
9
1010        System often reads/writes 6003D4/5, might be a cut-down 6845,
1111        as it only uses registers C,D,E,F.
1212
r29404r29405
120120   MCFG_MC68901_RX_CLOCK(0)
121121   MCFG_MC68901_TX_CLOCK(0)
122122   MCFG_MC68901_OUT_SO_CB(DEVWRITELINE("keyboard", serial_keyboard_device, input_txd))
123   
123
124124   MCFG_SERIAL_KEYBOARD_ADD("keyboard", keyboard_interface, 1200)
125125MACHINE_CONFIG_END
126126
trunk/src/mess/drivers/grfd2301.c
r29404r29405
123123   MCFG_SCREEN_SIZE(640, 240)
124124   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
125125   MCFG_SCREEN_PALETTE("palette")
126   
126
127127   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
128128MACHINE_CONFIG_END
129129
trunk/src/mess/drivers/dms5000.c
r29404r29405
6767   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
6868   MCFG_SCREEN_UPDATE_DRIVER(dms5000_state, screen_update_dms5000)
6969   MCFG_SCREEN_PALETTE("palette")
70   
70
7171   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
7272MACHINE_CONFIG_END
7373
trunk/src/mess/drivers/ti85.c
r29404r29405
552552
553553   MCFG_SCREEN_MODIFY("screen")
554554   MCFG_SCREEN_UPDATE_DEVICE("t6a04", t6a04_device, screen_update)
555   
555
556556   MCFG_PALETTE_MODIFY("palette")
557557   MCFG_PALETTE_ENTRIES(2)
558558   MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
r29404r29405
582582
583583   MCFG_SCREEN_MODIFY("screen")
584584   MCFG_SCREEN_UPDATE_DEVICE("t6a04", t6a04_device, screen_update)
585   
585
586586   MCFG_PALETTE_MODIFY("palette")
587587   MCFG_PALETTE_ENTRIES(2)
588588   MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
r29404r29405
616616
617617   MCFG_SCREEN_MODIFY("screen")
618618   MCFG_SCREEN_UPDATE_DEVICE("t6a04", t6a04_device, screen_update)
619   
619
620620   MCFG_PALETTE_MODIFY("palette")
621621   MCFG_PALETTE_ENTRIES(2)
622622   MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
trunk/src/mess/drivers/unior.c
r29404r29405
8383   required_device<pit8253_device> m_pit;
8484   required_device<i8257_device> m_dma;
8585   required_device<i8251_device> m_uart;
86public:   
86public:
8787   required_device<palette_device> m_palette;
8888};
8989
trunk/src/mess/drivers/xerox820.c
r29404r29405
692692   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
693693   MCFG_SCREEN_UPDATE_DRIVER(xerox820_state, screen_update)
694694   MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240)
695   
695
696696   MCFG_GFXDECODE_ADD("gfxdecode", "palette", xerox820)
697697   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
698698
r29404r29405
747747   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
748748   MCFG_SCREEN_UPDATE_DRIVER(xerox820ii_state, screen_update)
749749   MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240)
750   
750
751751   MCFG_GFXDECODE_ADD("gfxdecode", "palette", xerox820ii)
752752   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
753753
trunk/src/mess/drivers/micronic.c
r29404r29405
376376   MCFG_RAM_ADD(RAM_TAG)
377377   MCFG_RAM_DEFAULT_SIZE("224K")
378378
379   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram1", micronic_state, nvram_init)   // base ram
380   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram2", micronic_state, nvram_init)   // additional ram banks
379   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram1", micronic_state, nvram_init)  // base ram
380   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram2", micronic_state, nvram_init)  // additional ram banks
381381
382382   MCFG_MC146818_ADD( MC146818_TAG, XTAL_32_768kHz )
383383   MCFG_MC146818_IRQ_HANDLER(WRITELINE(micronic_state, mc146818_irq))
trunk/src/mess/drivers/p2000t.c
r29404r29405
257257   MCFG_VIDEO_START_OVERRIDE(p2000t_state,p2000m)
258258   MCFG_SCREEN_UPDATE_DRIVER(p2000t_state, screen_update_p2000m)
259259   MCFG_SCREEN_PALETTE("palette")
260   
260
261261   MCFG_GFXDECODE_ADD("gfxdecode", "palette", p2000m )
262262   MCFG_PALETTE_ADD("palette", 4)
263263   MCFG_PALETTE_INIT_OWNER(p2000t_state,p2000m)
trunk/src/mess/drivers/alphasma.c
r29404r29405
398398   MCFG_SCREEN_SIZE(6*40, 9*4)
399399   MCFG_SCREEN_VISIBLE_AREA(0, (6*40)-1, 0, (9*4)-1)
400400   MCFG_SCREEN_PALETTE("palette")
401   
401
402402   MCFG_PALETTE_ADD("palette", 2)
403403   MCFG_PALETTE_INIT_OWNER(alphasmart_state, alphasmart)
404404   MCFG_DEFAULT_LAYOUT(layout_lcd)
trunk/src/mess/drivers/esq1.c
r29404r29405
608608   MCFG_ES5503_OUTPUT_CHANNELS(8)
609609   MCFG_ES5503_IRQ_FUNC(WRITELINE(esq1_state, esq1_doc_irq))
610610   MCFG_ES5503_ADC_FUNC(READ8(esq1_state, esq1_adc_read))
611   
611
612612   MCFG_SOUND_ROUTE_EX(0, "filters", 1.0, 0)
613613   MCFG_SOUND_ROUTE_EX(1, "filters", 1.0, 1)
614614   MCFG_SOUND_ROUTE_EX(2, "filters", 1.0, 2)
trunk/src/mess/drivers/irisha.c
r29404r29405
407407   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
408408   MCFG_SCREEN_UPDATE_DRIVER(irisha_state, screen_update_irisha)
409409   MCFG_SCREEN_PALETTE("palette")
410   
410
411411   MCFG_GFXDECODE_ADD("gfxdecode", "palette", irisha)
412412   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
413413
trunk/src/mess/drivers/atari400.c
r29404r29405
325325   void ms_atari800xl_machine_start(int type, int has_cart);
326326
327327   DECLARE_WRITE8_MEMBER(a600xl_pia_pb_w) { a600xl_mmu(data); }
328   
328
329329   DECLARE_READ8_MEMBER(atari_pia_pa_r);
330330   DECLARE_READ8_MEMBER(atari_pia_pb_r);
331331
trunk/src/mess/drivers/nakajies.c
r29404r29405
745745   MCFG_SCREEN_SIZE( 80 * 6, 8 * 8 )
746746   MCFG_SCREEN_VISIBLE_AREA( 0, 6 * 80 - 1, 0, 8 * 8 - 1 )
747747   MCFG_SCREEN_PALETTE("palette")
748   
748
749749   MCFG_GFXDECODE_ADD("gfxdecode", "palette", wales210)
750750   MCFG_PALETTE_ADD( "palette", 2 )
751751   MCFG_PALETTE_INIT_OWNER(nakajies_state, nakajies)
trunk/src/mess/drivers/ace.c
r29404r29405
726726   MCFG_SCREEN_UPDATE_DRIVER(ace_state, screen_update)
727727   MCFG_SCREEN_RAW_PARAMS(XTAL_6_5MHz, 416, 0, 336, 312, 0, 304)
728728   MCFG_SCREEN_PALETTE("palette")
729   
729
730730   MCFG_TIMER_DRIVER_ADD_SCANLINE("set_irq", ace_state, set_irq, SCREEN_TAG, 31*8, 264)
731731   MCFG_TIMER_DRIVER_ADD_SCANLINE("clear_irq", ace_state, clear_irq, SCREEN_TAG, 32*8, 264)
732732
trunk/src/mess/drivers/binbug.c
r29404r29405
301301   MCFG_SCREEN_SIZE(512, 256)
302302   MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
303303   MCFG_SCREEN_PALETTE("palette")
304   
304
305305   MCFG_GFXDECODE_ADD("gfxdecode", "palette", dg640)
306306   MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
307307
r29404r29405
561561   MCFG_SCREEN_SIZE(512, 256)
562562   MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
563563   MCFG_SCREEN_PALETTE("palette")
564   
564
565565   MCFG_GFXDECODE_ADD("gfxdecode", "palette", dg640)
566566   MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
567567
trunk/src/mess/drivers/cat.c
r29404r29405
218218    (vcc ? ? ? ? ? ? gnd) (random guess: txd, rxd, rts, cts, dsr, dtr, and one pin could be cd/ri though the modem circuit may do that separately?)
219219J3: Floppy Connector
220220    (standard DIL 34 pin 2-row rectangular connector for mini-shugart/pc floppy cable; pin 2 IS connected somewhere and ?probably? is used for /DISKCHANGE like on an Amiga, with pin 34 being /TRUEREADY?)
221    (as opposed to normal ibm pc 3.5" drives where pin 2 is unconnected or is /DENSITY *input to drive*, and pin 34 is /DISKCHANGE)
221    (as opposed to normal ibm pc 3.5" drives where pin 2 is unconnected or is /DENSITY *input to drive*, and pin 34 is /DISKCHANGE)
222222J4: 18-pin sip header for keyboard ribbon cable
223223    (needs tracing to see the VIA hookup order)
224224J5: locking-tab-type "CONN HEADER VERT 4POS .100 TIN" connector for supplying power
r29404r29405
282282    data, though track 0 is just a disk "unique" identifier for the cat
283283    meaning 404480 usable bytes
284284  * (Once the floppy is working I'd declare the system working)
285- WIP: Centronics port (not sure what is wrong right now, ip4 is never reading
285- WIP: Centronics port (not sure what is wrong right now, ip4 is never reading
286286    as high meaning nothing works; does our centronics implementation correctly
287287    assert BUSY at all?)
288288- RS232C port and Modem "port" connected to the DUART's two ports
r29404r29405
597597    *   sync is active here for 7 cycles; manual claims 10 but is wrong
598598    *   HST (96) is the horizontal count at which the HSYNC pin goes low
599599    *   sync is inactive here for 7 cycles, manual claims 8 but is wrong?, this is the frontporch
600    *   HSE (104) is the horizontal count at which the horizontal counter is reset to 0 (so counts 0-103 then back to 0)
600    *   HSE (104) is the horizontal count at which the horizontal counter is reset to 0 (so counts 0-103 then back to 0)
601601    *
602602    * VERTICAL:
603603    *   0 is the first vertical line displayed to screen
r29404r29405
654654   m_keyboard_line = data >> 8;
655655}
656656
657// 0x800004-0x800005 'pr.data' write
657// 0x800004-0x800005 'pr.data' write
658658// /DSTB (centronics pin 1) is implied by the cat source code to be pulsed
659659// low (for some unknown period of time) upon any write to this port.
660660WRITE16_MEMBER( cat_state::cat_printer_data_w )
r29404r29405
764764    * |||||||\-- CC line enable (pin 34) (verified from cat source code)
765765    * ||||||\--- LEDE line enable (pin 33) (verified from cat source code)
766766    * |||||\---- ?
767    * ||||\----- ? may be IPP (pin 2) write (non-standard pin 34 of centronics port) or another watchdog reset bit; may also be /DSTB-enable-on-pr.data-write
767    * ||||\----- ? may be IPP (pin 2) write (non-standard pin 34 of centronics port) or another watchdog reset bit; may also be /DSTB-enable-on-pr.data-write
768768    * |||\------ ?
769769    * ||\------- ?
770770    * |\-------- ?
r29404r29405
835835    *
836836    * 76543210
837837    * ??????\\-- Watchdog count? (counts upward? if this reaches <some unknown number greater than 2> the watchdog fires? writing bit 3 set to opr above resets this)
838    *
838    *
839839    * FEDCBA98
840840    * |||||||\-- PFAIL state (MB3771 comparator: 1: vcc = 5v; 0: vcc != 5v, hence do not write to svram!)
841841    * ||||||\--- (always 0?)
r29404r29405
847847    * \--------- (always 0?)
848848    */
849849READ16_MEMBER( cat_state::cat_wdt_r )
850{   
850{
851851   uint16 Retval = 0x0100; // set pfail to 1; should this be a dipswitch?
852852   return Retval | m_wdt_counter;
853853}
trunk/src/mess/drivers/konin.c
r29404r29405
9090   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
9191   MCFG_SCREEN_UPDATE_DRIVER(konin_state, screen_update_konin)
9292   MCFG_SCREEN_PALETTE("palette")
93   
93
9494   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
9595MACHINE_CONFIG_END
9696
trunk/src/mess/drivers/wangpc.c
r29404r29405
11331133   MCFG_IM6402_TRO_CALLBACK(DEVWRITELINE(WANGPC_KEYBOARD_TAG, wangpc_keyboard_device, write_rxd))
11341134   MCFG_IM6402_DR_CALLBACK(WRITELINE(wangpc_state, uart_dr_w))
11351135   MCFG_IM6402_TBRE_CALLBACK(WRITELINE(wangpc_state, uart_tbre_w))
1136   
1136
11371137   MCFG_DEVICE_ADD(SCN2661_TAG, MC2661, 0)
11381138   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
11391139   MCFG_MC2661_RXRDY_HANDLER(WRITELINE(wangpc_state, epci_irq_w))
trunk/src/mess/drivers/apricotp.c
r29404r29405
576576   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
577577   MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
578578   MCFG_SCREEN_SIZE(640, 256)
579   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)   
579   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)
580580
581581   MCFG_PALETTE_ADD("palette", 16)
582582   MCFG_GFXDECODE_ADD("gfxdecode", "palette", act_f1)
trunk/src/mess/drivers/ibmpcjr.c
r29404r29405
7878   UINT32 m_raw_keyb_data;
7979   int m_signal_count;
8080   UINT8 m_nmi_enabled;
81   
81
8282   void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8383   emu_timer *m_pc_int_delay_timer;
8484   emu_timer *m_pcjr_watchdog;
r29404r29405
9090      TIMER_WATCHDOG,
9191      TIMER_KB_SIGNAL
9292   };
93   
93
9494   void machine_reset();
9595   DECLARE_DRIVER_INIT(pcjr);
9696};
r29404r29405
146146         else
147147            m_pic8259->ir6_w(0);
148148         break;
149           
149
150150      case TIMER_KB_SIGNAL:
151151         m_raw_keyb_data = m_raw_keyb_data >> 1;
152152         m_signal_count--;
r29404r29405
246246WRITE_LINE_MEMBER(pcjr_state::keyb_interrupt)
247247{
248248   int data;
249   
249
250250   if(state && (data = m_keyboard->read(machine().driver_data()->generic_space(), 0)))
251251   {
252252      UINT8   parity = 0;
r29404r29405
650650
651651   /* video hardware */
652652   MCFG_PCVIDEO_PCJR_ADD("pcvideo_pcjr")
653   
653
654654   MCFG_GFXDECODE_ADD("gfxdecode", "pcvideo_pcjr:palette", pcjr)
655655
656656   /* sound hardware */
trunk/src/mess/drivers/amust.c
r29404r29405
9494
9595//WRITE8_MEMBER( amust_state::port00_w )
9696//{
97//   membank("bankr0")->set_entry(BIT(data, 6));
98//   m_fdc->dden_w(BIT(data, 5));
99//   floppy_image_device *floppy = NULL;
100//   if (BIT(data, 0)) floppy = m_floppy0->get_device();
101//   m_fdc->set_floppy(floppy);
102//   if (floppy)
103//      floppy->ss_w(BIT(data, 4));
97//  membank("bankr0")->set_entry(BIT(data, 6));
98//  m_fdc->dden_w(BIT(data, 5));
99//  floppy_image_device *floppy = NULL;
100//  if (BIT(data, 0)) floppy = m_floppy0->get_device();
101//  m_fdc->set_floppy(floppy);
102//  if (floppy)
103//      floppy->ss_w(BIT(data, 4));
104104//}
105105
106106static ADDRESS_MAP_START(amust_mem, AS_PROGRAM, 8, amust_state)
r29404r29405
179179
180180//static I8255_INTERFACE( ppi1_intf )
181181//{
182//   DEVCB_DRIVER_MEMBER(amust_state, ppi1_pa_r),   // Port A read
183//   DEVCB_DRIVER_MEMBER(amust_state, ppi1_pa_w),   // Port A write
184//   DEVCB_DRIVER_MEMBER(amust_state, ppi1_pb_r),   // Port B read
185//   DEVCB_DRIVER_MEMBER(amust_state, ppi1_pb_w),   // Port B write
186//   DEVCB_DRIVER_MEMBER(amust_state, ppi1_pc_r),   // Port C read
187//   DEVCB_DRIVER_MEMBER(amust_state, ppi1_pc_w),   // Port C write
182//  DEVCB_DRIVER_MEMBER(amust_state, ppi1_pa_r),   // Port A read
183//  DEVCB_DRIVER_MEMBER(amust_state, ppi1_pa_w),   // Port A write
184//  DEVCB_DRIVER_MEMBER(amust_state, ppi1_pb_r),   // Port B read
185//  DEVCB_DRIVER_MEMBER(amust_state, ppi1_pb_w),   // Port B write
186//  DEVCB_DRIVER_MEMBER(amust_state, ppi1_pc_r),   // Port C read
187//  DEVCB_DRIVER_MEMBER(amust_state, ppi1_pc_w),   // Port C write
188188//};
189189
190190//static I8255_INTERFACE( ppi2_intf )
191191//{
192//   DEVCB_DRIVER_MEMBER(amust_state, ppi2_pa_r),   // Port A read
193//   DEVCB_DRIVER_MEMBER(amust_state, ppi2_pa_w),   // Port A write
194//   DEVCB_DRIVER_MEMBER(amust_state, ppi2_pb_r),   // Port B read
195//   DEVCB_DRIVER_MEMBER(amust_state, ppi2_pb_w),   // Port B write
196//   DEVCB_DRIVER_MEMBER(amust_state, ppi2_pc_r),   // Port C read
197//   DEVCB_DRIVER_MEMBER(amust_state, ppi2_pc_w),   // Port C write
192//  DEVCB_DRIVER_MEMBER(amust_state, ppi2_pa_r),   // Port A read
193//  DEVCB_DRIVER_MEMBER(amust_state, ppi2_pa_w),   // Port A write
194//  DEVCB_DRIVER_MEMBER(amust_state, ppi2_pb_r),   // Port B read
195//  DEVCB_DRIVER_MEMBER(amust_state, ppi2_pb_w),   // Port B write
196//  DEVCB_DRIVER_MEMBER(amust_state, ppi2_pc_r),   // Port C read
197//  DEVCB_DRIVER_MEMBER(amust_state, ppi2_pc_w),   // Port C write
198198//};
199199
200200WRITE8_MEMBER( amust_state::kbd_put )
trunk/src/mess/drivers/ng_aes.c
r29404r29405
13461346
13471347   PORT_START("JP") // JP1 and JP2 are jumpers or solderpads depending on AES board revision, intended for use on the Development BIOS
13481348   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Short JP1 (Debug Monitor)") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, ng_aes_state, aes_jp1, 0)
1349//   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) // what is JP2 for? somehow related to system reset, disable watchdog?
1349//  PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) // what is JP2 for? somehow related to system reset, disable watchdog?
13501350INPUT_PORTS_END
13511351
13521352INPUT_CHANGED_MEMBER(ng_aes_state::aes_jp1)
trunk/src/mess/drivers/rsc55.c
r29404r29405
33    Roland Sound Canvas SC-55
44
55    Skeleton by R. Belmont
6
6
77    Reference and LCD photo: http://www.synthman.com/roland/Roland_SC-55.html
88                             http://en.wikipedia.org/wiki/Roland_SCC-1
9
9
1010    The Roland SC55 is an expander (synthesizer without the keyboard)
1111    from 1991.  It has 24 voice polyphony, is 16 part multitimbral, and
1212    outputs 16-bit stereo samples at 32 kHz.  The synthesis engine uses a
1313    combination of Roland's LA and straight PCM playback.
14
14
1515    The front panel includes the power switch, a headphone jack with volume knob,
1616    a second MIDI IN port, a large LCD, ALL and MUTE buttons, and a group of up/down
1717    buttons for Part, Level, Reverb, Key Shift, Instrument, Pan, Chorus, and MIDI Channel.
18
18
1919    The SCC-1 is an ISA board variant of the SC55 with a MPU-401 frontend added to
20   communicate with the synth.
21 
20    communicate with the synth.
21
2222    Main PCB:
23
23
2424    20.0 MHz crystal
2525    Roland R15239147  HG62E11B23FS  1L1 Japan
2626    Roland R15199778  6435328A97F   1M1 R Japan
r29404r29405
3030    HM62256ALFP-12T   32K by 8-bit RAM
3131    65256BLFP-12T     32K by 8-bit high-speed pseudo-static RAM
3232    MB89251A - Serial data transceiver
33
33
3434    LCD controller (on front panel board) is a Toshiba T7934.
3535*/
3636
r29404r29405
5151
5252sc55_state::sc55_state(const machine_config &mconfig, device_type type, const char *tag) :
5353   driver_device(mconfig, type, tag),
54   m_maincpu(*this, "maincpu")
54   m_maincpu(*this, "maincpu")
5555{
5656}
5757
r29404r29405
6363ADDRESS_MAP_END
6464
6565static MACHINE_CONFIG_START( sc55, sc55_state )
66   MCFG_CPU_ADD( "maincpu", P8098, XTAL_20MHz )   // probably not?
66   MCFG_CPU_ADD( "maincpu", P8098, XTAL_20MHz )    // probably not?
6767   MCFG_CPU_PROGRAM_MAP( sc55_map )
6868   MCFG_CPU_IO_MAP( sc55_io )
6969MACHINE_CONFIG_END
7070
7171ROM_START( sc55 )
7272   ROM_REGION( 0x40000, "maincpu", 0 )
73   ROM_LOAD( "roland_r15209363.ic23", 0x000000, 0x040000, CRC(2dc58549) SHA1(9c17f85e784dc1549ac1f98d457b353393331f6b) )
73   ROM_LOAD( "roland_r15209363.ic23", 0x000000, 0x040000, CRC(2dc58549) SHA1(9c17f85e784dc1549ac1f98d457b353393331f6b) )
7474
7575   ROM_REGION( 0x300000, "la", 0 )
76   ROM_LOAD( "roland-gss.a_r15209276.ic28", 0x000000, 0x100000, CRC(1ac774d3) SHA1(8cc3c0d7ec0993df81d4ca1970e01a4b0d8d3775) )
77   ROM_LOAD( "roland-gss.b_r15209277.ic27", 0x100000, 0x100000, CRC(8dcc592a) SHA1(80e6eb130c18c09955551563f78906163c55cc11) )
78   ROM_LOAD( "roland-gss.c_r15209281.ic26", 0x200000, 0x100000, CRC(e21ebc04) SHA1(7454b817778179806f3f9d1985b3a2ef67ace76f) )
76   ROM_LOAD( "roland-gss.a_r15209276.ic28", 0x000000, 0x100000, CRC(1ac774d3) SHA1(8cc3c0d7ec0993df81d4ca1970e01a4b0d8d3775) )
77   ROM_LOAD( "roland-gss.b_r15209277.ic27", 0x100000, 0x100000, CRC(8dcc592a) SHA1(80e6eb130c18c09955551563f78906163c55cc11) )
78   ROM_LOAD( "roland-gss.c_r15209281.ic26", 0x200000, 0x100000, CRC(e21ebc04) SHA1(7454b817778179806f3f9d1985b3a2ef67ace76f) )
7979ROM_END
8080
8181CONS( 1991, sc55,  0, 0, sc55, sc55, driver_device, 0, "Roland", "Sound Canvas SC-55",  GAME_NOT_WORKING|GAME_NO_SOUND )
trunk/src/mess/drivers/ie15.c
r29404r29405
634634      IE15_HORZ_START+IE15_DISP_HORZ,IE15_TOTAL_VERT,IE15_VERT_START,
635635      IE15_VERT_START+IE15_DISP_VERT);
636636   MCFG_SCREEN_PALETTE("palette")
637   
638   MCFG_GFXDECODE_ADD("gfxdecode", "palette", ie15)   
637
638   MCFG_GFXDECODE_ADD("gfxdecode", "palette", ie15)
639639   MCFG_PALETTE_ADD("palette", 2)
640640   MCFG_PALETTE_INIT_OWNER(ie15_state, ie15)
641641
trunk/src/mess/drivers/hx20.c
r29404r29405
833833   MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 32-1)
834834   MCFG_SCREEN_UPDATE_DRIVER(hx20_state, screen_update)
835835   MCFG_SCREEN_PALETTE("palette")
836   
836
837837   MCFG_PALETTE_ADD("palette", 2)
838838   MCFG_PALETTE_INIT_OWNER(hx20_state, hx20)
839   
839
840840   MCFG_UPD7227_ADD(UPD7227_0_TAG, 0, 0)
841841   MCFG_UPD7227_ADD(UPD7227_1_TAG, 40, 0)
842842   MCFG_UPD7227_ADD(UPD7227_2_TAG, 80, 0)
trunk/src/mess/drivers/pc100.c
r29404r29405
7373      m_maincpu(*this, "maincpu"),
7474      m_beeper(*this, "beeper"),
7575      m_rtc_portc(0),
76      m_palette(*this, "palette")
76      m_palette(*this, "palette")
7777   {
7878   }
7979
r29404r29405
534534   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK*4, 1024, 0, 768, 264*2, 0, 512)
535535   MCFG_SCREEN_UPDATE_DRIVER(pc100_state, screen_update_pc100)
536536   MCFG_SCREEN_PALETTE("palette")
537   
537
538538   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pc100)
539539   MCFG_PALETTE_ADD("palette", 16)
540540//  MCFG_PALETTE_INIT(black_and_white)
trunk/src/mess/drivers/hec2hrp.c
r29404r29405
648648   MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
649649   MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
650650   MCFG_SCREEN_PALETTE("palette")
651   
651
652652   MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
653653   MCFG_PALETTE_ADD("palette", 16)
654654   MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
trunk/src/mess/drivers/spectrum.c
r29404r29405
707707
708708   MCFG_PALETTE_ADD("palette", 16)
709709   MCFG_PALETTE_INIT_OWNER(spectrum_state, spectrum )
710   
710
711711   MCFG_GFXDECODE_ADD("gfxdecode", "palette", spectrum)
712712   MCFG_VIDEO_START_OVERRIDE(spectrum_state, spectrum )
713713
trunk/src/mess/drivers/pc.c
r29404r29405
246246
247247   MCFG_IBM5150_MOTHERBOARD_ADD("mb", "maincpu")
248248   MCFG_DEVICE_INPUT_DEFAULTS(pccga)
249   
249
250250   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "cga", false)
251251   MCFG_ISA8_SLOT_ADD("mb:isa", "isa2", pc_isa8_cards, "fdc_xt", false)
252252   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, "lpt", false)
trunk/src/mess/drivers/esq5505.c
r29404r29405
222222   DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
223223   IRQ_CALLBACK_MEMBER(maincpu_irq_acknowledge_callback);
224224   DECLARE_WRITE_LINE_MEMBER(esq5505_otis_irq);
225   
225
226226   //dmac
227227   DECLARE_WRITE8_MEMBER(dma_end);
228228   DECLARE_WRITE8_MEMBER(dma_error);
trunk/src/mess/drivers/fp6000.c
r29404r29405
3333      m_maincpu(*this, "maincpu")
3434      , m_crtc(*this, "crtc"),
3535      m_gfxdecode(*this, "gfxdecode"),
36      m_palette(*this, "palette")
36      m_palette(*this, "palette")
3737   { }
3838
3939   UINT8 *m_char_rom;
trunk/src/mess/drivers/fk1.c
r29404r29405
447447   MCFG_SCREEN_SIZE(512, 256)
448448   MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
449449   MCFG_SCREEN_PALETTE("palette")
450   
450
451451   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
452452
453453   MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
trunk/src/mess/drivers/mk85.c
r29404r29405
7474   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
7575   MCFG_SCREEN_UPDATE_DRIVER(mk85_state, screen_update_mk85)
7676   MCFG_SCREEN_PALETTE("palette")
77   
77
7878   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
7979MACHINE_CONFIG_END
8080
trunk/src/mess/drivers/mycom.c
r29404r29405
118118   required_device<floppy_connector> m_floppy1;
119119   required_device<sn76489_device> m_audio;
120120   required_device<msm5832_device> m_rtc;
121public:   
122   required_device<palette_device> m_palette;   
121public:
122   required_device<palette_device> m_palette;
123123};
124124
125125
trunk/src/mess/drivers/apc.c
r29404r29405
8383      m_pit(*this, "pit8253"),
8484      m_video_ram_1(*this, "video_ram_1"),
8585      m_video_ram_2(*this, "video_ram_2"),
86      m_palette(*this, "palette")
86      m_palette(*this, "palette")
8787   { }
8888
8989   // devices
r29404r29405
101101
102102   required_shared_ptr<UINT8> m_video_ram_1;
103103   required_shared_ptr<UINT8> m_video_ram_2;
104   
104
105105   required_device<palette_device> m_palette;
106106
107107   // screen updates
r29404r29405
151151   UINT8 m_dma_offset[4];
152152
153153   IRQ_CALLBACK_MEMBER(irq_callback);
154   
154
155155   UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels );
156156   UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text );
157157
r29404r29405
984984
985985   MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 3579545) // unk clock
986986   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_1_map)
987   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(apc_state, hgdc_draw_text)   
987   MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(apc_state, hgdc_draw_text)
988988
989989   MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 3579545) // unk clock
990990   MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_2_map)
991   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(apc_state, hgdc_display_pixels)   
991   MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(apc_state, hgdc_display_pixels)
992992
993993   MCFG_PALETTE_ADD("palette", 16)
994994   MCFG_PALETTE_INIT_OWNER(apc_state,apc)
trunk/src/mess/drivers/vector06.c
r29404r29405
176176   MCFG_SCREEN_VISIBLE_AREA(0, 256+64-1, 0, 256+64-1)
177177   MCFG_SCREEN_UPDATE_DRIVER(vector06_state, screen_update_vector06)
178178   MCFG_SCREEN_PALETTE("palette")
179   
179
180180   MCFG_PALETTE_ADD("palette", 16)
181181   MCFG_PALETTE_INIT_OWNER(vector06_state, vector06)
182182
trunk/src/mess/drivers/llc.c
r29404r29405
217217   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*8-1)
218218   MCFG_SCREEN_UPDATE_DRIVER(llc_state, screen_update_llc1)
219219   MCFG_SCREEN_PALETTE("palette")
220   
220
221221   MCFG_GFXDECODE_ADD("gfxdecode", "palette", llc1)
222222   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
223223   MCFG_DEFAULT_LAYOUT(layout_llc1)
r29404r29405
245245   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
246246   MCFG_SCREEN_UPDATE_DRIVER(llc_state, screen_update_llc2)
247247   MCFG_SCREEN_PALETTE("palette")
248   
248
249249   MCFG_GFXDECODE_ADD("gfxdecode", "palette", llc2)
250250   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
251251
trunk/src/mess/drivers/atm.c
r29404r29405
190190   MCFG_MACHINE_RESET_OVERRIDE(atm_state, atm )
191191
192192   MCFG_BETA_DISK_ADD(BETA_DISK_TAG)
193   
193
194194   MCFG_GFXDECODE_MODIFY("gfxdecode", atm)
195195MACHINE_CONFIG_END
196196
trunk/src/mess/drivers/sorcerer.c
r29404r29405
434434   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 30*8-1)
435435   MCFG_SCREEN_UPDATE_DRIVER(sorcerer_state, screen_update)
436436   MCFG_SCREEN_PALETTE("palette")
437   
437
438438   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sorcerer)
439439   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
440440
trunk/src/mess/drivers/vta2000.c
r29404r29405
171171   MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*12-1)
172172   MCFG_SCREEN_UPDATE_DRIVER(vta2000_state, screen_update_vta2000)
173173   MCFG_SCREEN_PALETTE("palette")
174   
175   MCFG_PALETTE_ADD("palette", 3)   
174
175   MCFG_PALETTE_ADD("palette", 3)
176176   MCFG_PALETTE_INIT_OWNER(vta2000_state, vta2000)
177177   MCFG_GFXDECODE_ADD("gfxdecode", "palette", vta2000)
178178MACHINE_CONFIG_END
trunk/src/mess/drivers/x07.c
r29404r29405
14811481   MCFG_SCREEN_SIZE(120, 32)
14821482   MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 32-1)
14831483   MCFG_SCREEN_PALETTE("palette")
1484   
1484
14851485   MCFG_PALETTE_ADD("palette", 2)
14861486   MCFG_PALETTE_INIT_OWNER(x07_state, x07)
14871487   MCFG_DEFAULT_LAYOUT(layout_lcd)
r29404r29405
14991499
15001500   MCFG_TIMER_DRIVER_ADD_PERIODIC("blink_timer", x07_state, blink_timer, attotime::from_msec(300))
15011501
1502   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram1", x07_state, nvram_init)   // t6834 RAM
1502   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram1", x07_state, nvram_init)   // t6834 RAM
15031503   MCFG_NVRAM_ADD_0FILL("nvram2") // RAM banks
15041504
15051505   /* internal ram */
r29404r29405
15401540   ROM_REGION( 0x0800, "default", ROMREGION_ERASE00 )
15411541ROM_END
15421542
1543DRIVER_INIT_MEMBER(x07_state, x07) 
1544{
1543DRIVER_INIT_MEMBER(x07_state, x07)
1544{
15451545   UINT8 *RAM = memregion("default")->base();
15461546   UINT8 *GFX = memregion("gfx1")->base();
1547   
1547
15481548   for (int i = 0; i < 12; i++)
15491549      strcpy((char *)RAM + udk_offset[i], udk_ini[i]);
1550   
1550
15511551   //copy default chars in the UDC
15521552   memcpy(RAM + 0x200, GFX + 0x400, 0x100);
15531553   memcpy(RAM + 0x300, GFX + 0x700, 0x100);
trunk/src/mess/drivers/modellot.c
r29404r29405
167167   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
168168   MCFG_SCREEN_UPDATE_DRIVER(modellot_state, screen_update_modellot)
169169   MCFG_SCREEN_PALETTE("palette")
170   
170
171171   MCFG_GFXDECODE_ADD("gfxdecode", "palette", modellot )
172172   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
173   
173
174174   /* Devices */
175175   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
176176MACHINE_CONFIG_END
trunk/src/mess/drivers/myb3k.c
r29404r29405
286286   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
287287   MCFG_SCREEN_UPDATE_DRIVER(myb3k_state, screen_update_myb3k)
288288   MCFG_SCREEN_PALETTE("palette")
289     
289
290290   MCFG_GFXDECODE_ADD("gfxdecode", "palette", myb3k)
291291   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
292292
trunk/src/mess/drivers/gb.c
r29404r29405
756756   MCFG_SCREEN_VBLANK_TIME(0)
757757   MCFG_SCREEN_UPDATE_DEVICE("lcd", gb_lcd_device, screen_update)
758758   MCFG_SCREEN_PALETTE("palette")
759   
759
760760   MCFG_DEFAULT_LAYOUT(layout_lcd)
761761//  MCFG_SCREEN_SIZE(20*8, 18*8)
762762   MCFG_SCREEN_SIZE( 458, 154 )
r29404r29405
797797   MCFG_SCREEN_MODIFY("screen")
798798   MCFG_SCREEN_SIZE(32*8, 28*8)
799799   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
800   
800
801801   MCFG_PALETTE_MODIFY("palette")
802802   MCFG_PALETTE_ENTRIES(32768)
803803   MCFG_PALETTE_INIT_OWNER(gb_state,sgb)
r29404r29405
814814
815815   MCFG_MACHINE_START_OVERRIDE(gb_state, gbpocket)
816816   MCFG_MACHINE_RESET_OVERRIDE(gb_state, gbpocket)
817   
817
818818   MCFG_PALETTE_MODIFY("palette")
819819   MCFG_PALETTE_INIT_OWNER(gb_state,gbp)
820820
r29404r29405
860860   MCFG_SCREEN_REFRESH_RATE(DMG_FRAMES_PER_SECOND)
861861   MCFG_SCREEN_VBLANK_TIME(0)
862862   MCFG_SCREEN_PALETTE("palette")
863   
863
864864   MCFG_QUANTUM_TIME(attotime::from_hz(60))
865865
866866   MCFG_MACHINE_START_OVERRIDE(megaduck_state, megaduck )
r29404r29405
872872
873873   MCFG_DEFAULT_LAYOUT(layout_lcd)
874874   MCFG_GFXDECODE_ADD("gfxdecode", "palette", gb)
875   
875
876876   MCFG_PALETTE_ADD("palette", 4)
877877   MCFG_PALETTE_INIT_OWNER(megaduck_state,megaduck)
878878
trunk/src/mess/drivers/a2600.c
r29404r29405
19391939   MCFG_TIA_READ_INPUT_PORT_CB(READ16(a2600_state, a2600_read_input_port))
19401940   MCFG_TIA_DATABUS_CONTENTS_CB(READ8(a2600_state, a2600_get_databus_contents))
19411941   MCFG_TIA_VSYNC_CB(WRITE16(a2600_state, a2600_tia_vsync_callback))
1942   
1942
19431943   MCFG_SCREEN_ADD("screen", RASTER)
19441944   MCFG_SCREEN_RAW_PARAMS( MASTER_CLOCK_NTSC, 228, 26, 26 + 160 + 16, 262, 24 , 24 + 192 + 31 )
19451945   MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update)
r29404r29405
19771977   MCFG_TIA_READ_INPUT_PORT_CB(READ16(a2600_state, a2600_read_input_port))
19781978   MCFG_TIA_DATABUS_CONTENTS_CB(READ8(a2600_state, a2600_get_databus_contents))
19791979   MCFG_TIA_VSYNC_CB(WRITE16(a2600_state, a2600_tia_vsync_callback_pal))
1980   
19811980
1981
19821982   MCFG_SCREEN_ADD("screen", RASTER)
19831983   MCFG_SCREEN_RAW_PARAMS( MASTER_CLOCK_PAL, 228, 26, 26 + 160 + 16, 312, 32, 32 + 228 + 31 )
19841984   MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update)
trunk/src/mess/drivers/homelab.c
r29404r29405
745745   MCFG_VIDEO_START_OVERRIDE(homelab_state,homelab2)
746746   MCFG_SCREEN_UPDATE_DRIVER(homelab_state, screen_update_homelab2)
747747   MCFG_SCREEN_PALETTE("palette")
748   
748
749749   MCFG_GFXDECODE_ADD("gfxdecode", "palette", homelab)
750750   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
751751
r29404r29405
776776   MCFG_VIDEO_START_OVERRIDE(homelab_state,homelab3)
777777   MCFG_SCREEN_UPDATE_DRIVER(homelab_state, screen_update_homelab3)
778778   MCFG_SCREEN_PALETTE("palette")
779   
779
780780   MCFG_GFXDECODE_ADD("gfxdecode", "palette", homelab)
781781   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
782782
r29404r29405
807807   MCFG_VIDEO_START_OVERRIDE(homelab_state,brailab4)
808808   MCFG_SCREEN_UPDATE_DRIVER(homelab_state, screen_update_homelab3)
809809   MCFG_SCREEN_PALETTE("palette")
810   
810
811811   MCFG_GFXDECODE_ADD("gfxdecode", "palette", homelab)
812812   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
813813
trunk/src/mess/drivers/vt220.c
r29404r29405
6868   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
6969   MCFG_SCREEN_UPDATE_DRIVER(vt220_state, screen_update_vt220)
7070   MCFG_SCREEN_PALETTE("palette")
71   
71
7272   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
7373
7474   /* internal ram */
trunk/src/mess/drivers/amiga.c
r29404r29405
799799//  MCFG_SCREEN_RAW_PARAMS(AMIGA_68EC020_NTSC_CLOCK,512*2,(129-8-8)*2,(449+8-1+8)*2,312,44-8,300+8)
800800   MCFG_SCREEN_RAW_PARAMS(AMIGA_68EC020_NTSC_CLOCK,228*4,214,228*4,262,34,262)
801801
802   MCFG_SCREEN_UPDATE_DRIVER(a1200_state, screen_update_amiga_aga)   
802   MCFG_SCREEN_UPDATE_DRIVER(a1200_state, screen_update_amiga_aga)
803803
804804   MCFG_VIDEO_START_OVERRIDE(a1200_state,amiga_aga)
805805
trunk/src/mess/drivers/pp01.c
r29404r29405
209209   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
210210   MCFG_SCREEN_UPDATE_DRIVER(pp01_state, screen_update_pp01)
211211   MCFG_SCREEN_PALETTE("palette")
212   
212
213213   MCFG_PALETTE_ADD("palette", 8)
214214   MCFG_PALETTE_INIT_OWNER(pp01_state, pp01)
215215
trunk/src/mess/drivers/odyssey2.c
r29404r29405
867867   MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
868868   MCFG_SCREEN_PALETTE("palette")
869869
870   MCFG_GFXDECODE_ADD("gfxdecode", "palette", odyssey2 )   
870   MCFG_GFXDECODE_ADD("gfxdecode", "palette", odyssey2 )
871871   MCFG_PALETTE_ADD("palette", 16)
872872   MCFG_PALETTE_INIT_OWNER(g7400_state, g7400)
873873
trunk/src/mess/drivers/apollo.c
r29404r29405
4444#define APOLLO_MAX_NO_OF_LOG_LINES 1000000
4545
4646// ISA/AT Bus notes
47// I/O space: to get the Apollo address = take the PC I/O address, keep the low 3 bits how they are, and shift the rest left 7, inserting zeros. 
47// I/O space: to get the Apollo address = take the PC I/O address, keep the low 3 bits how they are, and shift the rest left 7, inserting zeros.
4848// then add 0x40000 for the I/O base.
4949//
5050// example: 3c503 Ethernet is at I/O 300h on PC, which is (%1100000000 -> 1 1000 0000 0000 0000) + 0x40000 = 0x58000
r29404r29405
719719      AM_RANGE(0x010100, 0x0101ff) AM_READWRITE16(apollo_csr_control_register_r, apollo_csr_control_register_w, 0xffffffff)
720720      AM_RANGE(0x010200, 0x0102ff) AM_READWRITE8(cache_status_register_r, cache_control_register_w, 0xffffffff )
721721      AM_RANGE(0x010300, 0x0103ff) AM_READWRITE8(task_alias_register_r , task_alias_register_w , 0xffffffff )
722      AM_RANGE(0x010400, 0x0104ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
722      AM_RANGE(0x010400, 0x0104ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
723723      AM_RANGE(0x010500, 0x0105ff) AM_DEVREADWRITE8(APOLLO_SIO2_TAG, mc68681_device, read, write, 0x00ff00ff )
724      AM_RANGE(0x010800, 0x0108ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )     
724      AM_RANGE(0x010800, 0x0108ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )
725725      AM_RANGE(0x010900, 0x0109ff) AM_READWRITE8(apollo_rtc_r, apollo_rtc_w, 0xffffffff )
726726      AM_RANGE(0x010c00, 0x010cff) AM_READWRITE8(/*"dma1",*/apollo_dma_1_r, apollo_dma_1_w, 0xffffffff )
727727      AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
r29404r29405
751751      AM_RANGE(0x000000, 0x007fff) AM_WRITE(apollo_rom_w)
752752      AM_RANGE(0x008000, 0x0080ff) AM_READWRITE16(apollo_csr_status_register_r, apollo_csr_status_register_w, 0xffffffff)
753753      AM_RANGE(0x008100, 0x0081ff) AM_READWRITE16(apollo_csr_control_register_r, apollo_csr_control_register_w, 0xffffffff)
754      AM_RANGE(0x008400, 0x0087ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
754      AM_RANGE(0x008400, 0x0087ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
755755      AM_RANGE(0x008800, 0x0088ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )
756756      AM_RANGE(0x008900, 0x0089ff) AM_READWRITE8(apollo_rtc_r, apollo_rtc_w, 0xffffffff )
757757      AM_RANGE(0x009000, 0x0090ff) AM_READWRITE8(/*"dma1",*/apollo_dma_1_r, apollo_dma_1_w, 0xffffffff )
r29404r29405
786786      AM_RANGE(0x000000, 0x007fff) AM_WRITE(apollo_rom_w)
787787      AM_RANGE(0x008000, 0x0080ff) AM_READWRITE16(apollo_csr_status_register_r, apollo_csr_status_register_w, 0xffffffff)
788788      AM_RANGE(0x008100, 0x0081ff) AM_READWRITE16(apollo_csr_control_register_r, apollo_csr_control_register_w, 0xffffffff)
789      AM_RANGE(0x008400, 0x0087ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
789      AM_RANGE(0x008400, 0x0087ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
790790      AM_RANGE(0x008800, 0x0088ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )
791791      AM_RANGE(0x008900, 0x0089ff) AM_READWRITE8(apollo_rtc_r, apollo_rtc_w, 0xffffffff )
792792
r29404r29405
819819      AM_RANGE(0x010100, 0x0101ff) AM_READWRITE16(apollo_csr_control_register_r, apollo_csr_control_register_w, 0xffffffff)
820820      AM_RANGE(0x010200, 0x0102ff) AM_READWRITE8(cache_status_register_r, cache_control_register_w, 0xffffffff )
821821      AM_RANGE(0x010300, 0x0103ff) AM_READWRITE8(task_alias_register_r , task_alias_register_w , 0xffffffff )
822      AM_RANGE(0x010400, 0x0104ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
822      AM_RANGE(0x010400, 0x0104ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
823823      AM_RANGE(0x010500, 0x0105ff) AM_DEVREADWRITE8(APOLLO_SIO2_TAG, mc68681_device, read, write, 0x00ff00ff )
824      AM_RANGE(0x010800, 0x0108ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )     
824      AM_RANGE(0x010800, 0x0108ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )
825825      AM_RANGE(0x010900, 0x0109ff) AM_READWRITE8(apollo_rtc_r, apollo_rtc_w, 0xffffffff )
826826      AM_RANGE(0x010c00, 0x010cff) AM_READWRITE8(/*"dma1",*/apollo_dma_1_r, apollo_dma_1_w, 0xffffffff )
827827      AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
r29404r29405
868868      AM_RANGE(0x010100, 0x0101ff) AM_READWRITE16(apollo_csr_control_register_r, apollo_csr_control_register_w, 0xffffffff)
869869      AM_RANGE(0x010200, 0x0102ff) AM_READWRITE8(cache_status_register_r, cache_control_register_w, 0xffffffff )
870870      AM_RANGE(0x010300, 0x0103ff) AM_READWRITE8(task_alias_register_r , task_alias_register_w , 0xffffffff )
871      AM_RANGE(0x010400, 0x0104ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
871      AM_RANGE(0x010400, 0x0104ff) AM_DEVREADWRITE8(APOLLO_SIO_TAG, mc68681_device, read, write, 0x00ff00ff )
872872      AM_RANGE(0x010500, 0x0105ff) AM_DEVREADWRITE8(APOLLO_SIO2_TAG, mc68681_device, read, write, 0x00ff00ff )
873      AM_RANGE(0x010800, 0x0108ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )     
873      AM_RANGE(0x010800, 0x0108ff) AM_DEVREADWRITE8(APOLLO_PTM_TAG, ptm6840_device, read, write, 0x00ff00ff )
874874      AM_RANGE(0x010900, 0x0109ff) AM_READWRITE8(apollo_rtc_r, apollo_rtc_w, 0xffffffff )
875875      AM_RANGE(0x010c00, 0x010cff) AM_READWRITE8(/*"dma1",*/apollo_dma_1_r, apollo_dma_1_w, 0xffffffff )
876876      AM_RANGE(0x010d00, 0x010dff) AM_READWRITE8(/*"dma2",*/apollo_dma_2_r, apollo_dma_2_w, 0xffffffff )
r29404r29405
925925         // set node_id from UID of logical volume 1 of logical unit 0
926926         node_id = (((db[0x49] << 8) | db[0x4a]) << 8) | db[0x4b];
927927
928          MLOG2(("machine_reset_dn3500: node ID is %06X (from disk)", node_id));
928         MLOG2(("machine_reset_dn3500: node ID is %06X (from disk)", node_id));
929929      }
930930   }
931931   #endif
r29404r29405
10471047   PORT_INCLUDE(apollo_config)
10481048INPUT_PORTS_END
10491049
1050READ_LINE_MEMBER( apollo_state::apollo_kbd_is_german )
1050READ_LINE_MEMBER( apollo_state::apollo_kbd_is_german )
10511051{
10521052   return (apollo_config(APOLLO_CONF_GERMAN_KBD) != 0) ? ASSERT_LINE : CLEAR_LINE;
10531053}
r29404r29405
11001100   /* video hardware 19" monochrome */
11011101   MCFG_APOLLO_MONO19I_ADD(APOLLO_SCREEN_TAG)
11021102   MCFG_DEVICE_ADD(APOLLO_KBD_TAG, APOLLO_KBD, 0)
1103   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1104   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
1103   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1104   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
11051105MACHINE_CONFIG_END
11061106
11071107static MACHINE_CONFIG_DERIVED( dn3500_15i, dn3500 )
11081108   /* video hardware is 15" monochrome or color */
11091109   MCFG_APOLLO_GRAPHICS_ADD(APOLLO_SCREEN_TAG)
11101110   MCFG_DEVICE_ADD(APOLLO_KBD_TAG, APOLLO_KBD, 0)
1111   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1112   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
1111   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1112   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
11131113MACHINE_CONFIG_END
11141114
11151115static MACHINE_CONFIG_DERIVED( dn3000, dn3500 )
r29404r29405
11491149   /* video hardware 19" monochrome */
11501150   MCFG_APOLLO_MONO19I_ADD(APOLLO_SCREEN_TAG)
11511151   MCFG_DEVICE_ADD(APOLLO_KBD_TAG, APOLLO_KBD, 0)
1152   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1153   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
1152   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1153   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
11541154MACHINE_CONFIG_END
11551155
11561156static MACHINE_CONFIG_DERIVED( dn3000_15i, dn3000 )
11571157   /* video hardware 15" monochrome */
11581158   MCFG_APOLLO_GRAPHICS_ADD(APOLLO_SCREEN_TAG)
11591159   MCFG_DEVICE_ADD(APOLLO_KBD_TAG, APOLLO_KBD, 0)
1160   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1161   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
1160   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1161   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
11621162MACHINE_CONFIG_END
11631163
11641164static MACHINE_CONFIG_DERIVED( dn5500, dn3500 )
r29404r29405
11861186   /* video hardware 19" monochrome */
11871187   MCFG_APOLLO_MONO19I_ADD(APOLLO_SCREEN_TAG)
11881188   MCFG_DEVICE_ADD(APOLLO_KBD_TAG, APOLLO_KBD, 0)
1189   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1190   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
1189   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1190   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
11911191MACHINE_CONFIG_END
11921192
11931193static MACHINE_CONFIG_DERIVED( dn5500_15i, dn5500 )
11941194   /* video hardware 15" monochrome */
11951195   MCFG_APOLLO_GRAPHICS_ADD(APOLLO_SCREEN_TAG)
11961196   MCFG_DEVICE_ADD(APOLLO_KBD_TAG, APOLLO_KBD, 0)
1197   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1198   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
1197   MCFG_APOLLO_KBD_TX_CALLBACK(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_a_w))
1198   MCFG_APOLLO_KBD_GERMAN_CALLBACK(READLINE(apollo_state, apollo_kbd_is_german))
11991199MACHINE_CONFIG_END
12001200
12011201/***************************************************************************
r29404r29405
12651265COMP( 1991, dn5500,     dn3500, 0,      dn5500_15i, dn3500, apollo_state, dn5500, "Apollo",   "Apollo DN5500", GAME_NOT_WORKING )
12661266COMP( 1991, dsp5500,    dn3500, 0,      dsp5500,    dsp3500, apollo_state,dsp5500,"Apollo",   "Apollo DSP5500",                GAME_NOT_WORKING )
12671267COMP( 1991, dn5500_19i, dn3500, 0,      dn5500_19i, dn3500, apollo_state, dn5500, "Apollo",   "Apollo DN5500 19\" Monochrome", GAME_NOT_WORKING )
1268
trunk/src/mess/drivers/a7000.c
r29404r29405
2727   a7000_state(const machine_config &mconfig, device_type type, const char *tag)
2828      : driver_device(mconfig, type, tag),
2929      m_maincpu(*this, "maincpu"),
30      m_palette(*this, "palette")
30      m_palette(*this, "palette")
3131   { }
3232
3333   required_device<cpu_device> m_maincpu;
trunk/src/mess/drivers/ibm6580.c
r29404r29405
8383   MCFG_SCREEN_SIZE(640, 240)
8484   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
8585   MCFG_SCREEN_PALETTE("palette")
86   
86
8787   MCFG_PALETTE_ADD("palette", 3)
8888   MCFG_PALETTE_INIT_OWNER(ibm6580_state, ibm6580)
8989MACHINE_CONFIG_END
trunk/src/mess/drivers/ti89.c
r29404r29405
529529   MCFG_SCREEN_SIZE(240, 128)
530530   MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 100-1)
531531   MCFG_SCREEN_PALETTE("palette")
532   
532
533533   MCFG_PALETTE_ADD("palette", 2)
534534   MCFG_PALETTE_INIT_OWNER(ti68k_state, ti68k)
535535   MCFG_DEFAULT_LAYOUT(layout_lcd)
trunk/src/mess/drivers/a7800.c
r29404r29405
7474
7575    2014/01/02 Robert Tuccitto  Corrected joystick buttons assignment & minor
7676                                palette notes cleanup.
77   
77
7878    2014/01/09 Robert Tuccitto  Positional description for difficulty
7979                                switches added.
80   
80
8181    2014/02/15 Robert Tuccitto  Added more details and clarification
8282                                regarding the potentiometer.
8383
r29404r29405
177177calibration) on a modern flat panel display, as opposed to 'gold' (~-33
178178degrees) on a CRT.
179179
180The potentiometer (pot adjustment) for the 7800 modifies the delay line
181regarding colors it will exhibit and is extremely sensitive.  The slightest
182turn can have a significant impact. 
180The potentiometer (pot adjustment) for the 7800 modifies the delay line
181regarding colors it will exhibit and is extremely sensitive.  The slightest
182turn can have a significant impact.
183183
184A system whose potentiometer is not properly calibrated via
185'CPS 7800 Diagnostic Test Cartridge' or/and just slightly off from the
186desired factory settings may exhibit consequences such as too much blue in
187place of green (Pot adjusted slightly too far left) or washed out reddish
188tones in place of where most other systems display a darker reddish tones
189(Pot adjusted slightly too far right). 
184A system whose potentiometer is not properly calibrated via
185'CPS 7800 Diagnostic Test Cartridge' or/and just slightly off from the
186desired factory settings may exhibit consequences such as too much blue in
187place of green (Pot adjusted slightly too far left) or washed out reddish
188tones in place of where most other systems display a darker reddish tones
189(Pot adjusted slightly too far right).
190190
191This is a result of the phase shifting of lesser degrees (Pot adjusted more
192to the left) or phase shifting of greater degrees (Pot adjusted more to the
193right).
191This is a result of the phase shifting of lesser degrees (Pot adjusted more
192to the left) or phase shifting of greater degrees (Pot adjusted more to the
193right).
194194
195Turning the pot adjustment to the right, it can be observed that the values
196of the higher end of the scale will match the lower end of the scale. 
197For example, after some turning to the right, the values of Dx, Ex, Fx,
198can be set to match 1x, 2x, 3x. 
195Turning the pot adjustment to the right, it can be observed that the values
196of the higher end of the scale will match the lower end of the scale.
197For example, after some turning to the right, the values of Dx, Ex, Fx,
198can be set to match 1x, 2x, 3x.
199199
200After further turning to the right, now the palette can be brought to make
201Ax, Bx, Cx, Dx, Ex, Fx will match 1x, 2x, 3x, 4x, 5x, 6x. 
200After further turning to the right, now the palette can be brought to make
201Ax, Bx, Cx, Dx, Ex, Fx will match 1x, 2x, 3x, 4x, 5x, 6x.
202202
203Ultimately though, too much turning to the right results in all colors being
204wiped from the scale, excluding the hue begin point 1x (Which remains
203Ultimately though, too much turning to the right results in all colors being
204wiped from the scale, excluding the hue begin point 1x (Which remains
205205unchanged while tweaking the potentiometer either left or right).
206206
207Continuously turning the pot adjustment to the left, red and blue become the
208most dominant two colors encompassing the palette with only a slight
209influence of green at the highest end of the palette (Fx), once turned all
207Continuously turning the pot adjustment to the left, red and blue become the
208most dominant two colors encompassing the palette with only a slight
209influence of green at the highest end of the palette (Fx), once turned all
210210the way leftward.
211211
212The degree range for adjustment of the phase shifting on the 7800 appears
213to be as low as approximately 15 degrees when tuned all the way left, and
214seems to be able to achieve as high as approximately 45 degrees when turned
212The degree range for adjustment of the phase shifting on the 7800 appears
213to be as low as approximately 15 degrees when tuned all the way left, and
214seems to be able to achieve as high as approximately 45 degrees when turned
215215right before losing all color (Excluding 1x) from the palette scale.
216216
217For even a properly calibrated system at power on, the system's phase
218shift appears as low as ~23 degrees and after a considerable consistent
217For even a properly calibrated system at power on, the system's phase
218shift appears as low as ~23 degrees and after a considerable consistent
219219runtime ('warm-up'), can be as high as ~28 degrees.
220220
221221In general, the low end of ~23 degrees lasts for maybe several seconds,
r29404r29405
224224near exact match of Hue 1x and 15x - To the naked eye they appear to be
225225the same).
226226
227However, consistent system run time causes Hue 15x (F$) to become
227However, consistent system run time causes Hue 15x (F$) to become
228228stronger/darker gold (More brown then ultimately red-brown); as well
229229as leans Hue 14x (E$) more brown than green.  Once achieving a phase shift
230230of 27.7, Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
r29404r29405
265265***************************************************************************/
266266
267267#define NTSC_GREY \
268    rgb_t(0x00,0x00,0x00), rgb_t(0x11,0x11,0x11), rgb_t(0x22,0x22,0x22), rgb_t(0x33,0x33,0x33), \
269    rgb_t(0x44,0x44,0x44), rgb_t(0x55,0x55,0x55), rgb_t(0x66,0x66,0x66), rgb_t(0x77,0x77,0x77), \
270    rgb_t(0x88,0x88,0x88), rgb_t(0x99,0x99,0x99), rgb_t(0xAA,0xAA,0xAA), rgb_t(0xBB,0xBB,0xBB), \
271    rgb_t(0xCC,0xCC,0xCC), rgb_t(0xDD,0xDD,0xDD), rgb_t(0xEE,0xEE,0xEE), rgb_t(0xFF,0xFF,0xFF   )
268   rgb_t(0x00,0x00,0x00), rgb_t(0x11,0x11,0x11), rgb_t(0x22,0x22,0x22), rgb_t(0x33,0x33,0x33), \
269   rgb_t(0x44,0x44,0x44), rgb_t(0x55,0x55,0x55), rgb_t(0x66,0x66,0x66), rgb_t(0x77,0x77,0x77), \
270   rgb_t(0x88,0x88,0x88), rgb_t(0x99,0x99,0x99), rgb_t(0xAA,0xAA,0xAA), rgb_t(0xBB,0xBB,0xBB), \
271   rgb_t(0xCC,0xCC,0xCC), rgb_t(0xDD,0xDD,0xDD), rgb_t(0xEE,0xEE,0xEE), rgb_t(0xFF,0xFF,0xFF   )
272272
273273#define NTSC_GOLD \
274    rgb_t(0x1A,0x07,0x00), rgb_t(0x2B,0x18,0x00), rgb_t(0x3C,0x29,0x00), rgb_t(0x4D,0x3A,0x00), \
275    rgb_t(0x5E,0x4B,0x00), rgb_t(0x6F,0x5C,0x00), rgb_t(0x80,0x6D,0x00), rgb_t(0x91,0x7E,0x09), \
276    rgb_t(0xA2,0x8F,0x1A), rgb_t(0xB3,0xA0,0x2B), rgb_t(0xC4,0xB1,0x3C), rgb_t(0xD5,0xC2,0x4D), \
277    rgb_t(0xE6,0xD3,0x5E), rgb_t(0xF7,0xE4,0x6F), rgb_t(0xFF,0xF5,0x83), rgb_t(0xFF,0xF7,0x97   )
274   rgb_t(0x1A,0x07,0x00), rgb_t(0x2B,0x18,0x00), rgb_t(0x3C,0x29,0x00), rgb_t(0x4D,0x3A,0x00), \
275   rgb_t(0x5E,0x4B,0x00), rgb_t(0x6F,0x5C,0x00), rgb_t(0x80,0x6D,0x00), rgb_t(0x91,0x7E,0x09), \
276   rgb_t(0xA2,0x8F,0x1A), rgb_t(0xB3,0xA0,0x2B), rgb_t(0xC4,0xB1,0x3C), rgb_t(0xD5,0xC2,0x4D), \
277   rgb_t(0xE6,0xD3,0x5E), rgb_t(0xF7,0xE4,0x6F), rgb_t(0xFF,0xF5,0x83), rgb_t(0xFF,0xF7,0x97   )
278278
279279#define NTSC_ORANGE \
280    rgb_t(0x31,0x00,0x00), rgb_t(0x42,0x06,0x00), rgb_t(0x53,0x17,0x00), rgb_t(0x64,0x28,0x00), \
281    rgb_t(0x75,0x39,0x00), rgb_t(0x86,0X4A,0x00), rgb_t(0x97,0x5B,0x0A), rgb_t(0xA8,0x6C,0x1B), \
282    rgb_t(0xB9,0x7D,0x2C), rgb_t(0xCA,0x8E,0x3D), rgb_t(0xDB,0x9F,0x4E), rgb_t(0xEC,0xB0,0x5F), \
283    rgb_t(0xFD,0xC1,0x70), rgb_t(0xFF,0xD2,0x85), rgb_t(0xFF,0xE3,0x9C), rgb_t(0xFF,0xF4,0xB2   )
280   rgb_t(0x31,0x00,0x00), rgb_t(0x42,0x06,0x00), rgb_t(0x53,0x17,0x00), rgb_t(0x64,0x28,0x00), \
281   rgb_t(0x75,0x39,0x00), rgb_t(0x86,0X4A,0x00), rgb_t(0x97,0x5B,0x0A), rgb_t(0xA8,0x6C,0x1B), \
282   rgb_t(0xB9,0x7D,0x2C), rgb_t(0xCA,0x8E,0x3D), rgb_t(0xDB,0x9F,0x4E), rgb_t(0xEC,0xB0,0x5F), \
283   rgb_t(0xFD,0xC1,0x70), rgb_t(0xFF,0xD2,0x85), rgb_t(0xFF,0xE3,0x9C), rgb_t(0xFF,0xF4,0xB2   )
284284
285285#define NTSC_RED_ORANGE \
286    rgb_t(0x3E,0x00,0x00), rgb_t(0x4F,0x00,0x00), rgb_t(0x60,0x08,0x00), rgb_t(0x71,0x19,0x00), \
287    rgb_t(0x82,0x2A,0x0D), rgb_t(0x93,0x3B,0x1E), rgb_t(0xA4,0x4C,0x2F), rgb_t(0xB5,0x5D,0x40), \
288    rgb_t(0xC6,0x6E,0x51), rgb_t(0xD7,0x7F,0x62), rgb_t(0xE8,0x90,0x73), rgb_t(0xF9,0xA1,0x83), \
289    rgb_t(0xFF,0xB2,0x98), rgb_t(0xFF,0xC3,0xAE), rgb_t(0xFF,0xD4,0xC4), rgb_t(0xFF,0xE5,0xDA   )
286   rgb_t(0x3E,0x00,0x00), rgb_t(0x4F,0x00,0x00), rgb_t(0x60,0x08,0x00), rgb_t(0x71,0x19,0x00), \
287   rgb_t(0x82,0x2A,0x0D), rgb_t(0x93,0x3B,0x1E), rgb_t(0xA4,0x4C,0x2F), rgb_t(0xB5,0x5D,0x40), \
288   rgb_t(0xC6,0x6E,0x51), rgb_t(0xD7,0x7F,0x62), rgb_t(0xE8,0x90,0x73), rgb_t(0xF9,0xA1,0x83), \
289   rgb_t(0xFF,0xB2,0x98), rgb_t(0xFF,0xC3,0xAE), rgb_t(0xFF,0xD4,0xC4), rgb_t(0xFF,0xE5,0xDA   )
290290
291291#define NTSC_PINK \
292    rgb_t(0x3F,0x00,0x03), rgb_t(0x50,0x00,0x0F), rgb_t(0x61,0x00,0x1B), rgb_t(0x72,0x0F,0x2B), \
293    rgb_t(0x83,0x20,0x3C), rgb_t(0x94,0x31,0x4D), rgb_t(0xA5,0x42,0x5E), rgb_t(0xB6,0x53,0x6F), \
294    rgb_t(0xC7,0x64,0x80), rgb_t(0xD8,0x75,0x91), rgb_t(0xE9,0x86,0xA2), rgb_t(0xFA,0x97,0xB3), \
295    rgb_t(0xFF,0xA8,0xC8), rgb_t(0xFF,0xB9,0xDE), rgb_t(0xFF,0xCA,0xEF), rgb_t(0xFF,0xDB,0xF4   )
292   rgb_t(0x3F,0x00,0x03), rgb_t(0x50,0x00,0x0F), rgb_t(0x61,0x00,0x1B), rgb_t(0x72,0x0F,0x2B), \
293   rgb_t(0x83,0x20,0x3C), rgb_t(0x94,0x31,0x4D), rgb_t(0xA5,0x42,0x5E), rgb_t(0xB6,0x53,0x6F), \
294   rgb_t(0xC7,0x64,0x80), rgb_t(0xD8,0x75,0x91), rgb_t(0xE9,0x86,0xA2), rgb_t(0xFA,0x97,0xB3), \
295   rgb_t(0xFF,0xA8,0xC8), rgb_t(0xFF,0xB9,0xDE), rgb_t(0xFF,0xCA,0xEF), rgb_t(0xFF,0xDB,0xF4   )
296296
297297#define NTSC_PURPLE \
298    rgb_t(0x33,0x00,0x35), rgb_t(0x44,0x00,0x41), rgb_t(0x55,0x00,0x4C), rgb_t(0x66,0x0C,0x5C), \
299    rgb_t(0x77,0x1D,0x6D), rgb_t(0x88,0x2E,0x7E), rgb_t(0x99,0x3F,0x8F), rgb_t(0xAA,0x50,0xA0), \
300    rgb_t(0xBB,0x61,0xB1), rgb_t(0xCC,0x72,0xC2), rgb_t(0xDD,0x83,0xD3), rgb_t(0xEE,0x94,0xE4), \
301    rgb_t(0xFF,0xA5,0xE4), rgb_t(0xFF,0xB6,0xE9), rgb_t(0xFF,0xC7,0xEE), rgb_t(0xFF,0xD8,0xF3   )
298   rgb_t(0x33,0x00,0x35), rgb_t(0x44,0x00,0x41), rgb_t(0x55,0x00,0x4C), rgb_t(0x66,0x0C,0x5C), \
299   rgb_t(0x77,0x1D,0x6D), rgb_t(0x88,0x2E,0x7E), rgb_t(0x99,0x3F,0x8F), rgb_t(0xAA,0x50,0xA0), \
300   rgb_t(0xBB,0x61,0xB1), rgb_t(0xCC,0x72,0xC2), rgb_t(0xDD,0x83,0xD3), rgb_t(0xEE,0x94,0xE4), \
301   rgb_t(0xFF,0xA5,0xE4), rgb_t(0xFF,0xB6,0xE9), rgb_t(0xFF,0xC7,0xEE), rgb_t(0xFF,0xD8,0xF3   )
302302
303303#define NTSC_PURPLE_BLUE \
304    rgb_t(0x1D,0x00,0x5C), rgb_t(0x2E,0x00,0x68), rgb_t(0x40,0x00,0x74), rgb_t(0x51,0x10,0x84), \
305    rgb_t(0x62,0x21,0x95), rgb_t(0x73,0x32,0xA6), rgb_t(0x84,0x43,0xB7), rgb_t(0x95,0x54,0xC8), \
306    rgb_t(0xA6,0x65,0xD9), rgb_t(0xB7,0x76,0xEA), rgb_t(0xC8,0x87,0xEB), rgb_t(0xD9,0x98,0xEB), \
307    rgb_t(0xE9,0xA9,0xEC), rgb_t(0xFB,0xBA,0xEB), rgb_t(0xFF,0xCB,0xEF), rgb_t(0xFF,0xDC,0xF4   )
304   rgb_t(0x1D,0x00,0x5C), rgb_t(0x2E,0x00,0x68), rgb_t(0x40,0x00,0x74), rgb_t(0x51,0x10,0x84), \
305   rgb_t(0x62,0x21,0x95), rgb_t(0x73,0x32,0xA6), rgb_t(0x84,0x43,0xB7), rgb_t(0x95,0x54,0xC8), \
306   rgb_t(0xA6,0x65,0xD9), rgb_t(0xB7,0x76,0xEA), rgb_t(0xC8,0x87,0xEB), rgb_t(0xD9,0x98,0xEB), \
307   rgb_t(0xE9,0xA9,0xEC), rgb_t(0xFB,0xBA,0xEB), rgb_t(0xFF,0xCB,0xEF), rgb_t(0xFF,0xDC,0xF4   )
308308
309309#define NTSC_BLUE1 \
310    rgb_t(0x02,0x00,0x71), rgb_t(0x13,0x00,0x7D), rgb_t(0x24,0x0B,0x8C), rgb_t(0x35,0x1C,0x9D), \
311    rgb_t(0x46,0x2D,0xAE), rgb_t(0x57,0x3E,0xBF), rgb_t(0x68,0x4F,0xD0), rgb_t(0x79,0x60,0xE1), \
312    rgb_t(0x8A,0x71,0xF2), rgb_t(0x9B,0x82,0xF7), rgb_t(0xAC,0x93,0xF7), rgb_t(0xBD,0xA4,0xF7), \
313    rgb_t(0xCE,0xB5,0xF7), rgb_t(0xDF,0xC6,0xF7), rgb_t(0xF0,0xD7,0xF7), rgb_t(0xFF,0xE8,0xF8   )
310   rgb_t(0x02,0x00,0x71), rgb_t(0x13,0x00,0x7D), rgb_t(0x24,0x0B,0x8C), rgb_t(0x35,0x1C,0x9D), \
311   rgb_t(0x46,0x2D,0xAE), rgb_t(0x57,0x3E,0xBF), rgb_t(0x68,0x4F,0xD0), rgb_t(0x79,0x60,0xE1), \
312   rgb_t(0x8A,0x71,0xF2), rgb_t(0x9B,0x82,0xF7), rgb_t(0xAC,0x93,0xF7), rgb_t(0xBD,0xA4,0xF7), \
313   rgb_t(0xCE,0xB5,0xF7), rgb_t(0xDF,0xC6,0xF7), rgb_t(0xF0,0xD7,0xF7), rgb_t(0xFF,0xE8,0xF8   )
314314
315315#define NTSC_BLUE2 \
316    rgb_t(0x00,0x00,0x68), rgb_t(0x00,0x0A,0x7C), rgb_t(0x08,0x1B,0x90), rgb_t(0x19,0x2C,0xA1), \
317    rgb_t(0x2A,0x3D,0xB2), rgb_t(0x3B,0x4E,0xC3), rgb_t(0x4C,0x5F,0xD4), rgb_t(0x5D,0x70,0xE5), \
318    rgb_t(0x6E,0x81,0xF6), rgb_t(0x7F,0x92,0xFF), rgb_t(0x90,0xA3,0xFF), rgb_t(0xA1,0xB4,0xFF), \
319    rgb_t(0xB2,0xC5,0xFF), rgb_t(0xC3,0xD6,0xFF), rgb_t(0xD4,0xE7,0xFF), rgb_t(0xE5,0xF8,0xFF   )
316   rgb_t(0x00,0x00,0x68), rgb_t(0x00,0x0A,0x7C), rgb_t(0x08,0x1B,0x90), rgb_t(0x19,0x2C,0xA1), \
317   rgb_t(0x2A,0x3D,0xB2), rgb_t(0x3B,0x4E,0xC3), rgb_t(0x4C,0x5F,0xD4), rgb_t(0x5D,0x70,0xE5), \
318   rgb_t(0x6E,0x81,0xF6), rgb_t(0x7F,0x92,0xFF), rgb_t(0x90,0xA3,0xFF), rgb_t(0xA1,0xB4,0xFF), \
319   rgb_t(0xB2,0xC5,0xFF), rgb_t(0xC3,0xD6,0xFF), rgb_t(0xD4,0xE7,0xFF), rgb_t(0xE5,0xF8,0xFF   )
320320
321321#define NTSC_LIGHT_BLUE \
322    rgb_t(0x00,0x0A,0x4D), rgb_t(0x00,0x1B,0x63), rgb_t(0x00,0x2C,0x79), rgb_t(0x02,0x3D,0x8F), \
323    rgb_t(0x13,0x4E,0xA0), rgb_t(0x24,0x5F,0xB1), rgb_t(0x35,0x70,0xC2), rgb_t(0x46,0x81,0xD3), \
324    rgb_t(0x57,0x92,0xE4), rgb_t(0x68,0xA3,0xF5), rgb_t(0x79,0xB4,0xFF), rgb_t(0x8A,0xC5,0xFF), \
325    rgb_t(0x9B,0xD6,0xFF), rgb_t(0xAC,0xE7,0xFF), rgb_t(0xBD,0xF8,0xFF), rgb_t(0xCE,0xFF,0xFF   )
322   rgb_t(0x00,0x0A,0x4D), rgb_t(0x00,0x1B,0x63), rgb_t(0x00,0x2C,0x79), rgb_t(0x02,0x3D,0x8F), \
323   rgb_t(0x13,0x4E,0xA0), rgb_t(0x24,0x5F,0xB1), rgb_t(0x35,0x70,0xC2), rgb_t(0x46,0x81,0xD3), \
324   rgb_t(0x57,0x92,0xE4), rgb_t(0x68,0xA3,0xF5), rgb_t(0x79,0xB4,0xFF), rgb_t(0x8A,0xC5,0xFF), \
325   rgb_t(0x9B,0xD6,0xFF), rgb_t(0xAC,0xE7,0xFF), rgb_t(0xBD,0xF8,0xFF), rgb_t(0xCE,0xFF,0xFF   )
326326
327327#define NTSC_TURQUOISE \
328    rgb_t(0x00,0x1A,0x26), rgb_t(0x00,0x2B,0x3C), rgb_t(0x00,0x3C,0x52), rgb_t(0x00,0x4D,0x68), \
329    rgb_t(0x06,0x5E,0x7C), rgb_t(0x17,0x6F,0x8D), rgb_t(0x28,0x80,0x9E), rgb_t(0x39,0x91,0xAF), \
330    rgb_t(0x4A,0xA2,0xC0), rgb_t(0x5B,0xB3,0xD1), rgb_t(0x6C,0xC4,0xE2), rgb_t(0x7D,0xD5,0xF3), \
331    rgb_t(0x8E,0xE6,0xFF), rgb_t(0x9F,0xF7,0xFF), rgb_t(0xB0,0xFF,0xFF), rgb_t(0xC1,0xFF,0xFF   )
328   rgb_t(0x00,0x1A,0x26), rgb_t(0x00,0x2B,0x3C), rgb_t(0x00,0x3C,0x52), rgb_t(0x00,0x4D,0x68), \
329   rgb_t(0x06,0x5E,0x7C), rgb_t(0x17,0x6F,0x8D), rgb_t(0x28,0x80,0x9E), rgb_t(0x39,0x91,0xAF), \
330   rgb_t(0x4A,0xA2,0xC0), rgb_t(0x5B,0xB3,0xD1), rgb_t(0x6C,0xC4,0xE2), rgb_t(0x7D,0xD5,0xF3), \
331   rgb_t(0x8E,0xE6,0xFF), rgb_t(0x9F,0xF7,0xFF), rgb_t(0xB0,0xFF,0xFF), rgb_t(0xC1,0xFF,0xFF   )
332332
333333#define NTSC_GREEN_BLUE \
334    rgb_t(0x00,0x24,0x0B), rgb_t(0x00,0x35,0x10), rgb_t(0x00,0x46,0x22), rgb_t(0x00,0x57,0x38), \
335    rgb_t(0x05,0x68,0x4D), rgb_t(0x16,0x79,0x5E), rgb_t(0x27,0x8A,0x6F), rgb_t(0x38,0x9B,0x80), \
336    rgb_t(0x49,0xAC,0x91), rgb_t(0x5A,0xBD,0xA2), rgb_t(0x6B,0xCE,0xB3), rgb_t(0x7C,0xDF,0xC4), \
337    rgb_t(0x8D,0xF0,0xD5), rgb_t(0x9E,0xFF,0xE5), rgb_t(0xAF,0xFF,0xF1), rgb_t(0xC0,0xFF,0xFD   )
334   rgb_t(0x00,0x24,0x0B), rgb_t(0x00,0x35,0x10), rgb_t(0x00,0x46,0x22), rgb_t(0x00,0x57,0x38), \
335   rgb_t(0x05,0x68,0x4D), rgb_t(0x16,0x79,0x5E), rgb_t(0x27,0x8A,0x6F), rgb_t(0x38,0x9B,0x80), \
336   rgb_t(0x49,0xAC,0x91), rgb_t(0x5A,0xBD,0xA2), rgb_t(0x6B,0xCE,0xB3), rgb_t(0x7C,0xDF,0xC4), \
337   rgb_t(0x8D,0xF0,0xD5), rgb_t(0x9E,0xFF,0xE5), rgb_t(0xAF,0xFF,0xF1), rgb_t(0xC0,0xFF,0xFD   )
338338
339339#define NTSC_GREEN \
340    rgb_t(0x00,0x27,0x0C), rgb_t(0x00,0x38,0x11), rgb_t(0x00,0x49,0x16), rgb_t(0x00,0x5A,0x1B), \
341    rgb_t(0x10,0x6B,0x1B), rgb_t(0x21,0x7C,0x2C), rgb_t(0x32,0x8D,0x3D), rgb_t(0x43,0x9E,0x4E), \
342    rgb_t(0x54,0xAF,0x5F), rgb_t(0x65,0xC0,0x70), rgb_t(0x76,0xD1,0x81), rgb_t(0x87,0xE2,0x92), \
343    rgb_t(0x98,0xF3,0xA3), rgb_t(0xA9,0xFF,0xB3), rgb_t(0xBA,0xFF,0xBF), rgb_t(0xCB,0xFF,0xCB   )
340   rgb_t(0x00,0x27,0x0C), rgb_t(0x00,0x38,0x11), rgb_t(0x00,0x49,0x16), rgb_t(0x00,0x5A,0x1B), \
341   rgb_t(0x10,0x6B,0x1B), rgb_t(0x21,0x7C,0x2C), rgb_t(0x32,0x8D,0x3D), rgb_t(0x43,0x9E,0x4E), \
342   rgb_t(0x54,0xAF,0x5F), rgb_t(0x65,0xC0,0x70), rgb_t(0x76,0xD1,0x81), rgb_t(0x87,0xE2,0x92), \
343   rgb_t(0x98,0xF3,0xA3), rgb_t(0xA9,0xFF,0xB3), rgb_t(0xBA,0xFF,0xBF), rgb_t(0xCB,0xFF,0xCB   )
344344
345345#define NTSC_YELLOW_GREEN \
346    rgb_t(0x00,0x23,0x0A), rgb_t(0x00,0x34,0x10), rgb_t(0x04,0x45,0x13), rgb_t(0x15,0x56,0x13), \
347    rgb_t(0x26,0x67,0x13), rgb_t(0x37,0x78,0x13), rgb_t(0x48,0x89,0x14), rgb_t(0x59,0x9A,0x25), \
348    rgb_t(0x6A,0xAB,0x36), rgb_t(0x7B,0xBC,0x47), rgb_t(0x8C,0xCD,0x58), rgb_t(0x9D,0xDE,0x69), \
349    rgb_t(0xAE,0xEF,0x7A), rgb_t(0xBF,0xFF,0x8B), rgb_t(0xD0,0xFF,0x97), rgb_t(0xE1,0xFF,0xA3   )
346   rgb_t(0x00,0x23,0x0A), rgb_t(0x00,0x34,0x10), rgb_t(0x04,0x45,0x13), rgb_t(0x15,0x56,0x13), \
347   rgb_t(0x26,0x67,0x13), rgb_t(0x37,0x78,0x13), rgb_t(0x48,0x89,0x14), rgb_t(0x59,0x9A,0x25), \
348   rgb_t(0x6A,0xAB,0x36), rgb_t(0x7B,0xBC,0x47), rgb_t(0x8C,0xCD,0x58), rgb_t(0x9D,0xDE,0x69), \
349   rgb_t(0xAE,0xEF,0x7A), rgb_t(0xBF,0xFF,0x8B), rgb_t(0xD0,0xFF,0x97), rgb_t(0xE1,0xFF,0xA3   )
350350
351351#define NTSC_ORANGE_GREEN \
352    rgb_t(0x00,0x17,0x07), rgb_t(0x0E,0x28,0x08), rgb_t(0x1F,0x39,0x08), rgb_t(0x30,0x4A,0x08), \
353    rgb_t(0x41,0x5B,0x08), rgb_t(0x52,0x6C,0x08), rgb_t(0x63,0x7D,0x08), rgb_t(0x74,0x8E,0x0D), \
354    rgb_t(0x85,0x9F,0x1E), rgb_t(0x96,0xB0,0x2F), rgb_t(0xA7,0xC1,0x40), rgb_t(0xB8,0xD2,0x51), \
355    rgb_t(0xC9,0xE3,0x62), rgb_t(0xDA,0xF4,0x73), rgb_t(0xEB,0xFF,0x82), rgb_t(0xFC,0xFF,0x8E   )
352   rgb_t(0x00,0x17,0x07), rgb_t(0x0E,0x28,0x08), rgb_t(0x1F,0x39,0x08), rgb_t(0x30,0x4A,0x08), \
353   rgb_t(0x41,0x5B,0x08), rgb_t(0x52,0x6C,0x08), rgb_t(0x63,0x7D,0x08), rgb_t(0x74,0x8E,0x0D), \
354   rgb_t(0x85,0x9F,0x1E), rgb_t(0x96,0xB0,0x2F), rgb_t(0xA7,0xC1,0x40), rgb_t(0xB8,0xD2,0x51), \
355   rgb_t(0xC9,0xE3,0x62), rgb_t(0xDA,0xF4,0x73), rgb_t(0xEB,0xFF,0x82), rgb_t(0xFC,0xFF,0x8E   )
356356
357357#define NTSC_LIGHT_ORANGE \
358    rgb_t(0x19,0x07,0x00), rgb_t(0x2A,0x18,0x00), rgb_t(0x3B,0x29,0x00), rgb_t(0x4C,0x3A,0x00), \
359    rgb_t(0x5D,0x4B,0x00), rgb_t(0x6E,0x5C,0x00), rgb_t(0x7F,0x6D,0x00), rgb_t(0x90,0x7E,0x09), \
360    rgb_t(0xA1,0x8F,0x1A), rgb_t(0xB2,0xA0,0x2B), rgb_t(0xC3,0xB1,0x3C), rgb_t(0xD4,0xC2,0x4D), \
361    rgb_t(0xE5,0xD3,0x5E), rgb_t(0xF6,0xE4,0x6F), rgb_t(0xFF,0xF5,0x82), rgb_t(0xFF,0xFF,0x96   )
358   rgb_t(0x19,0x07,0x00), rgb_t(0x2A,0x18,0x00), rgb_t(0x3B,0x29,0x00), rgb_t(0x4C,0x3A,0x00), \
359   rgb_t(0x5D,0x4B,0x00), rgb_t(0x6E,0x5C,0x00), rgb_t(0x7F,0x6D,0x00), rgb_t(0x90,0x7E,0x09), \
360   rgb_t(0xA1,0x8F,0x1A), rgb_t(0xB2,0xA0,0x2B), rgb_t(0xC3,0xB1,0x3C), rgb_t(0xD4,0xC2,0x4D), \
361   rgb_t(0xE5,0xD3,0x5E), rgb_t(0xF6,0xE4,0x6F), rgb_t(0xFF,0xF5,0x82), rgb_t(0xFF,0xFF,0x96   )
362362
363363static const rgb_t a7800_palette[256*3] =
364364{
r29404r29405
711711
712712
713713#define NTSC_GREY \
714   rgb_t(0x00,0x00,0x00), rgb_t(0x11,0x11,0x11), rgb_t(0x22,0x22,0x22), rgb_t(0x33,0x33,0x33), \
715   rgb_t(0x44,0x44,0x44), rgb_t(0x55,0x55,0x55), rgb_t(0x66,0x66,0x66), rgb_t(0x77,0x77,0x77), \
716   rgb_t(0x88,0x88,0x88), rgb_t(0x99,0x99,0x99), rgb_t(0xAA,0xAA,0xAA), rgb_t(0xBB,0xBB,0xBB), \
717   rgb_t(0xCC,0xCC,0xCC), rgb_t(0xDD,0xDD,0xDD), rgb_t(0xEE,0xEE,0xEE), rgb_t(0xFF,0xFF,0xFF   )
714    rgb_t(0x00,0x00,0x00), rgb_t(0x11,0x11,0x11), rgb_t(0x22,0x22,0x22), rgb_t(0x33,0x33,0x33), \
715    rgb_t(0x44,0x44,0x44), rgb_t(0x55,0x55,0x55), rgb_t(0x66,0x66,0x66), rgb_t(0x77,0x77,0x77), \
716    rgb_t(0x88,0x88,0x88), rgb_t(0x99,0x99,0x99), rgb_t(0xAA,0xAA,0xAA), rgb_t(0xBB,0xBB,0xBB), \
717    rgb_t(0xCC,0xCC,0xCC), rgb_t(0xDD,0xDD,0xDD), rgb_t(0xEE,0xEE,0xEE), rgb_t(0xFF,0xFF,0xFF   )
718718
719719#define NTSC_GOLD \
720   rgb_t(0x1A,0x07,0x00), rgb_t(0x2B,0x18,0x00), rgb_t(0x3C,0x29,0x00), rgb_t(0x4D,0x3A,0x00), \
721   rgb_t(0x5E,0x4B,0x00), rgb_t(0x6F,0x5C,0x00), rgb_t(0x80,0x6D,0x00), rgb_t(0x91,0x7E,0x09), \
722   rgb_t(0xA2,0x8F,0x1A), rgb_t(0xB3,0xA0,0x2B), rgb_t(0xC4,0xB1,0x3C), rgb_t(0xD5,0xC2,0x4D), \
723   rgb_t(0xE6,0xD3,0x5E), rgb_t(0xF7,0xE4,0x6F), rgb_t(0xFF,0xF5,0x83), rgb_t(0xFF,0xF7,0x97   )
720    rgb_t(0x1A,0x07,0x00), rgb_t(0x2B,0x18,0x00), rgb_t(0x3C,0x29,0x00), rgb_t(0x4D,0x3A,0x00), \
721    rgb_t(0x5E,0x4B,0x00), rgb_t(0x6F,0x5C,0x00), rgb_t(0x80,0x6D,0x00), rgb_t(0x91,0x7E,0x09), \
722    rgb_t(0xA2,0x8F,0x1A), rgb_t(0xB3,0xA0,0x2B), rgb_t(0xC4,0xB1,0x3C), rgb_t(0xD5,0xC2,0x4D), \
723    rgb_t(0xE6,0xD3,0x5E), rgb_t(0xF7,0xE4,0x6F), rgb_t(0xFF,0xF5,0x83), rgb_t(0xFF,0xF7,0x97   )
724724
725725#define NTSC_ORANGE \
726   rgb_t(0x31,0x00,0x00), rgb_t(0x42,0x06,0x00), rgb_t(0x53,0x17,0x00), rgb_t(0x64,0x28,0x00), \
727   rgb_t(0x75,0x39,0x00), rgb_t(0x86,0X4A,0x00), rgb_t(0x97,0x5B,0x0B), rgb_t(0xA8,0x6C,0x1C), \
728   rgb_t(0xB9,0x7D,0x2D), rgb_t(0xCA,0x8E,0x3E), rgb_t(0xDB,0x9F,0x4F), rgb_t(0xEC,0xB0,0x60), \
729   rgb_t(0xFD,0xC1,0x71), rgb_t(0xFF,0xD2,0x86), rgb_t(0xFF,0xE3,0x9D), rgb_t(0xFF,0xF4,0xB3   )
726    rgb_t(0x31,0x00,0x00), rgb_t(0x42,0x06,0x00), rgb_t(0x53,0x17,0x00), rgb_t(0x64,0x28,0x00), \
727    rgb_t(0x75,0x39,0x00), rgb_t(0x86,0X4A,0x00), rgb_t(0x97,0x5B,0x0B), rgb_t(0xA8,0x6C,0x1C), \
728    rgb_t(0xB9,0x7D,0x2D), rgb_t(0xCA,0x8E,0x3E), rgb_t(0xDB,0x9F,0x4F), rgb_t(0xEC,0xB0,0x60), \
729    rgb_t(0xFD,0xC1,0x71), rgb_t(0xFF,0xD2,0x86), rgb_t(0xFF,0xE3,0x9D), rgb_t(0xFF,0xF4,0xB3   )
730730
731731#define NTSC_RED_ORANGE \
732   rgb_t(0x3E,0x00,0x00), rgb_t(0x4F,0x00,0x00), rgb_t(0x60,0x08,0x00), rgb_t(0x71,0x19,0x00), \
733   rgb_t(0x82,0x2A,0x0F), rgb_t(0x93,0x3B,0x20), rgb_t(0xA4,0x4C,0x31), rgb_t(0xB5,0x5D,0x42), \
734   rgb_t(0xC6,0x6E,0x53), rgb_t(0xD7,0x7F,0x64), rgb_t(0xE8,0x90,0x75), rgb_t(0xF9,0xA1,0x86), \
735   rgb_t(0xFF,0xB2,0x9A), rgb_t(0xFF,0xC3,0xB0), rgb_t(0xFF,0xD4,0xC6), rgb_t(0xFF,0xE5,0xDC   )
732    rgb_t(0x3E,0x00,0x00), rgb_t(0x4F,0x00,0x00), rgb_t(0x60,0x08,0x00), rgb_t(0x71,0x19,0x00), \
733    rgb_t(0x82,0x2A,0x0F), rgb_t(0x93,0x3B,0x20), rgb_t(0xA4,0x4C,0x31), rgb_t(0xB5,0x5D,0x42), \
734    rgb_t(0xC6,0x6E,0x53), rgb_t(0xD7,0x7F,0x64), rgb_t(0xE8,0x90,0x75), rgb_t(0xF9,0xA1,0x86), \
735    rgb_t(0xFF,0xB2,0x9A), rgb_t(0xFF,0xC3,0xB0), rgb_t(0xFF,0xD4,0xC6), rgb_t(0xFF,0xE5,0xDC   )
736736
737737#define NTSC_PINK \
738   rgb_t(0x3E,0x00,0x06), rgb_t(0x4F,0x00,0x12), rgb_t(0x60,0x00,0x1E), rgb_t(0x71,0x0E,0x2E), \
739   rgb_t(0x82,0x1F,0x3F), rgb_t(0x93,0x30,0x50), rgb_t(0xA4,0x41,0x61), rgb_t(0xB5,0x52,0x72), \
740   rgb_t(0xC6,0x63,0x83), rgb_t(0xD7,0x74,0x94), rgb_t(0xE8,0x85,0xA5), rgb_t(0xF9,0x96,0xB6), \
741   rgb_t(0xFF,0xA7,0xCB), rgb_t(0xFF,0xB8,0xE1), rgb_t(0xFF,0xC9,0xEF), rgb_t(0xFF,0xDA,0xF4   )
738    rgb_t(0x3E,0x00,0x06), rgb_t(0x4F,0x00,0x12), rgb_t(0x60,0x00,0x1E), rgb_t(0x71,0x0E,0x2E), \
739    rgb_t(0x82,0x1F,0x3F), rgb_t(0x93,0x30,0x50), rgb_t(0xA4,0x41,0x61), rgb_t(0xB5,0x52,0x72), \
740    rgb_t(0xC6,0x63,0x83), rgb_t(0xD7,0x74,0x94), rgb_t(0xE8,0x85,0xA5), rgb_t(0xF9,0x96,0xB6), \
741    rgb_t(0xFF,0xA7,0xCB), rgb_t(0xFF,0xB8,0xE1), rgb_t(0xFF,0xC9,0xEF), rgb_t(0xFF,0xDA,0xF4   )
742742
743743#define NTSC_PURPLE \
744   rgb_t(0x32,0x00,0x38), rgb_t(0x43,0x00,0x44), rgb_t(0x54,0x00,0x50), rgb_t(0x65,0x0C,0x5F), \
745   rgb_t(0x76,0x1D,0x70), rgb_t(0x87,0x2E,0x81), rgb_t(0x98,0x3F,0x92), rgb_t(0xA9,0x50,0xA3), \
746   rgb_t(0xBA,0x61,0xB4), rgb_t(0xCB,0x72,0xC5), rgb_t(0xDC,0x83,0xD6), rgb_t(0xED,0x94,0xE4), \
747   rgb_t(0xFE,0xA5,0xE4), rgb_t(0xFF,0xB6,0xE9), rgb_t(0xFF,0xC7,0xEE), rgb_t(0xFF,0xD8,0xF3   )
744    rgb_t(0x32,0x00,0x38), rgb_t(0x43,0x00,0x44), rgb_t(0x54,0x00,0x50), rgb_t(0x65,0x0C,0x5F), \
745    rgb_t(0x76,0x1D,0x70), rgb_t(0x87,0x2E,0x81), rgb_t(0x98,0x3F,0x92), rgb_t(0xA9,0x50,0xA3), \
746    rgb_t(0xBA,0x61,0xB4), rgb_t(0xCB,0x72,0xC5), rgb_t(0xDC,0x83,0xD6), rgb_t(0xED,0x94,0xE4), \
747    rgb_t(0xFE,0xA5,0xE4), rgb_t(0xFF,0xB6,0xE9), rgb_t(0xFF,0xC7,0xEE), rgb_t(0xFF,0xD8,0xF3   )
748748
749749#define NTSC_PURPLE_BLUE \
750   rgb_t(0x1B,0x00,0x5F), rgb_t(0x2C,0x00,0x6B), rgb_t(0x3D,0x00,0x77), rgb_t(0x4E,0x11,0x88), \
751   rgb_t(0x5F,0x22,0x99), rgb_t(0x70,0x33,0xAA), rgb_t(0x81,0x44,0xBB), rgb_t(0x92,0x55,0xCC), \
752   rgb_t(0xA3,0x66,0xDD), rgb_t(0xB4,0x77,0xED), rgb_t(0xC5,0x88,0xED), rgb_t(0xD6,0x99,0xED), \
753   rgb_t(0xE7,0xAA,0xED), rgb_t(0xF8,0xBB,0xED), rgb_t(0xFF,0xCC,0xF0), rgb_t(0xFF,0xDD,0xF5   )
750    rgb_t(0x1B,0x00,0x5F), rgb_t(0x2C,0x00,0x6B), rgb_t(0x3D,0x00,0x77), rgb_t(0x4E,0x11,0x88), \
751    rgb_t(0x5F,0x22,0x99), rgb_t(0x70,0x33,0xAA), rgb_t(0x81,0x44,0xBB), rgb_t(0x92,0x55,0xCC), \
752    rgb_t(0xA3,0x66,0xDD), rgb_t(0xB4,0x77,0xED), rgb_t(0xC5,0x88,0xED), rgb_t(0xD6,0x99,0xED), \
753    rgb_t(0xE7,0xAA,0xED), rgb_t(0xF8,0xBB,0xED), rgb_t(0xFF,0xCC,0xF0), rgb_t(0xFF,0xDD,0xF5   )
754754
755755#define NTSC_BLUE1 \
756   rgb_t(0x00,0x00,0x72), rgb_t(0x10,0x00,0x7E), rgb_t(0x21,0x0D,0x8E), rgb_t(0x32,0x1E,0x9F), \
757   rgb_t(0x43,0x2F,0xB0), rgb_t(0x54,0x40,0xC1), rgb_t(0x65,0x51,0xD2), rgb_t(0x76,0x62,0xE3), \
758   rgb_t(0x87,0x73,0xF4), rgb_t(0x98,0x84,0xF9), rgb_t(0xA9,0x95,0xF9), rgb_t(0xBA,0xA6,0xF9), \
759   rgb_t(0xCB,0xB7,0xF9), rgb_t(0xDC,0xC8,0xF9), rgb_t(0xED,0xD9,0xF9), rgb_t(0xFE,0xEA,0xF9   )
756    rgb_t(0x00,0x00,0x72), rgb_t(0x10,0x00,0x7E), rgb_t(0x21,0x0D,0x8E), rgb_t(0x32,0x1E,0x9F), \
757    rgb_t(0x43,0x2F,0xB0), rgb_t(0x54,0x40,0xC1), rgb_t(0x65,0x51,0xD2), rgb_t(0x76,0x62,0xE3), \
758    rgb_t(0x87,0x73,0xF4), rgb_t(0x98,0x84,0xF9), rgb_t(0xA9,0x95,0xF9), rgb_t(0xBA,0xA6,0xF9), \
759    rgb_t(0xCB,0xB7,0xF9), rgb_t(0xDC,0xC8,0xF9), rgb_t(0xED,0xD9,0xF9), rgb_t(0xFE,0xEA,0xF9   )
760760
761761#define NTSC_BLUE2 \
762   rgb_t(0x00,0x00,0x65), rgb_t(0x00,0x0C,0x7A), rgb_t(0x05,0x1D,0x8E), rgb_t(0x16,0x2E,0x9F), \
763   rgb_t(0x27,0x3F,0xB0), rgb_t(0x38,0x50,0xC1), rgb_t(0x49,0x61,0xD2), rgb_t(0x5A,0x72,0xE3), \
764   rgb_t(0x6B,0x83,0xF4), rgb_t(0x7C,0x94,0xFF), rgb_t(0x8D,0xA5,0xFF), rgb_t(0x9E,0xB6,0xFF), \
765   rgb_t(0xAF,0xC7,0xFF), rgb_t(0xC0,0xD8,0xFF), rgb_t(0xD1,0xE9,0xFF), rgb_t(0xE2,0xFA,0xFF   )
762    rgb_t(0x00,0x00,0x65), rgb_t(0x00,0x0C,0x7A), rgb_t(0x05,0x1D,0x8E), rgb_t(0x16,0x2E,0x9F), \
763    rgb_t(0x27,0x3F,0xB0), rgb_t(0x38,0x50,0xC1), rgb_t(0x49,0x61,0xD2), rgb_t(0x5A,0x72,0xE3), \
764    rgb_t(0x6B,0x83,0xF4), rgb_t(0x7C,0x94,0xFF), rgb_t(0x8D,0xA5,0xFF), rgb_t(0x9E,0xB6,0xFF), \
765    rgb_t(0xAF,0xC7,0xFF), rgb_t(0xC0,0xD8,0xFF), rgb_t(0xD1,0xE9,0xFF), rgb_t(0xE2,0xFA,0xFF   )
766766
767767#define NTSC_LIGHT_BLUE \
768   rgb_t(0x00,0x0D,0x48), rgb_t(0x00,0x1E,0x5E), rgb_t(0x00,0x2F,0x74), rgb_t(0x00,0x40,0x8A), \
769   rgb_t(0x11,0x51,0x9B), rgb_t(0x22,0x62,0xAC), rgb_t(0x33,0x73,0xBD), rgb_t(0x44,0x84,0xCE), \
770   rgb_t(0x55,0x95,0xDF), rgb_t(0x66,0xA6,0xF0), rgb_t(0x77,0xB7,0xFF), rgb_t(0x88,0xC8,0xFF), \
771   rgb_t(0x99,0xD9,0xFF), rgb_t(0xAA,0xEA,0xFF), rgb_t(0xBB,0xFB,0xFF), rgb_t(0xCC,0xFF,0xFF   )
768    rgb_t(0x00,0x0D,0x48), rgb_t(0x00,0x1E,0x5E), rgb_t(0x00,0x2F,0x74), rgb_t(0x00,0x40,0x8A), \
769    rgb_t(0x11,0x51,0x9B), rgb_t(0x22,0x62,0xAC), rgb_t(0x33,0x73,0xBD), rgb_t(0x44,0x84,0xCE), \
770    rgb_t(0x55,0x95,0xDF), rgb_t(0x66,0xA6,0xF0), rgb_t(0x77,0xB7,0xFF), rgb_t(0x88,0xC8,0xFF), \
771    rgb_t(0x99,0xD9,0xFF), rgb_t(0xAA,0xEA,0xFF), rgb_t(0xBB,0xFB,0xFF), rgb_t(0xCC,0xFF,0xFF   )
772772
773773#define NTSC_TURQUOISE \
774   rgb_t(0x00,0x1C,0x1C), rgb_t(0x00,0x2D,0x32), rgb_t(0x00,0x3E,0x49), rgb_t(0x00,0x4F,0x5F), \
775   rgb_t(0x05,0x60,0x73), rgb_t(0x16,0x71,0x84), rgb_t(0x27,0x82,0x95), rgb_t(0x38,0x93,0xA6), \
776   rgb_t(0x49,0xA4,0xB7), rgb_t(0x5A,0xB5,0xC8), rgb_t(0x6B,0xC6,0xD9), rgb_t(0x7C,0xD7,0xEA), \
777   rgb_t(0x8D,0xE8,0xFB), rgb_t(0x9E,0xF9,0xFF), rgb_t(0xAF,0xFF,0xFF), rgb_t(0xC0,0xFF,0xFF   )
774    rgb_t(0x00,0x1C,0x1C), rgb_t(0x00,0x2D,0x32), rgb_t(0x00,0x3E,0x49), rgb_t(0x00,0x4F,0x5F), \
775    rgb_t(0x05,0x60,0x73), rgb_t(0x16,0x71,0x84), rgb_t(0x27,0x82,0x95), rgb_t(0x38,0x93,0xA6), \
776    rgb_t(0x49,0xA4,0xB7), rgb_t(0x5A,0xB5,0xC8), rgb_t(0x6B,0xC6,0xD9), rgb_t(0x7C,0xD7,0xEA), \
777    rgb_t(0x8D,0xE8,0xFB), rgb_t(0x9E,0xF9,0xFF), rgb_t(0xAF,0xFF,0xFF), rgb_t(0xC0,0xFF,0xFF   )
778778
779779#define NTSC_GREEN_BLUE \
780   rgb_t(0x00,0x25,0x0B), rgb_t(0x00,0x36,0x10), rgb_t(0x00,0x47,0x18), rgb_t(0x00,0x58,0x2E), \
781   rgb_t(0x07,0x69,0x42), rgb_t(0x18,0x7A,0x53), rgb_t(0x29,0x8B,0x64), rgb_t(0x3A,0x9C,0x75), \
782   rgb_t(0x4B,0xAD,0x86), rgb_t(0x5C,0xBE,0x97), rgb_t(0x6D,0xCF,0xA8), rgb_t(0x7E,0xE0,0xB9), \
783   rgb_t(0x8F,0xF1,0xCA), rgb_t(0xA0,0xFF,0xDA), rgb_t(0xB1,0xFF,0xE6), rgb_t(0xC2,0xFF,0xF2   )
780    rgb_t(0x00,0x25,0x0B), rgb_t(0x00,0x36,0x10), rgb_t(0x00,0x47,0x18), rgb_t(0x00,0x58,0x2E), \
781    rgb_t(0x07,0x69,0x42), rgb_t(0x18,0x7A,0x53), rgb_t(0x29,0x8B,0x64), rgb_t(0x3A,0x9C,0x75), \
782    rgb_t(0x4B,0xAD,0x86), rgb_t(0x5C,0xBE,0x97), rgb_t(0x6D,0xCF,0xA8), rgb_t(0x7E,0xE0,0xB9), \
783    rgb_t(0x8F,0xF1,0xCA), rgb_t(0xA0,0xFF,0xDA), rgb_t(0xB1,0xFF,0xE6), rgb_t(0xC2,0xFF,0xF2   )
784784
785785#define NTSC_GREEN \
786   rgb_t(0x00,0x27,0x0C), rgb_t(0x00,0x38,0x11), rgb_t(0x00,0x49,0x16), rgb_t(0x04,0x5A,0x1A), \
787   rgb_t(0x15,0x6B,0x1A), rgb_t(0x26,0x7C,0x22), rgb_t(0x37,0x8D,0x33), rgb_t(0x48,0x9E,0x44), \
788   rgb_t(0x59,0xAF,0x55), rgb_t(0x6A,0xC0,0x66), rgb_t(0x7B,0xD1,0x77), rgb_t(0x8C,0xE2,0x88), \
789   rgb_t(0x9D,0xF3,0x99), rgb_t(0xAE,0xFF,0xA8), rgb_t(0xBF,0xFF,0xB4), rgb_t(0xD0,0xFF,0xC0   )
786    rgb_t(0x00,0x27,0x0C), rgb_t(0x00,0x38,0x11), rgb_t(0x00,0x49,0x16), rgb_t(0x04,0x5A,0x1A), \
787    rgb_t(0x15,0x6B,0x1A), rgb_t(0x26,0x7C,0x22), rgb_t(0x37,0x8D,0x33), rgb_t(0x48,0x9E,0x44), \
788    rgb_t(0x59,0xAF,0x55), rgb_t(0x6A,0xC0,0x66), rgb_t(0x7B,0xD1,0x77), rgb_t(0x8C,0xE2,0x88), \
789    rgb_t(0x9D,0xF3,0x99), rgb_t(0xAE,0xFF,0xA8), rgb_t(0xBF,0xFF,0xB4), rgb_t(0xD0,0xFF,0xC0   )
790790
791791#define NTSC_YELLOW_GREEN \
792   rgb_t(0x00,0x21,0x0A), rgb_t(0x00,0x32,0x0F), rgb_t(0x0A,0x43,0x11), rgb_t(0x1B,0x54,0x11), \
793   rgb_t(0x2C,0x65,0x11), rgb_t(0x3D,0x76,0x11), rgb_t(0x4E,0x87,0x11), rgb_t(0x5F,0x98,0x1E), \
794   rgb_t(0x70,0xA9,0x2F), rgb_t(0x81,0xBA,0x40), rgb_t(0x92,0xCB,0x51), rgb_t(0xA3,0xDC,0x62), \
795   rgb_t(0xB4,0xED,0x73), rgb_t(0xC5,0xFE,0x84), rgb_t(0xD6,0xFF,0x90), rgb_t(0xE7,0xFF,0x9C   )
792    rgb_t(0x00,0x21,0x0A), rgb_t(0x00,0x32,0x0F), rgb_t(0x0A,0x43,0x11), rgb_t(0x1B,0x54,0x11), \
793    rgb_t(0x2C,0x65,0x11), rgb_t(0x3D,0x76,0x11), rgb_t(0x4E,0x87,0x11), rgb_t(0x5F,0x98,0x1E), \
794    rgb_t(0x70,0xA9,0x2F), rgb_t(0x81,0xBA,0x40), rgb_t(0x92,0xCB,0x51), rgb_t(0xA3,0xDC,0x62), \
795    rgb_t(0xB4,0xED,0x73), rgb_t(0xC5,0xFE,0x84), rgb_t(0xD6,0xFF,0x90), rgb_t(0xE7,0xFF,0x9C   )
796796
797797#define NTSC_ORANGE_GREEN \
798   rgb_t(0x05,0x13,0x04), rgb_t(0x16,0x24,0x04), rgb_t(0x27,0x35,0x04), rgb_t(0x38,0x46,0x04), \
799   rgb_t(0x49,0x57,0x04), rgb_t(0x5A,0x68,0x04), rgb_t(0x6B,0x79,0x04), rgb_t(0x7C,0x8A,0x09), \
800   rgb_t(0x8D,0x9B,0x1A), rgb_t(0x9E,0xAC,0x2B), rgb_t(0xAF,0xBD,0x3C), rgb_t(0xC0,0xCE,0x4D), \
801   rgb_t(0xD1,0xDF,0x5E), rgb_t(0xE2,0xF0,0x6F), rgb_t(0xF3,0xFF,0x80), rgb_t(0xFF,0xFF,0x8D   )
798    rgb_t(0x05,0x13,0x04), rgb_t(0x16,0x24,0x04), rgb_t(0x27,0x35,0x04), rgb_t(0x38,0x46,0x04), \
799    rgb_t(0x49,0x57,0x04), rgb_t(0x5A,0x68,0x04), rgb_t(0x6B,0x79,0x04), rgb_t(0x7C,0x8A,0x09), \
800    rgb_t(0x8D,0x9B,0x1A), rgb_t(0x9E,0xAC,0x2B), rgb_t(0xAF,0xBD,0x3C), rgb_t(0xC0,0xCE,0x4D), \
801    rgb_t(0xD1,0xDF,0x5E), rgb_t(0xE2,0xF0,0x6F), rgb_t(0xF3,0xFF,0x80), rgb_t(0xFF,0xFF,0x8D   )
802802
803803#define NTSC_LIGHT_ORANGE \
804   rgb_t(0x21,0x02,0x00), rgb_t(0x32,0x13,0x00), rgb_t(0x43,0x24,0x00), rgb_t(0x54,0x35,0x00), \
805   rgb_t(0x65,0x46,0x00), rgb_t(0x76,0x57,0x00), rgb_t(0x87,0x68,0x00), rgb_t(0x98,0x79,0x0C), \
806   rgb_t(0xA9,0x8A,0x1D), rgb_t(0xBA,0x9B,0x2E), rgb_t(0xCB,0xAC,0x3F), rgb_t(0xDC,0xBD,0x50), \
807   rgb_t(0xED,0xCE,0x61), rgb_t(0xFE,0xDF,0x72), rgb_t(0xFF,0xF0,0x87), rgb_t(0xFF,0xFF,0x9D   )
804    rgb_t(0x21,0x02,0x00), rgb_t(0x32,0x13,0x00), rgb_t(0x43,0x24,0x00), rgb_t(0x54,0x35,0x00), \
805    rgb_t(0x65,0x46,0x00), rgb_t(0x76,0x57,0x00), rgb_t(0x87,0x68,0x00), rgb_t(0x98,0x79,0x0C), \
806    rgb_t(0xA9,0x8A,0x1D), rgb_t(0xBA,0x9B,0x2E), rgb_t(0xCB,0xAC,0x3F), rgb_t(0xDC,0xBD,0x50), \
807    rgb_t(0xED,0xCE,0x61), rgb_t(0xFE,0xDF,0x72), rgb_t(0xFF,0xF0,0x87), rgb_t(0xFF,0xFF,0x9D   )
808808***************************************************************************/
809809
810810
trunk/src/mess/drivers/mac.c
r29404r29405
946946
947947   MCFG_DEVICE_ADD("scc", SCC8530, C7M)
948948   MCFG_Z8530_INTRQ_CALLBACK(WRITELINE(mac_state, set_scc_interrupt))
949   
949
950950   MCFG_DEVICE_ADD("via6522_0", VIA6522, 1000000)
951951   MCFG_VIA6522_READPA_HANDLER(READ8(mac_state,mac_via_in_a))
952952   MCFG_VIA6522_READPB_HANDLER(READ8(mac_state,mac_via_in_b))
r29404r29405
955955   MCFG_VIA6522_CB2_HANDLER(WRITELINE(mac_state,mac_via_out_cb2))
956956   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(mac_state,mac_via_irq))
957957
958    MCFG_MACKBD_ADD(MACKBD_TAG)
958   MCFG_MACKBD_ADD(MACKBD_TAG)
959959#ifdef MAC_USE_EMULATED_KBD
960960   MCFG_MACKBD_DATAOUT_HANDLER(DEVWRITELINE("via6522_0", via6522_device, write_cb2))
961961   MCFG_MACKBD_CLKOUT_HANDLER(WRITELINE(mac_state, mac_kbd_clk_in))
r29404r29405
15651565   MCFG_SCREEN_SIZE(700, 480)
15661566   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
15671567   MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macpb160)
1568   MCFG_SCREEN_PALETTE("palette")   
1568   MCFG_SCREEN_PALETTE("palette")
15691569
15701570   MCFG_PALETTE_ADD("palette", 16)
15711571   MCFG_PALETTE_INIT_OWNER(mac_state,macgsc)
r29404r29405
16971697   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
16981698   MCFG_SCREEN_SIZE(640, 870)
16991699   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
1700   MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macrbv)   
1700   MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macrbv)
17011701   MCFG_DEFAULT_LAYOUT(layout_mac)
17021702
17031703   /* internal ram */
r29404r29405
18251825   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1260))
18261826   MCFG_SCREEN_SIZE(1152, 870)
18271827   MCFG_SCREEN_VISIBLE_AREA(0, 1152-1, 0, 870-1)
1828   MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macdafb)   
1828   MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macdafb)
18291829
18301830   MCFG_VIDEO_START_OVERRIDE(mac_state,macdafb)
18311831   MCFG_VIDEO_RESET_OVERRIDE(mac_state,macdafb)
trunk/src/mess/drivers/multi16.c
r29404r29405
1818   m_maincpu(*this, "maincpu"),
1919   m_pic(*this, "pic8259"),
2020   m_crtc(*this, "crtc"),
21      m_palette(*this, "palette")
21      m_palette(*this, "palette")
2222   ,
2323      m_p_vram(*this, "p_vram"){ }
2424
r29404r29405
171171   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
172172   MCFG_SCREEN_UPDATE_DRIVER(multi16_state, screen_update_multi16)
173173   MCFG_SCREEN_PALETTE("palette")
174   
174
175175   MCFG_PALETTE_ADD("palette", 8)
176176
177177   /* Devices */
trunk/src/mess/drivers/kaypro.c
r29404r29405
210210   MCFG_VIDEO_START_OVERRIDE(kaypro_state, kaypro )
211211   MCFG_SCREEN_UPDATE_DRIVER(kaypro_state, screen_update_kayproii)
212212   MCFG_SCREEN_PALETTE("palette")
213   
213
214214   MCFG_GFXDECODE_ADD("gfxdecode", "palette", kayproii)
215215   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
216216
r29404r29405
266266   MCFG_SCREEN_SIZE(80*8, 25*16)
267267   MCFG_SCREEN_VISIBLE_AREA(0,80*8-1,0,25*16-1)
268268   MCFG_VIDEO_START_OVERRIDE(kaypro_state, kaypro )
269   MCFG_SCREEN_UPDATE_DRIVER(kaypro_state, screen_update_kaypro2x)   
270   
269   MCFG_SCREEN_UPDATE_DRIVER(kaypro_state, screen_update_kaypro2x)
270
271271   MCFG_GFXDECODE_ADD("gfxdecode", "palette", kaypro2x)
272272   MCFG_PALETTE_ADD("palette", 3)
273273   MCFG_PALETTE_INIT_OWNER(kaypro_state,kaypro)
trunk/src/mess/drivers/ip20.c
r29404r29405
601601   MCFG_SPEAKER_STANDARD_MONO("mono")
602602
603603   MCFG_DEVICE_ADD("scc", SCC8530, 7000000)
604   
604
605605   MCFG_DEVICE_ADD("sgi_mc", SGI_MC, 0)
606606
607607   MCFG_SCSIBUS_ADD("scsi")
trunk/src/mess/drivers/pc8001.c
r29404r29405
547547   MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
548548   MCFG_I8257_ADD(I8257_TAG, 4000000, dmac_intf)
549549   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, NULL, NULL)
550   
550
551551   MCFG_DEVICE_ADD(UPD3301_TAG, UPD3301, 14318180)
552552   MCFG_UPD3301_CHARACTER_WIDTH(8)
553553   MCFG_UPD3301_DRAW_CHARACTER_CALLBACK_OWNER(pc8001_state, pc8001_display_pixels)
trunk/src/mess/drivers/pc8801.c
r29404r29405
310310         m_beeper(*this, "beeper"),
311311         m_opna(*this, "opna"),
312312         m_opn(*this, "opn"),
313         m_palette(*this, "palette")
313         m_palette(*this, "palette")
314314   { }
315315
316316   required_device<cpu_device> m_maincpu;
r29404r29405
322322   required_device<ym2608_device> m_opna;
323323   required_device<ym2203_device> m_opn;
324324   required_device<palette_device> m_palette;
325   
325
326326   UINT8 *m_work_ram;
327327   UINT8 *m_hi_work_ram;
328328   UINT8 *m_ext_work_ram;
r29404r29405
26442644   MCFG_I8255_ADD( "d8255_slave", slave_fdd_intf )
26452645
26462646   MCFG_UPD765A_ADD("upd765", true, true)
2647    MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0))
2647   MCFG_UPD765_INTRQ_CALLBACK(INPUTLINE("fdccpu", INPUT_LINE_IRQ0))
26482648
26492649   #ifdef USE_PROPER_I8214
26502650   MCFG_I8214_ADD(I8214_TAG, MASTER_CLOCK, pic_intf)
trunk/src/mess/drivers/pocketc.c
r29404r29405
769769   MCFG_SC61860_READ_B_HANDLER(READ8(pc1251_state,pc1251_inb))
770770   MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1251_state,pc1251_outb))
771771   MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1251_state,pc1251_outc))
772   
772
773773   /* video hardware */
774774   MCFG_SCREEN_MODIFY("screen")
775775   MCFG_SCREEN_SIZE(608, 300)
trunk/src/mess/drivers/argo.c
r29404r29405
359359   MCFG_SCREEN_SIZE(640, 250)
360360   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
361361   MCFG_SCREEN_PALETTE("palette")
362   
362
363363   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
364364MACHINE_CONFIG_END
365365
trunk/src/mess/drivers/bmjr.c
r29404r29405
360360   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 192-1)
361361   MCFG_SCREEN_UPDATE_DRIVER(bmjr_state, screen_update_bmjr)
362362   MCFG_SCREEN_PALETTE("palette")
363   
363
364364   MCFG_PALETTE_ADD("palette", 8)
365365   MCFG_PALETTE_INIT_OWNER(bmjr_state, bmjr)
366366   MCFG_GFXDECODE_ADD("gfxdecode", "palette", bmjr)
trunk/src/mess/drivers/asst128.c
r29404r29405
104104DEVICE_INPUT_DEFAULTS_END
105105
106106static MACHINE_CONFIG_START( asst128, asst128_state )
107   MCFG_CPU_ADD("maincpu", I8086, 4772720)
107   MCFG_CPU_ADD("maincpu", I8086, 4772720)
108108   MCFG_CPU_PROGRAM_MAP(asst128_map)
109109   MCFG_CPU_IO_MAP(asst128_io)
110110
r29404r29405
148148ROM_END
149149
150150/*    YEAR  NAME        PARENT      COMPAT      MACHINE     INPUT       INIT        COMPANY            FULLNAME */
151COMP( 198?, asst128,    ibm5150,    0,          asst128,    0,      driver_device, 0,   "Schetmash", "Assistent 128", GAME_NOT_WORKING)
No newline at end of file
151COMP( 198?, asst128,    ibm5150,    0,          asst128,    0,      driver_device, 0,   "Schetmash", "Assistent 128", GAME_NOT_WORKING)
trunk/src/mess/drivers/dm7000.c
r29404r29405
256256   dcr[DCRSTB045_DISP_MODE] = 0x00880000;
257257   dcr[DCRSTB045_FRAME_BUFR_BASE] = 0x0f000000;
258258   m_scc0_lsr = UART_LSR_THRE | UART_LSR_TEMT;
259   
259
260260   ppc4xx_set_dcr_read_handler(m_maincpu, read32_delegate(FUNC(dm7000_state::dcr_r),this));
261261   ppc4xx_set_dcr_write_handler(m_maincpu, write32_delegate(FUNC(dm7000_state::dcr_w),this));
262262}
trunk/src/mess/drivers/msx.c
r29404r29405
10291029
10301030static const ay8910_interface msx_ay8910_interface =
10311031{
1032    AY8910_SINGLE_OUTPUT,
1032   AY8910_SINGLE_OUTPUT,
10331033   AY8910_DEFAULT_LOADS,
10341034   DEVCB_DRIVER_MEMBER(msx_state, msx_psg_port_a_r),
10351035   DEVCB_DRIVER_MEMBER(msx_state, msx_psg_port_b_r),
r29404r29405
11911191   MCFG_SCREEN_UPDATE_DEVICE("v9938", v9938_device, screen_update)
11921192   MCFG_SCREEN_SIZE(MSX2_TOTAL_XRES_PIXELS, 262*2)
11931193   MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1)
1194   MCFG_SCREEN_PALETTE("v9938:palette")   
1194   MCFG_SCREEN_PALETTE("v9938:palette")
11951195
11961196   /* sound hardware */
11971197   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/beehive.c
r29404r29405
300300   MCFG_SCREEN_SIZE(640, 250)
301301   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
302302   MCFG_SCREEN_PALETTE("palette")
303   
303
304304   MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
305305MACHINE_CONFIG_END
306306
trunk/src/mess/drivers/tavernie.c
r29404r29405
106106   optional_device<beep_device> m_beep;
107107   required_device<cpu_device> m_maincpu;
108108   required_device<acia6850_device> m_acia;
109public:   
109public:
110110   optional_device<palette_device> m_palette;
111111};
112112
trunk/src/mess/drivers/z1013.c
r29404r29405
409409   MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1)
410410   MCFG_SCREEN_UPDATE_DRIVER(z1013_state, screen_update_z1013)
411411   MCFG_SCREEN_PALETTE("palette")
412   
412
413413   MCFG_GFXDECODE_ADD("gfxdecode", "palette", z1013)
414414   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
415415
trunk/src/mess/drivers/sbrain.c
r29404r29405
6161      m_vs(*this, "VS"),
6262      m_bankr0(*this, "bankr0"),
6363      m_bankw0(*this, "bankw0"),
64      m_bank2(*this, "bank2")   {}
64      m_bank2(*this, "bank2") {}
6565
6666public:
6767   const UINT8 *m_p_chargen;
r29404r29405
340340   MCFG_SCREEN_SIZE(640, 240)
341341   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
342342   MCFG_SCREEN_PALETTE("palette")
343   
343
344344   MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
345345
346346   /* sound hardware */
trunk/src/mess/drivers/trs80.c
r29404r29405
641641   MCFG_MACHINE_RESET_OVERRIDE(trs80_state, trs80m4 )
642642
643643   MCFG_GFXDECODE_MODIFY("gfxdecode",trs80m4)
644   
644
645645   MCFG_SCREEN_MODIFY("screen")
646646   MCFG_SCREEN_UPDATE_DRIVER(trs80_state, screen_update_trs80m4)
647647   MCFG_SCREEN_SIZE(80*8, 240)
r29404r29405
676676   MCFG_MACHINE_RESET_OVERRIDE(trs80_state, lnw80 )
677677
678678   MCFG_GFXDECODE_MODIFY("gfxdecode",lnw80)
679   
679
680680   MCFG_PALETTE_MODIFY("palette")
681681   MCFG_PALETTE_ENTRIES(8)
682682   MCFG_PALETTE_INIT_OWNER(trs80_state,lnw80)
trunk/src/mess/drivers/fanucspmg.c
r29404r29405
400400              |      /-->| Graphic memory|------|                             |
401401              |      |   |---------------|      |                             |     |----------------|
402402              |      |                          |         |--------|          |<--->|RS232C interface|---CN2
403              |       |                            |         | BOOT   |<-------->|     |----------------|
403              |      |                            |         | BOOT   |<-------->|     |----------------|
404404              |      |                          |         | EPROM  |          |
405405              |      |   |----------------|     |         |--------|          |     |----------------|
406406              |<-----|-->|Character memory|--|  |                             |<--->|RS232C interface|---CN3
407407              |      |-->|----------------|  |  |         |--------|          |     |----------------|
408408              |      |                       |  |         |Main RAM|<-------->|
409409              |      |                       |  |         |--------|          |     |----------------|
410              |      |                        |  |                             |<--->|RS232C interface|---CN4
410              |      |                       |  |                             |<--->|RS232C interface|---CN4
411411              |      |                       |  |                             |     |----------------|
412412|---------|   |      |                       \/ \/                            |
413413|Keyboard |   \/     \---|---------------------------|                        |     |-----------------|  CN9  |--------|
r29404r29405
421421 |---|----|                       |----|----|
422422 |Keyboard|                       | Screen  |
423423 |--------|                       |---------|
424 
425 
424
425
426426  TODO:
427427    - Is the VRAM hookup anything like correct?
428428    - Hookup enough keyboard to get it to boot a floppy, the FAPT DOCTOR
r29404r29405
430430    - Shared RAM is 8k, but there are 2 6264s on the sub board.  Is shared RAM
431431       banked?
432432    - I/O is at F00xx:
433      ':maincpu' (FC15A): unmapped program memory write to F0012 = 00CE & 00FF
434      ':maincpu' (FC15D): unmapped program memory write to F0016 = 00CE & 00FF
435      ':maincpu' (FC160): unmapped program memory write to F001A = 00CE & 00FF
436      ':maincpu' (FC163): unmapped program memory write to F001E = 00CE & 00FF
437      ':maincpu' (FC16D): unmapped program memory write to F000E = 0034 & 00FF
438      ':maincpu' (FC172): unmapped program memory write to F0008 = 00D4 & 00FF
439      ':maincpu' (FC177): unmapped program memory write to F0008 = 0030 & 00FF
440      ':maincpu' (FC17C): unmapped program memory write to F000E = 0056 & 00FF
441      ':maincpu' (FC181): unmapped program memory write to F000A = 0010 & 00FF
442      ':maincpu' (FC186): unmapped program memory write to F000E = 0096 & 00FF
443      ':maincpu' (FC18B): unmapped program memory write to F000C = 0010 & 00FF
444      ':maincpu' (FC190): unmapped program memory write to F004E = 0034 & 00FF
445      ':maincpu' (FC195): unmapped program memory write to F0048 = 0020 & 00FF
446      ':maincpu' (FC19A): unmapped program memory write to F0048 = 004E & 00FF
447      ':maincpu' (FC19F): unmapped program memory write to F004E = 0056 & 00FF
448      ':maincpu' (FC1A4): unmapped program memory write to F004A = 0010 & 00FF
449      ':maincpu' (FC1A9): unmapped program memory write to F004E = 0096 & 00FF
450      ':maincpu' (FC1AE): unmapped program memory write to F004C = 0010 & 00FF
451 
433        ':maincpu' (FC15A): unmapped program memory write to F0012 = 00CE & 00FF
434        ':maincpu' (FC15D): unmapped program memory write to F0016 = 00CE & 00FF
435        ':maincpu' (FC160): unmapped program memory write to F001A = 00CE & 00FF
436        ':maincpu' (FC163): unmapped program memory write to F001E = 00CE & 00FF
437        ':maincpu' (FC16D): unmapped program memory write to F000E = 0034 & 00FF
438        ':maincpu' (FC172): unmapped program memory write to F0008 = 00D4 & 00FF
439        ':maincpu' (FC177): unmapped program memory write to F0008 = 0030 & 00FF
440        ':maincpu' (FC17C): unmapped program memory write to F000E = 0056 & 00FF
441        ':maincpu' (FC181): unmapped program memory write to F000A = 0010 & 00FF
442        ':maincpu' (FC186): unmapped program memory write to F000E = 0096 & 00FF
443        ':maincpu' (FC18B): unmapped program memory write to F000C = 0010 & 00FF
444        ':maincpu' (FC190): unmapped program memory write to F004E = 0034 & 00FF
445        ':maincpu' (FC195): unmapped program memory write to F0048 = 0020 & 00FF
446        ':maincpu' (FC19A): unmapped program memory write to F0048 = 004E & 00FF
447        ':maincpu' (FC19F): unmapped program memory write to F004E = 0056 & 00FF
448        ':maincpu' (FC1A4): unmapped program memory write to F004A = 0010 & 00FF
449        ':maincpu' (FC1A9): unmapped program memory write to F004E = 0096 & 00FF
450        ':maincpu' (FC1AE): unmapped program memory write to F004C = 0010 & 00FF
451
452452****************************************************************************/
453453
454454#include "emu.h"
r29404r29405
464464#include "video/mc6845.h"
465465#include "formats/imd_dsk.h"
466466
467#define MAINCPU_TAG   "maincpu"
468#define SUBCPU_TAG   "subcpu"
469#define USART0_TAG   "usart0"
470#define USART1_TAG   "usart1"
471#define USART2_TAG   "usart2"
472#define USART3_TAG   "usart3"
473#define PIT0_TAG   "pit0"
474#define PIT1_TAG   "pit1"
475#define PIC0_TAG      "pic0"
476#define PIC1_TAG      "pic1"
477#define DMAC_TAG   "dmac"
478#define CRTC_TAG   "crtc"
479#define FDC_TAG      "fdc"
480#define SCREEN_TAG   "screen"
481#define SHARED_TAG   "shared"
482#define CHARGEN_TAG   "chargen"
467#define MAINCPU_TAG "maincpu"
468#define SUBCPU_TAG  "subcpu"
469#define USART0_TAG  "usart0"
470#define USART1_TAG  "usart1"
471#define USART2_TAG  "usart2"
472#define USART3_TAG  "usart3"
473#define PIT0_TAG    "pit0"
474#define PIT1_TAG    "pit1"
475#define PIC0_TAG    "pic0"
476#define PIC1_TAG    "pic1"
477#define DMAC_TAG    "dmac"
478#define CRTC_TAG    "crtc"
479#define FDC_TAG     "fdc"
480#define SCREEN_TAG  "screen"
481#define SHARED_TAG  "shared"
482#define CHARGEN_TAG "chargen"
483483
484484class fanucspmg_state : public driver_device
485485{
r29404r29405
577577
578578READ8_MEMBER(fanucspmg_state::test_r)
579579{
580   return 0x00;   // 0x80 to start weird not-sure-what process which may be FDC related
580   return 0x00;    // 0x80 to start weird not-sure-what process which may be FDC related
581581}
582582
583583READ8_MEMBER(fanucspmg_state::vbl_r)
r29404r29405
586586}
587587
588588static ADDRESS_MAP_START(maincpu_mem, AS_PROGRAM, 16, fanucspmg_state)
589   AM_RANGE(0x00000, 0x7ffff) AM_RAM   // main RAM
589   AM_RANGE(0x00000, 0x7ffff) AM_RAM   // main RAM
590590
591591   AM_RANGE(0x88000, 0x88001) AM_READ8(vbl_r, 0xffff)
592592
593593   AM_RANGE(0xf0004, 0xf0005) AM_READ8(test_r, 0xffff)
594594
595595   AM_RANGE(0xf8000, 0xf9fff) AM_READWRITE8(shared_r, shared_w, 0xffff)
596   AM_RANGE(0xfc000, 0xfffff) AM_ROM AM_REGION(MAINCPU_TAG, 0)
596   AM_RANGE(0xfc000, 0xfffff) AM_ROM AM_REGION(MAINCPU_TAG, 0)
597597ADDRESS_MAP_END
598598
599599static ADDRESS_MAP_START(maincpu_io, AS_IO, 16, fanucspmg_state)
r29404r29405
603603{
604604   if ((m_vbl_ctrl & 0x08) == 0x08)
605605   {
606      if (state == ASSERT_LINE)
606      if (state == ASSERT_LINE)
607607      {
608608         m_subcpu->set_input_line(I8085_RST75_LINE, ASSERT_LINE);
609609      }
r29404r29405
672672   AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION(SUBCPU_TAG, 0)
673673
674674   AM_RANGE(0x4000, 0x45ff) AM_READWRITE(vram1_r, vram1_w)
675   AM_RANGE(0x4800, 0x4dff) AM_READWRITE(vram2_r, vram2_w)
675   AM_RANGE(0x4800, 0x4dff) AM_READWRITE(vram2_r, vram2_w)
676676
677677   AM_RANGE(0x5000, 0x5000) AM_DEVREADWRITE(CRTC_TAG, mc6845_device, status_r, address_w)
678678   AM_RANGE(0x5001, 0x5001) AM_DEVREADWRITE(CRTC_TAG, mc6845_device, register_r, register_w)
679679   AM_RANGE(0x5008, 0x5008) AM_WRITE(keyboard_row_w)
680680   AM_RANGE(0x5009, 0x5009) AM_READ(keyboard_r)
681   AM_RANGE(0x500a, 0x500b) AM_WRITENOP   // probably keyboard related, not sure how though
681   AM_RANGE(0x500a, 0x500b) AM_WRITENOP    // probably keyboard related, not sure how though
682682   AM_RANGE(0x500c, 0x500c) AM_WRITE(vbl_ctrl_w)
683683   AM_RANGE(0x500d, 0x500d) AM_WRITE(vram_bank_w)
684684   AM_RANGE(0x500e, 0x500e) AM_READ(vblank_ack_r)
685   AM_RANGE(0x5018, 0x5018) AM_WRITE(video_ctrl_w)
685   AM_RANGE(0x5018, 0x5018) AM_WRITE(video_ctrl_w)
686686
687   AM_RANGE(0xe000, 0xffff) AM_RAM   AM_SHARE(SHARED_TAG) // shared RAM
687   AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE(SHARED_TAG) // shared RAM
688688ADDRESS_MAP_END
689689
690690/* Input ports */
r29404r29405
752752            *p++ = ( data & 0x01 ) ? fg : bg;
753753            *p++ = ( data & 0x02 ) ? fg : bg;
754754            *p++ = ( data & 0x04 ) ? fg : bg;
755            *p++ = ( data & 0x08 ) ? fg : bg;                       
756            *p++ = ( data & 0x10 ) ? fg : bg;                       
755            *p++ = ( data & 0x08 ) ? fg : bg;
756            *p++ = ( data & 0x10 ) ? fg : bg;
757757            *p++ = ( data & 0x20 ) ? fg : bg;
758758            *p++ = ( data & 0x40 ) ? fg : bg;
759759            *p++ = ( data & 0x80 ) ? fg : bg;
r29404r29405
784784   DEVCB_NULL,         /* on_de_changed */
785785   DEVCB_NULL,         /* on_cur_changed */
786786   DEVCB_NULL,         /* on hsync changed */
787   DEVCB_DRIVER_LINE_MEMBER(fanucspmg_state, vsync_w),   /* on vsync changed */
787   DEVCB_DRIVER_LINE_MEMBER(fanucspmg_state, vsync_w), /* on vsync changed */
788788   NULL
789789};
790790
r29404r29405
838838/* ROM definition */
839839ROM_START( fanucspg )
840840   ROM_REGION(0x4000, MAINCPU_TAG, 0)
841   ROM_LOAD16_BYTE( "a40_001a.13a", 0x000000, 0x002000, CRC(1b8ac8ef) SHA1(309c081d25270e082ebf846b4f73cef76b52d991) )
842   ROM_LOAD16_BYTE( "a40_002a.15a", 0x000001, 0x002000, CRC(587ae652) SHA1(ebc5a4c3d64ab9d6dd4d5355f85bc894e7294e17) )
841   ROM_LOAD16_BYTE( "a40_001a.13a", 0x000000, 0x002000, CRC(1b8ac8ef) SHA1(309c081d25270e082ebf846b4f73cef76b52d991) )
842   ROM_LOAD16_BYTE( "a40_002a.15a", 0x000001, 0x002000, CRC(587ae652) SHA1(ebc5a4c3d64ab9d6dd4d5355f85bc894e7294e17) )
843843
844844   ROM_REGION(0x4000, SUBCPU_TAG, 0)
845   ROM_LOAD( "a41_010b.28b", 0x000000, 0x004000, CRC(35a9714f) SHA1(5697b6c4db5adb5702dc1290ecc98758d5fab221) )
845   ROM_LOAD( "a41_010b.28b", 0x000000, 0x004000, CRC(35a9714f) SHA1(5697b6c4db5adb5702dc1290ecc98758d5fab221) )
846846
847847   ROM_REGION(0x8000, CHARGEN_TAG, 0)
848   ROM_LOAD( "a42_020a.30b", 0x000000, 0x008000, CRC(33eb5962) SHA1(1157a72089ff77e8db9a9a8fcd0f6c32a1374f56) )
848   ROM_LOAD( "a42_020a.30b", 0x000000, 0x008000, CRC(33eb5962) SHA1(1157a72089ff77e8db9a9a8fcd0f6c32a1374f56) )
849849ROM_END
850850
851851/* Driver */
852852/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT      CLASS           INIT       COMPANY  FULLNAME            FLAGS */
853853COMP( 1983, fanucspg, 0,      0,    fanucspmg, fanucspmg, fanucspmg_state, fanucspmg, "Fanuc", "System P Model G", GAME_NOT_WORKING | GAME_NO_SOUND)
854
855
trunk/src/mess/drivers/thomson.c
r29404r29405
566566
567567WRITE_LINE_MEMBER( thomson_state::fdc_index_0_w )
568568{
569  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_0), state);
569   thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_0), state);
570570}
571571
572572WRITE_LINE_MEMBER( thomson_state::fdc_index_1_w )
573573{
574  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_1), state);
574   thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_1), state);
575575}
576576
577577WRITE_LINE_MEMBER( thomson_state::fdc_index_2_w )
578578{
579  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_2), state);
579   thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_2), state);
580580}
581581
582582WRITE_LINE_MEMBER( thomson_state::fdc_index_3_w )
583583{
584  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_3), state);
584   thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_3), state);
585585}
586586
587587static const floppy_interface thomson_floppy_interface_0 =
r29404r29405
956956
957957   MCFG_DEVICE_MODIFY("mc6846")
958958   MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to770_timer_port_out))
959   
959
960960   MCFG_CARTSLOT_MODIFY("cart")
961961   MCFG_CARTSLOT_INTERFACE("to770_cart")
962962   MCFG_DEVICE_REMOVE("cart_list")
r29404r29405
18781878   MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to9p_timer_port_out))
18791879   MCFG_MC6846_OUT_CP2_CB(WRITE8(thomson_state, to8_timer_cp2_out))
18801880   MCFG_MC6846_IN_PORT_CB(READ8(thomson_state, to9p_timer_port_in))
1881   
1881
18821882   /* internal ram */
18831883   MCFG_RAM_MODIFY(RAM_TAG)
18841884   MCFG_RAM_DEFAULT_SIZE("512K")
r29404r29405
19651965   AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE(to7_midi_r, to7_midi_w )
19661966   AM_RANGE ( 0xa7fe, 0xa7ff ) AM_DEVREADWRITE("mea8000", mea8000_device, read, write)
19671967   AM_RANGE ( 0xb000, 0xbfff ) AM_ROMBANK   ( MO6_CART_LO )
1968                AM_WRITE     ( mo6_cartridge_w )
1968               AM_WRITE     ( mo6_cartridge_w )
19691969   AM_RANGE ( 0xc000, 0xefff ) AM_ROMBANK   ( MO6_CART_HI )
1970                AM_WRITE     ( mo6_cartridge_w )
1970               AM_WRITE     ( mo6_cartridge_w )
19711971   AM_RANGE ( 0xf000, 0xffff ) AM_ROMBANK   ( TO8_BIOS_BANK )
19721972
19731973/* 0x10000 - 0x1ffff: 64 KB external ROM cartridge */
r29404r29405
22952295   AM_RANGE ( 0xa7f8, 0xa7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt)
22962296   AM_RANGE ( 0xa7fe, 0xa7ff ) AM_DEVREADWRITE("mea8000", mea8000_device, read, write)
22972297   AM_RANGE ( 0xb000, 0xbfff ) AM_ROMBANK   ( MO6_CART_LO )
2298                AM_WRITE     ( mo6_cartridge_w )
2298               AM_WRITE     ( mo6_cartridge_w )
22992299   AM_RANGE ( 0xc000, 0xefff ) AM_ROMBANK   ( MO6_CART_HI )
2300                AM_WRITE     ( mo6_cartridge_w )
2300               AM_WRITE     ( mo6_cartridge_w )
23012301   AM_RANGE ( 0xf000, 0xffff ) AM_ROMBANK   ( TO8_BIOS_BANK )
23022302
23032303/* 0x10000 - 0x1ffff: 64 KB external ROM cartridge */
trunk/src/mess/drivers/lcmate2.c
r29404r29405
235235   MCFG_SCREEN_SIZE(120, 18)
236236   MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18-1)
237237   MCFG_SCREEN_PALETTE("palette")
238   
238
239239   MCFG_PALETTE_ADD("palette", 2)
240240   MCFG_PALETTE_INIT_OWNER(lcmate2_state, lcmate2)
241241   MCFG_DEFAULT_LAYOUT(layout_lcd)
trunk/src/mess/drivers/mbee.c
r29404r29405
793793   MCFG_SCREEN_UPDATE_DRIVER(mbee_state, screen_update_mbee)
794794
795795   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mbeeic)
796   
796
797797   MCFG_PALETTE_ADD("palette", 96)
798798   MCFG_PALETTE_INIT_OWNER(mbee_state,mbeeic)
799799
trunk/src/mess/drivers/ymmu100.c
r29404r29405
7979        16 7 mode
8080        15 7 eq
8181        14 7 exit
82        10 7 value -
82        10 7 value -
8383        11 7 value +
8484           2 led play
8585           3 led edit
r29404r29405
452452
453453static MACHINE_CONFIG_DERIVED_CLASS( mu100r, mu100, mu100r_state )
454454MACHINE_CONFIG_END
455   
455
456456#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
457457      ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */
458
458
459459ROM_START( mu100 )
460460   ROM_REGION( 0x200000, "maincpu", 0 )
461461   ROM_SYSTEM_BIOS( 0, "bios0", "xu50720 (v1.11, Aug. 3, 1999)" )
trunk/src/mess/drivers/nanos.c
r29404r29405
570570   MCFG_SCREEN_SIZE(80*8, 25*10)
571571   MCFG_SCREEN_VISIBLE_AREA(0,80*8-1,0,25*10-1)
572572   MCFG_SCREEN_PALETTE("palette")
573   
573
574574   MCFG_GFXDECODE_ADD("gfxdecode", "palette", nanos)
575575   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
576576
trunk/src/mess/drivers/z9001.c
r29404r29405
251251   MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 24*8-1)
252252   MCFG_SCREEN_UPDATE_DRIVER(z9001_state, screen_update_z9001)
253253   MCFG_SCREEN_PALETTE("palette")
254   
254
255255   MCFG_GFXDECODE_ADD("gfxdecode", "palette", z9001)
256256   MCFG_PALETTE_ADD("palette", 16)
257257
trunk/src/mess/drivers/wswan.c
r29404r29405
135135   MCFG_SCREEN_SIZE( WSWAN_X_PIXELS, WSWAN_Y_PIXELS )
136136   MCFG_SCREEN_VISIBLE_AREA(0*8, WSWAN_X_PIXELS - 1, 0, WSWAN_Y_PIXELS - 1)
137137   MCFG_SCREEN_PALETTE("palette")
138   
138
139139   MCFG_DEFAULT_LAYOUT(layout_wswan)
140140
141141   MCFG_QUANTUM_TIME(attotime::from_hz(60))
r29404r29405
169169   MCFG_CPU_MODIFY("maincpu")
170170   MCFG_CPU_PROGRAM_MAP(wscolor_mem)
171171   MCFG_MACHINE_START_OVERRIDE(wswan_state, wscolor )
172   
172
173173   MCFG_PALETTE_MODIFY("palette")
174174   MCFG_PALETTE_ENTRIES(4096)
175175   MCFG_PALETTE_INIT_OWNER(wswan_state, wscolor )
trunk/src/mess/mess.mak
r29404r29405
17711771   $(MESS_DRIVERS)/svision.o   \
17721772   $(MESS_AUDIO)/svision.o     \
17731773
1774$(MESSOBJ)/swtpc09.a:         \
1775   $(MESS_DRIVERS)/swtpc09.o   \
1774$(MESSOBJ)/swtpc09.a:           \
1775   $(MESS_DRIVERS)/swtpc09.o   \
17761776   $(MESS_MACHINE)/swtpc09.o    \
17771777
17781778$(MESSOBJ)/synertec.a:          \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team