summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/nscsi/cd.cpp3
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.cpp19
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.h4
-rw-r--r--src/devices/bus/sms_ctrl/lphaser.cpp2
-rw-r--r--src/devices/bus/sms_ctrl/sports.cpp2
-rw-r--r--src/devices/bus/spectrum/beta.cpp138
-rw-r--r--src/devices/bus/spectrum/beta.h9
-rw-r--r--src/devices/bus/spectrum/beta128.cpp38
-rw-r--r--src/devices/bus/ti99/gromport/cartridges.cpp8
-rw-r--r--src/devices/bus/ti99/internal/genboard.cpp809
-rw-r--r--src/devices/bus/ti99/internal/genboard.h193
-rw-r--r--src/devices/bus/ti99/internal/genkbd.cpp648
-rw-r--r--src/devices/bus/ti99/internal/genkbd.h89
-rw-r--r--src/devices/cpu/drcbex64.cpp17
-rw-r--r--src/devices/cpu/hcd62121/hcd62121.cpp17
-rw-r--r--src/devices/cpu/m6805/m68hc05.cpp17
-rw-r--r--src/devices/cpu/powerpc/ppcdrc.cpp2
-rw-r--r--src/devices/cpu/rii/riidasm.cpp8
-rw-r--r--src/devices/cpu/rii/riidasm.h12
-rw-r--r--src/devices/cpu/rii/riscii.cpp879
-rw-r--r--src/devices/cpu/rii/riscii.h211
-rw-r--r--src/devices/cpu/sh/sh2.cpp89
-rw-r--r--src/devices/cpu/sh/sh4.cpp93
-rw-r--r--src/devices/cpu/tms34010/34010ops.hxx6
-rw-r--r--src/devices/imagedev/avivideo.cpp118
-rw-r--r--src/devices/imagedev/avivideo.h67
-rw-r--r--src/devices/imagedev/diablo.cpp25
-rw-r--r--src/devices/imagedev/harddriv.cpp29
-rw-r--r--src/devices/imagedev/picture.h2
-rw-r--r--src/devices/machine/28fxxx.cpp3
-rw-r--r--src/devices/machine/6532riot.cpp2
-rw-r--r--src/devices/machine/6821pia.cpp263
-rw-r--r--src/devices/machine/68561mpcc.cpp2
-rw-r--r--src/devices/machine/acorn_vidc.cpp513
-rw-r--r--src/devices/machine/acorn_vidc.h144
-rw-r--r--src/devices/machine/ds2404.cpp16
-rw-r--r--src/devices/machine/i8251.cpp2
-rw-r--r--src/devices/machine/meters.cpp2
-rw-r--r--src/devices/machine/netlist.cpp28
-rw-r--r--src/devices/machine/upd7002.cpp62
-rw-r--r--src/devices/machine/vr0uart.cpp20
-rw-r--r--src/devices/machine/vrender0.cpp20
-rw-r--r--src/devices/machine/vrender0.h22
-rw-r--r--src/devices/machine/wd1000.cpp2
-rw-r--r--src/devices/sound/2203intf.cpp3
-rw-r--r--src/devices/sound/2608intf.cpp9
-rw-r--r--src/devices/sound/2610intf.cpp7
-rw-r--r--src/devices/sound/2612intf.cpp3
-rw-r--r--src/devices/sound/262intf.cpp3
-rw-r--r--src/devices/sound/3526intf.cpp3
-rw-r--r--src/devices/sound/3812intf.cpp3
-rw-r--r--src/devices/sound/8950intf.cpp3
-rw-r--r--src/devices/sound/ay8910.cpp18
-rw-r--r--src/devices/sound/discrete.cpp6
-rw-r--r--src/devices/sound/pokey.cpp2
-rw-r--r--src/devices/sound/tiaintf.cpp3
-rw-r--r--src/devices/sound/upd7759.cpp2
-rw-r--r--src/devices/sound/ymf271.cpp2
-rw-r--r--src/devices/sound/ymf278b.cpp3
-rw-r--r--src/devices/sound/ymz280b.cpp4
-rw-r--r--src/devices/video/bt431.cpp12
-rw-r--r--src/devices/video/bt45x.cpp8
-rw-r--r--src/devices/video/gba_lcd.cpp16
-rw-r--r--src/devices/video/imagetek_i4100.cpp2
-rw-r--r--src/devices/video/mc6845.cpp4
-rw-r--r--src/devices/video/snes_ppu.cpp8
-rw-r--r--src/devices/video/voodoo.cpp3
-rw-r--r--src/devices/video/vrender0.cpp18
-rw-r--r--src/devices/video/vrender0.h20
-rw-r--r--src/emu/debug/debugcmd.cpp21
-rw-r--r--src/emu/debug/debugcon.cpp6
-rw-r--r--src/emu/diimage.cpp50
-rw-r--r--src/emu/diimage.h5
-rw-r--r--src/emu/dinetwork.cpp6
-rw-r--r--src/emu/dipalette.cpp3
-rw-r--r--src/emu/emucore.h12
-rw-r--r--src/emu/emupal.cpp9
-rw-r--r--src/emu/inputdev.cpp6
-rw-r--r--src/emu/ioport.cpp18
-rw-r--r--src/emu/machine.cpp13
-rw-r--r--src/emu/natkeyboard.h4
-rw-r--r--src/emu/render.cpp12
-rw-r--r--src/emu/screen.h1
-rw-r--r--src/emu/tilemap.cpp8
-rw-r--r--src/emu/tilemap.h4
-rw-r--r--src/emu/video/generic.cpp12
-rw-r--r--src/emu/xtal.cpp2
-rw-r--r--src/frontend/mame/mameopts.cpp2
-rw-r--r--src/lib/formats/ap2_dsk.cpp4
-rw-r--r--src/lib/netlist/build/makefile5
-rw-r--r--src/lib/netlist/devices/nld_log.cpp8
-rw-r--r--src/lib/netlist/devices/nlid_system.h2
-rw-r--r--src/lib/netlist/devices/nlid_truthtable.cpp2
-rw-r--r--src/lib/netlist/nl_base.cpp37
-rw-r--r--src/lib/netlist/nl_base.h6
-rw-r--r--src/lib/netlist/nl_errstr.h6
-rw-r--r--src/lib/netlist/nl_setup.cpp48
-rw-r--r--src/lib/netlist/nl_setup.h14
-rw-r--r--src/lib/netlist/nltypes.h2
-rw-r--r--src/lib/netlist/plib/mat_cr.h1
-rw-r--r--src/lib/netlist/plib/palloc.h4
-rw-r--r--src/lib/netlist/plib/pchrono.cpp2
-rw-r--r--src/lib/netlist/plib/pchrono.h2
-rw-r--r--src/lib/netlist/plib/pfmtlog.cpp182
-rw-r--r--src/lib/netlist/plib/pfmtlog.h109
-rw-r--r--src/lib/netlist/plib/pfunction.cpp2
-rw-r--r--src/lib/netlist/plib/pmain.cpp6
-rw-r--r--src/lib/netlist/plib/pmain.h5
-rw-r--r--src/lib/netlist/plib/pmatrix2d.h2
-rw-r--r--src/lib/netlist/plib/pmempool.h2
-rw-r--r--src/lib/netlist/plib/pomp.h3
-rw-r--r--src/lib/netlist/plib/poptions.cpp2
-rw-r--r--src/lib/netlist/plib/pparser.cpp18
-rw-r--r--src/lib/netlist/plib/pparser.h58
-rw-r--r--src/lib/netlist/plib/ppmf.h2
-rw-r--r--src/lib/netlist/plib/pstream.cpp276
-rw-r--r--src/lib/netlist/plib/pstream.h503
-rw-r--r--src/lib/netlist/plib/pstring.h40
-rw-r--r--src/lib/netlist/plib/ptime.h2
-rw-r--r--src/lib/netlist/plib/putil.cpp31
-rw-r--r--src/lib/netlist/plib/putil.h82
-rw-r--r--src/lib/netlist/plib/vector_ops.h1
-rw-r--r--src/lib/netlist/prg/nltool.cpp75
-rw-r--r--src/lib/netlist/prg/nlwav.cpp61
-rw-r--r--src/lib/netlist/solver/nld_ms_gcr.h10
-rw-r--r--src/lib/netlist/solver/nld_solver.cpp2
-rw-r--r--src/lib/netlist/tools/nl_convert.cpp66
-rw-r--r--src/lib/netlist/tools/nl_convert.h10
-rw-r--r--src/lib/util/aviio.cpp26
-rw-r--r--src/lib/util/aviio.h2
-rw-r--r--src/mame/arcade.flt2
-rw-r--r--src/mame/audio/geebee.cpp12
-rw-r--r--src/mame/audio/snes_snd.cpp5
-rw-r--r--src/mame/audio/t5182.cpp10
-rw-r--r--src/mame/audio/taito_en.cpp6
-rw-r--r--src/mame/audio/warpwarp.cpp24
-rw-r--r--src/mame/drivers/2mindril.cpp2
-rw-r--r--src/mame/drivers/4dpi.cpp33
-rw-r--r--src/mame/drivers/aa310.cpp45
-rw-r--r--src/mame/drivers/acefruit.cpp14
-rw-r--r--src/mame/drivers/alpha68k.cpp108
-rw-r--r--src/mame/drivers/amust.cpp2
-rw-r--r--src/mame/drivers/apple2e.cpp4
-rw-r--r--src/mame/drivers/argo.cpp2
-rw-r--r--src/mame/drivers/aristmk4.cpp2
-rw-r--r--src/mame/drivers/aristmk5.cpp487
-rw-r--r--src/mame/drivers/artmagic.cpp2
-rw-r--r--src/mame/drivers/asterix.cpp2
-rw-r--r--src/mame/drivers/astinvad.cpp2
-rw-r--r--src/mame/drivers/asuka.cpp2
-rw-r--r--src/mame/drivers/at.cpp300
-rw-r--r--src/mame/drivers/atarist.cpp2
-rw-r--r--src/mame/drivers/atpci.cpp1
-rw-r--r--src/mame/drivers/beezer.cpp2
-rw-r--r--src/mame/drivers/boxer.cpp2
-rw-r--r--src/mame/drivers/c10.cpp2
-rw-r--r--src/mame/drivers/c2color.cpp29
-rw-r--r--src/mame/drivers/capbowl.cpp2
-rw-r--r--src/mame/drivers/cat.cpp2
-rw-r--r--src/mame/drivers/cball.cpp2
-rw-r--r--src/mame/drivers/cbnt2039.cpp67
-rw-r--r--src/mame/drivers/cfx9850.cpp2
-rw-r--r--src/mame/drivers/cidelsa.cpp2
-rw-r--r--src/mame/drivers/clpoker.cpp19
-rw-r--r--src/mame/drivers/cps1.cpp13
-rw-r--r--src/mame/drivers/cps3.cpp414
-rw-r--r--src/mame/drivers/crospuzl.cpp70
-rw-r--r--src/mame/drivers/crystal.cpp32
-rw-r--r--src/mame/drivers/ct486.cpp1
-rw-r--r--src/mame/drivers/dec0.cpp53
-rw-r--r--src/mame/drivers/dec8.cpp2
-rw-r--r--src/mame/drivers/deco_mlc.cpp14
-rw-r--r--src/mame/drivers/dectalk.cpp2
-rw-r--r--src/mame/drivers/destroyr.cpp2
-rw-r--r--src/mame/drivers/ertictac.cpp44
-rw-r--r--src/mame/drivers/fgoal.cpp2
-rw-r--r--src/mame/drivers/firetrap.cpp249
-rw-r--r--src/mame/drivers/flyball.cpp2
-rw-r--r--src/mame/drivers/fm7.cpp2
-rw-r--r--src/mame/drivers/fuukifg2.cpp2
-rw-r--r--src/mame/drivers/fuukifg3.cpp2
-rw-r--r--src/mame/drivers/gaplus.cpp2
-rw-r--r--src/mame/drivers/geneve.cpp103
-rw-r--r--src/mame/drivers/geniusjr.cpp20
-rw-r--r--src/mame/drivers/genpc.cpp4
-rw-r--r--src/mame/drivers/gottlieb.cpp2
-rw-r--r--src/mame/drivers/gpworld.cpp2
-rw-r--r--src/mame/drivers/gunbustr.cpp2
-rw-r--r--src/mame/drivers/h01x.cpp28
-rw-r--r--src/mame/drivers/h19.cpp4
-rw-r--r--src/mame/drivers/hawk.cpp4
-rw-r--r--src/mame/drivers/hh_sm510.cpp102
-rw-r--r--src/mame/drivers/hvyunit.cpp22
-rw-r--r--src/mame/drivers/ibmpc.cpp18
-rw-r--r--src/mame/drivers/icebox.cpp14
-rw-r--r--src/mame/drivers/igspoker.cpp38
-rw-r--r--src/mame/drivers/indy_indigo2.cpp2
-rw-r--r--src/mame/drivers/intv.cpp2
-rw-r--r--src/mame/drivers/island.cpp81
-rw-r--r--src/mame/drivers/itech8.cpp2
-rw-r--r--src/mame/drivers/jclub2.cpp23
-rw-r--r--src/mame/drivers/karnov.cpp350
-rw-r--r--src/mame/drivers/kinst.cpp2
-rw-r--r--src/mame/drivers/konamim2.cpp8
-rw-r--r--src/mame/drivers/laserbat.cpp2
-rw-r--r--src/mame/drivers/laz_aftrshok.cpp130
-rw-r--r--src/mame/drivers/laz_awetoss.cpp86
-rw-r--r--src/mame/drivers/laz_ribrac.cpp315
-rw-r--r--src/mame/drivers/leapfrog_leappad.cpp27
-rw-r--r--src/mame/drivers/m10.cpp2
-rw-r--r--src/mame/drivers/mac.cpp4
-rw-r--r--src/mame/drivers/mac128.cpp2
-rw-r--r--src/mame/drivers/marineb.cpp16
-rw-r--r--src/mame/drivers/mekd2.cpp2
-rw-r--r--src/mame/drivers/mekd3.cpp1021
-rw-r--r--src/mame/drivers/mekd5.cpp2
-rw-r--r--src/mame/drivers/menghong.cpp38
-rw-r--r--src/mame/drivers/metro.cpp2
-rw-r--r--src/mame/drivers/mgolf.cpp2
-rw-r--r--src/mame/drivers/midvunit.cpp4
-rw-r--r--src/mame/drivers/mjsister.cpp2
-rw-r--r--src/mame/drivers/mlanding.cpp10
-rw-r--r--src/mame/drivers/mycom.cpp21
-rw-r--r--src/mame/drivers/namcona1.cpp8
-rw-r--r--src/mame/drivers/namcos2.cpp13
-rw-r--r--src/mame/drivers/nightmare.cpp2
-rw-r--r--src/mame/drivers/notetaker.cpp2
-rw-r--r--src/mame/drivers/okean240.cpp2
-rw-r--r--src/mame/drivers/osi.cpp2
-rw-r--r--src/mame/drivers/parodius.cpp2
-rw-r--r--src/mame/drivers/pc.cpp8
-rw-r--r--src/mame/drivers/pc88va.cpp2
-rw-r--r--src/mame/drivers/pcfx.cpp2
-rw-r--r--src/mame/drivers/pentagon.cpp2
-rw-r--r--src/mame/drivers/pk8020.cpp16
-rw-r--r--src/mame/drivers/plan80.cpp2
-rw-r--r--src/mame/drivers/pmd85.cpp8
-rw-r--r--src/mame/drivers/ps2.cpp1
-rw-r--r--src/mame/drivers/psattack.cpp10
-rw-r--r--src/mame/drivers/ptcsol.cpp2
-rw-r--r--src/mame/drivers/rabbit.cpp2
-rw-r--r--src/mame/drivers/riscpc.cpp4
-rw-r--r--src/mame/drivers/rollerg.cpp2
-rw-r--r--src/mame/drivers/saitek_mark5.cpp2
-rw-r--r--src/mame/drivers/samcoupe.cpp2
-rw-r--r--src/mame/drivers/segac2.cpp8
-rw-r--r--src/mame/drivers/segaorun.cpp2
-rw-r--r--src/mame/drivers/segas32.cpp284
-rw-r--r--src/mame/drivers/simpsons.cpp2
-rw-r--r--src/mame/drivers/slapshot.cpp2
-rw-r--r--src/mame/drivers/sm7238.cpp2
-rw-r--r--src/mame/drivers/socrates.cpp2
-rw-r--r--src/mame/drivers/spacefb.cpp2
-rw-r--r--src/mame/drivers/spartanxtec.cpp23
-rw-r--r--src/mame/drivers/spbactn.cpp10
-rw-r--r--src/mame/drivers/spectrum.cpp2
-rw-r--r--src/mame/drivers/sprint4.cpp2
-rw-r--r--src/mame/drivers/super80.cpp16
-rw-r--r--src/mame/drivers/swyft.cpp19
-rw-r--r--src/mame/drivers/symbolics.cpp4
-rw-r--r--src/mame/drivers/sys2900.cpp2
-rw-r--r--src/mame/drivers/taito_f2.cpp2
-rw-r--r--src/mame/drivers/taito_f3.cpp2
-rw-r--r--src/mame/drivers/taito_z.cpp2
-rw-r--r--src/mame/drivers/tehkanwc.cpp2
-rw-r--r--src/mame/drivers/thayers.cpp2
-rw-r--r--src/mame/drivers/thunderx.cpp13
-rw-r--r--src/mame/drivers/tickee.cpp2
-rw-r--r--src/mame/drivers/tmc1800.cpp2
-rw-r--r--src/mame/drivers/tmnt.cpp2
-rw-r--r--src/mame/drivers/trivrus.cpp10
-rw-r--r--src/mame/drivers/trucocl.cpp2
-rw-r--r--src/mame/drivers/tubep.cpp2
-rw-r--r--src/mame/drivers/tugboat.cpp2
-rw-r--r--src/mame/drivers/ultratnk.cpp2
-rw-r--r--src/mame/drivers/vegaeo.cpp9
-rw-r--r--src/mame/drivers/vendetta.cpp2
-rw-r--r--src/mame/drivers/videopin.cpp2
-rw-r--r--src/mame/drivers/videopkr.cpp7
-rw-r--r--src/mame/drivers/vk100.cpp2
-rw-r--r--src/mame/drivers/vtech_eu3a12.cpp8
-rw-r--r--src/mame/drivers/wgp.cpp106
-rw-r--r--src/mame/drivers/wolfpack.cpp2
-rw-r--r--src/mame/drivers/x1.cpp5
-rw-r--r--src/mame/drivers/x1twin.cpp3
-rw-r--r--src/mame/drivers/x68k.cpp2
-rw-r--r--src/mame/drivers/zrt80.cpp2
-rw-r--r--src/mame/etc/opwolf_cchip.txt2
-rw-r--r--src/mame/includes/alpha68k.h2
-rw-r--r--src/mame/includes/archimds.h58
-rw-r--r--src/mame/includes/cps3.h20
-rw-r--r--src/mame/includes/firetrap.h38
-rw-r--r--src/mame/includes/h01x.h1
-rw-r--r--src/mame/includes/karnov.h50
-rw-r--r--src/mame/includes/ut88.h3
-rw-r--r--src/mame/includes/wgp.h10
-rw-r--r--src/mame/includes/x1.h4
-rw-r--r--src/mame/layout/mekd3.lay305
-rw-r--r--src/mame/machine/3dom2.cpp15
-rw-r--r--src/mame/machine/3dom2.h5
-rw-r--r--src/mame/machine/amstrad.cpp2
-rw-r--r--src/mame/machine/archimds.cpp349
-rw-r--r--src/mame/machine/arkanoid.cpp2
-rw-r--r--src/mame/machine/asic65.cpp2
-rw-r--r--src/mame/machine/at.cpp1
-rw-r--r--src/mame/machine/bebox.cpp9
-rw-r--r--src/mame/machine/bublbobl.cpp2
-rw-r--r--src/mame/machine/dai.cpp2
-rw-r--r--src/mame/machine/electron.cpp2
-rw-r--r--src/mame/machine/hpc3.cpp2
-rw-r--r--src/mame/machine/ioc2.cpp7
-rw-r--r--src/mame/machine/ioc2.h3
-rw-r--r--src/mame/machine/kaneko_calc3.cpp2
-rw-r--r--src/mame/machine/kaypro.cpp2
-rw-r--r--src/mame/machine/lynx.cpp2
-rw-r--r--src/mame/machine/mbee.cpp2
-rw-r--r--src/mame/machine/micro3d.cpp2
-rw-r--r--src/mame/machine/mikro80.cpp2
-rw-r--r--src/mame/machine/nb1412m2.cpp2
-rw-r--r--src/mame/machine/nb1413m3.cpp2
-rw-r--r--src/mame/machine/pk8020.cpp2
-rw-r--r--src/mame/machine/pmd85.cpp2
-rw-r--r--src/mame/machine/pocketc.cpp2
-rw-r--r--src/mame/machine/radio86.cpp2
-rw-r--r--src/mame/machine/saa7191.cpp8
-rw-r--r--src/mame/machine/saa7191.h6
-rw-r--r--src/mame/machine/segabill.cpp55
-rw-r--r--src/mame/machine/segacrp2_device.cpp2
-rw-r--r--src/mame/machine/snes.cpp14
-rw-r--r--src/mame/machine/sorcerer.cpp2
-rw-r--r--src/mame/machine/special.cpp4
-rw-r--r--src/mame/machine/stfight.cpp2
-rw-r--r--src/mame/machine/ut88.cpp2
-rw-r--r--src/mame/machine/vino.cpp667
-rw-r--r--src/mame/machine/vino.h91
-rw-r--r--src/mame/mame.lst98
-rw-r--r--src/mame/mess.flt2
-rw-r--r--src/mame/video/3dom2_te.cpp10
-rw-r--r--src/mame/video/alpha68k.cpp130
-rw-r--r--src/mame/video/archimds.cpp229
-rw-r--r--src/mame/video/astrocde.cpp2
-rw-r--r--src/mame/video/cchasm.cpp2
-rw-r--r--src/mame/video/cps1.cpp3
-rw-r--r--src/mame/video/dcheese.cpp2
-rw-r--r--src/mame/video/deco_mlc.cpp45
-rw-r--r--src/mame/video/exidy.cpp2
-rw-r--r--src/mame/video/gameplan.cpp2
-rw-r--r--src/mame/video/gp9001.cpp2
-rw-r--r--src/mame/video/hyhoo.cpp2
-rw-r--r--src/mame/video/lethalj.cpp2
-rw-r--r--src/mame/video/m92.cpp2
-rw-r--r--src/mame/video/mcr.cpp2
-rw-r--r--src/mame/video/midtunit.cpp2
-rw-r--r--src/mame/video/midvunit.cpp2
-rw-r--r--src/mame/video/midyunit.cpp2
-rw-r--r--src/mame/video/namcona1.cpp2
-rw-r--r--src/mame/video/nbmj8688.cpp2
-rw-r--r--src/mame/video/nbmj8891.cpp2
-rw-r--r--src/mame/video/nbmj8900.cpp2
-rw-r--r--src/mame/video/nbmj8991.cpp2
-rw-r--r--src/mame/video/nbmj9195.cpp2
-rw-r--r--src/mame/video/niyanpai.cpp2
-rw-r--r--src/mame/video/pastelg.cpp2
-rw-r--r--src/mame/video/powervr2.cpp2
-rw-r--r--src/mame/video/segag80r.cpp2
-rw-r--r--src/mame/video/segag80v.cpp3
-rw-r--r--src/mame/video/segaic24.cpp2
-rw-r--r--src/mame/video/sgi_ge5.cpp852
-rw-r--r--src/mame/video/sgi_ge5.h77
-rw-r--r--src/mame/video/sgi_gr1.cpp411
-rw-r--r--src/mame/video/sgi_gr1.h139
-rw-r--r--src/mame/video/sgi_re2.cpp495
-rw-r--r--src/mame/video/sgi_re2.h244
-rw-r--r--src/mame/video/sgi_xmap2.cpp190
-rw-r--r--src/mame/video/sgi_xmap2.h60
-rw-r--r--src/mame/video/tank8.cpp2
-rw-r--r--src/mame/video/tecmo_spr.cpp2
-rw-r--r--src/mame/video/triplhnt.cpp2
-rw-r--r--src/mame/video/x1.cpp2
-rw-r--r--src/mame/video/x68k_crtc.cpp2
-rw-r--r--src/mame/video/zx.cpp2
-rw-r--r--src/osd/mac/appdelegate.mm16
-rw-r--r--src/osd/mac/macmain.cpp21
-rw-r--r--src/osd/mac/main.mm25
-rw-r--r--src/osd/mac/windowcontroller.mm54
-rw-r--r--src/osd/modules/diagnostics/diagnostics_win32.cpp12
-rw-r--r--src/osd/modules/input/input_mac.cpp3
-rw-r--r--src/osd/modules/lib/osdlib.h2
-rw-r--r--src/osd/modules/monitor/monitor_mac.cpp6
-rw-r--r--src/osd/modules/osdmodule.cpp19
-rw-r--r--src/osd/modules/osdwindow.h6
-rw-r--r--src/osd/modules/render/drawogl.cpp5
-rw-r--r--src/tools/unidasm.cpp2
393 files changed, 10931 insertions, 6100 deletions
diff --git a/src/devices/bus/nscsi/cd.cpp b/src/devices/bus/nscsi/cd.cpp
index 19b32cc785a..93424f493fa 100644
--- a/src/devices/bus/nscsi/cd.cpp
+++ b/src/devices/bus/nscsi/cd.cpp
@@ -104,7 +104,8 @@ int nscsi_cdrom_device::to_msf(int frame)
void nscsi_cdrom_device::set_block_size(u32 block_size)
{
- assert_always(bytes_per_sector % block_size == 0, "block size must be a factor of sector size");
+ if (bytes_per_sector % block_size)
+ throw emu_fatalerror("nscsi_cdrom_device(%s): block size must be a factor of sector size", tag());
bytes_per_block = block_size;
};
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp
index 5e99056adbe..0b308b57f96 100644
--- a/src/devices/bus/pc_kbd/pc_kbdc.cpp
+++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp
@@ -16,6 +16,10 @@ The following basic program can be useful for identifying scancodes:
#include "emu.h"
#include "pc_kbdc.h"
+#define LOG_SIGNALS (1U<<1)
+#define VERBOSE ( LOG_GENERAL )
+
+#include "logmacro.h"
//**************************************************************************
// GLOBAL VARIABLES
@@ -109,7 +113,7 @@ void pc_kbdc_device::device_start()
}
-void pc_kbdc_device::update_clock_state()
+void pc_kbdc_device::update_clock_state(bool fromkb)
{
int new_clock_state = m_mb_clock_state & m_kb_clock_state;
@@ -117,7 +121,7 @@ void pc_kbdc_device::update_clock_state()
{
// We first set our state to prevent possible endless loops
m_clock_state = new_clock_state;
-
+ LOGMASKED(LOG_SIGNALS, "%s Clock: %d\n", fromkb? "<-" : "->", m_clock_state);
// Send state to keyboard interface logic on mainboard
m_out_clock_cb(m_clock_state);
@@ -128,7 +132,7 @@ void pc_kbdc_device::update_clock_state()
}
-void pc_kbdc_device::update_data_state()
+void pc_kbdc_device::update_data_state(bool fromkb)
{
int new_data_state = m_mb_data_state & m_kb_data_state;
@@ -136,6 +140,7 @@ void pc_kbdc_device::update_data_state()
{
// We first set our state to prevent possible endless loops
m_data_state = new_data_state;
+ LOGMASKED(LOG_SIGNALS, "%s Data: %d\n", fromkb? "<-" : "->", m_data_state);
// Send state to keyboard interface logic on mainboard
m_out_data_cb(m_data_state);
@@ -150,28 +155,28 @@ void pc_kbdc_device::update_data_state()
WRITE_LINE_MEMBER(pc_kbdc_device::clock_write_from_mb)
{
m_mb_clock_state = state;
- update_clock_state();
+ update_clock_state(false);
}
WRITE_LINE_MEMBER(pc_kbdc_device::data_write_from_mb)
{
m_mb_data_state = state;
- update_data_state();
+ update_data_state(false);
}
WRITE_LINE_MEMBER(pc_kbdc_device::clock_write_from_kb)
{
m_kb_clock_state = state;
- update_clock_state();
+ update_clock_state(true);
}
WRITE_LINE_MEMBER(pc_kbdc_device::data_write_from_kb)
{
m_kb_data_state = state;
- update_data_state();
+ update_data_state(true);
}
diff --git a/src/devices/bus/pc_kbd/pc_kbdc.h b/src/devices/bus/pc_kbd/pc_kbdc.h
index ff1168c314c..34161c23c5a 100644
--- a/src/devices/bus/pc_kbd/pc_kbdc.h
+++ b/src/devices/bus/pc_kbd/pc_kbdc.h
@@ -79,8 +79,8 @@ protected:
virtual void device_resolve_objects() override;
virtual void device_start() override;
- void update_clock_state();
- void update_data_state();
+ void update_clock_state(bool fromkb);
+ void update_data_state(bool fromkb);
devcb_write_line m_out_clock_cb;
devcb_write_line m_out_data_cb;
diff --git a/src/devices/bus/sms_ctrl/lphaser.cpp b/src/devices/bus/sms_ctrl/lphaser.cpp
index 72b086af587..2dead793887 100644
--- a/src/devices/bus/sms_ctrl/lphaser.cpp
+++ b/src/devices/bus/sms_ctrl/lphaser.cpp
@@ -297,6 +297,6 @@ void sms_light_phaser_device::device_timer(emu_timer &timer, device_timer_id id,
sensor_check();
break;
default:
- assert_always(false, "Unknown id in sms_light_phaser_device::device_timer");
+ throw emu_fatalerror("sms_light_phaser_device(%s): Unknown timer ID", tag());
}
}
diff --git a/src/devices/bus/sms_ctrl/sports.cpp b/src/devices/bus/sms_ctrl/sports.cpp
index 5a4809d3573..dee6af4eb63 100644
--- a/src/devices/bus/sms_ctrl/sports.cpp
+++ b/src/devices/bus/sms_ctrl/sports.cpp
@@ -74,7 +74,7 @@ void sms_sports_pad_device::device_timer(emu_timer &timer, device_timer_id id, i
break;
default:
- assert_always(false, "Unknown id in sms_sports_pad_device::device_timer");
+ throw emu_fatalerror("sms_sports_pad_device(%s): Unknown timer ID", tag());
}
}
diff --git a/src/devices/bus/spectrum/beta.cpp b/src/devices/bus/spectrum/beta.cpp
index e713b548a0e..c171f54cd33 100644
--- a/src/devices/bus/spectrum/beta.cpp
+++ b/src/devices/bus/spectrum/beta.cpp
@@ -3,79 +3,79 @@
/*********************************************************************
Technology Research Beta Disk interface & clones
- these are designed for the 48k Spectrum models
+ these are designed for the 48k Spectrum models
- There are multiple versions of this
+ There are multiple versions of this
- 'hand made' PCB with V2 ROM:
- - possible prototype / low production run
- - 4k ROM
- - FORMAT, COPY etc. must be loaded from a disk to be used
- - disks are password protected
- - uses 1771 disk controller
- https://www.youtube.com/watch?v=gSJIuZjbFYs
+ 'hand made' PCB with V2 ROM:
+ - possible prototype / low production run
+ - 4k ROM
+ - FORMAT, COPY etc. must be loaded from a disk to be used
+ - disks are password protected
+ - uses 1771 disk controller
+ https://www.youtube.com/watch?v=gSJIuZjbFYs
- Original Beta Disk release with V3 ROM:
- - same features as above
- - uses a 1793 controller
+ Original Beta Disk release with V3 ROM:
+ - same features as above
+ - uses a 1793 controller
- Re-release dubbed "Beta Disk plus" with V4 ROM:
- - many operations moved into a larger capacity (8k) ROM rather
- than requiring a utility disk
- - uses a 1793 controller
- - adds 'magic button' to dump the running state of the machine
- to disk
- - disk password system removed
+ Re-release dubbed "Beta Disk plus" with V4 ROM:
+ - many operations moved into a larger capacity (8k) ROM rather
+ than requiring a utility disk
+ - uses a 1793 controller
+ - adds 'magic button' to dump the running state of the machine
+ to disk
+ - disk password system removed
- Many clones exist, some specific to the various Spectrum clones.
- (not yet added)
+ Many clones exist, some specific to the various Spectrum clones.
+ (not yet added)
- Original Beta Disk (V3) clones
- - Sandy FDD2 SP-DOS
- - AC DOS P.Z.APINA
+ Original Beta Disk (V3) clones
+ - Sandy FDD2 SP-DOS
+ - AC DOS P.Z.APINA
- Beta Disk plus (V4) clones
- - CAS DOS Cheyenne Advanced System
- - CBI-95
- - SYNCHRON IDS91
- - SYNCHRON IDS2001ne
- - ARCADE AR-20
- - Vision Desktop Betadisk
+ Beta Disk plus (V4) clones
+ - CAS DOS Cheyenne Advanced System
+ - CBI-95
+ - SYNCHRON IDS91
+ - SYNCHRON IDS2001ne
+ - ARCADE AR-20
+ - Vision Desktop Betadisk
- Some units also exist that allow population of both V3 and V4
- ROM types with a switch (unofficial, for compatibility?)
+ Some units also exist that allow population of both V3 and V4
+ ROM types with a switch (unofficial, for compatibility?)
- ---
+ ---
- NOTE:
+ NOTE:
- ROMs really need verifying, real dumps appear to be bitswapped
- on original boards, so we're using those ones where possible,
- however sizes are unconfirmed (some sources state that the data
- is duplicated across the 16k in ROM, others state it just mirrors
- in memory) and some might be modified or bad.
+ ROMs really need verifying, real dumps appear to be bitswapped
+ on original boards, so we're using those ones where possible,
+ however sizes are unconfirmed (some sources state that the data
+ is duplicated across the 16k in ROM, others state it just mirrors
+ in memory) and some might be modified or bad.
- beta128.cpp could be modified to expand on this, as it builds
- on the features of the betaplus, but for now I've kept them
- separate as the enable / disable mechanisms are different and
- remaining mappings of devices unconfirmed
+ beta128.cpp could be modified to expand on this, as it builds
+ on the features of the betaplus, but for now I've kept them
+ separate as the enable / disable mechanisms are different and
+ remaining mappings of devices unconfirmed
- ---
+ ---
- Based on older BDI schematics, it seems the logic is like:
+ Based on older BDI schematics, it seems the logic is like:
- memory access 0x3CXX (any type of access: code or data, read or write) -> temporary use BDI ROM (NOT permanent latch/switch like in beta128)
- memory access <0x4000 area and BDI ROM_latch==true -> use BDI ROM
-
- IO write to port 0bxxxxxx00 -> D7 master_latch, 0=enable, 1=disable
+ memory access 0x3CXX (any type of access: code or data, read or write) -> temporary use BDI ROM (NOT permanent latch/switch like in beta128)
+ memory access <0x4000 area and BDI ROM_latch==true -> use BDI ROM
- while master_latch is enabled access to regular Spectrum IO is blocked (output /IORQ forced to 1) but enabled BDI ports:
+ IO write to port 0bxxxxxx00 -> D7 master_latch, 0=enable, 1=disable
- IO write to port 0b1xxxx111 -> D7 BDI ROM_latch (0=enable, 1=disble), D6 - FDC DDEN, D4 - SIDE, D3 - FDC HLT, D2 - FDC /MR (reset), D0-1 - floppy drive select.
- IO read port 0b1xxxx111 <- D7 - FDC INTRQ, D6 - FDC DRQ
- IO read/write ports 0b0YYxx111 - access FDC ports YY
+ while master_latch is enabled access to regular Spectrum IO is blocked (output /IORQ forced to 1) but enabled BDI ports:
- So mostly the same as beta128, except for new BDI ROM_latch bit
+ IO write to port 0b1xxxx111 -> D7 BDI ROM_latch (0=enable, 1=disble), D6 - FDC DDEN, D4 - SIDE, D3 - FDC HLT, D2 - FDC /MR (reset), D0-1 - floppy drive select.
+ IO read port 0b1xxxx111 <- D7 - FDC INTRQ, D6 - FDC DRQ
+ IO read/write ports 0b0YYxx111 - access FDC ports YY
+
+ So mostly the same as beta128, except for new BDI ROM_latch bit
*********************************************************************/
@@ -140,11 +140,11 @@ ROM_START(betav3)
ROM_RELOAD(0x1000,0x1000)
ROM_RELOAD(0x2000,0x1000)
ROM_RELOAD(0x3000,0x1000)
-// ROM_SYSTEM_BIOS(1, "trd30a", "TR-DOS v3.0 (set 2)")
-// ROMX_LOAD("trd30_alt.bin", 0x0000, 0x1000, CRC(48f9149f) SHA1(52774757096fdc93ea94c55306481f6f41204e96), ROM_BIOS(1))
-// ROM_RELOAD(0x1000,0x1000)
-// ROM_RELOAD(0x2000,0x1000)
-// ROM_RELOAD(0x3000,0x1000)
+// ROM_SYSTEM_BIOS(1, "trd30a", "TR-DOS v3.0 (set 2)")
+// ROMX_LOAD("trd30_alt.bin", 0x0000, 0x1000, CRC(48f9149f) SHA1(52774757096fdc93ea94c55306481f6f41204e96), ROM_BIOS(1))
+// ROM_RELOAD(0x1000,0x1000)
+// ROM_RELOAD(0x2000,0x1000)
+// ROM_RELOAD(0x3000,0x1000)
ROM_SYSTEM_BIOS(1, "trd30p", "TR-DOS v3.0 (set 2, Profisoft)") // is this a clone device?
ROMX_LOAD("trd30ps.bin", 0x0000, 0x1000, CRC(b0f175a3) SHA1(ac95bb4d89072224deef58a1655e8029f811a7fa), ROM_BIOS(1))
ROM_RELOAD(0x1000,0x1000)
@@ -282,7 +282,7 @@ void spectrum_betav2_device::device_reset()
// always paged in on boot? (no mode switch like beta128)
m_romcs = 1;
m_romlatch = 0;
-// m_masterportdisable = 1;
+// m_masterportdisable = 1;
}
//**************************************************************************
@@ -302,7 +302,7 @@ void spectrum_betav2_device::fetch(offs_t offset)
m_romcs = 1;
else
m_romcs = 0;
-
+
if (!m_romlatch)
{
if (offset < 0x4000)
@@ -327,9 +327,9 @@ uint8_t spectrum_betav2_device::iorq_r(offs_t offset)
{
uint8_t data = m_exp->iorq_r(offset);
-// if (!m_masterportdisable)
+// if (!m_masterportdisable)
if (m_romcs)
- {
+ {
switch (offset & 0xff)
{
case 0x1f: case 0x3f: case 0x5f: case 0x7f:
@@ -349,12 +349,12 @@ uint8_t spectrum_betav2_device::iorq_r(offs_t offset)
void spectrum_betav2_device::iorq_w(offs_t offset, uint8_t data)
{
-// if ((offset & 0x03) == 0x00)
-// {
-// m_masterportdisable = data & 0x80;
-// }
+// if ((offset & 0x03) == 0x00)
+// {
+// m_masterportdisable = data & 0x80;
+// }
-// if (!m_masterportdisable)
+// if (!m_masterportdisable)
if (m_romcs)
{
switch (offset & 0xff)
diff --git a/src/devices/bus/spectrum/beta.h b/src/devices/bus/spectrum/beta.h
index d9b1d8e914e..7fed611a49b 100644
--- a/src/devices/bus/spectrum/beta.h
+++ b/src/devices/bus/spectrum/beta.h
@@ -5,8 +5,8 @@
Technology Research Beta Disk interface
*********************************************************************/
-#ifndef MAME_BUS_SPECTRUM_BETAV2_H
-#define MAME_BUS_SPECTRUM_BETAV2_H
+#ifndef MAME_BUS_SPECTRUM_BETA_H
+#define MAME_BUS_SPECTRUM_BETA_H
#include "exp.h"
#include "softlist.h"
@@ -55,7 +55,7 @@ protected:
int m_romcs;
int m_romlatch;
-// int m_masterportdisable;
+// int m_masterportdisable;
void fetch(offs_t offset);
};
@@ -95,5 +95,4 @@ DECLARE_DEVICE_TYPE(SPECTRUM_BETAV2, spectrum_betav2_device)
DECLARE_DEVICE_TYPE(SPECTRUM_BETAV3, spectrum_betav3_device)
DECLARE_DEVICE_TYPE(SPECTRUM_BETAPLUS, spectrum_betaplus_device)
-
-#endif // MAME_BUS_SPECTRUM_BETAV2_H
+#endif // MAME_BUS_SPECTRUM_BETA_H
diff --git a/src/devices/bus/spectrum/beta128.cpp b/src/devices/bus/spectrum/beta128.cpp
index f034016a85e..a2240da737c 100644
--- a/src/devices/bus/spectrum/beta128.cpp
+++ b/src/devices/bus/spectrum/beta128.cpp
@@ -4,31 +4,31 @@
Technology Research Beta 128 Disk interface
- This hardware type runs TR-DOS 5.xx (official) and newer
- unofficial updates. It was designed to work properly with
- the 128k machines that had issues with the original Beta Disk
- due to changes in the 128k ROM structure etc. (enable address
- is moved from 3cxx to 3dxx for example)
+ This hardware type runs TR-DOS 5.xx (official) and newer
+ unofficial updates. It was designed to work properly with
+ the 128k machines that had issues with the original Beta Disk
+ due to changes in the 128k ROM structure etc. (enable address
+ is moved from 3cxx to 3dxx for example)
- Issues:
+ Issues:
- Using the FD1793 device a 'CAT' operation in the 'spectrum' driver
- will always report 'No Disk' but using the Soviet clone KR1818VG93
- it properly gives the disk catalogue. Despite this files can still
- be loaded from disk.
+ Using the FD1793 device a 'CAT' operation in the 'spectrum' driver
+ will always report 'No Disk' but using the Soviet clone KR1818VG93
+ it properly gives the disk catalogue. Despite this files can still
+ be loaded from disk.
- The 128k Spectrum drivers have a similar issues, although even if
- you replace the controller doing a 'CAT' operation seems to have
- an adverse effect on the system memory setup as things become
- corrupt (LOADing or MERGEing a program afterwards can cause a reset)
+ The 128k Spectrum drivers have a similar issues, although even if
+ you replace the controller doing a 'CAT' operation seems to have
+ an adverse effect on the system memory setup as things become
+ corrupt (LOADing or MERGEing a program afterwards can cause a reset)
- Neither of these issues occur in other Spectrum emulators using
- the same ROMs and floppy images.
+ Neither of these issues occur in other Spectrum emulators using
+ the same ROMs and floppy images.
- TODO:
+ TODO:
- there were many unofficial ROMs available for this, make them
- available for use.
+ there were many unofficial ROMs available for this, make them
+ available for use.
*********************************************************************/
diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp
index 91e2aabdf5f..b56e3dbb4f9 100644
--- a/src/devices/bus/ti99/gromport/cartridges.cpp
+++ b/src/devices/bus/ti99/gromport/cartridges.cpp
@@ -1514,7 +1514,8 @@ void ti99_cartridge_device::rpk::close()
if (socket.second->persistent_ram())
{
// try to open the battery file and write it if possible
- assert_always(socket.second->get_contents() && (socket.second->get_content_length() > 0), "Buffer is null or length is 0");
+ if (!socket.second->get_contents() || (socket.second->get_content_length() <= 0))
+ throw emu_fatalerror("ti99_cartridge_device::rpk::close: Buffer is null or length is 0");
emu_file file(m_options.nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
osd_file::error filerr = file.open(socket.second->get_pathname());
@@ -1699,12 +1700,13 @@ std::unique_ptr<ti99_cartridge_device::rpk_socket> ti99_cartridge_device::rpk_re
LOGMASKED(LOG_RPK, "[RPK handler] Loading NVRAM contents from '%s'\n", ram_pname.c_str());
// Load the NVRAM contents
- int bytes_read = 0;
- assert_always(contents && (length > 0), "Buffer is null or length is 0");
+ if (!contents || (length <= 0))
+ throw emu_fatalerror("ti99_cartridge_device::rpk_reader::load_ram_resource: Buffer is null or length is 0");
// try to open the battery file and read it if possible
emu_file file(options.nvram_directory(), OPEN_FLAG_READ);
osd_file::error filerr = file.open(ram_pname);
+ int bytes_read = 0;
if (filerr == osd_file::error::NONE)
bytes_read = file.read(contents, length);
diff --git a/src/devices/bus/ti99/internal/genboard.cpp b/src/devices/bus/ti99/internal/genboard.cpp
index 91c5c8d127e..773aa0ef217 100644
--- a/src/devices/bus/ti99/internal/genboard.cpp
+++ b/src/devices/bus/ti99/internal/genboard.cpp
@@ -1,13 +1,52 @@
// license:LGPL-2.1+
// copyright-holders:Michael Zapf
/***************************************************************************
- Geneve 9640 mapper and more components
+ Geneve 9640 Gate Array and more components
- This file contains 2 classes:
- - mapper: main function of the Gate Array on the Geneve board. Maps logical
- memory accesses to a wider address space using map registers.
- - keyboard: an implementation of a XT-style keyboard. This should be dropped
- and replaced by a proper XT keyboard implementation.
+ This file contains the emulation of the gate array and of the PAL chip
+ that is used to control wait state generation.
+
+ Pins of the Gate Array:
+
+ in: AMC, AMB, AMA, A0..A15: Address bus
+ in: CLKOUT
+ in: IAQ/HOLDA
+ in?: NMI*
+ in?: RESET*
+
+ i/o: D0..D7: Data bus
+
+ out: KBDINT*: Keyboard interrupt
+ i/o: KBDCLK: Keyboard clock line
+ i/o: KBDDATA: Keyboard data line
+
+ out: SNDEN*: Sound chip select
+ out: RTCEN*: RTC chip select
+
+ out: RAS*
+ out: CAS* (2x for two banks)
+ out: DRA0..DRA8: Address bus for DRAM (1+18 bit = 512K)
+
+ out: PSIEN*: 9901 enable
+ out: CRUCLK*
+
+ out: CSW*: v9938 write
+ out: CSR*: v9938 read
+
+ out: RAMENX*: SRAM expansion
+ out: RAMEN*: SRAM
+ out: ROMEN*: EPROM
+ out: AB0, AB1, AB2: Mapped address bits
+ in: DBIN*
+ ? : ABUS* / HOLDA
+ out: DBIN
+ ? : HOLD*
+ ? : READY*
+ out: DBEN*: External data bus enable
+ in: MEMEN*
+ in: SNDRDY
+ out: WE* / CRUCLK
+ out: PhiCLK: System clock for 9901
Onboard SRAM configuration:
There is an adjustable SRAM configuration on board, representing the
@@ -221,6 +260,7 @@
#define LOG_VIDEOWS (1U<<9)
#define LOG_PFM (1U<<10)
#define LOG_DECODE (1U<<11)
+#define LOG_INVADDR (1U<<12)
// Minimum log should be settings and warnings
#define VERBOSE ( LOG_SETTING | LOG_WARN )
@@ -228,14 +268,15 @@
#include "genboard.h"
#include "logmacro.h"
-DEFINE_DEVICE_TYPE_NS(GENEVE_KEYBOARD, bus::ti99::internal, geneve_keyboard_device, "geneve_keyboard", "Geneve XT-style keyboard")
-DEFINE_DEVICE_TYPE_NS(GENEVE_MAPPER, bus::ti99::internal, geneve_mapper_device, "geneve_mapper", "Geneve Gate Array")
-DEFINE_DEVICE_TYPE_NS(GENMOD_MAPPER, bus::ti99::internal, genmod_mapper_device, "genmod_mapper", "Geneve Mod Gate Array")
+DEFINE_DEVICE_TYPE_NS(GENEVE_GATE_ARRAY, bus::ti99::internal, geneve_gate_array_device, "geneve_gate_array", "Geneve Gate Array")
+DEFINE_DEVICE_TYPE_NS(GENMOD_GATE_ARRAY, bus::ti99::internal, genmod_gate_array_device, "genmod_gate_array", "Geneve Mod Gate Array")
namespace bus { namespace ti99 { namespace internal {
-geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, type, tag, owner, clock), m_gromwaddr_LSB(false),
+geneve_gate_array_device::geneve_gate_array_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
+ m_boot_rom(0),
+ m_gromwaddr_LSB(false),
m_gromraddr_LSB(false),
m_grom_address(0),
m_video_waitstates(false),
@@ -249,36 +290,40 @@ geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, device
m_cartridge_secondpage(false),
m_cartridge6_writable(false),
m_cartridge7_writable(false),
- m_boot_rom(0),
m_pfm_bank(0),
m_pfm_output_enable(false),
m_sram_mask(0),
m_sram_val(0),
m_ready(*this),
+ m_keyint(*this),
m_waitcount(0),
m_video_waitcount(0),
- m_clock(*owner, GENEVE_CLOCK_TAG),
+ m_keyboard_shift_reg(0),
+ m_keyboard_last_clock(CLEAR_LINE),
+ m_keyboard_data_in(CLEAR_LINE),
+ m_shift_reg_enabled(false),
m_cpu(*owner, "maincpu"),
- m_pfm512(*owner, GENEVE_PFM512_TAG),
- m_pfm512a(*owner, GENEVE_PFM512A_TAG),
m_sound(*owner, TI_SOUNDCHIP_TAG),
- m_keyboard(*owner, GENEVE_KEYBOARD_TAG),
m_video(*owner, TI_VDP_TAG),
- m_peribox(*owner, TI_PERIBOX_TAG),
+ m_rtc(*owner, GENEVE_CLOCK_TAG),
m_sram(*this, GENEVE_SRAM_PAR_TAG),
- m_dram(*this, GENEVE_DRAM_PAR_TAG)
+ m_dram(*this, GENEVE_DRAM_PAR_TAG),
+ m_peribox(*owner, TI_PERIBOX_TAG),
+ m_pfm512(*owner, GENEVE_PFM512_TAG),
+ m_pfm512a(*owner, GENEVE_PFM512A_TAG),
+ m_keyb_conn(*owner, GENEVE_KEYBOARD_CONN_TAG)
{
}
-geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : geneve_mapper_device(mconfig, GENEVE_MAPPER, tag, owner, clock)
+geneve_gate_array_device::geneve_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : geneve_gate_array_device(mconfig, GENEVE_GATE_ARRAY, tag, owner, clock)
{
m_eprom = nullptr;
m_pbox_prefix = 0x070000;
}
-genmod_mapper_device::genmod_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : geneve_mapper_device(mconfig, GENMOD_MAPPER, tag, owner, clock),
+genmod_gate_array_device::genmod_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : geneve_gate_array_device(mconfig, GENMOD_GATE_ARRAY, tag, owner, clock),
m_gm_timode(false),
m_turbo(false)
{
@@ -286,13 +331,13 @@ genmod_mapper_device::genmod_mapper_device(const machine_config &mconfig, const
m_pbox_prefix = 0x170000;
}
-INPUT_CHANGED_MEMBER( geneve_mapper_device::settings_changed )
+INPUT_CHANGED_MEMBER( geneve_gate_array_device::settings_changed )
{
// Used when switching the boot ROMs during runtime, especially the PFM
m_boot_rom = newval;
}
-INPUT_CHANGED_MEMBER( genmod_mapper_device::setgm_changed )
+INPUT_CHANGED_MEMBER( genmod_gate_array_device::setgm_changed )
{
int number = int(param&0x03);
int value = newval;
@@ -329,7 +374,7 @@ INPUT_CHANGED_MEMBER( genmod_mapper_device::setgm_changed )
within the gate array. Unlike with real GROMs, no address wrapping occurs,
and the complete 64K space is available.
*/
-uint8_t geneve_mapper_device::read_grom(offs_t offset)
+uint8_t geneve_gate_array_device::read_grom(offs_t offset)
{
uint8_t reply;
if (offset & 0x0002)
@@ -364,7 +409,7 @@ uint8_t geneve_mapper_device::read_grom(offs_t offset)
Simulates GROM. The real Geneve does not use GROMs but simulates them
within the gate array.
*/
-void geneve_mapper_device::write_grom(offs_t offset, uint8_t data)
+void geneve_gate_array_device::write_grom(offs_t offset, uint8_t data)
{
if (offset & 0x0002)
{
@@ -393,7 +438,7 @@ void geneve_mapper_device::write_grom(offs_t offset, uint8_t data)
}
}
-void geneve_mapper_device::set_wait(int min)
+void geneve_gate_array_device::set_wait(int min)
{
if (m_extra_waitstates && min < 2) min = 2;
@@ -411,38 +456,38 @@ void geneve_mapper_device::set_wait(int min)
}
}
-void geneve_mapper_device::set_video_waitcount(int min)
+void geneve_gate_array_device::set_video_waitcount(int min)
{
if (m_debug_no_ws) return;
m_video_waitcount = min;
}
-void geneve_mapper_device::set_geneve_mode(bool geneve)
+void geneve_gate_array_device::set_geneve_mode(bool geneve)
{
LOGMASKED(LOG_SETTING, "Setting Geneve mode = %d\n", geneve);
m_geneve_mode = geneve;
}
-void geneve_mapper_device::set_direct_mode(bool direct)
+void geneve_gate_array_device::set_direct_mode(bool direct)
{
LOGMASKED(LOG_SETTING, "Setting direct mode = %d\n", direct);
m_direct_mode = direct;
}
-void geneve_mapper_device::set_cartridge_size(int size)
+void geneve_gate_array_device::set_cartridge_size(int size)
{
LOGMASKED(LOG_SETTING, "Setting cartridge size to %d\n", size);
m_cartridge_size = size;
}
-void geneve_mapper_device::set_cartridge_writable(int base, bool write)
+void geneve_gate_array_device::set_cartridge_writable(int base, bool write)
{
LOGMASKED(LOG_SETTING, "Cartridge %04x space writable = %d\n", base, write);
if (base==0x6000) m_cartridge6_writable = write;
else m_cartridge7_writable = write;
}
-void geneve_mapper_device::set_video_waitstates(bool wait)
+void geneve_gate_array_device::set_video_waitstates(bool wait)
{
// Tends to be called repeatedly
if (m_video_waitstates != wait)
@@ -452,12 +497,105 @@ void geneve_mapper_device::set_video_waitstates(bool wait)
m_video_waitstates = wait;
}
-void geneve_mapper_device::set_extra_waitstates(bool wait)
+void geneve_gate_array_device::set_extra_waitstates(bool wait)
{
LOGMASKED(LOG_SETTING, "Setting extra waitstates = %d\n", wait);
m_extra_waitstates = wait;
}
+/******************************************************************
+ Keyboard support
+ XT protocol:
+
+ Original XT: 0 1 bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7
+ Some clones: 1 bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7
+
+ bit0 = LSB, bit7 = MSB
+
+ For now we assume that the Geneve needs the original XT keyboard.
+
+ We can use the start 1 bit to control bit reception. When it reaches the
+ rightmost position, we suspend transfer and raise the interrupt.
+
+ With the flagging of the interrupt, the data line towards the keyboard
+ is held low until the interrupt is cleared. This is done by clearing the
+ shift register by setting the CRU address 1EF2 to 0.
+
+ Note that lowering the clock line to 0 for more than 20ms will trigger
+ a keyboard reset.
+
+******************************************************************/
+
+/*
+ Pull down or release the clock line.
+ Called by setting CRU bit 1EF0 to 0 or 1.
+*/
+WRITE_LINE_MEMBER( geneve_gate_array_device::set_keyboard_clock)
+{
+ m_keyb_conn->clock_write_from_mb(state);
+}
+
+/*
+ Enable the shift register. Setting to 0 will clear the register and
+ lock it. At the same time, the interrupt is cleared, and the data line
+ is released. If further scancodes are expected, the shift register should
+ immediately be enabled again.
+
+ Called by setting CRU bit 1EF2 to 0 or 1
+*/
+WRITE_LINE_MEMBER( geneve_gate_array_device::enable_shift_register)
+{
+ m_shift_reg_enabled = (state==ASSERT_LINE);
+
+ if (!m_shift_reg_enabled)
+ {
+ LOGMASKED(LOG_KEYBOARD, "Clear shift register, disable\n");
+ m_keyboard_shift_reg = 0;
+ shift_reg_changed();
+ }
+ else
+ LOGMASKED(LOG_KEYBOARD, "Enable shift register\n");
+}
+
+void geneve_gate_array_device::shift_reg_changed()
+{
+ // The level of the data line is the inverse of the rightmost bit of
+ // the shift register. This means that once the start bit reaches that
+ // position, it will pull down the data line and stop the transfer.
+ m_keyb_conn->data_write_from_mb(1 - (m_keyboard_shift_reg & 1));
+ m_keyint((m_keyboard_shift_reg & 1)? ASSERT_LINE : CLEAR_LINE);
+ if (m_keyboard_shift_reg & 1)
+ LOGMASKED(LOG_KEYBOARD, "Scan code complete; raise interrupt, hold down data line\n");
+ else
+ LOGMASKED(LOG_KEYBOARD, "Clear keyboard interrupt, release data line\n");
+}
+
+/*
+ Incoming keyboard strobe. When 0, push the current data line level into
+ the shift register at the leftmost position.
+*/
+WRITE_LINE_MEMBER( geneve_gate_array_device::kbdclk )
+{
+ LOGMASKED(LOG_KEYBOARD, "Keyboard clock: %d\n", state);
+ bool clock_falling_edge = (m_keyboard_last_clock == ASSERT_LINE && state == CLEAR_LINE);
+
+ if (m_shift_reg_enabled && clock_falling_edge)
+ {
+ m_keyboard_shift_reg = (m_keyboard_shift_reg>>1) | (m_keyboard_data_in? 0x100 : 0x00);
+ LOGMASKED(LOG_KEYBOARD, "Shift register = %02x\n", m_keyboard_shift_reg>>1);
+ shift_reg_changed();
+ }
+ m_keyboard_last_clock = (line_state)state;
+}
+
+/*
+ Latch the value of the incoming data line.
+*/
+WRITE_LINE_MEMBER( geneve_gate_array_device::kbddata )
+{
+ LOGMASKED(LOG_KEYBOARD, "Keyboard data: %d\n", state);
+ m_keyboard_data_in = (line_state)state;
+}
/************************************************************************
Called by the address map
@@ -468,7 +606,7 @@ void geneve_mapper_device::set_extra_waitstates(bool wait)
SETADDRESS method, and we re-use the values stored there to quickly
access the appropriate component.
*/
-uint8_t geneve_mapper_device::readm(offs_t offset)
+uint8_t geneve_gate_array_device::readm(offs_t offset)
{
uint8_t value = 0;
@@ -525,8 +663,8 @@ uint8_t geneve_mapper_device::readm(offs_t offset)
case MLKEY:
// key
- if (!machine().side_effects_disabled()) value = m_keyboard->get_recent_key();
- LOGMASKED(LOG_READ, "Read keyboard -> %02x\n", value);
+ value = m_keyboard_shift_reg>>1;
+ LOGMASKED(LOG_KEYBOARD, "Read keyboard -> %02x\n", value);
break;
case MLCLOCK:
@@ -538,7 +676,7 @@ uint8_t geneve_mapper_device::readm(offs_t offset)
// Needs more investigation. We might as well ignore this,
// as the high nibble is obviously undefined and takes some past
// value floating around.
- value = m_clock->read(dec->offset & 0x000f);
+ value = m_rtc->read(dec->offset & 0x000f);
if (m_geneve_mode) value |= 0xf0;
else value |= ((dec->offset & 0x000f)==0x000f)? 0x20 : 0x10;
LOGMASKED(LOG_READ, "Read clock %04x -> %02x\n", dec->offset, value);
@@ -582,7 +720,7 @@ uint8_t geneve_mapper_device::readm(offs_t offset)
}
else
{
- LOGMASKED(LOG_WARN, "Decoded as SRAM read, but no SRAM at %06x\n", dec->physaddr);
+ LOGMASKED(LOG_INVADDR, "Decoded as SRAM read, but no SRAM at %06x\n", dec->physaddr);
value = 0;
}
// Return in any case
@@ -605,7 +743,7 @@ uint8_t geneve_mapper_device::readm(offs_t offset)
return value;
}
-void geneve_mapper_device::writem(offs_t offset, uint8_t data)
+void geneve_gate_array_device::writem(offs_t offset, uint8_t data)
{
decdata *dec;
decdata debug;
@@ -666,7 +804,7 @@ void geneve_mapper_device::writem(offs_t offset, uint8_t data)
case MLCLOCK:
// clock
// ++++ ++++ ++++ ----
- m_clock->write(dec->offset & 0x000f, data);
+ m_rtc->write(dec->offset & 0x000f, data);
LOGMASKED(LOG_WRITE, "Write clock %04x <- %02x\n", offset, data);
break;
@@ -702,7 +840,7 @@ void geneve_mapper_device::writem(offs_t offset, uint8_t data)
// Ignore EPROM write (unless PFM)
if (m_boot_rom != GENEVE_EPROM) write_to_pfm(dec->physaddr, data);
else
- LOGMASKED(LOG_WARN, "Write EPROM %04x (%06x) <- %02x, ignored\n", offset, dec->physaddr, data);
+ LOGMASKED(LOG_INVADDR, "Write EPROM %04x (%06x) <- %02x, ignored\n", offset, dec->physaddr, data);
break;
case MPSRAM:
@@ -713,7 +851,7 @@ void geneve_mapper_device::writem(offs_t offset, uint8_t data)
}
else
{
- LOGMASKED(LOG_WARN, "Decoded as SRAM write, but no SRAM at %06x\n", dec->physaddr);
+ LOGMASKED(LOG_INVADDR, "Decoded as SRAM write, but no SRAM at %06x\n", dec->physaddr);
}
break;
@@ -730,7 +868,18 @@ void geneve_mapper_device::writem(offs_t offset, uint8_t data)
}
}
-void geneve_mapper_device::decode_logical(bool reading, geneve_mapper_device::decdata* dec)
+const geneve_gate_array_device::logentry_t geneve_gate_array_device::s_logmap[7] =
+{
+ { 0xf100, 0x000e, 0x8800, 0x03fe, 0x0400, MLVIDEO, "video" },
+ { 0xf110, 0x0007, 0x8000, 0x0007, 0x0000, MLMAPPER, "mapper" },
+ { 0xf118, 0x0007, 0x8008, 0x0007, 0x0000, MLKEY, "keyboard" },
+ { 0xf120, 0x000e, 0x8400, 0x03fe, 0x0000, MLSOUND, "sound" },
+ { 0xf130, 0x000f, 0x8010, 0x000f, 0x0000, MLCLOCK, "clock" },
+ { 0x0000, 0x0000, 0x9000, 0x03fe, 0x0400, MBOX, "speech (in P-Box)" },
+ { 0x0000, 0x0000, 0x9800, 0x03fe, 0x0400, MLGROM, "GROM" },
+};
+
+void geneve_gate_array_device::decode_logical(bool reading, geneve_gate_array_device::decdata* dec)
{
dec->function = MUNDEF;
dec->physaddr = m_pbox_prefix | dec->offset;
@@ -742,19 +891,19 @@ void geneve_mapper_device::decode_logical(bool reading, geneve_mapper_device::de
if (m_geneve_mode)
{
// Skip when genbase is 0
- if ((m_logmap[i].genbase != 0) && ((dec->offset & ~m_logmap[i].genmask) == m_logmap[i].genbase))
+ if ((s_logmap[i].genbase != 0) && ((dec->offset & ~s_logmap[i].genmask) == s_logmap[i].genbase))
break;
}
else
{
if (reading)
{
- if ((dec->offset & ~m_logmap[i].timask) == m_logmap[i].tibase)
+ if ((dec->offset & ~s_logmap[i].timask) == s_logmap[i].tibase)
break;
}
else
{
- if ((dec->offset & ~m_logmap[i].timask) == (m_logmap[i].tibase | m_logmap[i].writeoff))
+ if ((dec->offset & ~s_logmap[i].timask) == (s_logmap[i].tibase | s_logmap[i].writeoff))
break;
}
}
@@ -762,12 +911,12 @@ void geneve_mapper_device::decode_logical(bool reading, geneve_mapper_device::de
}
if (i != 7)
{
- LOGMASKED(LOG_DECODE, "Decoded as %s: %04x\n", m_logmap[i].description, dec->offset);
- dec->function = m_logmap[i].function;
+ LOGMASKED(LOG_DECODE, "Decoded as %s: %04x\n", s_logmap[i].description, dec->offset);
+ dec->function = s_logmap[i].function;
}
}
-void geneve_mapper_device::map_address(bool reading, geneve_mapper_device::decdata* dec)
+void geneve_gate_array_device::map_address(bool reading, geneve_gate_array_device::decdata* dec)
{
int logpage = (dec->offset & 0xe000) >> 13;
int physpage = 0;
@@ -812,22 +961,30 @@ void geneve_mapper_device::map_address(bool reading, geneve_mapper_device::decda
dec->physaddr = ((physpage << 13) | (dec->offset & 0x1fff)) & 0x1fffff;
}
-void geneve_mapper_device::decode_physical(geneve_mapper_device::decdata* dec)
+const geneve_gate_array_device::physentry_t geneve_gate_array_device::s_physmap[4] =
+{
+ { 0x000000, 0x07ffff, MPDRAM, 1, "DRAM" },
+ { 0x080000, 0x07ffff, MPEXP, 1, "on-board expansion" },
+ { 0x1e0000, 0x01ffff, MPEPROM, 0, "EPROM" },
+ { 0x180000, 0x07ffff, MPSRAM, 0, "SRAM" }
+};
+
+void geneve_gate_array_device::decode_physical(geneve_gate_array_device::decdata* dec)
{
dec->function = MUNDEF;
int i = 0;
while (i < 4)
{
- if ((dec->physaddr & ~m_physmap[i].mask) == m_physmap[i].base)
+ if ((dec->physaddr & ~s_physmap[i].mask) == s_physmap[i].base)
break;
i++;
}
if (i != 4)
{
- LOGMASKED(LOG_DECODE, "Decoded as %s: %06x\n", m_physmap[i].description, dec->physaddr);
- dec->function = m_physmap[i].function;
- dec->wait = m_physmap[i].wait;
+ LOGMASKED(LOG_DECODE, "Decoded as %s: %06x\n", s_physmap[i].description, dec->physaddr);
+ dec->function = s_physmap[i].function;
+ dec->wait = s_physmap[i].wait;
}
else
{
@@ -837,7 +994,7 @@ void geneve_mapper_device::decode_physical(geneve_mapper_device::decdata* dec)
}
}
-void genmod_mapper_device::decode_mod(geneve_mapper_device::decdata* dec)
+void genmod_gate_array_device::decode_mod(geneve_gate_array_device::decdata* dec)
{
// GenMod mode
// The TI Mode switch activates the DRAM on the board (1 WS)
@@ -854,7 +1011,7 @@ void genmod_mapper_device::decode_mod(geneve_mapper_device::decdata* dec)
/*
Boot ROM handling, from EPROM or PFM.
*/
-uint8_t geneve_mapper_device::boot_rom(offs_t offset)
+uint8_t geneve_gate_array_device::boot_rom(offs_t offset)
{
uint8_t value;
int pfmaddress = (offset & 0x01ffff) | (m_pfm_bank<<17);
@@ -881,7 +1038,7 @@ uint8_t geneve_mapper_device::boot_rom(offs_t offset)
return value;
}
-void geneve_mapper_device::write_to_pfm(offs_t offset, uint8_t data)
+void geneve_gate_array_device::write_to_pfm(offs_t offset, uint8_t data)
{
// Nota bene: The PFM must be write protected on startup, or the RESET
// of the 9995 will attempt to write the return vector into the flash EEPROM
@@ -907,7 +1064,7 @@ void geneve_mapper_device::write_to_pfm(offs_t offset, uint8_t data)
This decoding will later be used in the READ/WRITE member functions. Also,
we initiate wait state creation here.
*/
-void geneve_mapper_device::setaddress(offs_t address, uint8_t busctrl)
+void geneve_gate_array_device::setaddress(offs_t address, uint8_t busctrl)
{
LOGMASKED(LOG_DETAIL, "setaddress = %04x\n", address);
m_debug_no_ws = false;
@@ -944,7 +1101,7 @@ void geneve_mapper_device::setaddress(offs_t address, uint8_t busctrl)
affect the video access itself but become effective after the access; if
the code runs on the chip, these wait states are ignored.)
*/
-WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
+WRITE_LINE_MEMBER( geneve_gate_array_device::clock_in )
{
if (state==ASSERT_LINE)
{
@@ -1000,21 +1157,21 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
/*
PFM expansion: Setting the bank.
*/
-WRITE_LINE_MEMBER( geneve_mapper_device::pfm_select_lsb )
+WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_select_lsb )
{
if (state==ASSERT_LINE) m_pfm_bank |= 1;
else m_pfm_bank &= 0xfe;
LOGMASKED(LOG_PFM, "Setting bank (l) = %d\n", m_pfm_bank);
}
-WRITE_LINE_MEMBER( geneve_mapper_device::pfm_select_msb )
+WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_select_msb )
{
if (state==ASSERT_LINE) m_pfm_bank |= 2;
else m_pfm_bank &= 0xfd;
LOGMASKED(LOG_PFM, "Setting bank (u) = %d\n", m_pfm_bank);
}
-WRITE_LINE_MEMBER( geneve_mapper_device::pfm_output_enable )
+WRITE_LINE_MEMBER( geneve_gate_array_device::pfm_output_enable )
{
// Negative logic
m_pfm_output_enable = (state==CLEAR_LINE);
@@ -1025,9 +1182,10 @@ WRITE_LINE_MEMBER( geneve_mapper_device::pfm_output_enable )
// Common device lifecycle
//====================================================================
-void geneve_mapper_device::device_start()
+void geneve_gate_array_device::device_start()
{
- m_ready.resolve();
+ m_ready.resolve_safe();
+ m_keyint.resolve_safe();
m_geneve_mode = false;
m_direct_mode = true;
@@ -1060,7 +1218,7 @@ void geneve_mapper_device::device_start()
save_item(NAME(m_video_waitcount));
}
-void geneve_mapper_device::common_reset()
+void geneve_gate_array_device::common_reset()
{
m_extra_waitstates = false;
m_video_waitstates = true;
@@ -1092,7 +1250,7 @@ void geneve_mapper_device::common_reset()
LOGMASKED(LOG_SETTING, "Video RAM set to %d KiB\n", videoram / 1024);
}
-void geneve_mapper_device::device_reset()
+void geneve_gate_array_device::device_reset()
{
common_reset();
@@ -1121,7 +1279,7 @@ void geneve_mapper_device::device_reset()
}
}
-void genmod_mapper_device::device_reset()
+void genmod_gate_array_device::device_reset()
{
common_reset();
LOGMASKED(LOG_SETTING, "Using GenMod modification\n");
@@ -1129,521 +1287,6 @@ void genmod_mapper_device::device_reset()
m_gm_timode = ((machine().root_device().ioport("GENMODDIPS")->read() & GENEVE_GM_TIM)!=0);
}
-/****************************************************************************
- Keyboard support
-
- The XT keyboard interface is described in various places on the internet,
- like (http://www-2.cs.cmu.edu/afs/cs/usr/jmcm/www/info/key2.txt). It is a
- synchronous unidirectional serial interface: the data line is driven by the
- keyboard to send data to the CPU; the CTS/clock line has a pull up resistor
- and can be driven low by both keyboard and CPU. To send data to the CPU,
- the keyboard pulses the clock line low 9 times, and the Geneve samples all
- 8 bits of data (plus one start bit) on each falling edge of the clock.
- When the key code buffer is full, the Geneve gate array asserts the kbdint*
- line (connected to 9901 int8_t*). The Geneve gate array will hold the
- CTS/clock line low as long as the keyboard buffer is full or CRU bit @>F78
- is 0. Writing a 0 to >F79 will clear the Geneve keyboard buffer, and
- writing a 1 will resume normal operation: you need to write a 0 to >F78
- before clearing >F79, or the keyboard will be enabled to send data the gate
- array when >F79 is is set to 0, and any such incoming data from the
- keyboard will be cleared as soon as it is buffered by the gate array.
-
-****************************************************************************/
-
-static const uint8_t MF1_CODE[0xe] =
-{
- /* extended keys that are equivalent to non-extended keys */
- 0x1c, /* keypad enter */
- 0x1d, /* right control */
- 0x38, /* alt gr */
- // extra codes are 0x5b for Left Windows, 0x5c for Right Windows, 0x5d
- // for Menu, 0x5e for power, 0x5f for sleep, 0x63 for wake, but I doubt
- // any Geneve program would take advantage of these. */
-
- // extended key that is equivalent to a non-extended key
- // with shift off
- 0x35, /* pad slash */
-
- // extended keys that are equivalent to non-extended keys
- // with numlock off
- 0x47, /* home */
- 0x48, /* up */
- 0x49, /* page up */
- 0x4b, /* left */
- 0x4d, /* right */
- 0x4f, /* end */
- 0x50, /* down */
- 0x51, /* page down */
- 0x52, /* insert */
- 0x53 /* delete */
-};
-
-geneve_keyboard_device::geneve_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, GENEVE_KEYBOARD, tag, owner, clock),
- m_interrupt(*this),
- m_keys(*this, "KEY%u", 0),
- m_key_reset(false), m_key_queue_length(0), m_key_queue_head(0), m_key_in_buffer(false), m_key_numlock_state(false), m_key_ctrl_state(0), m_key_alt_state(0),
- m_key_real_shift_state(0), m_key_fake_shift_state(false), m_key_fake_unshift_state(false), m_key_autorepeat_key(0), m_key_autorepeat_timer(0), m_keep_keybuf(false),
- m_keyboard_clock(false), m_timer(nullptr)
-{
-}
-
-void geneve_keyboard_device::post_in_key_queue(int keycode)
-{
- m_key_queue[(m_key_queue_head + m_key_queue_length) % KEYQUEUESIZE] = keycode;
- m_key_queue_length++;
-
- LOGMASKED(LOG_KEYBOARD, "Posting keycode %02x\n", keycode);
-}
-
-void geneve_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- poll();
-}
-
-void geneve_keyboard_device::poll()
-{
- uint32_t keystate;
- uint32_t key_transitions;
- int i, j;
- int keycode;
- int pressed;
- LOGMASKED(LOG_KEYBOARD, "Poll keyboard\n");
- if (m_key_reset) return;
-
- /* Poll keyboard */
- for (i = 0; (i < 4) && (m_key_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)); i++)
- {
- keystate = m_keys[2*i]->read() | (m_keys[2*i + 1]->read() << 16);
- key_transitions = keystate ^ m_key_state_save[i];
- if (key_transitions)
- {
- for (j = 0; (j < 32) && (m_key_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)); j++)
- {
- if ((key_transitions >> j) & 1)
- {
- keycode = (i << 5) | j;
- pressed = ((keystate >> j) & 1);
- if (pressed)
- m_key_state_save[i] |= (1 << j);
- else
- m_key_state_save[i] &= ~ (1 << j);
-
- /* Update auto-repeat */
- if (pressed)
- {
- m_key_autorepeat_key = keycode;
- m_key_autorepeat_timer = KEYAUTOREPEATDELAY+1;
- }
- else /*if (keycode == m_key_autorepeat_key)*/
- m_key_autorepeat_key = 0;
-
- // Release Fake Shift/Unshift if another key is pressed
- // We do so if a key is released, though it is actually
- // required only if it is a modifier key
- /*if (pressed)*/
- //{
- if (m_key_fake_shift_state)
- {
- /* Fake shift release */
- post_in_key_queue(0xe0);
- post_in_key_queue(0xaa);
- m_key_fake_shift_state = false;
- }
- if (m_key_fake_unshift_state)
- {
- /* Fake shift press */
- post_in_key_queue(0xe0);
- post_in_key_queue(0x2a);
- m_key_fake_unshift_state = false;
- }
- //}
-
- /* update shift and numlock state */
- if ((keycode == 0x2a) || (keycode == 0x36))
- m_key_real_shift_state = m_key_real_shift_state + (pressed ? +1 : -1);
- if ((keycode == 0x1d) || (keycode == 0x61))
- m_key_ctrl_state = m_key_ctrl_state + (pressed ? +1 : -1);
- if ((keycode == 0x38) || (keycode == 0x62))
- m_key_alt_state = m_key_alt_state + (pressed ? +1 : -1);
- if ((keycode == 0x45) && pressed)
- m_key_numlock_state = !m_key_numlock_state;
-
- if ((keycode >= 0x60) && (keycode < 0x6e))
- { /* simpler extended keys */
- /* these keys are emulated */
-
- if ((keycode >= 0x63) && pressed)
- {
- /* Handle shift state */
- if (keycode == 0x63)
- { /* non-shifted key */
- if (m_key_real_shift_state!=0)
- /* Fake shift unpress */
- m_key_fake_unshift_state = true;
- }
- else /*if (keycode >= 0x64)*/
- { /* non-numlock mode key */
- if (m_key_numlock_state & (m_key_real_shift_state==0))
- /* Fake shift press if numlock is active */
- m_key_fake_shift_state = true;
- else if ((!m_key_numlock_state) & (m_key_real_shift_state!=0))
- /* Fake shift unpress if shift is down */
- m_key_fake_unshift_state = true;
- }
-
- if (m_key_fake_shift_state)
- {
- post_in_key_queue(0xe0);
- post_in_key_queue(0x2a);
- }
-
- if (m_key_fake_unshift_state)
- {
- post_in_key_queue(0xe0);
- post_in_key_queue(0xaa);
- }
- }
-
- keycode = MF1_CODE[keycode-0x60];
- if (!pressed) keycode |= 0x80;
- post_in_key_queue(0xe0);
- post_in_key_queue(keycode);
- }
- else if (keycode == 0x6e)
- { /* emulate Print Screen / System Request (F13) key */
- /* this is a bit complex, as Alt+PrtScr -> SysRq */
- /* Additionally, Ctrl+PrtScr involves no fake shift press */
- if (m_key_alt_state!=0)
- {
- /* SysRq */
- keycode = 0x54;
- if (!pressed) keycode |= 0x80;
- post_in_key_queue(keycode);
- }
- else
- {
- /* Handle shift state */
- if (pressed && (m_key_real_shift_state==0) && (m_key_ctrl_state==0))
- { /* Fake shift press */
- post_in_key_queue(0xe0);
- post_in_key_queue(0x2a);
- m_key_fake_shift_state = true;
- }
-
- keycode = 0x37;
- if (!pressed) keycode |= 0x80;
- post_in_key_queue(0xe0);
- post_in_key_queue(keycode);
- }
- }
- else if (keycode == 0x6f)
- { // emulate pause (F15) key
- // this is a bit complex, as Pause -> Ctrl+NumLock and
- // Ctrl+Pause -> Ctrl+ScrLock. Furthermore, there is no
- // repeat or release.
- if (pressed)
- {
- if (m_key_ctrl_state!=0)
- {
- post_in_key_queue(0xe0);
- post_in_key_queue(0x46);
- post_in_key_queue(0xe0);
- post_in_key_queue(0xc6);
- }
- else
- {
- post_in_key_queue(0xe1);
- post_in_key_queue(0x1d);
- post_in_key_queue(0x45);
- post_in_key_queue(0xe1);
- post_in_key_queue(0x9d);
- post_in_key_queue(0xc5);
- }
- }
- }
- else
- {
- if (!pressed) keycode |= 0x80;
- post_in_key_queue(keycode);
- }
- signal_when_key_available();
- }
- }
- }
- }
-
- /* Handle auto-repeat */
- if ((m_key_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)) && (m_key_autorepeat_key!=0) && (--m_key_autorepeat_timer == 0))
- {
- if ((m_key_autorepeat_key >= 0x60) && (m_key_autorepeat_key < 0x6e))
- {
- post_in_key_queue(0xe0);
- post_in_key_queue(MF1_CODE[m_key_autorepeat_key-0x60]);
- }
- else if (m_key_autorepeat_key == 0x6e)
- {
- if (m_key_alt_state!=0)
- post_in_key_queue(0x54);
- else
- {
- post_in_key_queue(0xe0);
- post_in_key_queue(0x37);
- }
- }
- else if (m_key_autorepeat_key == 0x6f)
- ;
- else
- {
- post_in_key_queue(m_key_autorepeat_key);
- }
- signal_when_key_available();
- m_key_autorepeat_timer = KEYAUTOREPEATRATE;
- }
-}
-
-uint8_t geneve_keyboard_device::get_recent_key()
-{
- if (m_key_in_buffer) return m_key_queue[m_key_queue_head];
- else return 0;
-}
-
-void geneve_keyboard_device::signal_when_key_available()
-{
- // if keyboard reset is not asserted, and key clock is enabled, and key
- // buffer clear is disabled, and key queue is not empty. */
- if ((!m_key_reset) && (m_keyboard_clock) && (m_keep_keybuf) && (m_key_queue_length != 0))
- {
- LOGMASKED(LOG_KEYBOARD, "Key available\n");
- m_interrupt(ASSERT_LINE);
- m_key_in_buffer = true;
- }
-}
-
-WRITE_LINE_MEMBER( geneve_keyboard_device::clock_control )
-{
- bool rising_edge = (!m_keyboard_clock && (state==ASSERT_LINE));
- m_keyboard_clock = (state==ASSERT_LINE);
- LOGMASKED(LOG_KEYBOARD, "Keyboard clock_control state=%d\n", m_keyboard_clock);
- if (rising_edge)
- signal_when_key_available();
-}
-
-WRITE_LINE_MEMBER( geneve_keyboard_device::send_scancodes )
-{
- bool rising_edge = (!m_keep_keybuf && (state==ASSERT_LINE));
- bool falling_edge = (m_keep_keybuf && (state==CLEAR_LINE));
- m_keep_keybuf = (state==ASSERT_LINE);
-
- if (rising_edge) signal_when_key_available();
- else
- {
- if (falling_edge)
- {
- if (m_key_queue_length != 0)
- {
- m_key_queue_head = (m_key_queue_head + 1) % KEYQUEUESIZE;
- m_key_queue_length--;
- }
- /* clear keyboard interrupt */
- m_interrupt(CLEAR_LINE);
- m_key_in_buffer = false;
- }
- }
-}
-
-WRITE_LINE_MEMBER( geneve_keyboard_device::reset_line )
-{
- m_key_reset = !(state==ASSERT_LINE);
-
- if (m_key_reset)
- {
- /* reset -> clear keyboard key queue, but not geneve key buffer */
- m_key_queue_length = (m_key_in_buffer)? 1 : 0;
- m_key_queue_head = 0;
- memset(m_key_state_save, 0, sizeof(m_key_state_save));
- m_key_numlock_state = false;
- m_key_ctrl_state = 0;
- m_key_alt_state = 0;
- m_key_real_shift_state = 0;
- m_key_fake_shift_state = false;
- m_key_fake_unshift_state = false;
- m_key_autorepeat_key = 0;
- }
-}
-
-void geneve_keyboard_device::device_start()
-{
- m_timer = timer_alloc(0);
- m_interrupt.resolve();
-
- // State registration
- save_item(NAME(m_key_reset));
- save_item(NAME(m_key_queue_length));
- save_item(NAME(m_key_queue_head));
- save_item(NAME(m_key_in_buffer));
- save_item(NAME(m_key_numlock_state));
- save_item(NAME(m_key_ctrl_state));
- save_item(NAME(m_key_alt_state));
- save_item(NAME(m_key_real_shift_state));
- save_item(NAME(m_key_fake_shift_state));
- save_item(NAME(m_key_fake_unshift_state));
- save_item(NAME(m_key_autorepeat_key));
- save_item(NAME(m_key_autorepeat_timer));
- save_item(NAME(m_keep_keybuf));
- save_item(NAME(m_keyboard_clock));
- save_pointer(NAME(m_key_queue),KEYQUEUESIZE);
- save_pointer(NAME(m_key_state_save),4);
-}
-
-void geneve_keyboard_device::device_reset()
-{
- m_key_in_buffer = false;
- reset_line(CLEAR_LINE);
- m_key_queue_length = 0;
- m_key_reset = true;
- m_keyboard_clock = false;
- m_keep_keybuf = false;
- m_timer->adjust(attotime::from_usec(1), 0, attotime::from_hz(120));
-}
-
-INPUT_PORTS_START( genkeys )
- PORT_START("KEY0") /* IN3 */
- PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) /* Esc 01 81 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) /* 1 02 82 */
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) /* 2 03 83 */
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) /* 3 04 84 */
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) /* 4 05 85 */
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) /* 5 06 86 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) /* 6 07 87 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) /* 7 08 88 */
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) /* 8 09 89 */
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) /* 9 0A 8A */
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) /* 0 0B 8B */
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- _") PORT_CODE(KEYCODE_MINUS) /* - 0C 8C */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) /* = 0D 8D */
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) /* Backspace 0E 8E */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) /* Tab 0F 8F */
-
- PORT_START("KEY1") /* IN4 */
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) /* Q 10 90 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) /* W 11 91 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) /* E 12 92 */
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) /* R 13 93 */
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) /* T 14 94 */
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) /* Y 15 95 */
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) /* U 16 96 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) /* I 17 97 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) /* O 18 98 */
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) /* P 19 99 */
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE) /* [ 1A 9A */
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) /* ] 1B 9B */
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) /* Enter 1C 9C */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L-Ctrl") PORT_CODE(KEYCODE_LCONTROL) /* Left Ctrl 1D 9D */
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) /* A 1E 9E */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) /* S 1F 9F */
-
- PORT_START("KEY2") /* IN5 */
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) /* D 20 A0 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) /* F 21 A1 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) /* G 22 A2 */
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) /* H 23 A3 */
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) /* J 24 A4 */
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) /* K 25 A5 */
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) /* L 26 A6 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) /* ; 27 A7 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE) /* ' 28 A8 */
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("` ~") PORT_CODE(KEYCODE_TILDE) /* ` 29 A9 */
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L-Shift") PORT_CODE(KEYCODE_LSHIFT) /* Left Shift 2A AA */
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_BACKSLASH) /* \ 2B AB */
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) /* Z 2C AC */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) /* X 2D AD */
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) /* C 2E AE */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) /* V 2F AF */
-
- PORT_START("KEY3") /* IN6 */
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) /* B 30 B0 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) /* N 31 B1 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) /* M 32 B2 */
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) /* , 33 B3 */
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) /* . 34 B4 */
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) /* / 35 B5 */
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R-Shift") PORT_CODE(KEYCODE_RSHIFT) /* Right Shift 36 B6 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP * (PrtScr)") PORT_CODE(KEYCODE_ASTERISK ) /* Keypad * (PrtSc) 37 B7 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alt") PORT_CODE(KEYCODE_LALT) /* Left Alt 38 B8 */
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) /* Space 39 B9 */
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps") PORT_CODE(KEYCODE_CAPSLOCK) /* Caps Lock 3A BA */
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) /* F1 3B BB */
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) /* F2 3C BC */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) /* F3 3D BD */
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) /* F4 3E BE */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) /* F5 3F BF */
-
- PORT_START("KEY4") /* IN7 */
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) /* F6 40 C0 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) /* F7 41 C1 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) /* F8 42 C2 */
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) /* F9 43 C3 */
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) /* F10 44 C4 */
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NumLock") PORT_CODE(KEYCODE_NUMLOCK) /* Num Lock 45 C5 */
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ScrLock (F14)") PORT_CODE(KEYCODE_SCRLOCK) /* Scroll Lock 46 C6 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 7 (Home)") PORT_CODE(KEYCODE_7_PAD ) /* Keypad 7 (Home) 47 C7 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 8 (Up)") PORT_CODE(KEYCODE_8_PAD ) /* Keypad 8 (Up arrow) 48 C8 */
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 9 (PgUp)") PORT_CODE(KEYCODE_9_PAD ) /* Keypad 9 (PgUp) 49 C9 */
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP -") PORT_CODE(KEYCODE_MINUS_PAD) /* Keypad - 4A CA */
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 4 (Left)") PORT_CODE(KEYCODE_4_PAD ) /* Keypad 4 (Left arrow) 4B CB */
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 5") PORT_CODE(KEYCODE_5_PAD) /* Keypad 5 4C CC */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 6 (Right)") PORT_CODE(KEYCODE_6_PAD ) /* Keypad 6 (Right arrow) 4D CD */
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP +") PORT_CODE(KEYCODE_PLUS_PAD) /* Keypad + 4E CE */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 1 (End)") PORT_CODE(KEYCODE_1_PAD ) /* Keypad 1 (End) 4F CF */
-
- PORT_START("KEY5") /* IN8 */
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 2 (Down)") PORT_CODE(KEYCODE_2_PAD ) /* Keypad 2 (Down arrow) 50 D0 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 3 (PgDn)") PORT_CODE(KEYCODE_3_PAD ) /* Keypad 3 (PgDn) 51 D1 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 0 (Ins)") PORT_CODE(KEYCODE_0_PAD ) /* Keypad 0 (Ins) 52 D2 */
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP . (Del)") PORT_CODE(KEYCODE_DEL_PAD ) /* Keypad . (Del) 53 D3 */
- PORT_BIT ( 0x0030, 0x0000, IPT_UNUSED )
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(84/102)\\") PORT_CODE(KEYCODE_BACKSLASH2) /* Backslash 2 56 D6 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)F11") PORT_CODE(KEYCODE_F11) /* F11 57 D7 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)F12") PORT_CODE(KEYCODE_F12) /* F12 58 D8 */
- PORT_BIT ( 0xfe00, 0x0000, IPT_UNUSED )
-
- PORT_START("KEY6") /* IN9 */
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)KP Enter") PORT_CODE(KEYCODE_ENTER_PAD) /* PAD Enter 60 e0 */
- PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)R-Control") PORT_CODE(KEYCODE_RCONTROL) /* Right Control 61 e1 */
- PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)ALTGR") PORT_CODE(KEYCODE_RALT) /* ALTGR 64 e4 */
-
- PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)KP /") PORT_CODE(KEYCODE_SLASH_PAD) /* PAD Slash 62 e2 */
-
- PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Home") PORT_CODE(KEYCODE_HOME) /* Home 66 e6 */
- PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Up") PORT_CODE(KEYCODE_UP) /* Up 67 e7 */
- PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Page Up") PORT_CODE(KEYCODE_PGUP) /* Page Up 68 e8 */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Left") PORT_CODE(KEYCODE_LEFT) /* Left 69 e9 */
- PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Right") PORT_CODE(KEYCODE_RIGHT) /* Right 6a ea */
- PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)End") PORT_CODE(KEYCODE_END) /* End 6b eb */
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Down") PORT_CODE(KEYCODE_DOWN) /* Down 6c ec */
- PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Page Down") PORT_CODE(KEYCODE_PGDN) /* Page Down 6d ed */
- PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Insert") PORT_CODE(KEYCODE_INSERT) /* Insert 6e ee */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Delete") PORT_CODE(KEYCODE_DEL) /* Delete 6f ef */
-
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)PrtScr (F13)") PORT_CODE(KEYCODE_PRTSCR) /* Print Screen 63 e3 */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Pause (F15)") PORT_CODE(KEYCODE_PAUSE) /* Pause 65 e5 */
-
- PORT_START("KEY7") /* IN10 */
- PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED )
-#if 0
- PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Print Screen") PORT_CODE(KEYCODE_PRTSCR) /* Print Screen alternate 77 f7 */
- PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Win") /* Left Win 7d fd */
- PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Win") /* Right Win 7e fe */
- PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Menu") /* Menu 7f ff */
-#endif
-INPUT_PORTS_END
-
-ioport_constructor geneve_keyboard_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( genkeys );
-}
} } } // end namespace bus::ti99::internal
diff --git a/src/devices/bus/ti99/internal/genboard.h b/src/devices/bus/ti99/internal/genboard.h
index b0d6ba7bb1c..3e927ab70df 100644
--- a/src/devices/bus/ti99/internal/genboard.h
+++ b/src/devices/bus/ti99/internal/genboard.h
@@ -23,6 +23,7 @@
#include "machine/mm58274c.h"
#include "machine/at29x.h"
#include "machine/ram.h"
+#include "bus/pc_kbd/pc_kbdc.h"
enum
{
@@ -37,12 +38,12 @@ enum
GENEVE_PFM512A
};
-#define GENEVE_KEYBOARD_TAG "gkeyboard"
-#define GENEVE_MAPPER_TAG "gmapper"
+#define GENEVE_GATE_ARRAY_TAG "gatearray"
#define GENEVE_MOUSE_TAG "gmouse"
#define GENEVE_CLOCK_TAG "mm58274c"
#define GENEVE_PFM512_TAG "pfm512"
#define GENEVE_PFM512A_TAG "pfm512a"
+#define GENEVE_KEYBOARD_CONN_TAG "keybconn"
#define GENEVE_SRAM_TAG "sram"
#define GENEVE_DRAM_TAG "dram"
@@ -53,66 +54,10 @@ namespace bus { namespace ti99 { namespace internal {
/*****************************************************************************/
-class geneve_keyboard_device : public device_t
+class geneve_gate_array_device : public device_t
{
public:
- geneve_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_WRITE_LINE_MEMBER( reset_line );
- DECLARE_WRITE_LINE_MEMBER( send_scancodes );
- DECLARE_WRITE_LINE_MEMBER( clock_control );
- uint8_t get_recent_key();
-
- auto int_cb() { return m_interrupt.bind(); }
-
-protected:
- void device_start() override;
- void device_reset() override;
- ioport_constructor device_input_ports() const override;
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
-
- devcb_write_line m_interrupt; // Keyboard interrupt to console
- required_ioport_array<8> m_keys;
-
-private:
- static constexpr unsigned KEYQUEUESIZE = 256;
- static constexpr unsigned MAXKEYMSGLENGTH = 10;
- static constexpr unsigned KEYAUTOREPEATDELAY = 30;
- static constexpr unsigned KEYAUTOREPEATRATE = 6;
-
- void post_in_key_queue(int keycode);
- void signal_when_key_available();
- void poll();
-
- bool m_key_reset;
- int m_key_queue_length;
- uint8_t m_key_queue[KEYQUEUESIZE];
- int m_key_queue_head;
- bool m_key_in_buffer;
- uint32_t m_key_state_save[4];
- bool m_key_numlock_state;
-
- int m_key_ctrl_state;
- int m_key_alt_state;
- int m_key_real_shift_state;
-
- bool m_key_fake_shift_state;
- bool m_key_fake_unshift_state;
-
- int m_key_autorepeat_key;
- int m_key_autorepeat_timer;
-
- bool m_keep_keybuf;
- bool m_keyboard_clock;
-
- emu_timer* m_timer;
-};
-
-/*****************************************************************************/
-
-class geneve_mapper_device : public device_t
-{
-public:
- geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ geneve_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void set_geneve_mode(bool geneve);
void set_direct_mode(bool direct);
@@ -130,44 +75,24 @@ public:
DECLARE_WRITE_LINE_MEMBER( clock_in );
DECLARE_WRITE_LINE_MEMBER( dbin_in );
+ // Keyboard support
+ DECLARE_WRITE_LINE_MEMBER( set_keyboard_clock );
+ DECLARE_WRITE_LINE_MEMBER( enable_shift_register );
+ DECLARE_WRITE_LINE_MEMBER( kbdclk );
+ DECLARE_WRITE_LINE_MEMBER( kbddata );
+
// PFM support
DECLARE_WRITE_LINE_MEMBER( pfm_select_lsb );
DECLARE_WRITE_LINE_MEMBER( pfm_select_msb );
DECLARE_WRITE_LINE_MEMBER( pfm_output_enable );
auto ready_cb() { return m_ready.bind(); }
+ auto kbdint_cb() { return m_keyint.bind(); }
protected:
- geneve_mapper_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- void device_start() override;
- virtual void device_reset() override;
+ geneve_gate_array_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
void common_reset();
- // GROM simulation
- bool m_gromwaddr_LSB;
- bool m_gromraddr_LSB;
- int m_grom_address;
- uint8_t read_grom(offs_t offset);
- void write_grom(offs_t offset, uint8_t data);
-
- // wait states
- void set_wait(int min);
- void set_video_waitcount(int min);
- bool m_video_waitstates;
- bool m_extra_waitstates;
- bool m_ready_asserted;
-
- bool m_read_mode;
-
- bool m_debug_no_ws;
- bool m_geneve_mode;
- bool m_direct_mode;
- int m_cartridge_size;
- bool m_cartridge_secondpage;
- bool m_cartridge6_writable;
- bool m_cartridge7_writable;
- int m_map[8];
-
/*
Constants for mapper decoding. Naming scheme:
M=Mapper, L=Logical space; P=Physical space
@@ -200,6 +125,39 @@ protected:
int wait; // Wait states
} decdata;
+ uint8_t* m_eprom;
+ int m_pbox_prefix;
+ int m_boot_rom;
+
+private:
+ void device_start() override;
+ virtual void device_reset() override;
+
+ // GROM simulation
+ bool m_gromwaddr_LSB;
+ bool m_gromraddr_LSB;
+ int m_grom_address;
+ uint8_t read_grom(offs_t offset);
+ void write_grom(offs_t offset, uint8_t data);
+
+ // wait states
+ void set_wait(int min);
+ void set_video_waitcount(int min);
+ bool m_video_waitstates;
+ bool m_extra_waitstates;
+ bool m_ready_asserted;
+
+ bool m_read_mode;
+
+ bool m_debug_no_ws;
+ bool m_geneve_mode;
+ bool m_direct_mode;
+ int m_cartridge_size;
+ bool m_cartridge_secondpage;
+ bool m_cartridge6_writable;
+ bool m_cartridge7_writable;
+ int m_map[8];
+
// The result of decoding
decdata m_decoded;
@@ -219,17 +177,6 @@ protected:
const char* description; // Good for logging
} logentry_t;
- logentry_t m_logmap[7] =
- {
- { 0xf100, 0x000e, 0x8800, 0x03fe, 0x0400, MLVIDEO, "video" },
- { 0xf110, 0x0007, 0x8000, 0x0007, 0x0000, MLMAPPER, "mapper" },
- { 0xf118, 0x0007, 0x8008, 0x0007, 0x0000, MLKEY, "keyboard" },
- { 0xf120, 0x000e, 0x8400, 0x03fe, 0x0000, MLSOUND, "sound" },
- { 0xf130, 0x000f, 0x8010, 0x000f, 0x0000, MLCLOCK, "clock" },
- { 0x0000, 0x0000, 0x9000, 0x03fe, 0x0400, MBOX, "speech (in P-Box)" },
- { 0x0000, 0x0000, 0x9800, 0x03fe, 0x0400, MLGROM, "GROM" },
- };
-
// Static decoder entry for the physical space
// There are no differences between native mode and TI mode.
typedef struct
@@ -241,13 +188,8 @@ protected:
const char* description; // Good for logging
} physentry_t;
- physentry_t m_physmap[4] =
- {
- { 0x000000, 0x07ffff, MPDRAM, 1, "DRAM" },
- { 0x080000, 0x07ffff, MPEXP, 1, "on-board expansion" },
- { 0x1e0000, 0x01ffff, MPEPROM, 0, "EPROM" },
- { 0x180000, 0x07ffff, MPSRAM, 0, "SRAM" }
- };
+ static const geneve_gate_array_device::logentry_t s_logmap[];
+ static const geneve_gate_array_device::physentry_t s_physmap[];
void decode_logical(bool reading, decdata* dec);
void map_address(bool reading, decdata* dec);
@@ -258,12 +200,9 @@ protected:
// PFM mod (0 = none, 1 = AT29C040, 2 = AT29C040A)
uint8_t boot_rom(offs_t offset);
void write_to_pfm(offs_t offset, uint8_t data);
- int m_boot_rom;
int m_pfm_bank;
bool m_pfm_output_enable;
- int m_pbox_prefix;
-
// SRAM access
int m_sram_mask;
int m_sram_val;
@@ -271,29 +210,40 @@ protected:
// Ready line to the CPU
devcb_write_line m_ready;
+ // Keyboard interrupt
+ devcb_write_line m_keyint;
+
// Counter for the wait states.
int m_waitcount;
int m_video_waitcount;
+ // Keyboard support
+ uint16_t m_keyboard_shift_reg;
+ line_state m_keyboard_last_clock;
+ line_state m_keyboard_data_in;
+ bool m_shift_reg_enabled;
+ void shift_reg_changed();
+
// Devices
- required_device<mm58274c_device> m_clock;
required_device<tms9995_device> m_cpu;
+ required_device<sn76496_base_device> m_sound;
+ required_device<v9938_device> m_video;
+ required_device<mm58274c_device> m_rtc;
+ required_device<ram_device> m_sram;
+ required_device<ram_device> m_dram;
+
+ required_device<bus::ti99::peb::peribox_device> m_peribox;
+
required_device<at29c040_device> m_pfm512;
required_device<at29c040a_device> m_pfm512a;
- required_device<sn76496_base_device> m_sound;
- required_device<bus::ti99::internal::geneve_keyboard_device> m_keyboard;
- required_device<v9938_device> m_video;
- required_device<bus::ti99::peb::peribox_device> m_peribox;
- uint8_t* m_eprom;
- required_device<ram_device> m_sram;
- required_device<ram_device> m_dram;
+ required_device<pc_kbdc_device> m_keyb_conn;
};
-class genmod_mapper_device : public geneve_mapper_device
+class genmod_gate_array_device : public geneve_gate_array_device
{
public:
- genmod_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ genmod_gate_array_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void decode_mod(decdata* dec) override;
void device_reset() override;
DECLARE_INPUT_CHANGED_MEMBER( setgm_changed );
@@ -306,8 +256,7 @@ private:
} } } // end namespace bus::ti99::internal
-DECLARE_DEVICE_TYPE_NS(GENEVE_KEYBOARD, bus::ti99::internal, geneve_keyboard_device)
-DECLARE_DEVICE_TYPE_NS(GENEVE_MAPPER, bus::ti99::internal, geneve_mapper_device)
-DECLARE_DEVICE_TYPE_NS(GENMOD_MAPPER, bus::ti99::internal, genmod_mapper_device)
+DECLARE_DEVICE_TYPE_NS(GENEVE_GATE_ARRAY, bus::ti99::internal, geneve_gate_array_device)
+DECLARE_DEVICE_TYPE_NS(GENMOD_GATE_ARRAY, bus::ti99::internal, genmod_gate_array_device)
#endif // MAME_BUS_TI99_INTERNAL_GENBOARD_H
diff --git a/src/devices/bus/ti99/internal/genkbd.cpp b/src/devices/bus/ti99/internal/genkbd.cpp
new file mode 100644
index 00000000000..92f0e34b66b
--- /dev/null
+++ b/src/devices/bus/ti99/internal/genkbd.cpp
@@ -0,0 +1,648 @@
+// license:BSD-3-Clause
+// copyright-holders:Michael Zapf
+/**********************************************************************
+
+ Geneve 9640 101-key XT/AT keyboard (High-level emulation)
+
+ Geneves may use any XT keyboard; some were delivered with a 101-key XT/AT
+ keyboard.
+
+ This is a high-level emulation in the sense that it is only emulated
+ from its behavior, not from its actual chipset. This will be done as
+ soon as we have a ROM dump.
+
+ Although the keyboard is switchable between XT and AT mode, we will
+ only emulate the XT mode here.
+
+ The code is copied from the previous implementation in genboard.cpp
+ and appropriately adapted to use the pc_kbd interface.
+
+ The XT keyboard interface is described in various places on the internet.
+ It does not comply with the PS2 protocol. The keyboard transmits 8-bit
+ scancodes serially with one (1) or two (0,1) start bits, LSB to MSB,
+ no parity and no stop bits. Each bit is read into the shift register
+ when the clock line is pulled low by the keyboard.
+
+ MZ, August 2019
+
+****************************************************************************/
+
+#include "emu.h"
+#include "genkbd.h"
+
+#define LOG_WARN (1U<<1)
+#define LOG_QUEUE (1U<<2)
+#define LOG_TRANSFER (1U<<3)
+#define LOG_LINES (1U<<4)
+
+#define VERBOSE ( LOG_GENERAL | LOG_WARN )
+
+#include "logmacro.h"
+
+DEFINE_DEVICE_TYPE(KBD_GENEVE_XT_101_HLE, geneve_xt_101_hle_keyboard_device, "kb_geneve_hle", "Geneve XT Keyboard 101 Keys (HLE)")
+
+INPUT_PORTS_START( geneve_xt_101_hle_keyboard )
+ PORT_START("KEY0") /* IN3 */
+ PORT_BIT(0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) /* Esc 01 81 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) /* 1 02 82 */
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) /* 2 03 83 */
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) /* 3 04 84 */
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) /* 4 05 85 */
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) /* 5 06 86 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) /* 6 07 87 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) /* 7 08 88 */
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) /* 8 09 89 */
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) /* 9 0A 8A */
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) /* 0 0B 8B */
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- _") PORT_CODE(KEYCODE_MINUS) /* - 0C 8C */
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) /* = 0D 8D */
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) /* Backspace 0E 8E */
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) /* Tab 0F 8F */
+
+ PORT_START("KEY1") /* IN4 */
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) /* Q 10 90 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) /* W 11 91 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) /* E 12 92 */
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) /* R 13 93 */
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) /* T 14 94 */
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) /* Y 15 95 */
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) /* U 16 96 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) /* I 17 97 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) /* O 18 98 */
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) /* P 19 99 */
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE) /* [ 1A 9A */
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) /* ] 1B 9B */
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) /* Enter 1C 9C */
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L-Ctrl") PORT_CODE(KEYCODE_LCONTROL) /* LCtrl 1D 9D */
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) /* A 1E 9E */
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) /* S 1F 9F */
+
+ PORT_START("KEY2") /* IN5 */
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) /* D 20 A0 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) /* F 21 A1 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) /* G 22 A2 */
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) /* H 23 A3 */
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) /* J 24 A4 */
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) /* K 25 A5 */
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) /* L 26 A6 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) /* ; 27 A7 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE) /* ' 28 A8 */
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("` ~") PORT_CODE(KEYCODE_TILDE) /* ` 29 A9 */
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L-Shift") PORT_CODE(KEYCODE_LSHIFT) /* LShift 2A AA */
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_BACKSLASH) /* \ 2B AB */
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) /* Z 2C AC */
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) /* X 2D AD */
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) /* C 2E AE */
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) /* V 2F AF */
+
+ PORT_START("KEY3") /* IN6 */
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) /* B 30 B0 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) /* N 31 B1 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) /* M 32 B2 */
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) /* , 33 B3 */
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) /* . 34 B4 */
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) /* / 35 B5 */
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R-Shift") PORT_CODE(KEYCODE_RSHIFT) /* RShift 36 B6 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP * (PrtScr)") PORT_CODE(KEYCODE_ASTERISK ) /* KP * (PrtSc) 37 B7 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alt") PORT_CODE(KEYCODE_LALT) /* LAlt 38 B8 */
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) /* Space 39 B9 */
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps") PORT_CODE(KEYCODE_CAPSLOCK) /* Caps Lock 3A BA */
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) /* F1 3B BB */
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) /* F2 3C BC */
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) /* F3 3D BD */
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) /* F4 3E BE */
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) /* F5 3F BF */
+
+ PORT_START("KEY4") /* IN7 */
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) /* F6 40 C0 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) /* F7 41 C1 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) /* F8 42 C2 */
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) /* F9 43 C3 */
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) /* F10 44 C4 */
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NumLock") PORT_CODE(KEYCODE_NUMLOCK) /* Num Lock 45 C5 */
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ScrLock (F14)") PORT_CODE(KEYCODE_SCRLOCK) /* Scroll Lock 46 C6 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 7 (Home)") PORT_CODE(KEYCODE_7_PAD) /* KP 7 (Home) 47 C7 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 8 (Up)") PORT_CODE(KEYCODE_8_PAD) /* KP 8 (Up) 48 C8 */
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 9 (PgUp)") PORT_CODE(KEYCODE_9_PAD) /* KP 9 (PgUp) 49 C9 */
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP -") PORT_CODE(KEYCODE_MINUS_PAD) /* KP - 4A CA */
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 4 (Left)") PORT_CODE(KEYCODE_4_PAD) /* KP 4 (Left) 4B CB */
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 5") PORT_CODE(KEYCODE_5_PAD) /* KP 5 4C CC */
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 6 (Right)") PORT_CODE(KEYCODE_6_PAD) /* KP 6 (Right)4D CD */
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP +") PORT_CODE(KEYCODE_PLUS_PAD) /* KP + 4E CE */
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 1 (End)") PORT_CODE(KEYCODE_1_PAD) /* KP 1 (End) 4F CF */
+
+ PORT_START("KEY5") /* IN8 */
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 2 (Down)") PORT_CODE(KEYCODE_2_PAD) /* KP 2 (Down) 50 D0 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 3 (PgDn)") PORT_CODE(KEYCODE_3_PAD) /* KP 3 (PgDn) 51 D1 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 0 (Ins)") PORT_CODE(KEYCODE_0_PAD) /* KP 0 (Ins) 52 D2 */
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP . (Del)") PORT_CODE(KEYCODE_DEL_PAD) /* KP . (Del) 53 D3 */
+ PORT_BIT ( 0x0030, 0x0000, IPT_UNUSED )
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(84/102)\\") PORT_CODE(KEYCODE_BACKSLASH2) /* Backslash 2 56 D6 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)F11") PORT_CODE(KEYCODE_F11) /* F11 57 D7 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)F12") PORT_CODE(KEYCODE_F12) /* F12 58 D8 */
+ PORT_BIT ( 0xfe00, 0x0000, IPT_UNUSED )
+
+ PORT_START("KEY6") /* IN9 */
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)KP Enter") PORT_CODE(KEYCODE_ENTER_PAD) /* KP Enter 60 e0 */
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)R-Control") PORT_CODE(KEYCODE_RCONTROL) /* RCtrl 61 e1 */
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)AltGr") PORT_CODE(KEYCODE_RALT) /* AltGr 64 e4 */
+
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)KP /") PORT_CODE(KEYCODE_SLASH_PAD) /* KP Slash 62 e2 */
+
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Home") PORT_CODE(KEYCODE_HOME) /* Home 66 e6 */
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Up") PORT_CODE(KEYCODE_UP) /* Up 67 e7 */
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Page Up") PORT_CODE(KEYCODE_PGUP) /* Page Up 68 e8 */
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Left") PORT_CODE(KEYCODE_LEFT) /* Left 69 e9 */
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Right") PORT_CODE(KEYCODE_RIGHT) /* Right 6a ea */
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)End") PORT_CODE(KEYCODE_END) /* End 6b eb */
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Cursor Down") PORT_CODE(KEYCODE_DOWN) /* Down 6c ec */
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Page Down") PORT_CODE(KEYCODE_PGDN) /* Page Down 6d ed */
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Insert") PORT_CODE(KEYCODE_INSERT) /* Insert 6e ee */
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Delete") PORT_CODE(KEYCODE_DEL) /* Delete 6f ef */
+
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)PrtScr (F13)") PORT_CODE(KEYCODE_PRTSCR) /* Print Screen 63 e3 */
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(101)Pause (F15)") PORT_CODE(KEYCODE_PAUSE) /* Pause 65 e5 */
+
+ PORT_START("KEY7") /* IN10 */
+ PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED )
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor geneve_xt_101_hle_keyboard_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( geneve_xt_101_hle_keyboard );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// ibm_pc_xt_83_keyboard_device - constructor
+//-------------------------------------------------
+
+geneve_xt_101_hle_keyboard_device::geneve_xt_101_hle_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, KBD_GENEVE_XT_101_HLE, tag, owner, clock),
+ device_pc_kbd_interface(mconfig, *this),
+ m_keys(*this, "KEY%u", 0),
+ m_queue_length(0),
+ m_autorepeat_code(0),
+ m_autorepeat_timer(0),
+ m_fake_shift_state(false),
+ m_fake_unshift_state(false),
+ m_resetting(false),
+ m_clock_line(ASSERT_LINE),
+ m_data_line(ASSERT_LINE)
+{
+}
+
+/*
+ Called by the poll timer
+*/
+void geneve_xt_101_hle_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (id==0)
+ {
+ poll();
+ send_key();
+ }
+ else
+ {
+ if (id==1)
+ {
+ // Send timer
+ if (m_shift_count==10)
+ {
+ // Done, all sent
+ m_pc_kbdc->clock_write_from_kb(1);
+ m_pc_kbdc->data_write_from_kb(1);
+ m_send_timer->reset();
+ m_shift_count = 0;
+
+ // Adjust the queue
+ m_queue_head = (m_queue_head + 1) % KEYQUEUESIZE;
+ m_queue_length--;
+ }
+ else
+ {
+ m_pc_kbdc->clock_write_from_kb(1);
+ m_pc_kbdc->data_write_from_kb(m_shift_reg&1);
+ m_pc_kbdc->clock_write_from_kb(0);
+ m_shift_reg>>=1;
+ m_shift_count++;
+ }
+ }
+ }
+}
+
+
+/*
+ Translations
+*/
+static const uint8_t MF1_CODE[0xe] =
+{
+ // Extended keys that are equivalent to non-extended keys
+ 0x1c, // KP Enter -> Return
+ 0x1d, // RCtrl -> LCtrl
+ 0x38, // AltGr -> LAlt
+
+ // Extended key that is equivalent to a non-extended key with shift off
+ 0x35, // KP / -> /
+
+ // Extended keys that are equivalent to non-extended keys with numlock off
+ 0x47, // Home -> KP 7 (Home)
+ 0x48, // Up -> KP 8 (Up)
+ 0x49, // Page up -> KP 9 (PgUp)
+ 0x4b, // Left -> KP 4 (Left)
+ 0x4d, // Right -> KP 6 (Right)
+ 0x4f, // End -> KP 1 (End)
+ 0x50, // Down -> KP 2 (Down)
+ 0x51, // Page dn -> KP 3 (PgDn)
+ 0x52, // Insert -> KP 0 (Ins)
+ 0x53 // Delete -> KP . (Del)
+};
+
+void geneve_xt_101_hle_keyboard_device::poll()
+{
+ uint32_t keystate;
+ uint32_t key_transitions;
+ uint32_t mask;
+ bool pressed = false;
+ int keycode = 0;
+
+ if (m_resetting) return;
+
+ // We're testing two 16-bit ports at once
+ // but only if we have enough space in the queue
+ for (int i=0; (i < 4) && (m_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)); i++)
+ {
+ // Get those two ports and calculate the difference
+ keystate = m_keys[2*i]->read() | (m_keys[2*i + 1]->read() << 16);
+ key_transitions = keystate ^ m_key_state_save[i];
+ if (key_transitions != 0)
+ {
+ mask = 0x00000001;
+ // Some key(s) has/have changed (pressed/released)
+ for (int j=0; (j < 32) && (m_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)); j++)
+ {
+ if ((key_transitions & mask)!=0)
+ {
+ // Found one changed key (i is a 32-key block)
+ keycode = (i<<5) | j;
+ pressed = (keystate & mask)!=0;
+
+ // Auto-repeat
+ if (pressed)
+ {
+ m_autorepeat_code = keycode;
+ m_autorepeat_timer = KEYAUTOREPEATDELAY+1;
+ m_key_state_save[i] |= mask;
+ }
+ else
+ {
+ m_autorepeat_code = 0;
+ m_key_state_save[i] &= ~mask;
+ }
+
+ // We are here because the set of pressed keys has changed
+ // In the case that we have a fake shift/unshift,
+ // we have to release it.
+
+ if (m_fake_shift_state)
+ {
+ /* Fake shift release */
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0xaa);
+ m_fake_shift_state = false;
+ }
+ if (m_fake_unshift_state)
+ {
+ /* Fake shift press */
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0x2a);
+ m_fake_unshift_state = false;
+ }
+
+ switch (keycode)
+ {
+ case 0x2a:
+ m_left_shift = pressed;
+ break;
+ case 0x36:
+ m_right_shift = pressed;
+ break;
+ case 0x1d:
+ m_left_ctrl = pressed;
+ break;
+ case 0x61:
+ m_right_ctrl = pressed;
+ break;
+ case 0x38:
+ m_left_alt = pressed;
+ break;
+ case 0x62:
+ m_altgr = pressed;
+ break;
+ case 0x45:
+ if (pressed) m_numlock = !m_numlock;
+ break;
+ default:
+ break;
+ }
+
+ // Extended keycodes
+ if ((keycode >= 0x60) && (keycode < 0x6e))
+ {
+ if ((keycode >= 0x63) && pressed)
+ {
+ // Handle shift state
+ if (keycode == 0x63) // Slash
+ {
+ if (m_left_shift || m_right_shift)
+ {
+ // Fake shift unpress
+ m_fake_unshift_state = true;
+ }
+ }
+ else
+ { // Key function with NumLock=0
+ if (m_numlock && (!m_left_shift) && (!m_right_shift))
+ {
+ // Fake shift press if numlock is active
+ m_fake_shift_state = true;
+ }
+ else
+ {
+ if ((!m_numlock) && (m_left_shift || m_right_shift))
+ {
+ // Fake shift unpress if shift is down
+ m_fake_unshift_state = true;
+ }
+ }
+ }
+
+ if (m_fake_shift_state)
+ {
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0x2a);
+ }
+
+ if (m_fake_unshift_state)
+ {
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0xaa);
+ }
+ }
+ keycode = MF1_CODE[keycode-0x60];
+ if (!pressed) keycode |= 0x80;
+ post_in_key_queue(0xe0);
+ post_in_key_queue(keycode);
+ }
+ else
+ {
+ if (keycode == 0x6e)
+ {
+ // Emulate Print Screen / System Request (F13) key
+ // this is a bit complex, as Alt+PrtScr -> SysRq
+ // Additionally, Ctrl+PrtScr involves no fake shift press
+ if (m_left_alt || m_altgr)
+ {
+ // SysRq
+ keycode = 0x54;
+ if (!pressed) keycode |= 0x80;
+ post_in_key_queue(keycode);
+ }
+ else
+ {
+ // Handle shift state
+ if (pressed && (!m_left_shift) && (!m_right_shift) && (!m_left_ctrl) && (!m_right_ctrl))
+ { // Fake shift press
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0x2a);
+ m_fake_shift_state = true;
+ }
+
+ keycode = 0x37;
+ if (!pressed) keycode |= 0x80;
+ post_in_key_queue(0xe0);
+ post_in_key_queue(keycode);
+ }
+ }
+ else
+ {
+ if (keycode == 0x6f)
+ {
+ // Emulate pause (F15) key
+ // This is a bit complex, as Pause -> Ctrl+NumLock and
+ // Ctrl+Pause -> Ctrl+ScrLock.
+ // Furthermore, there is no repeat or release.
+ if (pressed)
+ {
+ if (m_left_ctrl || m_right_ctrl)
+ {
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0x46);
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0xc6);
+ }
+ else
+ {
+ post_in_key_queue(0xe1);
+ post_in_key_queue(0x1d);
+ post_in_key_queue(0x45);
+ post_in_key_queue(0xe1);
+ post_in_key_queue(0x9d);
+ post_in_key_queue(0xc5);
+ }
+ }
+ }
+ else
+ {
+ if (!pressed) keycode |= 0x80;
+ post_in_key_queue(keycode);
+ }
+ }
+ }
+
+ }
+ mask <<= 1;
+ }
+ }
+ }
+
+ // Implement auto repeat
+ if (m_autorepeat_code != 0)
+ {
+ m_autorepeat_timer--;
+ if ((m_autorepeat_timer == 0) && (m_queue_length <= (KEYQUEUESIZE-MAXKEYMSGLENGTH)))
+ {
+ // Extended code
+ if ((m_autorepeat_code >= 0x60) && (m_autorepeat_code < 0x6e))
+ {
+ post_in_key_queue(0xe0);
+ post_in_key_queue(MF1_CODE[m_autorepeat_code-0x60]);
+ }
+ else
+ {
+ if (m_autorepeat_code == 0x6e)
+ {
+ if (m_left_alt || m_altgr)
+ {
+ post_in_key_queue(0x54); // SysRq
+ }
+ else
+ {
+ post_in_key_queue(0xe0);
+ post_in_key_queue(0x37); // PrtScr
+ }
+ }
+ else
+ {
+ if (m_autorepeat_code != 0x6f) // Pause cannot do an auto-repeat
+ {
+ post_in_key_queue(m_autorepeat_code);
+ }
+ }
+ }
+ m_autorepeat_timer = KEYAUTOREPEATRATE;
+ }
+ }
+}
+
+void geneve_xt_101_hle_keyboard_device::send_key()
+{
+ if (m_clock_line == CLEAR_LINE)
+ {
+ m_reset_timer--;
+ if (m_reset_timer==0)
+ {
+ LOG("Reset triggered\n");
+ reset_line(0);
+ reset_line(1);
+ }
+ }
+ else
+ {
+ if (m_data_line==1)
+ {
+ // Dequeue a key
+ if (m_queue_length != 0)
+ {
+ LOGMASKED(LOG_TRANSFER, "Send keycode %02x\n", m_queue[m_queue_head]);
+ // Get the next key, add the two start bits to the right (0,1)
+ m_shift_reg = (m_queue[m_queue_head] << 2) | 0x02;
+ m_send_timer->adjust(attotime::from_usec(1), 0, attotime::from_hz(10000));
+ }
+ }
+ else
+ LOGMASKED(LOG_TRANSFER, "Transfer blocked by data=0 from host\n");
+ }
+}
+
+void geneve_xt_101_hle_keyboard_device::post_in_key_queue(int keycode)
+{
+ m_queue[(m_queue_head + m_queue_length) % KEYQUEUESIZE] = keycode;
+ m_queue_length++;
+
+ LOGMASKED(LOG_QUEUE, "Enqueue keycode %02x, queue length=%d\n", keycode, m_queue_length);
+}
+
+//-------------------------------------------------
+// clock_write -
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( geneve_xt_101_hle_keyboard_device::clock_write )
+{
+ LOGMASKED(LOG_LINES, "Clock write: %d\n", state);
+ m_clock_line = (line_state)state;
+ if (m_clock_line == CLEAR_LINE)
+ {
+ if (m_reset_timer == -1)
+ m_reset_timer = 3; // 25 ms
+ }
+ else
+ m_reset_timer = -1;
+}
+
+
+//-------------------------------------------------
+// data_write -
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( geneve_xt_101_hle_keyboard_device::data_write )
+{
+ LOGMASKED(LOG_LINES, "Data write: %d\n", state);
+ m_data_line = (line_state)state;
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void geneve_xt_101_hle_keyboard_device::device_start()
+{
+ set_pc_kbdc_device();
+ m_poll_timer = timer_alloc(0);
+ m_send_timer = timer_alloc(1);
+
+ // state saving
+ save_item(NAME(m_queue_length));
+ save_item(NAME(m_queue_head));
+ save_pointer(NAME(m_key_state_save),4);
+ save_pointer(NAME(m_queue),KEYQUEUESIZE);
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void geneve_xt_101_hle_keyboard_device::device_reset()
+{
+ // Trigger our reset line
+ reset_line(0);
+ reset_line(1);
+ m_poll_timer->adjust(attotime::from_usec(1), 0, attotime::from_hz(120));
+}
+
+
+WRITE_LINE_MEMBER( geneve_xt_101_hle_keyboard_device::reset_line )
+{
+ m_resetting = (state==0);
+
+ if (m_resetting)
+ {
+ // Reset -> clear keyboard key queue
+ m_reset_timer = -1;
+ m_queue_length = 0;
+ m_queue_head = 0;
+ memset(m_key_state_save, 0, sizeof(m_key_state_save));
+
+ m_numlock = false;
+ m_left_shift = false;
+ m_right_shift = false;
+ m_left_ctrl = false;
+ m_right_ctrl = false;
+ m_left_alt = false;
+ m_altgr = false;
+
+ m_fake_shift_state = false;
+ m_fake_unshift_state = false;
+ m_autorepeat_code = 0;
+
+ m_shift_reg = 0;
+ m_shift_count = 0;
+
+ // Send the BAT (Basic assurance test) OK value (AA)
+ post_in_key_queue(0xaa);
+ }
+}
+
diff --git a/src/devices/bus/ti99/internal/genkbd.h b/src/devices/bus/ti99/internal/genkbd.h
new file mode 100644
index 00000000000..78d985a6160
--- /dev/null
+++ b/src/devices/bus/ti99/internal/genkbd.h
@@ -0,0 +1,89 @@
+// license:BSD-3-Clause
+// copyright-holders:Michael Zapf
+/**********************************************************************
+
+ Geneve 9640 101-key XT/AT keyboard (High-level emulation)
+
+*********************************************************************/
+
+#ifndef MAME_BUS_TI99_INTERNAL_GENKBD_H
+#define MAME_BUS_TI99_INTERNAL_GENKBD_H
+
+#pragma once
+
+#include "bus/pc_kbd/pc_kbdc.h"
+
+#define STR_KBD_GENEVE_XT_101_HLE "geneve_kb_101"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> geneve_xt_101_hle_keyboard_device
+
+class geneve_xt_101_hle_keyboard_device : public device_t, public device_pc_kbd_interface
+{
+public:
+ // construction/destruction
+ geneve_xt_101_hle_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ DECLARE_WRITE_LINE_MEMBER( reset_line );
+
+protected:
+ // device-level overrides
+ void device_start() override;
+ void device_reset() override;
+ ioport_constructor device_input_ports() const override;
+
+ // device_pc_kbd_interface overrides
+ DECLARE_WRITE_LINE_MEMBER( clock_write ) override;
+ DECLARE_WRITE_LINE_MEMBER( data_write ) override;
+
+private:
+ emu_timer *m_poll_timer;
+ emu_timer *m_send_timer;
+
+ void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ static constexpr unsigned KEYQUEUESIZE = 256;
+ static constexpr unsigned MAXKEYMSGLENGTH = 10;
+ static constexpr unsigned KEYAUTOREPEATDELAY = 30;
+ static constexpr unsigned KEYAUTOREPEATRATE = 6;
+
+ void poll();
+ void send_key();
+ void post_in_key_queue(int key);
+
+ required_ioport_array<8> m_keys;
+
+ int m_queue_length;
+ int m_queue_head;
+ uint8_t m_queue[KEYQUEUESIZE];
+ uint32_t m_key_state_save[4];
+ int m_autorepeat_code;
+ int m_autorepeat_timer;
+ bool m_fake_shift_state;
+ bool m_fake_unshift_state;
+
+ bool m_left_shift;
+ bool m_right_shift;
+ bool m_left_ctrl;
+ bool m_right_ctrl;
+ bool m_left_alt;
+ bool m_altgr;
+ bool m_numlock;
+
+ bool m_resetting;
+
+ line_state m_clock_line;
+ line_state m_data_line;
+ int m_reset_timer;
+
+ int m_shift_reg;
+ int m_shift_count;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(KBD_GENEVE_XT_101_HLE, geneve_xt_101_hle_keyboard_device)
+
+#endif // MAME_BUS_TI99_INTERNAL_GENKBD_H
diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp
index 0a32b265bc7..499b0e40ff7 100644
--- a/src/devices/cpu/drcbex64.cpp
+++ b/src/devices/cpu/drcbex64.cpp
@@ -544,9 +544,10 @@ inline void drcbe_x64::normalize_commutative(be_parameter &inner, be_parameter &
inline int32_t drcbe_x64::offset_from_rbp(const void *ptr)
{
- int64_t delta = reinterpret_cast<uint8_t *>(const_cast<void *>(ptr)) - m_rbpvalue;
- assert_always((int32_t)delta == delta, "offset_from_rbp: delta out of range");
- return (int32_t)delta;
+ const int64_t delta = reinterpret_cast<const uint8_t *>(ptr) - m_rbpvalue;
+ if (int32_t(delta) != delta)
+ throw emu_fatalerror("drcbe_x64::offset_from_rbp: delta out of range");
+ return int32_t(delta);
}
@@ -558,7 +559,7 @@ inline int32_t drcbe_x64::offset_from_rbp(const void *ptr)
inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, uint8_t reg, int32_t &offset)
{
- int64_t delta = (uint8_t *)target - m_rbpvalue;
+ const int64_t delta = reinterpret_cast<uint8_t *>(target) - m_rbpvalue;
if (short_immediate(delta))
{
offset = delta;
@@ -567,7 +568,7 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target,
else
{
offset = 0;
- emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target
+ emit_mov_r64_imm(dst, reg, uintptr_t(target)); // mov reg,target
return reg;
}
}
@@ -580,12 +581,12 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target,
inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8_t reg)
{
- int64_t delta = target - (dst + 5);
+ const int64_t delta = target - (dst + 5);
if (short_immediate(delta))
emit_call(dst, target); // call target
else
{
- emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target
+ emit_mov_r64_imm(dst, reg, uintptr_t(target)); // mov reg,target
emit_call_r64(dst, reg); // call reg
}
}
@@ -598,7 +599,7 @@ inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8
inline void drcbe_x64::emit_smart_call_m64(x86code *&dst, x86code **target)
{
- int64_t delta = *target - (dst + 5);
+ const int64_t delta = *target - (dst + 5);
if (short_immediate(delta))
emit_call(dst, *target); // call *target
else
diff --git a/src/devices/cpu/hcd62121/hcd62121.cpp b/src/devices/cpu/hcd62121/hcd62121.cpp
index 53e9a1ed5da..4a99178dde5 100644
--- a/src/devices/cpu/hcd62121/hcd62121.cpp
+++ b/src/devices/cpu/hcd62121/hcd62121.cpp
@@ -1175,6 +1175,23 @@ void hcd62121_cpu_device::execute_run()
}
break;
+ case 0x50: /* xorb ir1,r2 */
+ case 0x51: /* xorw ir1,r2 */
+ case 0x52: /* xorq ir1,r2 */
+ case 0x53: /* xort ir1,r2 */
+ {
+ int size = datasize(op);
+ u8 reg1 = read_op();
+ u8 reg2 = read_op();
+
+ read_iregreg(size, reg1, reg2, true);
+
+ op_xor(size);
+
+ write_iregreg(size, reg1, reg2);
+ }
+ break;
+
case 0x54: /* cmpb ir1,r2 */
case 0x55: /* cmpw ir1,r2 */
case 0x56: /* cmpq ir1,r2 */
diff --git a/src/devices/cpu/m6805/m68hc05.cpp b/src/devices/cpu/m6805/m68hc05.cpp
index cd6168389d5..5cdbe2d619b 100644
--- a/src/devices/cpu/m6805/m68hc05.cpp
+++ b/src/devices/cpu/m6805/m68hc05.cpp
@@ -74,6 +74,19 @@ std::pair<u16, char const *> const m68hc705j1a_syms[] = {
{ 0x0014, "EPROG" },
{ 0x07f0, "COPR" }, { 0x07f1, "MOR" } };
+std::pair<u16, char const *> const m68hc05l9_syms[] = {
+ { 0x0000, "PORTA" }, { 0x0001, "PORTB" }, { 0x0002, "PORTC" }, { 0x0003, "PORTD" },
+ { 0x0004, "DDRA" }, { 0x0005, "DDRB" }, { 0x0006, "DDRC" }, { 0x0007, "DDRD" },
+ { 0x0008, "COUNT" },
+ { 0x0009, "GCR1" }, { 0x000a, "GCR2" },
+ { 0x000b, "MINA" }, { 0x000c, "HOURA" },
+ { 0x000d, "BAUD" }, { 0x000e, "SCCR1" }, { 0x000f, "SCCR2" }, { 0x0010, "SCSR" }, { 0x0011, "SCDR" },
+ { 0x0012, "TCR" }, { 0x0013, "TSR" },
+ { 0x0014, "ICRH" }, { 0x0015, "ICRL" }, { 0x0016, "OCRH" }, { 0x0017, "OCRL" },
+ { 0x0018, "TRH" }, { 0x0019, "TRL" }, { 0x001a, "ATRH" }, { 0x001b, "ATRL" },
+ { 0x001c, "RTCSR" },
+ { 0x001d, "HOUR" }, { 0x001e, "MIN" }, { 0x001f, "SEC" } };
+
ROM_START( m68hc705c8a )
ROM_REGION(0x00f0, "bootstrap", 0)
@@ -1045,7 +1058,7 @@ void m68hc05l9_device::l9_map(address_map &map)
map(0x0014, 0x0015).r(FUNC(m68hc05l9_device::icr_r));
map(0x0016, 0x0017).rw(FUNC(m68hc05l9_device::ocr_r), FUNC(m68hc05l9_device::ocr_w));
map(0x0018, 0x001b).r(FUNC(m68hc05l9_device::timer_r));
- // 0x001c RTC flags
+ // 0x001c RTC status and clock control
// 0x001d hours
// 0x001e minutes
// 0x001f seconds
@@ -1089,7 +1102,7 @@ void m68hc05l9_device::device_start()
std::unique_ptr<util::disasm_interface> m68hc05l9_device::create_disassembler()
{
- return std::make_unique<m68hc05_disassembler>(m68hc05c4_syms);
+ return std::make_unique<m68hc05_disassembler>(m68hc05l9_syms);
}
diff --git a/src/devices/cpu/powerpc/ppcdrc.cpp b/src/devices/cpu/powerpc/ppcdrc.cpp
index 00c635fc95c..120328a50a0 100644
--- a/src/devices/cpu/powerpc/ppcdrc.cpp
+++ b/src/devices/cpu/powerpc/ppcdrc.cpp
@@ -1068,7 +1068,7 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite
UML_AND(block, I0, I0, 0x7fffffff); // and i0,i0,0x7fffffff
UML_XOR(block, I0, I0, (mode & MODE_LITTLE_ENDIAN) ? (8 - size) : 0); // xor i0,i0,8-size
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
for (ramnum = 0; ramnum < PPC_MAX_FASTRAM; ramnum++)
if (m_fastram[ramnum].base != nullptr && (!iswrite || !m_fastram[ramnum].readonly))
{
diff --git a/src/devices/cpu/rii/riidasm.cpp b/src/devices/cpu/rii/riidasm.cpp
index cad53e121c9..aa8087c6fcc 100644
--- a/src/devices/cpu/rii/riidasm.cpp
+++ b/src/devices/cpu/rii/riidasm.cpp
@@ -16,8 +16,8 @@ using osd::u32;
using util::BIT;
using offs_t = u32;
-// FIXME: this set is an amalgam of ePG3231-EM202, EPD3332 and EPD3338
-const char *const riscii_disassembler::s_regs[0x60] =
+// TODO: add register sets for other models
+const char *const epg3231_disassembler::s_regs[0x60] =
{
"INDF0", "FSR0", "PCL", "PCM", "PCH", "BSR", "STKPTR", "BSR1",
"INDF1", "FSR1", "ACC", "TABPTRL", "TABPTRM", "TABPTRH", "CPUCON", "STATUS",
@@ -27,8 +27,8 @@ const char *const riscii_disassembler::s_regs[0x60] =
"TR2CON", "TRLIR", nullptr, "POST_ID", "ADCON", "PAINTEN", "PAINTSTA", "PAWAKE",
"UARTCON", "UARTSTA", "PORTJ", "PORTK", "DCRB", "DCRC", "DCRDE", "DCRFG",
"DCRHI", "DCRJK", "PBCON", "PCCON", "PLLF", "T0CL", "T0CH", "SPICON",
- "SPISTA", "SPRL", "SPRM", "SPRH", "SFCR", "ADDL1~ADDL4", "ADDM1~ADDM4", "ADDH1~ADDH4",
- "ENV1~4/SPHDR", "MTCON1~4/SPHTCON", "MTRL1~4/SPHTRL", "VOCON", "TR1C", "TR2C", "ADCF", nullptr,
+ "SPISTA", "SPRL", "SPRM", "SPRH", "SFCR", "ADDL", "ADDM", "ADDH",
+ "ENV/SPHDR", "MTCON/SPHTCON", "MTRL/SPHTRL", "VOCON", "TR1C", "TR2C", "ADCF", nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
};
diff --git a/src/devices/cpu/rii/riidasm.h b/src/devices/cpu/rii/riidasm.h
index 7c2ffb80bff..c2b5c81f7a6 100644
--- a/src/devices/cpu/rii/riidasm.h
+++ b/src/devices/cpu/rii/riidasm.h
@@ -8,9 +8,6 @@
class riscii_disassembler : public util::disasm_interface
{
-public:
- riscii_disassembler() : riscii_disassembler(s_regs) { }
-
protected:
// construction/destruction
riscii_disassembler(const char *const regs[]);
@@ -31,4 +28,13 @@ private:
const char *const *m_regs;
};
+class epg3231_disassembler : public riscii_disassembler
+{
+public:
+ epg3231_disassembler() : riscii_disassembler(s_regs) { }
+
+private:
+ static const char *const s_regs[0x60];
+};
+
#endif // MAME_CPU_RII_RIIDASM_H
diff --git a/src/devices/cpu/rii/riscii.cpp b/src/devices/cpu/rii/riscii.cpp
index c7b158bf3e0..0317c5c9c4b 100644
--- a/src/devices/cpu/rii/riscii.cpp
+++ b/src/devices/cpu/rii/riscii.cpp
@@ -11,7 +11,7 @@
13-bit opcodes.)
Currently the execution core is mostly complete, though interrupts and
- on-chip peripherals are completely unemulated.
+ on-chip peripherals are mostly unemulated.
***************************************************************************/
@@ -20,7 +20,7 @@
#include "riidasm.h"
// device type definitions
-DEFINE_DEVICE_TYPE(RISCII, riscii_series_device, "riscii", "Elan RISC II")
+DEFINE_DEVICE_TYPE(EPG3231, epg3231_device, "epg3231", "Elan ePG3231")
ALLOW_SAVE_TYPE(riscii_series_device::exec_state);
@@ -29,17 +29,18 @@ ALLOW_SAVE_TYPE(riscii_series_device::exec_state);
// DEVICE CONSTRUCTION AND INITIALIZATION
//**************************************************************************
-void riscii_series_device::regs_map(address_map &map)
+void riscii_series_device::core_regs_map(address_map &map)
{
- // 0x00 (INDF0) is not physically implemented
+ // INDF0 (R00h) is not physically implemented
map(0x0001, 0x0001).rw(FUNC(riscii_series_device::fsr0_r), FUNC(riscii_series_device::fsr0_w));
map(0x0002, 0x0002).rw(FUNC(riscii_series_device::pcl_r), FUNC(riscii_series_device::pcl_w));
map(0x0003, 0x0003).rw(FUNC(riscii_series_device::pcm_r), FUNC(riscii_series_device::pcm_w));
- map(0x0004, 0x0004).rw(FUNC(riscii_series_device::pch_r), FUNC(riscii_series_device::pch_w));
+ if (m_pcmask > 0xffff)
+ map(0x0004, 0x0004).rw(FUNC(riscii_series_device::pch_r), FUNC(riscii_series_device::pch_w));
map(0x0005, 0x0005).rw(FUNC(riscii_series_device::bsr_r), FUNC(riscii_series_device::bsr_w));
map(0x0006, 0x0006).rw(FUNC(riscii_series_device::stkptr_r), FUNC(riscii_series_device::stkptr_w));
map(0x0007, 0x0007).rw(FUNC(riscii_series_device::bsr1_r), FUNC(riscii_series_device::bsr1_w));
- // 0x08 (INDF1) is not physically implemented
+ // INDF1 (R08h) is not physically implemented
map(0x0009, 0x0009).rw(FUNC(riscii_series_device::fsr1_r), FUNC(riscii_series_device::fsr1_w));
map(0x000a, 0x000a).rw(FUNC(riscii_series_device::acc_r), FUNC(riscii_series_device::acc_w));
map(0x000b, 0x000b).rw(FUNC(riscii_series_device::tabptrl_r), FUNC(riscii_series_device::tabptrl_w));
@@ -47,31 +48,31 @@ void riscii_series_device::regs_map(address_map &map)
map(0x000d, 0x000d).rw(FUNC(riscii_series_device::tabptrh_r), FUNC(riscii_series_device::tabptrh_w));
map(0x000e, 0x000e).rw(FUNC(riscii_series_device::cpucon_r), FUNC(riscii_series_device::cpucon_w));
map(0x000f, 0x000f).rw(FUNC(riscii_series_device::status_r), FUNC(riscii_series_device::status_w));
- map(0x0010, 0x0010).ram(); // TODO: TRL2
- map(0x0011, 0x0011).rw(FUNC(riscii_series_device::prodl_r), FUNC(riscii_series_device::prodl_w));
- map(0x0012, 0x0012).rw(FUNC(riscii_series_device::prodh_r), FUNC(riscii_series_device::prodh_w));
- map(0x0013, 0x0029).ram(); // TODO: other special function registers
- map(0x002b, 0x002b).rw(FUNC(riscii_series_device::post_id_r), FUNC(riscii_series_device::post_id_w));
- map(0x002c, 0x007f).ram(); // TODO: other special function registers
for (unsigned b = 0; b <= m_maxbank; b++)
map(0x0080 | (b << 8), 0x00ff | (b << 8)).ram();
}
-std::unique_ptr<util::disasm_interface> riscii_series_device::create_disassembler()
+std::unique_ptr<util::disasm_interface> epg3231_device::create_disassembler()
{
- return std::make_unique<riscii_disassembler>();
+ return std::make_unique<epg3231_disassembler>();
}
-riscii_series_device::riscii_series_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, unsigned prgbits, unsigned bankbits, uint8_t maxbank)
+riscii_series_device::riscii_series_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, unsigned addrbits, unsigned pcbits, u32 datastart, unsigned bankbits, u8 maxbank, u8 post_id_mask, address_map_constructor regs)
: cpu_device(mconfig, type, tag, owner, clock)
- , m_program_config("program", ENDIANNESS_LITTLE, 16, prgbits, -1)
- , m_regs_config("register", ENDIANNESS_LITTLE, 8, 8 + bankbits, 0, address_map_constructor(FUNC(riscii_series_device::regs_map), this))
+ , m_program_config("program", ENDIANNESS_LITTLE, 16, addrbits, -1)
+ , m_regs_config("register", ENDIANNESS_LITTLE, 8, 8 + bankbits, 0, regs)
, m_program(nullptr)
, m_regs(nullptr)
, m_cache(nullptr)
- , m_prgbits(prgbits)
+ , m_porta_in_cb(*this)
+ , m_port_in_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_port_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_pcmask((1 << pcbits) - 1)
+ , m_datastart(datastart)
+ , m_tbptmask(((1 << (addrbits + 1)) - 1) | (datastart != 0 ? 0x800000 : 0))
, m_bankmask((1 << bankbits) - 1)
, m_maxbank(maxbank)
+ , m_post_id_mask(post_id_mask)
, m_pc(0)
, m_acc(0)
, m_fsr{0, 0}
@@ -81,7 +82,36 @@ riscii_series_device::riscii_series_device(const machine_config &mconfig, device
, m_cpucon(0)
, m_status(0)
, m_prod(0)
+ , m_pfs(0)
+ , m_intcon(0)
+ , m_intsta(0)
, m_post_id(0)
+ , m_port_data{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ , m_port_dcr{0, 0, 0, 0, 0, 0}
+ , m_port_control{0, 0}
+ , m_stbcon(0)
+ , m_painten(0)
+ , m_paintsta(0)
+ , m_pawake(0)
+ , m_uartcon(0)
+ , m_uartsta(0)
+ , m_spicon(0)
+ , m_spista(0)
+ , m_trl0(0)
+ , m_trl1(0)
+ , m_trl2(0)
+ , m_tr01con(0)
+ , m_tr2con(0)
+ , m_trlir(0)
+ , m_sfcr(0)
+ , m_add{0, 0, 0, 0}
+ , m_env{0, 0, 0, 0}
+ , m_mtcon{0, 0, 0, 0}
+ , m_mtrl{0, 0, 0, 0}
+ , m_sphdr(0)
+ , m_sphtcon(0)
+ , m_sphtrl(0)
+ , m_vocon(0)
, m_icount(0)
, m_exec_state(EXEC_CYCLE1)
, m_repeat(0)
@@ -89,8 +119,64 @@ riscii_series_device::riscii_series_device(const machine_config &mconfig, device
{
}
-riscii_series_device::riscii_series_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
- : riscii_series_device(mconfig, RISCII, tag, owner, clock, 18, 5, 0x1f)
+void epg3231_device::regs_map(address_map &map)
+{
+ core_regs_map(map);
+ map(0x0010, 0x0010).rw(FUNC(epg3231_device::trl2_r), FUNC(epg3231_device::trl2_w));
+ map(0x0011, 0x0011).rw(FUNC(epg3231_device::prodl_r), FUNC(epg3231_device::prodl_w));
+ map(0x0012, 0x0012).rw(FUNC(epg3231_device::prodh_r), FUNC(epg3231_device::prodh_w));
+ // TODO: ADOTL (R13h), ADOTH (R14h)
+ map(0x0015, 0x0015).w(FUNC(epg3231_device::uarttx_w));
+ map(0x0016, 0x0016).r(FUNC(epg3231_device::uartrx_r));
+ map(0x0017, 0x0017).r(FUNC(epg3231_device::porta_r));
+ map(0x0018, 0x001f).rw(FUNC(epg3231_device::port_r), FUNC(epg3231_device::port_w));
+ map(0x0020, 0x0020).rw(FUNC(epg3231_device::pfs_r), FUNC(epg3231_device::pfs_w));
+ map(0x0021, 0x0021).rw(FUNC(epg3231_device::stbcon_r), FUNC(epg3231_device::stbcon_w));
+ map(0x0022, 0x0022).rw(FUNC(epg3231_device::intcon_r), FUNC(epg3231_device::intcon_w));
+ map(0x0023, 0x0023).rw(FUNC(epg3231_device::intsta_r), FUNC(epg3231_device::intsta_w));
+ map(0x0024, 0x0024).rw(FUNC(epg3231_device::trl0l_r), FUNC(epg3231_device::trl0l_w));
+ map(0x0025, 0x0025).rw(FUNC(epg3231_device::trl0h_r), FUNC(epg3231_device::trl0h_w));
+ map(0x0026, 0x0026).rw(FUNC(epg3231_device::trl1_r), FUNC(epg3231_device::trl1_w));
+ map(0x0027, 0x0027).rw(FUNC(epg3231_device::tr01con_r), FUNC(epg3231_device::tr01con_w));
+ map(0x0028, 0x0028).rw(FUNC(epg3231_device::tr2con_r), FUNC(epg3231_device::tr2con_w));
+ map(0x0028, 0x0028).rw(FUNC(epg3231_device::trlir_r), FUNC(epg3231_device::trlir_w));
+ // R2Ah is reserved
+ map(0x002b, 0x002b).rw(FUNC(epg3231_device::post_id_r), FUNC(epg3231_device::post_id_w));
+ // TODO: ADCON (R2Ch)
+ map(0x002d, 0x002d).rw(FUNC(epg3231_device::painten_r), FUNC(epg3231_device::painten_w));
+ map(0x002e, 0x002e).rw(FUNC(epg3231_device::paintsta_r), FUNC(epg3231_device::paintsta_w));
+ map(0x002f, 0x002f).rw(FUNC(epg3231_device::pawake_r), FUNC(epg3231_device::pawake_w));
+ map(0x0030, 0x0030).rw(FUNC(epg3231_device::uartcon_r), FUNC(epg3231_device::uartcon_w));
+ map(0x0031, 0x0031).rw(FUNC(epg3231_device::uartsta_r), FUNC(epg3231_device::uartsta_w));
+ map(0x0032, 0x0033).rw(FUNC(epg3231_device::portjk_r), FUNC(epg3231_device::portjk_w));
+ map(0x0034, 0x0039).rw(FUNC(epg3231_device::dcr_r), FUNC(epg3231_device::dcr_w));
+ map(0x003a, 0x003b).rw(FUNC(epg3231_device::pcon_r), FUNC(epg3231_device::pcon_w));
+ // TODO: PLLF (R3Ch)
+ map(0x003d, 0x003d).r(FUNC(epg3231_device::t0cl_r));
+ map(0x003e, 0x003e).r(FUNC(epg3231_device::t0ch_r));
+ map(0x003f, 0x003f).rw(FUNC(epg3231_device::spicon_r), FUNC(epg3231_device::spicon_w));
+ map(0x0040, 0x0040).rw(FUNC(epg3231_device::spista_r), FUNC(epg3231_device::spista_w));
+ map(0x0041, 0x0041).rw(FUNC(epg3231_device::sprl_r), FUNC(epg3231_device::sprl_w));
+ map(0x0042, 0x0042).rw(FUNC(epg3231_device::sprm_r), FUNC(epg3231_device::sprm_w));
+ map(0x0043, 0x0043).rw(FUNC(epg3231_device::sprh_r), FUNC(epg3231_device::sprh_w));
+ map(0x0044, 0x0044).rw(FUNC(epg3231_device::sfcr_r), FUNC(epg3231_device::sfcr_w));
+ map(0x0045, 0x0045).rw(FUNC(epg3231_device::addl_r), FUNC(epg3231_device::addl_w));
+ map(0x0046, 0x0046).rw(FUNC(epg3231_device::addm_r), FUNC(epg3231_device::addm_w));
+ map(0x0047, 0x0047).rw(FUNC(epg3231_device::addh_r), FUNC(epg3231_device::addh_w));
+ map(0x0048, 0x0048).rw(FUNC(epg3231_device::env_sphdr_r), FUNC(epg3231_device::env_sphdr_w));
+ map(0x0049, 0x0049).rw(FUNC(epg3231_device::mtcon_sphtcon_r), FUNC(epg3231_device::mtcon_sphtcon_w));
+ map(0x004a, 0x004a).rw(FUNC(epg3231_device::mtrl_sphtrl_r), FUNC(epg3231_device::mtrl_sphtrl_w));
+ map(0x004b, 0x004b).rw(FUNC(epg3231_device::vocon_r), FUNC(epg3231_device::vocon_w));
+ map(0x004c, 0x004c).r(FUNC(epg3231_device::tr1c_r));
+ map(0x004d, 0x004d).r(FUNC(epg3231_device::tr2c_r));
+ // TODO: ADCF (R4Eh)
+ // R4Fh is reserved
+ map(0x0050, 0x007f).ram();
+}
+
+epg3231_device::epg3231_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : riscii_series_device(mconfig, EPG3231, tag, owner, clock, 22, 18, 0x40000, 5, 0x1f, 0xbb,
+ address_map_constructor(FUNC(epg3231_device::regs_map), this))
{
}
@@ -102,30 +188,84 @@ device_memory_interface::space_config_vector riscii_series_device::memory_space_
};
}
+void riscii_series_device::device_resolve_objects()
+{
+ m_porta_in_cb.resolve_safe(0xff);
+ for (auto &cb : m_port_in_cb)
+ cb.resolve_safe(0xff);
+ for (auto &cb : m_port_out_cb)
+ cb.resolve_safe();
+}
+
void riscii_series_device::device_start()
{
m_program = &space(AS_PROGRAM);
m_regs = &space(AS_DATA);
m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>();
+ if (m_pcmask > 0xffff)
+ m_pchstack = make_unique_clear<u8[]>(128);
+
set_icountptr(m_icount);
- state_add(RII_PC, "PC", m_pc).mask((1 << m_prgbits) - 1);
- state_add(STATE_GENPC, "GENPC", m_pc).mask((1 << m_prgbits) - 1).noshow();
- state_add(STATE_GENPCBASE, "CURPC", m_ppc).mask((1 << m_prgbits) - 1).noshow();
+ state_add<u32>(RII_PC, "PC", [this]() { return m_pc; }, [this](u32 pc) { debug_set_pc(pc); }).mask(m_pcmask);
+ state_add<u32>(STATE_GENPC, "GENPC", [this]() { return m_pc; }, [this](u32 pc) { debug_set_pc(pc); }).mask(m_pcmask).noshow();
+ state_add(STATE_GENPCBASE, "CURPC", m_ppc).mask(m_pcmask).noshow();
state_add(RII_REPEAT, "REPEAT", m_repeat);
state_add(RII_ACC, "ACC", m_acc);
state_add(RII_BSR, "BSR", m_bsr[0]).mask(m_bankmask);
state_add(RII_FSR0, "FSR0", m_fsr[0]);
state_add(RII_BSR1, "BSR1", m_bsr[1]).mask(m_bankmask);
- state_add(RII_FSR1, "FSR1", m_fsr[1]); // TODO: high bit forced to 1
- state_add(RII_TABPTR, "TABPTR", m_tabptr).mask(0x800000 + (1 << (m_prgbits + 1)) - 1);
+ state_add<u8>(RII_FSR1, "FSR1", [this]() { return m_fsr[1]; }, [this](u8 data) { m_fsr[1] = data | 0x80; });
+ state_add(RII_TABPTR, "TABPTR", m_tabptr).mask(m_tbptmask);
state_add(RII_STKPTR, "STKPTR", m_stkptr);
state_add(RII_CPUCON, "CPUCON", m_cpucon).mask(0x9f);
state_add(RII_STATUS, "STATUS", m_status);
state_add(STATE_GENFLAGS, "CURFLAGS", m_status).noshow().formatstr("%8s");
state_add(RII_PROD, "PROD", m_prod);
- state_add(RII_POST_ID, "POST_ID", m_post_id);
+ state_add(RII_PFS, "PFS", m_pfs);
+ state_add(RII_INTCON, "INTCON", m_intcon);
+ state_add(RII_INTSTA, "INTSTA", m_intsta);
+ state_add(RII_POST_ID, "POST_ID", m_post_id).mask(m_post_id_mask);
+ state_add(RII_STBCON, "STBCON", m_stbcon);
+ state_add(RII_PAINTEN, "PAINTEN", m_painten);
+ state_add(RII_PAINTSTA, "PAINTSTA", m_paintsta);
+ state_add(RII_PAWAKE, "PAWAKE", m_pawake);
+ for (int i = 0; i < 2; i++)
+ {
+ state_add(RII_PORTB + i, string_format("PORT%c", i + 'B').c_str(), m_port_data[i]);
+ state_add(RII_DCRB + i, string_format("DCR%c", i + 'B').c_str(), m_port_dcr[i]);
+ state_add(RII_PBCON + i, string_format("P%cCON", i + 'B').c_str(), m_port_control[i]);
+ }
+ for (int i = 2; i < 6; i++)
+ {
+ int p = i * 2 - 2;
+ state_add(RII_PORTB + p, string_format("PORT%c", p + 'B').c_str(), m_port_data[p]);
+ state_add(RII_PORTB + p + 1, string_format("PORT%c", p + 'C').c_str(), m_port_data[p + 1]);
+ state_add(RII_DCRB + i, string_format("DCR%c%c", p + 'B', p + 'C').c_str(), m_port_dcr[i]);
+ }
+ state_add(RII_UARTCON, "UARTCON", m_uartcon);
+ state_add(RII_UARTSTA, "UARTSTA", m_uartsta);
+ state_add(RII_SPICON, "SPICON", m_spicon);
+ state_add(RII_SPISTA, "SPISTA", m_spista).mask(0xbf);
+ state_add(RII_TRL0, "TRL0", m_trl0);
+ state_add(RII_TRL1, "TRL1", m_trl1);
+ state_add(RII_TR01CON, "TR01CON", m_tr01con);
+ state_add(RII_TRL2, "TRL2", m_trl2);
+ state_add(RII_TR2CON, "TR2CON", m_tr2con);
+ state_add(RII_TRLIR, "TRLIR", m_trlir);
+ state_add(RII_SFCR, "SFCR", m_sfcr);
+ for (int i = 0; i < 4; i++)
+ {
+ state_add(RII_ADD1 + i, string_format("ADD%d", i + 1).c_str(), m_add[i]).mask(0xffffff);
+ state_add(RII_ENV1 + i, string_format("ENV%d", i + 1).c_str(), m_env[i]);
+ state_add(RII_MTCON1 + i, string_format("MTCON%d", i + 1).c_str(), m_mtcon[i]);
+ state_add(RII_MTRL1 + i, string_format("MTRL%d", i + 1).c_str(), m_mtrl[i]);
+ }
+ state_add(RII_SPHDR, "SPHDR", m_sphdr);
+ state_add(RII_SPHTCON, "SPHTCON", m_sphtcon);
+ state_add(RII_SPHTRL, "SPHTRL", m_sphtrl);
+ state_add(RII_VOCON, "VOCON", m_vocon);
save_item(NAME(m_pc));
save_item(NAME(m_ppc));
@@ -136,8 +276,36 @@ void riscii_series_device::device_start()
save_item(NAME(m_stkptr));
save_item(NAME(m_cpucon));
save_item(NAME(m_status));
+ if (m_pcmask > 0xffff)
+ save_pointer(NAME(m_pchstack), 128);
save_item(NAME(m_prod));
+ save_item(NAME(m_pfs));
+ save_item(NAME(m_intcon));
+ save_item(NAME(m_intsta));
save_item(NAME(m_post_id));
+ save_item(NAME(m_port_data));
+ save_item(NAME(m_port_dcr));
+ save_item(NAME(m_port_control));
+ save_item(NAME(m_stbcon));
+ save_item(NAME(m_painten));
+ save_item(NAME(m_paintsta));
+ save_item(NAME(m_pawake));
+ save_item(NAME(m_uartcon));
+ save_item(NAME(m_uartsta));
+ save_item(NAME(m_spicon));
+ save_item(NAME(m_spista));
+ save_item(NAME(m_trl0));
+ save_item(NAME(m_trl1));
+ save_item(NAME(m_trl2));
+ save_item(NAME(m_tr01con));
+ save_item(NAME(m_tr2con));
+ save_item(NAME(m_trlir));
+ save_item(NAME(m_sfcr));
+ save_item(NAME(m_add));
+ save_item(NAME(m_env));
+ save_item(NAME(m_mtcon));
+ save_item(NAME(m_mtrl));
+ save_item(NAME(m_vocon));
save_item(NAME(m_exec_state));
save_item(NAME(m_repeat));
save_item(NAME(m_curreg));
@@ -154,9 +322,48 @@ void riscii_series_device::device_reset()
m_stkptr = 0x00;
m_cpucon &= 0x01;
m_status |= 0xc0;
- m_post_id = 0xf0;
+ m_pfs = 0x20;
+ m_intcon = 0x00;
+ m_intsta = 0x00;
+ m_post_id = 0xf0 & m_post_id_mask;
m_exec_state = EXEC_CYCLE1;
m_repeat = 0x00;
+
+ // reset ports (input mode, no pullups)
+ std::fill_n(&m_port_dcr[0], 2, 0xff);
+ std::fill_n(&m_port_dcr[2], 4, 0x33);
+ std::fill_n(&m_port_control[0], 2, 0x00);
+ m_stbcon = 0x40;
+ m_painten = 0x00;
+ m_paintsta = 0x00;
+ m_pawake = 0x00;
+
+ // reset UART
+ m_uartcon = 0x02;
+ m_uartsta = 0x00;
+
+ // reset SPI
+ m_spicon = 0x00;
+ m_spista = 0x00;
+
+ // reset timers
+ m_tr01con = 0x00;
+ m_tr2con = 0x00;
+ m_sfcr = 0x00;
+
+ // reset synthesizer
+ std::fill_n(&m_env[0], 4, 0x00);
+ std::fill_n(&m_mtcon[0], 4, 0x00);
+ std::fill_n(&m_mtrl[0], 4, 0x00);
+ m_sphdr = 0x00;
+ m_sphtcon = 0x00;
+ m_sphtrl = 0x00;
+ m_vocon = 0x07;
+}
+
+void riscii_series_device::debug_set_pc(u32 pc)
+{
+ m_ppc = m_pc = pc;
}
@@ -221,7 +428,7 @@ u8 riscii_series_device::pcm_r()
void riscii_series_device::pcm_w(u8 data)
{
- m_pc = (m_pc & 0xf00ff) | u32(data) << 8;
+ m_pc = (m_pc & 0xf00ff) | ((u32(data) << 8) & m_pcmask);
}
u8 riscii_series_device::pch_r()
@@ -231,8 +438,7 @@ u8 riscii_series_device::pch_r()
void riscii_series_device::pch_w(u8 data)
{
- if (m_prgbits > 16)
- m_pc = (m_pc & 0x0ffff) | u32(data & ((1 << (m_prgbits - 16)) - 1)) << 16;
+ m_pc = (m_pc & 0x0ffff) | ((u32(data) << 16) & m_pcmask);
}
u8 riscii_series_device::tabptrl_r()
@@ -262,7 +468,7 @@ u8 riscii_series_device::tabptrh_r()
void riscii_series_device::tabptrh_w(u8 data)
{
- m_tabptr = (m_tabptr & 0x00ffff) | u32(data & (0x80 | ((1 << (m_prgbits - 15)) - 1))) << 16;
+ m_tabptr = (m_tabptr & 0x00ffff) | ((u32(data) << 16) & m_tbptmask);
}
u8 riscii_series_device::acc_r()
@@ -302,6 +508,7 @@ u8 riscii_series_device::status_r()
void riscii_series_device::status_w(u8 data)
{
+ // TO and PD are read-only
m_status = (m_status & 0xc0) | (data & 0x3f);
}
@@ -325,6 +532,36 @@ void riscii_series_device::prodh_w(u8 data)
m_prod = (m_prod & 0x00ff) | u16(data) << 8;
}
+u8 riscii_series_device::pfs_r()
+{
+ return m_pfs;
+}
+
+void riscii_series_device::pfs_w(u8 data)
+{
+ m_pfs = data;
+}
+
+u8 riscii_series_device::intcon_r()
+{
+ return m_intcon;
+}
+
+void riscii_series_device::intcon_w(u8 data)
+{
+ m_intcon = data;
+}
+
+u8 riscii_series_device::intsta_r()
+{
+ return m_intsta;
+}
+
+void riscii_series_device::intsta_w(u8 data)
+{
+ m_intsta = data;
+}
+
u8 riscii_series_device::post_id_r()
{
return m_post_id;
@@ -332,7 +569,426 @@ u8 riscii_series_device::post_id_r()
void riscii_series_device::post_id_w(u8 data)
{
- m_post_id = data;
+ m_post_id = data & m_post_id_mask;
+}
+
+
+//**************************************************************************
+// PORT REGISTER HANDLERS
+//**************************************************************************
+
+u8 riscii_series_device::porta_r()
+{
+ // Port A is read-only
+ return m_porta_in_cb();
+}
+
+u8 riscii_series_device::port_r(offs_t offset)
+{
+ if (offset < 2)
+ {
+ u8 dc = m_port_dcr[offset];
+ u8 pu = ~dc & m_port_control[offset];
+ if (pu == 0xff)
+ return m_port_data[offset];
+ else
+ return (m_port_data[offset] | dc) & (m_port_in_cb[offset](0, ~pu) | pu);
+ }
+ else
+ {
+ u8 control = (m_port_dcr[(offset >> 1) + 1] >> (BIT(offset, 0) ? 4 : 0)) & 0xf;
+ if (control == 0xc)
+ return m_port_data[offset];
+ else
+ {
+ u8 dc = (BIT(control, 0) ? 0x0f : 0x00) | (BIT(control, 1) ? 0xf0 : 0x00);
+ u8 pu = ~dc & ((BIT(control, 2) ? 0x0f : 0x00) | (BIT(control, 3) ? 0xf0 : 0x00));
+ return (m_port_data[offset] | dc) & (m_port_in_cb[offset](0, ~pu) | pu);
+ }
+ }
+}
+
+void riscii_series_device::port_w(offs_t offset, u8 data)
+{
+ m_port_data[offset] = data;
+ if (offset < 2)
+ {
+ u8 dc = m_port_dcr[offset];
+ if (dc != 0xff)
+ m_port_out_cb[offset](0, data, ~dc);
+ }
+ else
+ {
+ u8 control = (m_port_dcr[(offset >> 1) + 1] >> (BIT(offset, 0) ? 4 : 0)) & 0xf;
+ u8 dc = (BIT(control, 0) ? 0x0f : 0x00) | (BIT(control, 1) ? 0xf0 : 0x00);
+ if (dc != 0xff)
+ m_port_out_cb[offset](0, data, ~dc);
+ }
+}
+
+u8 riscii_series_device::stbcon_r()
+{
+ return m_stbcon;
+}
+
+void riscii_series_device::stbcon_w(u8 data)
+{
+ m_stbcon = data;
+}
+
+u8 riscii_series_device::painten_r()
+{
+ return m_painten;
+}
+
+void riscii_series_device::painten_w(u8 data)
+{
+ m_painten = data;
+}
+
+u8 riscii_series_device::paintsta_r()
+{
+ return m_paintsta;
+}
+
+void riscii_series_device::paintsta_w(u8 data)
+{
+ m_paintsta = data;
+}
+
+u8 riscii_series_device::pawake_r()
+{
+ return m_pawake;
+}
+
+void riscii_series_device::pawake_w(u8 data)
+{
+ m_pawake = data;
+}
+
+u8 riscii_series_device::portjk_r(offs_t offset)
+{
+ return port_r(offset + 8);
+}
+
+void riscii_series_device::portjk_w(offs_t offset, u8 data)
+{
+ port_w(offset + 8, data);
+}
+
+u8 riscii_series_device::dcr_r(offs_t offset)
+{
+ return m_port_dcr[offset];
+}
+
+void riscii_series_device::dcr_w(offs_t offset, u8 data)
+{
+ m_port_dcr[offset] = data;
+}
+
+u8 riscii_series_device::pcon_r(offs_t offset)
+{
+ return m_port_control[offset];
+}
+
+void riscii_series_device::pcon_w(offs_t offset, u8 data)
+{
+ m_port_control[offset] = data;
+}
+
+
+//**************************************************************************
+// UART HANDLERS
+//**************************************************************************
+
+void riscii_series_device::uarttx_w(u8 data)
+{
+ logerror("%05X: UARTTX = %02X\n", m_ppc, data);
+}
+
+u8 riscii_series_device::uartrx_r()
+{
+ return 0;
+}
+
+u8 riscii_series_device::uartcon_r()
+{
+ // TB8 is write-only
+ return m_uartcon & 0x7f;
+}
+
+void riscii_series_device::uartcon_w(u8 data)
+{
+ // UTBE is read-only
+ m_uartcon = (data & 0xfd) | (m_uartcon & 0x02);
+}
+
+u8 riscii_series_device::uartsta_r()
+{
+ return m_uartsta;
+}
+
+void riscii_series_device::uartsta_w(u8 data)
+{
+ // RB8 and URBF are read-only
+ m_uartsta = (data & 0x7d) | (m_uartsta & 0x82);
+}
+
+
+//**************************************************************************
+// SPI HANDLERS
+//**************************************************************************
+
+u8 riscii_series_device::spicon_r()
+{
+ return m_spicon;
+}
+
+void riscii_series_device::spicon_w(u8 data)
+{
+ m_spicon = data;
+}
+
+u8 riscii_series_device::spista_r()
+{
+ return m_spista;
+}
+
+void riscii_series_device::spista_w(u8 data)
+{
+ // RBF is read-only
+ m_spista = (data & 0xbe) | (m_spista & 0x01);
+}
+
+u8 riscii_series_device::sprl_r()
+{
+ return 0;
+}
+
+void riscii_series_device::sprl_w(u8 data)
+{
+ logerror("%05X: SPRL = %02X\n", m_ppc, data);
+}
+
+u8 riscii_series_device::sprm_r()
+{
+ return 0;
+}
+
+void riscii_series_device::sprm_w(u8 data)
+{
+ logerror("%05X: SPRM = %02X\n", m_ppc, data);
+}
+
+u8 riscii_series_device::sprh_r()
+{
+ return 0;
+}
+
+void riscii_series_device::sprh_w(u8 data)
+{
+ logerror("%05X: SPRH = %02X\n", m_ppc, data);
+}
+
+
+//**************************************************************************
+// TIMER HANDLERS
+//**************************************************************************
+
+u8 riscii_series_device::trl0l_r()
+{
+ return m_trl0 & 0x00ff;
+}
+
+void riscii_series_device::trl0l_w(u8 data)
+{
+ m_trl0 = (m_trl0 & 0xff00) | data;
+}
+
+u8 riscii_series_device::trl0h_r()
+{
+ return (m_trl0 & 0xff00) >> 8;
+}
+
+void riscii_series_device::trl0h_w(u8 data)
+{
+ m_trl0 = u8(data) << 8 | (m_trl0 & 0x00ff);
+}
+
+u8 riscii_series_device::trl1_r()
+{
+ return m_trl1;
+}
+
+void riscii_series_device::trl1_w(u8 data)
+{
+ m_trl1 = data;
+}
+
+u8 riscii_series_device::trl2_r()
+{
+ return m_trl2;
+}
+
+void riscii_series_device::trl2_w(u8 data)
+{
+ m_trl2 = data;
+}
+
+u8 riscii_series_device::tr01con_r()
+{
+ return m_tr01con;
+}
+
+void riscii_series_device::tr01con_w(u8 data)
+{
+ m_tr01con = data;
+}
+
+u8 riscii_series_device::tr2con_r()
+{
+ return m_tr2con;
+}
+
+void riscii_series_device::tr2con_w(u8 data)
+{
+ m_tr2con = data;
+}
+
+u8 riscii_series_device::trlir_r()
+{
+ return m_trlir;
+}
+
+void riscii_series_device::trlir_w(u8 data)
+{
+ m_trlir = data;
+}
+
+u8 riscii_series_device::t0cl_r()
+{
+ return 0x00;
+}
+
+u8 riscii_series_device::t0ch_r()
+{
+ return 0x00;
+}
+
+u8 riscii_series_device::tr1c_r()
+{
+ return 0xff;
+}
+
+u8 riscii_series_device::tr2c_r()
+{
+ return 0xff;
+}
+
+u8 riscii_series_device::sfcr_r()
+{
+ return m_sfcr;
+}
+
+void riscii_series_device::sfcr_w(u8 data)
+{
+ m_sfcr = data;
+}
+
+
+//**************************************************************************
+// MUSIC/SPEECH SYNTHESIZER
+//**************************************************************************
+
+u8 riscii_series_device::addl_r()
+{
+ return m_add[BIT(m_sfcr, 2) ? 3 : m_sfcr & 0x03] & 0x0000ff;
+}
+
+void riscii_series_device::addl_w(u8 data)
+{
+ u32 &add = m_add[BIT(m_sfcr, 2) ? 3 : m_sfcr & 0x03];
+ add = (add & 0xffff00) | data;
+}
+
+u8 riscii_series_device::addm_r()
+{
+ return (m_add[BIT(m_sfcr, 2) ? 3 : m_sfcr & 0x03] & 0x00ff00) >> 8;
+}
+
+void riscii_series_device::addm_w(u8 data)
+{
+ u32 &add = m_add[BIT(m_sfcr, 2) ? 3 : m_sfcr & 0x03];
+ add = (add & 0xff00ff) | u32(data) << 8;
+}
+
+u8 riscii_series_device::addh_r()
+{
+ return (m_add[BIT(m_sfcr, 2) ? 3 : m_sfcr & 0x03] & 0xff0000) >> 8;
+}
+
+void riscii_series_device::addh_w(u8 data)
+{
+ u32 &add = m_add[BIT(m_sfcr, 2) ? 3 : m_sfcr & 0x03];
+ add = (add & 0x00ffff) | u32(data) << 16;
+}
+
+u8 riscii_series_device::env_sphdr_r()
+{
+ if (BIT(m_sfcr, 2))
+ return m_sphdr;
+ else
+ return m_env[m_sfcr & 0x03];
+}
+
+void riscii_series_device::env_sphdr_w(u8 data)
+{
+ if (BIT(m_sfcr, 2))
+ m_sphdr = data;
+ else
+ m_env[m_sfcr & 0x03] = data;
+}
+
+u8 riscii_series_device::mtcon_sphtcon_r()
+{
+ if (BIT(m_sfcr, 2))
+ return m_sphtcon;
+ else
+ return m_mtcon[m_sfcr & 0x03];
+}
+
+void riscii_series_device::mtcon_sphtcon_w(u8 data)
+{
+ if (BIT(m_sfcr, 2))
+ m_sphtcon = data;
+ else
+ m_mtcon[m_sfcr & 0x03] = data;
+}
+
+u8 riscii_series_device::mtrl_sphtrl_r()
+{
+ if (BIT(m_sfcr, 2))
+ return m_sphtrl;
+ else
+ return m_mtrl[m_sfcr & 0x03];
+}
+
+void riscii_series_device::mtrl_sphtrl_w(u8 data)
+{
+ if (BIT(m_sfcr, 2))
+ m_sphtrl = data;
+ else
+ m_mtrl[m_sfcr & 0x03] = data;
+}
+
+u8 riscii_series_device::vocon_r()
+{
+ return m_vocon;
+}
+
+void riscii_series_device::vocon_w(u8 data)
+{
+ m_vocon = data;
}
@@ -340,6 +996,11 @@ void riscii_series_device::post_id_w(u8 data)
// MEMORY HELPERS
//**************************************************************************
+u16 riscii_series_device::fetch_program_word()
+{
+ return m_cache->read_word(std::exchange(m_pc, (m_pc + 1) & m_pcmask));
+}
+
u16 riscii_series_device::get_banked_address(u8 reg)
{
if (reg == 0x00)
@@ -367,13 +1028,13 @@ u16 riscii_series_device::get_banked_address(u8 reg)
{
m_fsr[1] = (m_fsr[1] + 1) | 0x80;
if (m_fsr[1] == 0x80)
- ++m_bsr[1];
+ m_bsr[1] = (m_bsr[1] + 1) & m_bankmask;
}
else
{
m_fsr[1] = (m_fsr[1] - 1) | 0x80;
if (m_fsr[1] == 0xff)
- --m_bsr[1];
+ m_bsr[1] = (m_bsr[1] - 1) & m_bankmask;
}
}
return bfsr1;
@@ -386,7 +1047,61 @@ u16 riscii_series_device::get_banked_address(u8 reg)
u32 riscii_series_device::tabptr_offset(int offset) const
{
- return (m_tabptr & 0x800000) | ((m_tabptr + offset) & ((1 << (m_prgbits + 1)) - 1));
+ return (m_tabptr + offset) & m_tbptmask;
+}
+
+void riscii_series_device::multi_byte_carry(u16 addr, bool cy)
+{
+ if (addr == 0x0002)
+ m_exec_state = EXEC_ADCPCM;
+ else if (addr == 0x0009 && cy)
+ {
+ // FSR1 can carry into BSR1
+ bsr1_w(bsr1_r() + 1);
+ }
+ else if (addr == 0x000b && cy)
+ {
+ // TABPTRL can carry into TABPTRM and TABPTRH
+ u8 midbyte = tabptrm_r() + 1;
+ tabptrm_w(midbyte);
+ if (midbyte == 0)
+ tabptrh_w(tabptrh_r() + 1);
+ }
+ else if (addr == 0x001c && cy)
+ {
+ // PORTF can carry into PORTE and PORTD
+ u8 midbyte = port_r(3);
+ port_w(3, midbyte);
+ if (midbyte == 0)
+ port_w(2, port_r(2) + 1);
+ }
+}
+
+void riscii_series_device::multi_byte_borrow(u16 addr, bool cy)
+{
+ if (addr == 0x0002)
+ m_exec_state = EXEC_SBCPCM;
+ else if (addr == 0x0009 && !cy)
+ {
+ // FSR1 can borrow from BSR1
+ bsr1_w(bsr1_r() - 1);
+ }
+ else if (addr == 0x000b && !cy)
+ {
+ // TABPTRL can borrow from TABPTRM and TABPTRH
+ u8 midbyte = tabptrm_r() - 1;
+ tabptrm_w(midbyte);
+ if (midbyte == 0xff)
+ tabptrh_w(tabptrh_r() - 1);
+ }
+ else if (addr == 0x001c && !cy)
+ {
+ // PORTF can borrow from PORTE and PORTD
+ u8 midbyte = port_r(3) - 1;
+ port_w(3, midbyte);
+ if (midbyte == 0xff)
+ port_w(2, port_r(2) + 1);
+ }
}
@@ -405,13 +1120,17 @@ void riscii_series_device::execute_add(u8 reg, bool a, bool c)
u16 addr = get_banked_address(reg);
s8 data = m_regs->read_byte(addr);
s16 tmp = s16(data) + s8(m_acc) + (c ? m_status & 0x01 : 0);
+ bool cy = u16(data) + m_acc + (c ? m_status & 0x01 : 0) >= 0x100;
bool dc = (data & 0x0f) + (m_acc & 0x0f) + (c ? m_status & 0x01 : 0) >= 0x10;
if (a)
acc_w(tmp & 0xff);
else
+ {
m_regs->write_byte(addr, tmp & 0xff);
+ multi_byte_carry(addr, cy);
+ }
m_status = (m_status & 0xc0)
- | (BIT(tmp, 8) ? 0x01 : 0x00)
+ | (cy ? 0x01 : 0x00)
| (dc ? 0x02 : 0x00)
| ((tmp & 0xff) == 0 ? 0x04 : 0x00)
| ((tmp < 0) != BIT(tmp, 7) ? 0x08 : 0x00)
@@ -424,13 +1143,17 @@ void riscii_series_device::execute_sub(u8 reg, bool a, bool c)
u16 addr = get_banked_address(reg);
s8 data = m_regs->read_byte(addr);
s16 tmp = s16(data) - s8(m_acc) - (c ? ~m_status & 0x01 : 0);
+ bool cy = u8(data) >= m_acc + (c ? m_status & 0x01 : 0); // borrow is inverted
bool dc = (data & 0x0f) >= (m_acc & 0x0f) + (c ? ~m_status & 0x01 : 0);
if (a)
acc_w(tmp & 0xff);
else
+ {
m_regs->write_byte(addr, tmp & 0xff);
+ multi_byte_borrow(addr, cy);
+ }
m_status = (m_status & 0xc0)
- | (BIT(tmp, 8) ? 0x00 : 0x01) // borrow is inverted
+ | (cy ? 0x01 : 0x00)
| (dc ? 0x02 : 0x00)
| ((tmp & 0xff) == 0 ? 0x04 : 0x00)
| ((tmp < 0) != BIT(tmp, 7) ? 0x08 : 0x00)
@@ -441,10 +1164,11 @@ void riscii_series_device::execute_sub(u8 reg, bool a, bool c)
void riscii_series_device::execute_add_imm(u8 data, bool c)
{
s16 tmp = s16(s8(data)) + s8(m_acc) + (c ? m_status & 0x01 : 0);
+ bool cy = u16(data) + m_acc + (c ? m_status & 0x01 : 0) >= 0x100;
bool dc = (data & 0x0f) + (m_acc & 0x0f) + (c ? m_status & 0x01 : 0) >= 0x10;
acc_w(tmp & 0xff);
m_status = (m_status & 0xc0)
- | (BIT(tmp, 8) ? 0x01 : 0x00)
+ | (cy ? 0x01 : 0x00)
| (dc ? 0x02 : 0x00)
| ((tmp & 0xff) == 0 ? 0x04 : 0x00)
| ((tmp < 0) != BIT(tmp, 7) ? 0x08 : 0x00)
@@ -455,10 +1179,11 @@ void riscii_series_device::execute_add_imm(u8 data, bool c)
void riscii_series_device::execute_sub_imm(u8 data, bool c)
{
s16 tmp = s16(s8(data)) - s8(m_acc) - (c ? ~m_status & 0x01 : 0);
+ bool cy = u8(data) >= m_acc + (c ? m_status & 0x01 : 0); // borrow is inverted
bool dc = (data & 0x0f) + (m_acc & 0x0f) + (c ? ~m_status & 0x01 : 0) >= 0x10;
acc_w(tmp & 0xff);
m_status = (m_status & 0xc0)
- | (BIT(tmp, 8) ? 0x00 : 0x01) // borrow is inverted
+ | (cy ? 0x01 : 0x00)
| (dc ? 0x02 : 0x00)
| ((tmp & 0xff) == 0 ? 0x04 : 0x00)
| ((tmp < 0) != BIT(tmp, 7) ? 0x08 : 0x00)
@@ -508,12 +1233,14 @@ void riscii_series_device::execute_subdb(u8 reg, bool a)
void riscii_series_device::execute_mul(u8 reg)
{
- m_prod = u16(m_acc) * m_regs->read_byte(get_banked_address(reg));
+ execute_mul_imm(m_regs->read_byte(get_banked_address(reg)));
}
void riscii_series_device::execute_mul_imm(u8 data)
{
- m_prod = u16(m_acc) * data;
+ int mier = BIT(m_cpucon, 3) ? int(s8(m_acc)) : int(m_acc);
+ int mcand = BIT(m_cpucon, 4) ? int(s8(data)) : int(data);
+ m_prod = u16(mier * mcand);
}
void riscii_series_device::execute_or(u8 reg, bool a)
@@ -619,9 +1346,15 @@ void riscii_series_device::execute_jump(u32 addr)
void riscii_series_device::execute_call(u32 addr)
{
+ // Push PC to the stack region at the end of banked RAM
m_stkptr -= 2;
u16 stkaddr = u16(m_maxbank - (BIT(m_stkptr, 7) ? 0 : 1)) << 8 | 0x80 | (m_stkptr & 0x7e);
m_regs->write_word(stkaddr, swapendian_int16(m_pc & 0xffff));
+
+ // PCH (on relevant models) must be saved somewhere. This implementation assumes a private buffer is used.
+ if (m_pcmask > 0xffff)
+ m_pchstack[m_stkptr >> 1] = (m_pc & 0xff0000) >> 16;
+
execute_jump(addr);
}
@@ -640,7 +1373,10 @@ void riscii_series_device::execute_jdnz(u8 reg, bool a)
if (a)
acc_w(tmp);
else
+ {
m_regs->write_byte(addr, tmp);
+ multi_byte_borrow(addr, tmp != 0xff);
+ }
execute_jcc(tmp != 0);
}
@@ -651,7 +1387,10 @@ void riscii_series_device::execute_jinz(u8 reg, bool a)
if (a)
acc_w(tmp);
else
+ {
m_regs->write_byte(addr, tmp);
+ multi_byte_carry(addr, tmp == 0);
+ }
execute_jcc(tmp != 0);
}
@@ -731,7 +1470,10 @@ void riscii_series_device::execute_inc(u8 reg, bool a)
if (a)
acc_w(tmp & 0xff);
else
+ {
m_regs->write_byte(addr, tmp & 0xff);
+ multi_byte_carry(addr, (tmp >> 8) != 0);
+ }
m_status = (m_status & 0xfa) | ((tmp & 0xff) == 0 ? 0x04 : 0x00) | (tmp >> 8);
}
@@ -742,7 +1484,10 @@ void riscii_series_device::execute_dec(u8 reg, bool a)
if (a)
acc_w(tmp & 0xff);
else
+ {
m_regs->write_byte(addr, tmp & 0xff);
+ multi_byte_borrow(addr, (tmp >> 8) != 0);
+ }
m_status = (m_status & 0xfa) | ((tmp & 0xff) == 0 ? 0x04 : 0x00) | (tmp >> 8);
}
@@ -753,21 +1498,27 @@ void riscii_series_device::execute_rpt(u8 reg)
void riscii_series_device::execute_ret(bool inte)
{
+ // Pop PC from the stack region at the end of banked RAM
u16 stkaddr = u16(m_maxbank - (BIT(m_stkptr, 7) ? 0 : 1)) << 8 | 0x80 | (m_stkptr & 0x7e);
- execute_jump((m_pc & 0xf0000) | swapendian_int16(m_regs->read_word(stkaddr)));
+ u32 dest = swapendian_int16(m_regs->read_word(stkaddr));
+ if (m_pcmask > 0xffff)
+ dest |= u32(m_pchstack[m_stkptr >> 1]) << 16;
+ execute_jump(dest);
m_stkptr += 2;
+
+ // RETI also sets the global interrupt enable flag
if (inte)
m_cpucon |= 0x04;
}
void riscii_series_device::execute_wdtc()
{
- logerror("WDTC (PC = %05X)\n", m_ppc);
+ logerror("Watchdog timer reset (PC = %05X)\n", m_ppc);
}
void riscii_series_device::execute_slep()
{
- logerror("SLEP (PC = %05X)\n", m_ppc);
+ logerror("%s mode entered (PC = %05X)\n", BIT(m_cpucon, 1) ? "Idle" : "Sleep", m_ppc);
}
void riscii_series_device::execute_undef(u16 opcode)
@@ -1058,9 +1809,13 @@ void riscii_series_device::execute_cycle1(u16 opcode)
void riscii_series_device::execute_tbrd(u32 ptr)
{
- // TODO: "Bit 23 is used to select the internal/external memory"
u16 addr = get_banked_address(m_curreg);
- u16 data = m_program->read_word(ptr >> 1);
+ u32 memaddr = (ptr & 0x7ffffe) >> 1;
+ if (BIT(ptr, 23))
+ memaddr += m_datastart;
+ else
+ memaddr &= m_pcmask;
+ u16 data = m_program->read_word(memaddr);
if (BIT(ptr, 0))
m_regs->write_byte(addr, data >> 8);
else
@@ -1082,7 +1837,7 @@ void riscii_series_device::execute_run()
debugger_instruction_hook(m_pc);
if (m_repeat != 0)
{
- execute_cycle1(m_cache->read_word(m_pc++));
+ execute_cycle1(fetch_program_word());
if (m_exec_state == EXEC_CYCLE1)
{
--m_repeat;
@@ -1090,7 +1845,29 @@ void riscii_series_device::execute_run()
}
}
else
- execute_cycle1(m_cache->read_word(m_pc++));
+ execute_cycle1(fetch_program_word());
+ break;
+
+ case EXEC_ADCPCM:
+ if (BIT(m_status, 0))
+ {
+ u8 pcm = pcm_r() + 1;
+ pcm_w(pcm);
+ if (pcm == 0x00 && m_pcmask > 0xffff)
+ pch_w(pch_r() + 1);
+ }
+ m_exec_state = EXEC_CYCLE1;
+ break;
+
+ case EXEC_SBCPCM:
+ if (!BIT(m_status, 0))
+ {
+ u8 pcm = pcm_r() - 1;
+ pcm_w(pcm);
+ if (pcm == 0xff && m_pcmask > 0xffff)
+ pch_w(pch_r() - 1);
+ }
+ m_exec_state = EXEC_CYCLE1;
break;
case EXEC_TBRD0:
@@ -1113,7 +1890,7 @@ void riscii_series_device::execute_run()
case EXEC_L4JMP: case EXEC_L5JMP: case EXEC_L6JMP: case EXEC_L7JMP:
case EXEC_L8JMP: case EXEC_L9JMP: case EXEC_LAJMP: case EXEC_LBJMP:
case EXEC_LCJMP: case EXEC_LDJMP: case EXEC_LEJMP: case EXEC_LFJMP:
- execute_jump(u32(m_exec_state - EXEC_L0JMP) << 16 | m_cache->read_word(m_pc++));
+ execute_jump(u32(m_exec_state - EXEC_L0JMP) << 16 | fetch_program_word());
m_exec_state = EXEC_CYCLE1;
break;
@@ -1121,12 +1898,12 @@ void riscii_series_device::execute_run()
case EXEC_L4CALL: case EXEC_L5CALL: case EXEC_L6CALL: case EXEC_L7CALL:
case EXEC_L8CALL: case EXEC_L9CALL: case EXEC_LACALL: case EXEC_LBCALL:
case EXEC_LCCALL: case EXEC_LDCALL: case EXEC_LECALL: case EXEC_LFCALL:
- execute_call(u32(m_exec_state - EXEC_L0CALL) << 16 | m_cache->read_word(m_pc++));
+ execute_call(u32(m_exec_state - EXEC_L0CALL) << 16 | fetch_program_word());
m_exec_state = EXEC_CYCLE1;
break;
case EXEC_NOJMP:
- (void)m_cache->read_word(m_pc++);
+ (void)fetch_program_word();
m_exec_state = EXEC_CYCLE1;
break;
}
diff --git a/src/devices/cpu/rii/riscii.h b/src/devices/cpu/rii/riscii.h
index 835d9469f46..c670c1ea813 100644
--- a/src/devices/cpu/rii/riscii.h
+++ b/src/devices/cpu/rii/riscii.h
@@ -30,16 +30,60 @@ public:
RII_CPUCON,
RII_STATUS,
RII_PROD,
- RII_POST_ID
+ RII_PFS,
+ RII_INTCON,
+ RII_INTSTA,
+ RII_POST_ID,
+ RII_PORTB, RII_PORTC, RII_PORTD, RII_PORTE, RII_PORTF, RII_PORTG, RII_PORTH, RII_PORTI, RII_PORTJ, RII_PORTK,
+ RII_STBCON,
+ RII_PAINTEN, RII_PAINTSTA, RII_PAWAKE,
+ RII_DCRB, RII_DCRC, RII_DCRDE, RII_DCRFG, RII_DCRHI, RII_DCRJK,
+ RII_PBCON, RII_PCCON,
+ RII_UARTCON, RII_UARTSTA,
+ RII_SPICON, RII_SPISTA,
+ RII_TRL0, RII_TRL1, RII_TRL2,
+ RII_TR01CON,
+ RII_TR2CON,
+ RII_TRLIR,
+ RII_SFCR,
+ RII_ADD1, RII_ADD2, RII_ADD3, RII_ADD4,
+ RII_ENV1, RII_ENV2, RII_ENV3, RII_ENV4,
+ RII_MTCON1, RII_MTCON2, RII_MTCON3, RII_MTCON4,
+ RII_MTRL1, RII_MTRL2, RII_MTRL3, RII_MTRL4,
+ RII_SPHDR,
+ RII_SPHTCON,
+ RII_SPHTRL,
+ RII_VOCON
};
- // construction/destruction
- riscii_series_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ // callback configuration
+ auto in_porta_cb() { return m_porta_in_cb.bind(); }
+ auto in_portb_cb() { return m_port_in_cb[0].bind(); }
+ auto out_portb_cb() { return m_port_out_cb[0].bind(); }
+ auto in_portc_cb() { return m_port_in_cb[1].bind(); }
+ auto out_portc_cb() { return m_port_out_cb[1].bind(); }
+ auto in_portd_cb() { return m_port_in_cb[2].bind(); }
+ auto out_portd_cb() { return m_port_out_cb[2].bind(); }
+ auto in_porte_cb() { return m_port_in_cb[3].bind(); }
+ auto out_porte_cb() { return m_port_out_cb[3].bind(); }
+ auto in_portf_cb() { return m_port_in_cb[4].bind(); }
+ auto out_portf_cb() { return m_port_out_cb[4].bind(); }
+ auto in_portg_cb() { return m_port_in_cb[5].bind(); }
+ auto out_portg_cb() { return m_port_out_cb[5].bind(); }
+ auto in_porth_cb() { return m_port_in_cb[6].bind(); }
+ auto out_porth_cb() { return m_port_out_cb[6].bind(); }
+ auto in_porti_cb() { return m_port_in_cb[7].bind(); }
+ auto out_porti_cb() { return m_port_out_cb[7].bind(); }
+ auto in_portj_cb() { return m_port_in_cb[8].bind(); }
+ auto out_portj_cb() { return m_port_out_cb[8].bind(); }
+ auto in_portk_cb() { return m_port_in_cb[9].bind(); }
+ auto out_portk_cb() { return m_port_out_cb[9].bind(); }
protected:
- riscii_series_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, unsigned prgbits, unsigned bankbits, uint8_t maxbank);
+ riscii_series_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, unsigned addrbits, unsigned pcbits, u32 datastart, unsigned bankbits, u8 maxbank, u8 post_id_mask, address_map_constructor regs);
// device-level overrides
+ virtual void device_resolve_objects() override;
virtual void device_start() override;
virtual void device_reset() override;
@@ -47,16 +91,14 @@ protected:
virtual void execute_run() override;
virtual void execute_set_input(int inputnum, int state) override;
- // device_disasm_interface overrides
- virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
-
// device_memory_interface overrides
virtual space_config_vector memory_space_config() const override;
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
-private:
+ void core_regs_map(address_map &map);
+
// register handlers
u8 fsr0_r();
void fsr0_w(u8 data);
@@ -90,12 +132,92 @@ private:
void prodl_w(u8 data);
u8 prodh_r();
void prodh_w(u8 data);
+ u8 pfs_r();
+ void pfs_w(u8 data);
+ u8 intcon_r();
+ void intcon_w(u8 data);
+ u8 intsta_r();
+ void intsta_w(u8 data);
u8 post_id_r();
void post_id_w(u8 data);
+ u8 porta_r();
+ u8 port_r(offs_t offset);
+ void port_w(offs_t offset, u8 data);
+ u8 stbcon_r();
+ void stbcon_w(u8 data);
+ u8 painten_r();
+ void painten_w(u8 data);
+ u8 paintsta_r();
+ void paintsta_w(u8 data);
+ u8 pawake_r();
+ void pawake_w(u8 data);
+ u8 portjk_r(offs_t offset);
+ void portjk_w(offs_t offset, u8 data);
+ u8 dcr_r(offs_t offset);
+ void dcr_w(offs_t offset, u8 data);
+ u8 pcon_r(offs_t offset);
+ void pcon_w(offs_t offset, u8 data);
+ void uarttx_w(u8 data);
+ u8 uartrx_r();
+ u8 uartcon_r();
+ void uartcon_w(u8 data);
+ u8 uartsta_r();
+ void uartsta_w(u8 data);
+ u8 spicon_r();
+ void spicon_w(u8 data);
+ u8 spista_r();
+ void spista_w(u8 data);
+ u8 sprl_r();
+ void sprl_w(u8 data);
+ u8 sprm_r();
+ void sprm_w(u8 data);
+ u8 sprh_r();
+ void sprh_w(u8 data);
+ u8 trl0l_r();
+ void trl0l_w(u8 data);
+ u8 trl0h_r();
+ void trl0h_w(u8 data);
+ u8 trl1_r();
+ void trl1_w(u8 data);
+ u8 trl2_r();
+ void trl2_w(u8 data);
+ u8 tr01con_r();
+ void tr01con_w(u8 data);
+ u8 tr2con_r();
+ void tr2con_w(u8 data);
+ u8 trlir_r();
+ void trlir_w(u8 data);
+ u8 t0cl_r();
+ u8 t0ch_r();
+ u8 tr1c_r();
+ u8 tr2c_r();
+ u8 sfcr_r();
+ void sfcr_w(u8 data);
+ u8 addl_r();
+ void addl_w(u8 data);
+ u8 addm_r();
+ void addm_w(u8 data);
+ u8 addh_r();
+ void addh_w(u8 data);
+ u8 env_sphdr_r();
+ void env_sphdr_w(u8 data);
+ u8 mtcon_sphtcon_r();
+ void mtcon_sphtcon_w(u8 data);
+ u8 mtrl_sphtrl_r();
+ void mtrl_sphtrl_w(u8 data);
+ u8 vocon_r();
+ void vocon_w(u8 data);
+
+private:
+ // debugging helpers
+ void debug_set_pc(u32 pc);
// memory helpers
+ u16 fetch_program_word();
u16 get_banked_address(u8 reg);
u32 tabptr_offset(int offset) const;
+ void multi_byte_carry(u16 addr, bool cy);
+ void multi_byte_borrow(u16 addr, bool cy);
// execution
void execute_move(u8 dstreg, u8 srcreg);
@@ -143,6 +265,7 @@ private:
enum exec_state : u8 {
EXEC_CYCLE1,
+ EXEC_ADCPCM, EXEC_SBCPCM,
EXEC_TBRD0, EXEC_TBRD1, EXEC_TBRD2, EXEC_TBRDA,
EXEC_NOJMP,
EXEC_L0JMP, EXEC_L1JMP, EXEC_L2JMP, EXEC_L3JMP,
@@ -155,8 +278,6 @@ private:
EXEC_LCCALL, EXEC_LDCALL, EXEC_LECALL, EXEC_LFCALL
};
- void regs_map(address_map &map);
-
// address spaces
address_space_config m_program_config;
address_space_config m_regs_config;
@@ -164,10 +285,18 @@ private:
address_space *m_regs;
memory_access_cache<1, -1, ENDIANNESS_LITTLE> *m_cache;
+ // device callbacks
+ devcb_read8 m_porta_in_cb;
+ devcb_read8 m_port_in_cb[10];
+ devcb_write8 m_port_out_cb[10];
+
// model-specific parameters
- const unsigned m_prgbits;
- const uint8_t m_bankmask;
- const uint8_t m_maxbank;
+ const u32 m_pcmask;
+ const u32 m_datastart;
+ const u32 m_tbptmask;
+ const u8 m_bankmask;
+ const u8 m_maxbank;
+ const u8 m_post_id_mask;
// internal state
u32 m_pc;
@@ -177,11 +306,51 @@ private:
u8 m_bsr[2];
u32 m_tabptr;
u8 m_stkptr;
+ std::unique_ptr<u8[]> m_pchstack;
u8 m_cpucon;
u8 m_status;
u16 m_prod;
+ u8 m_pfs;
+ u8 m_intcon;
+ u8 m_intsta;
u8 m_post_id;
+ // port state
+ u8 m_port_data[10];
+ u8 m_port_dcr[6];
+ u8 m_port_control[2];
+ u8 m_stbcon;
+ u8 m_painten;
+ u8 m_paintsta;
+ u8 m_pawake;
+
+ // UART state
+ u8 m_uartcon;
+ u8 m_uartsta;
+
+ // SPI state
+ u8 m_spicon;
+ u8 m_spista;
+
+ // timer state
+ u16 m_trl0;
+ u8 m_trl1;
+ u8 m_trl2;
+ u8 m_tr01con;
+ u8 m_tr2con;
+ u8 m_trlir;
+ u8 m_sfcr;
+
+ // synthesizer state
+ u32 m_add[4];
+ u8 m_env[4];
+ u8 m_mtcon[4];
+ u8 m_mtrl[4];
+ u8 m_sphdr;
+ u8 m_sphtcon;
+ u8 m_sphtrl;
+ u8 m_vocon;
+
// execution sequencing
s32 m_icount;
exec_state m_exec_state;
@@ -189,6 +358,20 @@ private:
u8 m_curreg;
};
-DECLARE_DEVICE_TYPE(RISCII, riscii_series_device)
+class epg3231_device : public riscii_series_device
+{
+public:
+ // construction/destruction
+ epg3231_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ // device_disasm_interface overrides
+ virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+
+private:
+ void regs_map(address_map &map);
+};
+
+DECLARE_DEVICE_TYPE(EPG3231, epg3231_device)
#endif // MAME_CPU_RII_RISCII_H
diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp
index a489291ae51..c0fab41f9b0 100644
--- a/src/devices/cpu/sh/sh2.cpp
+++ b/src/devices/cpu/sh/sh2.cpp
@@ -1058,61 +1058,64 @@ void sh2_device::static_generate_memory_accessor(int size, int iswrite, const ch
UML_LABEL(block, label++); // label:
- for (auto & elem : m_fastram)
+ if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
{
- if (elem.base != nullptr && (!iswrite || !elem.readonly))
+ for (auto & elem : m_fastram)
{
- void *fastbase = (uint8_t *)elem.base - elem.start;
- uint32_t skip = label++;
- if (elem.end != 0xffffffff)
+ if (elem.base != nullptr && (!iswrite || !elem.readonly))
{
- UML_CMP(block, I0, elem.end); // cmp i0,end
- UML_JMPc(block, COND_A, skip); // ja skip
- }
- if (elem.start != 0x00000000)
- {
- UML_CMP(block, I0, elem.start);// cmp i0,fastram_start
- UML_JMPc(block, COND_B, skip); // jb skip
- }
-
- if (!iswrite)
- {
- if (size == 1)
- {
- UML_XOR(block, I0, I0, BYTE4_XOR_BE(0));
- UML_LOAD(block, I0, fastbase, I0, SIZE_BYTE, SCALE_x1); // load i0,fastbase,i0,byte
- }
- else if (size == 2)
- {
- UML_XOR(block, I0, I0, WORD_XOR_BE(0));
- UML_LOAD(block, I0, fastbase, I0, SIZE_WORD, SCALE_x1); // load i0,fastbase,i0,word_x1
- }
- else if (size == 4)
+ void *fastbase = (uint8_t *)elem.base - elem.start;
+ uint32_t skip = label++;
+ if (elem.end != 0xffffffff)
{
- UML_LOAD(block, I0, fastbase, I0, SIZE_DWORD, SCALE_x1); // load i0,fastbase,i0,dword_x1
+ UML_CMP(block, I0, elem.end); // cmp i0,end
+ UML_JMPc(block, COND_A, skip); // ja skip
}
- UML_RET(block); // ret
- }
- else
- {
- if (size == 1)
+ if (elem.start != 0x00000000)
{
- UML_XOR(block, I0, I0, BYTE4_XOR_BE(0));
- UML_STORE(block, fastbase, I0, I1, SIZE_BYTE, SCALE_x1);// store fastbase,i0,i1,byte
+ UML_CMP(block, I0, elem.start);// cmp i0,fastram_start
+ UML_JMPc(block, COND_B, skip); // jb skip
}
- else if (size == 2)
+
+ if (!iswrite)
{
- UML_XOR(block, I0, I0, WORD_XOR_BE(0));
- UML_STORE(block, fastbase, I0, I1, SIZE_WORD, SCALE_x1);// store fastbase,i0,i1,word_x1
+ if (size == 1)
+ {
+ UML_XOR(block, I0, I0, BYTE4_XOR_BE(0));
+ UML_LOAD(block, I0, fastbase, I0, SIZE_BYTE, SCALE_x1); // load i0,fastbase,i0,byte
+ }
+ else if (size == 2)
+ {
+ UML_XOR(block, I0, I0, WORD_XOR_BE(0));
+ UML_LOAD(block, I0, fastbase, I0, SIZE_WORD, SCALE_x1); // load i0,fastbase,i0,word_x1
+ }
+ else if (size == 4)
+ {
+ UML_LOAD(block, I0, fastbase, I0, SIZE_DWORD, SCALE_x1); // load i0,fastbase,i0,dword_x1
+ }
+ UML_RET(block); // ret
}
- else if (size == 4)
+ else
{
- UML_STORE(block, fastbase, I0, I1, SIZE_DWORD, SCALE_x1); // store fastbase,i0,i1,dword_x1
+ if (size == 1)
+ {
+ UML_XOR(block, I0, I0, BYTE4_XOR_BE(0));
+ UML_STORE(block, fastbase, I0, I1, SIZE_BYTE, SCALE_x1);// store fastbase,i0,i1,byte
+ }
+ else if (size == 2)
+ {
+ UML_XOR(block, I0, I0, WORD_XOR_BE(0));
+ UML_STORE(block, fastbase, I0, I1, SIZE_WORD, SCALE_x1);// store fastbase,i0,i1,word_x1
+ }
+ else if (size == 4)
+ {
+ UML_STORE(block, fastbase, I0, I1, SIZE_DWORD, SCALE_x1); // store fastbase,i0,i1,dword_x1
+ }
+ UML_RET(block); // ret
}
- UML_RET(block); // ret
- }
- UML_LABEL(block, skip); // skip:
+ UML_LABEL(block, skip); // skip:
+ }
}
}
diff --git a/src/devices/cpu/sh/sh4.cpp b/src/devices/cpu/sh/sh4.cpp
index 47ed74df421..636bcd05ddb 100644
--- a/src/devices/cpu/sh/sh4.cpp
+++ b/src/devices/cpu/sh/sh4.cpp
@@ -2713,64 +2713,67 @@ void sh34_base_device::static_generate_memory_accessor(int size, int iswrite, co
UML_LABEL(block, label++); // label:
- for (auto & elem : m_fastram)
+ if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
{
- if (elem.base != nullptr && (!iswrite || !elem.readonly))
+ for (auto & elem : m_fastram)
{
- void *fastbase = (uint8_t *)elem.base - elem.start;
- uint32_t skip = label++;
- if (elem.end != 0xffffffff)
+ if (elem.base != nullptr && (!iswrite || !elem.readonly))
{
- UML_CMP(block, I0, elem.end); // cmp i0,end
- UML_JMPc(block, COND_A, skip); // ja skip
- }
- if (elem.start != 0x00000000)
- {
- UML_CMP(block, I0, elem.start);// cmp i0,fastram_start
- UML_JMPc(block, COND_B, skip); // jb skip
- }
-
- if (!iswrite)
- {
- if (size == 1)
+ void *fastbase = (uint8_t *)elem.base - elem.start;
+ uint32_t skip = label++;
+ if (elem.end != 0xffffffff)
{
- UML_XOR(block, I0, I0, m_bigendian ? BYTE8_XOR_BE(0) : BYTE8_XOR_LE(0));
- UML_LOAD(block, I0, fastbase, I0, SIZE_BYTE, SCALE_x1); // load i0,fastbase,i0,byte
+ UML_CMP(block, I0, elem.end); // cmp i0,end
+ UML_JMPc(block, COND_A, skip); // ja skip
}
- else if (size == 2)
+ if (elem.start != 0x00000000)
{
- UML_XOR(block, I0, I0, m_bigendian ? WORD2_XOR_BE(0) : WORD2_XOR_LE(0));
- UML_LOAD(block, I0, fastbase, I0, SIZE_WORD, SCALE_x1); // load i0,fastbase,i0,word_x1
+ UML_CMP(block, I0, elem.start);// cmp i0,fastram_start
+ UML_JMPc(block, COND_B, skip); // jb skip
}
- else if (size == 4)
- {
- UML_XOR(block, I0, I0, m_bigendian ? DWORD_XOR_BE(0) : DWORD_XOR_LE(0));
- UML_LOAD(block, I0, fastbase, I0, SIZE_DWORD, SCALE_x1); // load i0,fastbase,i0,dword_x1
- }
- UML_RET(block); // ret
- }
- else
- {
- if (size == 1)
- {
- UML_XOR(block, I0, I0, m_bigendian ? BYTE8_XOR_BE(0) : BYTE8_XOR_LE(0));
- UML_STORE(block, fastbase, I0, I1, SIZE_BYTE, SCALE_x1);// store fastbase,i0,i1,byte
- }
- else if (size == 2)
+ if (!iswrite)
{
- UML_XOR(block, I0, I0, m_bigendian ? WORD2_XOR_BE(0) : WORD2_XOR_LE(0));
- UML_STORE(block, fastbase, I0, I1, SIZE_WORD, SCALE_x1);// store fastbase,i0,i1,word_x1
+ if (size == 1)
+ {
+ UML_XOR(block, I0, I0, m_bigendian ? BYTE8_XOR_BE(0) : BYTE8_XOR_LE(0));
+ UML_LOAD(block, I0, fastbase, I0, SIZE_BYTE, SCALE_x1); // load i0,fastbase,i0,byte
+ }
+ else if (size == 2)
+ {
+ UML_XOR(block, I0, I0, m_bigendian ? WORD2_XOR_BE(0) : WORD2_XOR_LE(0));
+ UML_LOAD(block, I0, fastbase, I0, SIZE_WORD, SCALE_x1); // load i0,fastbase,i0,word_x1
+ }
+ else if (size == 4)
+ {
+
+ UML_XOR(block, I0, I0, m_bigendian ? DWORD_XOR_BE(0) : DWORD_XOR_LE(0));
+ UML_LOAD(block, I0, fastbase, I0, SIZE_DWORD, SCALE_x1); // load i0,fastbase,i0,dword_x1
+ }
+ UML_RET(block); // ret
}
- else if (size == 4)
+ else
{
- UML_XOR(block, I0, I0, m_bigendian ? DWORD_XOR_BE(0) : DWORD_XOR_LE(0));
- UML_STORE(block, fastbase, I0, I1, SIZE_DWORD, SCALE_x1); // store fastbase,i0,i1,dword_x1
+ if (size == 1)
+ {
+ UML_XOR(block, I0, I0, m_bigendian ? BYTE8_XOR_BE(0) : BYTE8_XOR_LE(0));
+ UML_STORE(block, fastbase, I0, I1, SIZE_BYTE, SCALE_x1);// store fastbase,i0,i1,byte
+ }
+ else if (size == 2)
+ {
+ UML_XOR(block, I0, I0, m_bigendian ? WORD2_XOR_BE(0) : WORD2_XOR_LE(0));
+ UML_STORE(block, fastbase, I0, I1, SIZE_WORD, SCALE_x1);// store fastbase,i0,i1,word_x1
+ }
+ else if (size == 4)
+ {
+ UML_XOR(block, I0, I0, m_bigendian ? DWORD_XOR_BE(0) : DWORD_XOR_LE(0));
+ UML_STORE(block, fastbase, I0, I1, SIZE_DWORD, SCALE_x1); // store fastbase,i0,i1,dword_x1
+ }
+ UML_RET(block); // ret
}
- UML_RET(block); // ret
- }
- UML_LABEL(block, skip); // skip:
+ UML_LABEL(block, skip); // skip:
+ }
}
}
diff --git a/src/devices/cpu/tms34010/34010ops.hxx b/src/devices/cpu/tms34010/34010ops.hxx
index f0dbd7994fb..8483e1891fb 100644
--- a/src/devices/cpu/tms34010/34010ops.hxx
+++ b/src/devices/cpu/tms34010/34010ops.hxx
@@ -2076,9 +2076,9 @@ void tms340x0_device::blmove(uint16_t op)
}
/*
- TODO: We do not currently emulate precisely how B0 and B2 are modified during the operation:
- if D == 0, then B0 and B2 remain fixed during execution and are only incremented after operation completes.
- if D == 1, then B2 is incremented during move, B0 remains fixed until operation completes.
+ TODO: We do not currently emulate precisely how B0 and B2 are modified during the operation:
+ if D == 0, then B0 and B2 remain fixed during execution and are only incremented after operation completes.
+ if D == 1, then B2 is incremented during move, B0 remains fixed until operation completes.
*/
BREG(0) = src;
diff --git a/src/devices/imagedev/avivideo.cpp b/src/devices/imagedev/avivideo.cpp
new file mode 100644
index 00000000000..0c3559a127a
--- /dev/null
+++ b/src/devices/imagedev/avivideo.cpp
@@ -0,0 +1,118 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+/*********************************************************************
+
+ avivideo.cpp
+
+ Image device for AVI video.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "avivideo.h"
+#include "aviio.h"
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+// device type definition
+DEFINE_DEVICE_TYPE(IMAGE_AVIVIDEO, avivideo_image_device, "avivideo_image", "AVI Video Image")
+
+//-------------------------------------------------
+// avivideo_image_device - constructor
+//-------------------------------------------------
+
+avivideo_image_device::avivideo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, IMAGE_AVIVIDEO, tag, owner, clock),
+ device_image_interface(mconfig, *this),
+ m_frame(nullptr),
+ m_avi(nullptr),
+ m_frame_timer(nullptr),
+ m_frame_count(0),
+ m_frame_num(0)
+{
+}
+
+//-------------------------------------------------
+// avivideo_image_device - destructor
+//-------------------------------------------------
+
+avivideo_image_device::~avivideo_image_device()
+{
+ call_unload();
+}
+
+
+void avivideo_image_device::device_start()
+{
+ m_frame_timer = timer_alloc(TIMER_FRAME);
+ m_frame_timer->adjust(attotime::never);
+
+ save_item(NAME(m_frame_count));
+ save_item(NAME(m_frame_num));
+}
+
+void avivideo_image_device::device_reset()
+{
+ m_frame_num = 0;
+}
+
+void avivideo_image_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (id == TIMER_FRAME)
+ {
+ if (m_avi != nullptr)
+ {
+ avi_file::error avierr = m_avi->read_uncompressed_video_frame(m_frame_num, *m_frame);
+ if (avierr != avi_file::error::NONE)
+ {
+ m_frame_timer->adjust(attotime::never);
+ return;
+ }
+ m_frame_num++;
+ if (m_frame_num >= m_frame_count)
+ {
+ m_frame_num = 0;
+ }
+ }
+ else
+ {
+ m_frame_timer->adjust(attotime::never);
+ }
+ }
+}
+
+image_init_result avivideo_image_device::call_load()
+{
+ m_frame = new bitmap_argb32;
+ avi_file::error avierr = avi_file::open(filename(), m_avi);
+ if (avierr != avi_file::error::NONE)
+ {
+ delete m_frame;
+ m_frame = nullptr;
+ return image_init_result::FAIL;
+ }
+
+ const avi_file::movie_info &aviinfo = m_avi->get_movie_info();
+ float frame_rate = (float)aviinfo.video_timescale / (float)aviinfo.video_sampletime;
+ attotime frame_time = attotime::from_hz((int)round(frame_rate));
+ m_frame_timer->adjust(frame_time, 0, frame_time);
+ m_frame_count = aviinfo.video_numsamples;
+ m_frame_num = 0;
+ return image_init_result::PASS;
+}
+
+void avivideo_image_device::call_unload()
+{
+ if (m_frame)
+ {
+ delete m_frame;
+ m_frame = nullptr;
+ }
+ if (m_avi)
+ {
+ m_avi.release();
+ m_avi = nullptr;
+ }
+}
diff --git a/src/devices/imagedev/avivideo.h b/src/devices/imagedev/avivideo.h
new file mode 100644
index 00000000000..8feb78b262e
--- /dev/null
+++ b/src/devices/imagedev/avivideo.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+/*********************************************************************
+
+ avivideo.h
+
+ Image device for AVI video.
+
+*********************************************************************/
+
+#ifndef MAME_DEVICES_IMAGEDEV_AVIVIDEO_H
+#define MAME_DEVICES_IMAGEDEV_AVIVIDEO_H
+
+#pragma once
+
+#include "bitmap.h"
+#include "aviio.h"
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+// ======================> avivideo_image_device
+
+class avivideo_image_device : public device_t, public device_image_interface
+{
+public:
+ // construction/destruction
+ avivideo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ virtual ~avivideo_image_device();
+
+ // image-level overrides
+ virtual image_init_result call_load() override;
+ virtual void call_unload() override;
+ virtual iodevice_t image_type() const override { return IO_VIDEO; }
+
+ virtual bool is_readable() const override { return 1; }
+ virtual bool is_writeable() const override { return 0; }
+ virtual bool is_creatable() const override { return 0; }
+ virtual bool must_be_loaded() const override { return 0; }
+ virtual bool is_reset_on_load() const override { return 0; }
+ virtual const char *file_extensions() const override { return "avi"; }
+
+ bitmap_argb32 &get_frame() { return *m_frame; }
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+private:
+ static constexpr device_timer_id TIMER_FRAME = 0;
+
+ bitmap_argb32 *m_frame;
+ avi_file::ptr m_avi;
+
+ emu_timer *m_frame_timer;
+ uint32_t m_frame_count;
+ uint32_t m_frame_num;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(IMAGE_AVIVIDEO, avivideo_image_device)
+
+#endif // MAME_DEVICES_IMAGEDEV_AVIVIDEO_H
diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp
index 5e8162ce842..f7da6fa26cb 100644
--- a/src/devices/imagedev/diablo.cpp
+++ b/src/devices/imagedev/diablo.cpp
@@ -110,35 +110,32 @@ image_init_result diablo_image_device::call_load()
image_init_result diablo_image_device::call_create(int create_format, util::option_resolution *create_args)
{
int err;
- uint32_t sectorsize, hunksize;
- uint32_t cylinders, heads, sectors, totalsectors;
- assert_always(create_args != nullptr, "Expected create_args to not be nullptr");
- cylinders = create_args->lookup_int('C');
- heads = create_args->lookup_int('H');
- sectors = create_args->lookup_int('S');
- sectorsize = create_args->lookup_int('L') * sizeof(uint16_t);
- hunksize = create_args->lookup_int('K');
+ if (!create_args)
+ throw emu_fatalerror("diablo_image_device::call_create: Expected create_args to not be nullptr");
- totalsectors = cylinders * heads * sectors;
+ const uint32_t cylinders = create_args->lookup_int('C');
+ const uint32_t heads = create_args->lookup_int('H');
+ const uint32_t sectors = create_args->lookup_int('S');
+ const uint32_t sectorsize = create_args->lookup_int('L') * sizeof(uint16_t);
+ const uint32_t hunksize = create_args->lookup_int('K');
+
+ const uint32_t totalsectors = cylinders * heads * sectors;
/* create the CHD file */
chd_codec_type compression[4] = { CHD_CODEC_NONE };
err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression);
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
/* if we created the image and hence, have metadata to set, set the metadata */
err = m_origchd.write_metadata(HARD_DISK_METADATA_TAG, 0, string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize));
m_origchd.close();
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
return internal_load_dsk();
-
-error:
- return image_init_result::FAIL;
}
void diablo_image_device::call_unload()
diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp
index 7731fb45b30..cdb4f72e098 100644
--- a/src/devices/imagedev/harddriv.cpp
+++ b/src/devices/imagedev/harddriv.cpp
@@ -131,44 +131,39 @@ image_init_result harddisk_image_device::call_load()
image_init_result harddisk_image_device::call_create(int create_format, util::option_resolution *create_args)
{
int err;
- uint32_t sectorsize, hunksize;
- uint32_t cylinders, heads, sectors, totalsectors;
- assert_always(create_args != nullptr, "Expected create_args to not be nullptr");
- cylinders = create_args->lookup_int('C');
- heads = create_args->lookup_int('H');
- sectors = create_args->lookup_int('S');
- sectorsize = create_args->lookup_int('L');
- hunksize = create_args->lookup_int('K');
+ if (!create_args)
+ throw emu_fatalerror("harddisk_image_device::call_create: Expected create_args to not be nullptr");
- totalsectors = cylinders * heads * sectors;
+ const uint32_t cylinders = create_args->lookup_int('C');
+ const uint32_t heads = create_args->lookup_int('H');
+ const uint32_t sectors = create_args->lookup_int('S');
+ const uint32_t sectorsize = create_args->lookup_int('L');
+ const uint32_t hunksize = create_args->lookup_int('K');
+
+ const uint32_t totalsectors = cylinders * heads * sectors;
/* create the CHD file */
chd_codec_type compression[4] = { CHD_CODEC_NONE };
err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression);
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
/* if we created the image and hence, have metadata to set, set the metadata */
err = m_origchd.write_metadata(HARD_DISK_METADATA_TAG, 0, string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize));
m_origchd.close();
if (err != CHDERR_NONE)
- goto error;
+ return image_init_result::FAIL;
return internal_load_hd();
-
-error:
- return image_init_result::FAIL;
}
void harddisk_image_device::call_unload()
{
/* Check if there is an image_unload callback defined */
- if ( !m_device_image_unload.isnull() )
- {
+ if (!m_device_image_unload.isnull())
m_device_image_unload(*this);
- }
if (m_hard_disk_handle != nullptr)
{
diff --git a/src/devices/imagedev/picture.h b/src/devices/imagedev/picture.h
index 7d41d53b4da..4261d6cf351 100644
--- a/src/devices/imagedev/picture.h
+++ b/src/devices/imagedev/picture.h
@@ -19,7 +19,7 @@
TYPE DEFINITIONS
***************************************************************************/
-// ======================> microdrive_image_device
+// ======================> picture_image_device
class picture_image_device : public device_t,
public device_image_interface
diff --git a/src/devices/machine/28fxxx.cpp b/src/devices/machine/28fxxx.cpp
index 6218ada4548..0643685589a 100644
--- a/src/devices/machine/28fxxx.cpp
+++ b/src/devices/machine/28fxxx.cpp
@@ -58,7 +58,8 @@ base_28fxxx_device::base_28fxxx_device(const machine_config &mconfig, device_typ
, m_program_power(CLEAR_LINE)
, m_state(STATE_READ_MEMORY)
{
- assert_always((m_size & (m_size - 1)) == 0, "memory size must be an exact power of two");
+ if (m_size & (m_size - 1))
+ throw emu_fatalerror("%s(%s): memory size must be an exact power of two", type.shortname(), tag);
}
intel_28f010_device::intel_28f010_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
diff --git a/src/devices/machine/6532riot.cpp b/src/devices/machine/6532riot.cpp
index 1b619f4e16d..f24b8b1656c 100644
--- a/src/devices/machine/6532riot.cpp
+++ b/src/devices/machine/6532riot.cpp
@@ -510,6 +510,6 @@ void riot6532_device::device_timer(emu_timer &timer, device_timer_id id, int par
timer_end();
break;
default:
- assert_always(false, "Unknown id in riot6532_device::device_timer");
+ throw emu_fatalerror("Unknown id in riot6532_device::device_timer");
}
}
diff --git a/src/devices/machine/6821pia.cpp b/src/devices/machine/6821pia.cpp
index bee109d4d34..88c01234cca 100644
--- a/src/devices/machine/6821pia.cpp
+++ b/src/devices/machine/6821pia.cpp
@@ -347,9 +347,7 @@ void pia6821_device::set_out_ca2(int data)
else
{
if (m_out_ca2_needs_pulled)
- {
logerror("Warning! No port CA2 write handler. Previous value has been lost!\n");
- }
m_out_ca2_needs_pulled = true;
}
@@ -378,9 +376,7 @@ void pia6821_device::set_out_cb2(int data)
else
{
if (m_out_cb2_needs_pulled)
- {
logerror("Warning! No port CB2 write handler. Previous value has been lost!\n");
- }
m_out_cb2_needs_pulled = true;
}
@@ -402,16 +398,14 @@ uint8_t pia6821_device::port_a_r()
update_interrupts();
// CA2 is configured as output and in read strobe mode
- if(c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a))
+ if (c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a))
{
// this will cause a transition low
set_out_ca2(false);
// if the CA2 strobe is cleared by the E, reset it right away
- if(strobe_e_reset(m_ctl_a))
- {
+ if (strobe_e_reset(m_ctl_a))
set_out_ca2(true);
- }
}
LOG("PIA port A read = %02X\n", ret);
@@ -426,7 +420,7 @@ uint8_t pia6821_device::port_a_r()
uint8_t pia6821_device::ddr_a_r()
{
- uint8_t ret = m_ddr_a;
+ const uint8_t ret = m_ddr_a;
LOG("PIA DDR A read = %02X\n", ret);
@@ -440,16 +434,14 @@ uint8_t pia6821_device::ddr_a_r()
uint8_t pia6821_device::port_b_r()
{
- uint8_t ret = get_in_b_value();
+ const uint8_t ret = get_in_b_value();
// This read will implicitly clear the IRQ B1 flag. If CB2 is in write-strobe
// mode with CB1 restore, and a CB1 active transition set the flag,
// clearing it will cause CB2 to go high again. Note that this is different
// from what happens with port A.
- if(m_irq_b1 && c2_strobe_mode(m_ctl_b) && strobe_c1_reset(m_ctl_b))
- {
+ if (m_irq_b1 && c2_strobe_mode(m_ctl_b) && strobe_c1_reset(m_ctl_b))
set_out_cb2(true);
- }
// IRQ flags implicitly cleared by a read
m_irq_b1 = false;
@@ -468,7 +460,7 @@ uint8_t pia6821_device::port_b_r()
uint8_t pia6821_device::ddr_b_r()
{
- uint8_t ret = m_ddr_b;
+ const uint8_t ret = m_ddr_b;
LOG("PIA DDR B read = %02X\n", ret);
@@ -509,15 +501,11 @@ uint8_t pia6821_device::control_a_r()
ret = m_ctl_a;
// set the IRQ flags if we have pending IRQs
- if(m_irq_a1)
- {
+ if (m_irq_a1)
ret |= PIA_IRQ1;
- }
- if(m_irq_a2 && c2_input(m_ctl_a))
- {
+ if (m_irq_a2 && c2_input(m_ctl_a))
ret |= PIA_IRQ2;
- }
LOG("PIA control A read = %02X\n", ret);
@@ -554,15 +542,11 @@ uint8_t pia6821_device::control_b_r()
ret = m_ctl_b;
// set the IRQ flags if we have pending IRQs
- if(m_irq_b1)
- {
+ if (m_irq_b1)
ret |= PIA_IRQ1;
- }
- if(m_irq_b2 && c2_input(m_ctl_b))
- {
+ if (m_irq_b2 && c2_input(m_ctl_b))
ret |= PIA_IRQ2;
- }
LOG("PIA control B read = %02X\n", ret);
@@ -580,36 +564,22 @@ uint8_t pia6821_device::read(offs_t offset)
switch (offset & 0x03)
{
- default: // impossible
- case 0x00:
- if (output_selected(m_ctl_a))
- {
- ret = port_a_r();
- }
- else
- {
- ret = ddr_a_r();
- }
- break;
-
- case 0x01:
- ret = control_a_r();
- break;
-
- case 0x02:
- if (output_selected(m_ctl_b))
- {
- ret = port_b_r();
- }
- else
- {
- ret = ddr_b_r();
- }
- break;
-
- case 0x03:
- ret = control_b_r();
- break;
+ default: // impossible
+ case 0x00:
+ ret = output_selected(m_ctl_a) ? port_a_r() : ddr_a_r();
+ break;
+
+ case 0x01:
+ ret = control_a_r();
+ break;
+
+ case 0x02:
+ ret = output_selected(m_ctl_b) ? port_b_r() : ddr_b_r();
+ break;
+
+ case 0x03:
+ ret = control_b_r();
+ break;
}
return ret;
@@ -624,20 +594,18 @@ uint8_t pia6821_device::read(offs_t offset)
void pia6821_device::send_to_out_a_func(const char* message)
{
// input pins are pulled high
- uint8_t data = get_out_a_value();
+ const uint8_t data = get_out_a_value();
LOG("PIA %s = %02X\n", message, data);
- if(!m_out_a_handler.isnull())
+ if (!m_out_a_handler.isnull())
{
- m_out_a_handler((offs_t) 0, data);
+ m_out_a_handler(offs_t(0), data);
}
else
{
- if(m_out_a_needs_pulled)
- {
+ if (m_out_a_needs_pulled)
logerror("Warning! No port A write handler. Previous value has been lost!\n");
- }
m_out_a_needs_pulled = true;
}
@@ -651,20 +619,18 @@ void pia6821_device::send_to_out_a_func(const char* message)
void pia6821_device::send_to_out_b_func(const char* message)
{
// input pins are high-impedance - we just send them as zeros for backwards compatibility
- uint8_t data = get_out_b_value();
+ const uint8_t data = get_out_b_value();
LOG("PIA %s = %02X\n", message, data);
- if(!m_out_b_handler.isnull())
+ if (!m_out_b_handler.isnull())
{
- m_out_b_handler((offs_t)0, data);
+ m_out_b_handler(offs_t(0), data);
}
else
{
- if(m_out_b_needs_pulled)
- {
+ if (m_out_b_needs_pulled)
logerror("Warning! No port B write handler. Previous value has been lost!\n");
- }
m_out_b_needs_pulled = true;
}
@@ -690,20 +656,9 @@ void pia6821_device::port_a_w(uint8_t data)
void pia6821_device::ddr_a_w(uint8_t data)
{
- if(data == 0x00)
- {
- LOGSETUP("PIA DDR A write = %02X (input mode)\n", data);
- }
- else if(data == 0xff)
- {
- LOGSETUP("PIA DDR A write = %02X (output mode)\n", data);
- }
- else
- {
- LOGSETUP("PIA DDR A write = %02X (mixed mode)\n", data);
- }
+ LOGSETUP("PIA DDR A write = %02X (%s mode)\n", data, (0x00 == data) ? "input" : (0xff == data) ? "output" : "mixed");
- if(m_ddr_a != data)
+ if (m_ddr_a != data)
{
// DDR changed, call the callback again
m_ddr_a = data;
@@ -725,16 +680,14 @@ void pia6821_device::port_b_w(uint8_t data)
send_to_out_b_func("port B write");
// CB2 in write strobe mode
- if(c2_strobe_mode(m_ctl_b))
+ if (c2_strobe_mode(m_ctl_b))
{
// this will cause a transition low
set_out_cb2(false);
// if the CB2 strobe is cleared by the E, reset it right away
- if(strobe_e_reset(m_ctl_b))
- {
+ if (strobe_e_reset(m_ctl_b))
set_out_cb2(true);
- }
}
}
@@ -745,20 +698,9 @@ void pia6821_device::port_b_w(uint8_t data)
void pia6821_device::ddr_b_w(uint8_t data)
{
- if (data == 0x00)
- {
- LOGSETUP("PIA DDR B write = %02X (input mode)\n", data);
- }
- else if (data == 0xff)
- {
- LOGSETUP("PIA DDR B write = %02X (output mode)\n", data);
- }
- else
- {
- LOGSETUP("PIA DDR B write = %02X (mixed mode)\n", data);
- }
+ LOGSETUP("PIA DDR B write = %02X (%s mode)\n", data, (0x00 == data) ? "input" : (0xff == data) ? "output" : "mixed");
- if(m_ddr_b != data)
+ if (m_ddr_b != data)
{
// DDR changed, call the callback again
m_ddr_b = data;
@@ -783,20 +725,13 @@ void pia6821_device::control_a_w(uint8_t data)
m_ctl_a = data;
// CA2 is configured as output
- if(c2_output(m_ctl_a))
+ if (c2_output(m_ctl_a))
{
bool temp;
-
- if(c2_set_mode(m_ctl_a))
- {
- // set/reset mode - bit value determines the new output
- temp = c2_set(m_ctl_a);
- }
+ if (c2_set_mode(m_ctl_a))
+ temp = c2_set(m_ctl_a); // set/reset mode - bit value determines the new output
else
- {
- // strobe mode - output is always high unless strobed
- temp = true;
- }
+ temp = true; // strobe mode - output is always high unless strobed
set_out_ca2(temp);
}
@@ -812,8 +747,6 @@ void pia6821_device::control_a_w(uint8_t data)
void pia6821_device::control_b_w(uint8_t data)
{
- bool temp;
-
// bit 7 and 6 are read only
data &= 0x3f;
@@ -822,16 +755,11 @@ void pia6821_device::control_b_w(uint8_t data)
// update the control register
m_ctl_b = data;
+ bool temp;
if (c2_set_mode(m_ctl_b))
- {
- // set/reset mode - bit value determines the new output
- temp = c2_set(m_ctl_b);
- }
+ temp = c2_set(m_ctl_b); // set/reset mode - bit value determines the new output
else
- {
- // strobe mode - output is always high unless strobed
- temp = true;
- }
+ temp = true; // strobe mode - output is always high unless strobed
set_out_cb2(temp);
@@ -848,36 +776,28 @@ void pia6821_device::write(offs_t offset, uint8_t data)
{
switch (offset & 0x03)
{
- default: // impossible
- case 0x00:
- if (output_selected(m_ctl_a))
- {
- port_a_w(data);
- }
- else
- {
- ddr_a_w(data);
- }
- break;
+ default: // impossible
+ case 0x00:
+ if (output_selected(m_ctl_a))
+ port_a_w(data);
+ else
+ ddr_a_w(data);
+ break;
- case 0x01:
- control_a_w( data);
- break;
+ case 0x01:
+ control_a_w( data);
+ break;
- case 0x02:
- if(output_selected(m_ctl_b))
- {
- port_b_w(data);
- }
- else
- {
- ddr_b_w(data);
- }
- break;
+ case 0x02:
+ if (output_selected(m_ctl_b))
+ port_b_w(data);
+ else
+ ddr_b_w(data);
+ break;
- case 0x03:
- control_b_w(data);
- break;
+ case 0x03:
+ control_b_w(data);
+ break;
}
}
@@ -888,7 +808,8 @@ void pia6821_device::write(offs_t offset, uint8_t data)
void pia6821_device::set_a_input(uint8_t data)
{
- assert_always(m_in_a_handler.isnull(), "pia6821_device::set_a_input() called when m_in_a_handler set");
+ if (!m_in_a_handler.isnull())
+ throw emu_fatalerror("pia6821_device::set_a_input() called when m_in_a_handler set");
LOG("Set PIA input port A = %02X\n", data);
@@ -913,7 +834,7 @@ void pia6821_device::write_porta(uint8_t data)
void pia6821_device::write_porta_line(int line, bool state)
{
- uint8_t mask = 1 << line;
+ const uint8_t mask = 1 << line;
if (state)
set_a_input(m_in_a | mask);
else
@@ -942,7 +863,7 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
LOGCA1("Set PIA input CA1 = %d\n", state);
// the new state has caused a transition
- if((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
+ if ((m_in_ca1 != state) && ((state && c1_low_to_high(m_ctl_a)) || (!state && c1_high_to_low(m_ctl_a))))
{
LOGCA1("CA1 triggering\n");
@@ -953,10 +874,8 @@ WRITE_LINE_MEMBER( pia6821_device::ca1_w )
update_interrupts();
// CA2 is configured as output and in read strobe mode and cleared by a CA1 transition
- if(c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a) && strobe_c1_reset(m_ctl_a))
- {
+ if (c2_output(m_ctl_a) && c2_strobe_mode(m_ctl_a) && strobe_c1_reset(m_ctl_a))
set_out_ca2(true);
- }
}
// set the new value for CA1
@@ -974,7 +893,7 @@ WRITE_LINE_MEMBER( pia6821_device::ca2_w )
LOG("Set PIA input CA2 = %d\n", state);
// if input mode and the new state has caused a transition
- if(c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
+ if (c2_input(m_ctl_a) && (m_in_ca2 != state) && ((state && c2_low_to_high(m_ctl_a)) || (!state && c2_high_to_low(m_ctl_a))))
{
LOG("CA2 triggering\n");
@@ -1012,8 +931,7 @@ bool pia6821_device::ca2_output_z()
{
m_out_ca2_needs_pulled = false;
- // If it's an output, output the bit, if it's an input, it's
- // pulled up
+ // If it's an output, output the bit, if it's an input, it's pulled up
return m_out_ca2 | c2_input(m_ctl_a);
}
@@ -1024,7 +942,8 @@ bool pia6821_device::ca2_output_z()
void pia6821_device::write_portb(uint8_t data)
{
- assert_always(m_in_b_handler.isnull(), "pia_set_input_b() called when in_b_func implemented");
+ if (!m_in_b_handler.isnull())
+ throw emu_fatalerror("pia6821_device::write_portb() called when in_b_func implemented");
LOG("Set PIA input port B = %02X\n", data);
@@ -1039,7 +958,7 @@ void pia6821_device::write_portb(uint8_t data)
void pia6821_device::write_portb_line(int line, bool state)
{
- uint8_t mask = 1 << line;
+ const uint8_t mask = 1 << line;
if (state)
write_portb(m_in_b | mask);
@@ -1069,7 +988,7 @@ WRITE_LINE_MEMBER( pia6821_device::cb1_w )
LOG("Set PIA input CB1 = %d\n", state);
// the new state has caused a transition
- if((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
+ if ((m_in_cb1 != state) && ((state && c1_low_to_high(m_ctl_b)) || (!state && c1_high_to_low(m_ctl_b))))
{
LOG("CB1 triggering\n");
@@ -1145,17 +1064,17 @@ bool pia6821_device::cb2_output_z()
// control byte wrappers
//-------------------------------------------------
-bool pia6821_device::irq1_enabled(uint8_t c) { return bool((c >> 0) & 0x01); }
-bool pia6821_device::c1_low_to_high(uint8_t c) { return bool((c >> 1) & 0x01); }
-bool pia6821_device::c1_high_to_low(uint8_t c) { return !bool((c >> 1) & 0x01); }
-bool pia6821_device::output_selected(uint8_t c) { return bool((c >> 2) & 0x01); }
-bool pia6821_device::irq2_enabled(uint8_t c) { return bool((c >> 3) & 0x01); }
-bool pia6821_device::strobe_e_reset(uint8_t c) { return bool((c >> 3) & 0x01); }
-bool pia6821_device::strobe_c1_reset(uint8_t c) { return !bool((c >> 3) & 0x01); }
-bool pia6821_device::c2_set(uint8_t c) { return bool((c >> 3) & 0x01); }
-bool pia6821_device::c2_low_to_high(uint8_t c) { return bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_high_to_low(uint8_t c) { return !bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_set_mode(uint8_t c) { return bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_strobe_mode(uint8_t c) { return !bool((c >> 4) & 0x01); }
-bool pia6821_device::c2_output(uint8_t c) { return bool((c >> 5) & 0x01); }
-bool pia6821_device::c2_input(uint8_t c) { return !bool((c >> 5) & 0x01); }
+inline bool pia6821_device::irq1_enabled(uint8_t c) { return bool(BIT(c, 0)); }
+inline bool pia6821_device::c1_low_to_high(uint8_t c) { return bool(BIT(c, 1)); }
+inline bool pia6821_device::c1_high_to_low(uint8_t c) { return !bool(BIT(c, 1)); }
+inline bool pia6821_device::output_selected(uint8_t c) { return bool(BIT(c, 2)); }
+inline bool pia6821_device::irq2_enabled(uint8_t c) { return bool(BIT(c, 3)); }
+inline bool pia6821_device::strobe_e_reset(uint8_t c) { return bool(BIT(c, 3)); }
+inline bool pia6821_device::strobe_c1_reset(uint8_t c) { return !bool(BIT(c, 3)); }
+inline bool pia6821_device::c2_set(uint8_t c) { return bool(BIT(c, 3)); }
+inline bool pia6821_device::c2_low_to_high(uint8_t c) { return bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_high_to_low(uint8_t c) { return !bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_set_mode(uint8_t c) { return bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_strobe_mode(uint8_t c) { return !bool(BIT(c, 4)); }
+inline bool pia6821_device::c2_output(uint8_t c) { return bool(BIT(c, 5)); }
+inline bool pia6821_device::c2_input(uint8_t c) { return !bool(BIT(c, 5)); }
diff --git a/src/devices/machine/68561mpcc.cpp b/src/devices/machine/68561mpcc.cpp
index 364d9038bcb..3bbd73ac990 100644
--- a/src/devices/machine/68561mpcc.cpp
+++ b/src/devices/machine/68561mpcc.cpp
@@ -1,4 +1,4 @@
-// license:BSD-3-Clause
+// license:BSD-3-Clause
// copyright-holders: Joakim Larsson Edstrom
/***************************************************************************
diff --git a/src/devices/machine/acorn_vidc.cpp b/src/devices/machine/acorn_vidc.cpp
new file mode 100644
index 00000000000..012ed9f9819
--- /dev/null
+++ b/src/devices/machine/acorn_vidc.cpp
@@ -0,0 +1,513 @@
+// license:LGPL-2.1+
+// copyright-holders:Angelo Salese, R. Belmont, Juergen Buchmueller
+/**********************************************************************************************
+
+ Acorn VIDC10 (VIDeo Controller) device chip
+
+ based off legacy AA VIDC implementation by Angelo Salese, R. Belmont, Juergen Buchmueller
+
+ TODO:
+ - subclass screen_device, derive h/vsync signals out there;
+ - improve timings for raster effects:
+ * nebulus: 20 lines off with aa310;
+ * lotustc2: abuses color flipping;
+ * quazer: needs in-flight DMA;
+ - improve sound DAC writes;
+ - subclass this for VIDC20 emulation (RiscPC);
+ - Are CRTC values correct? VGA modes have a +1 in display line;
+
+**********************************************************************************************/
+
+#include "emu.h"
+#include "acorn_vidc.h"
+#include "screen.h"
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+DEFINE_DEVICE_TYPE(ACORN_VIDC10, acorn_vidc10_device, "acorn_vidc10", "Acorn VIDC10")
+DEFINE_DEVICE_TYPE(ACORN_VIDC10_LCD, acorn_vidc10_lcd_device, "acorn_vidc10_lcd", "Acorn VIDC10 with LCD monitor")
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// acorn_vidc10_device - constructor
+//-------------------------------------------------
+
+void acorn_vidc10_device::regs_map(address_map &map)
+{
+ map(0x00, 0x3f).w(FUNC(acorn_vidc10_device::pal_data_display_w));
+ map(0x40, 0x4f).w(FUNC(acorn_vidc10_device::pal_data_cursor_w));
+ map(0x60, 0x7f).w(FUNC(acorn_vidc10_device::stereo_image_w));
+ map(0x80, 0xbf).w(FUNC(acorn_vidc10_device::crtc_w));
+ map(0xc0, 0xc3).w(FUNC(acorn_vidc10_device::sound_frequency_w));
+ map(0xe0, 0xe3).w(FUNC(acorn_vidc10_device::control_w));
+}
+
+
+acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_memory_interface(mconfig, *this)
+ , device_palette_interface(mconfig, *this)
+ , device_video_interface(mconfig, *this)
+ , m_space_config("regs_space", ENDIANNESS_LITTLE, 32, 8, 0, address_map_constructor(FUNC(acorn_vidc10_device::regs_map), this))
+ , m_lspeaker(*this, "lspeaker")
+ , m_rspeaker(*this, "rspeaker")
+ , m_dac(*this, "dac%u", 0)
+ , m_vblank_cb(*this)
+ , m_sound_drq_cb(*this)
+{
+}
+
+acorn_vidc10_device::acorn_vidc10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : acorn_vidc10_device(mconfig, ACORN_VIDC10, tag, owner, clock)
+{
+}
+
+
+acorn_vidc10_lcd_device::acorn_vidc10_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : acorn_vidc10_device(mconfig, ACORN_VIDC10_LCD, tag, owner, clock)
+{
+}
+
+device_memory_interface::space_config_vector acorn_vidc10_device::memory_space_config() const
+{
+ return space_config_vector {
+ std::make_pair(AS_IO, &m_space_config)
+ };
+}
+
+
+//-------------------------------------------------
+// device_add_mconfig - device-specific machine
+// configuration addiitons
+//-------------------------------------------------
+
+void acorn_vidc10_device::device_add_mconfig(machine_config &config)
+{
+ SPEAKER(config, m_lspeaker).front_left();
+ SPEAKER(config, m_rspeaker).front_right();
+ voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
+ for (int i = 0; i < m_sound_max_channels; i++)
+ {
+ // custom DAC
+ DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, m_lspeaker, m_sound_input_gain).add_route(0, m_rspeaker, m_sound_input_gain);
+ vref.add_route(0, m_dac[i], 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, m_dac[i], -1.0, DAC_VREF_NEG_INPUT);
+ }
+}
+
+void acorn_vidc10_lcd_device::device_add_mconfig(machine_config &config)
+{
+ acorn_vidc10_device::device_add_mconfig(config);
+ // TODO: verify !Configure with automatic type detection, there must be an ID telling this is a LCD machine.
+}
+
+uint32_t acorn_vidc10_device::palette_entries() const
+{
+ return 0x100+0x10+4; // 8bpp + 1/2/4bpp + 2bpp for cursor
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void acorn_vidc10_device::device_config_complete()
+{
+ if (!has_screen())
+ return;
+
+ if (!screen().refresh_attoseconds())
+ screen().set_raw(clock() * 2 / 3, 1024,0,735, 624/2,0,292); // RiscOS 3 default screen settings
+
+ if (!screen().has_screen_update())
+ screen().set_screen_update(screen_update_rgb32_delegate(FUNC(acorn_vidc10_device::screen_update), this));
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void acorn_vidc10_device::device_start()
+{
+ m_vblank_cb.resolve_safe();
+ m_sound_drq_cb.resolve_safe();
+
+ for (int i = 0; i < entries(); i++)
+ set_pen_color(i, rgb_t::black());
+
+ save_item(NAME(m_bpp_mode));
+ save_item(NAME(m_crtc_interlace));
+ save_item(NAME(m_pixel_clock));
+ save_item(NAME(m_sound_frequency_latch));
+ save_item(NAME(m_sound_frequency_test_bit));
+ save_item(NAME(m_cursor_enable));
+ save_pointer(NAME(m_crtc_regs), CRTC_VCER+1);
+ m_data_vram = auto_alloc_array_clear(machine(), u8, m_data_vram_size);
+ m_cursor_vram = auto_alloc_array_clear(machine(), u8, m_cursor_vram_size);
+ save_pointer(NAME(m_data_vram), m_data_vram_size);
+ save_pointer(NAME(m_cursor_vram), m_cursor_vram_size);
+ save_pointer(NAME(m_stereo_image), m_sound_max_channels);
+
+ m_video_timer = timer_alloc(TIMER_VIDEO);
+ m_sound_timer = timer_alloc(TIMER_SOUND);
+
+ // generate u255 law lookup table
+ // cfr. page 48 of the VIDC20 manual, page 33 of the VIDC manual
+ // TODO: manual mentions a format difference between VIDC10 revisions
+ for (int rawval = 0; rawval < 256; rawval++)
+ {
+ uint8_t chord = rawval >> 5;
+ uint8_t point = (rawval & 0x1e) >> 1;
+ bool sign = rawval & 1;
+ int16_t result = ((16+point)<<chord)-16;
+
+ if (sign)
+ result = -result;
+
+ m_ulaw_lookup[rawval] = result*8;
+ }
+ save_pointer(NAME(m_ulaw_lookup), 256);
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void acorn_vidc10_device::device_reset()
+{
+ m_cursor_enable = false;
+ memset(m_data_vram, 0, m_data_vram_size);
+ memset(m_cursor_vram, 0, m_cursor_vram_size);
+ memset(m_stereo_image, 4, m_sound_max_channels);
+ for (int ch=0;ch<m_sound_max_channels;ch++)
+ refresh_stereo_image(ch);
+ m_video_timer->adjust(attotime::never);
+ m_sound_timer->adjust(attotime::never);
+}
+
+//-------------------------------------------------
+// device_timer - device-specific timer
+//-------------------------------------------------
+
+void acorn_vidc10_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch (id)
+ {
+ case TIMER_VIDEO:
+ m_vblank_cb(ASSERT_LINE);
+ screen_vblank_line_update();
+ break;
+ case TIMER_SOUND:
+ m_sound_drq_cb(ASSERT_LINE);
+ break;
+ }
+}
+
+//**************************************************************************
+// CRTC section
+//**************************************************************************
+
+inline void acorn_vidc10_device::screen_vblank_line_update()
+{
+ int vline = (m_crtc_regs[CRTC_VDER]) * (m_crtc_interlace + 1);
+ m_video_timer->adjust((vline > 2) ? screen().time_until_pos(vline) : attotime::never);
+}
+
+void acorn_vidc10_device::screen_dynamic_res_change()
+{
+ const int32_t pixel_rate[4] = { 8000000, 12000000, 16000000, 24000000};
+
+ // sanity checks
+ if (m_crtc_regs[CRTC_HCR] <= 1 || m_crtc_regs[CRTC_VCR] <= 1)
+ return;
+
+ if (m_crtc_regs[CRTC_HBER] <= 1 || m_crtc_regs[CRTC_VBER] <= 1)
+ return;
+
+ // total cycles >= border end >= border start
+ if (m_crtc_regs[CRTC_HCR] < m_crtc_regs[CRTC_HBER])
+ return;
+
+ if (m_crtc_regs[CRTC_HBER] < m_crtc_regs[CRTC_HBSR])
+ return;
+
+ if (m_crtc_regs[CRTC_VBER] < m_crtc_regs[CRTC_VBSR])
+ return;
+
+ rectangle const visarea(
+ 0, m_crtc_regs[CRTC_HBER] - m_crtc_regs[CRTC_HBSR] - 1,
+ 0, (m_crtc_regs[CRTC_VBER] - m_crtc_regs[CRTC_VBSR]) * (m_crtc_interlace + 1));
+
+#if 0
+ // TODO: move to debugger custom command
+ const int m_vidc_vblank_time = m_crtc_regs[CRTC_VDER] * (m_crtc_interlace+1);
+ printf("Configuring: htotal %d vtotal %d border %d x %d display origin %d x %d vblank = %d\n",
+ m_crtc_regs[CRTC_HCR], m_crtc_regs[CRTC_VCR],
+ visarea.right(), visarea.bottom(),
+ m_crtc_regs[CRTC_HDER]-m_crtc_regs[CRTC_HDSR],m_crtc_regs[CRTC_VDER]-m_crtc_regs[CRTC_VDSR]+1,
+ m_vidc_vblank_time);
+#endif
+
+ attoseconds_t const refresh = HZ_TO_ATTOSECONDS(pixel_rate[m_pixel_clock]) * m_crtc_regs[CRTC_HCR] * m_crtc_regs[CRTC_VCR];
+
+ screen().configure(m_crtc_regs[CRTC_HCR], m_crtc_regs[CRTC_VCR] * (m_crtc_interlace+1), visarea, refresh);
+}
+
+//**************************************************************************
+// READ/WRITE HANDLERS
+//**************************************************************************
+
+WRITE32_MEMBER( acorn_vidc10_device::write )
+{
+ // TODO: check against mem_mask not 32-bit wide
+ uint8_t reg = data >> 24;
+ uint32_t val = data & 0xffffff;
+
+ this->space(AS_IO).write_dword(reg, val);
+}
+
+inline void acorn_vidc10_device::update_4bpp_palette(uint16_t index, uint32_t paldata)
+{
+ int r,g,b;
+
+ // TODO: for TV Tuner we need to output this, also check if cursor mode actually sets this up for offset = 0
+// i = (paldata & 0x1000) >> 12; //supremacy bit
+ b = (paldata & 0x0f00) >> 8;
+ g = (paldata & 0x00f0) >> 4;
+ r = (paldata & 0x000f) >> 0;
+
+ set_pen_color(index, pal4bit(r), pal4bit(g), pal4bit(b) );
+ screen().update_partial(screen().vpos());
+}
+
+WRITE32_MEMBER( acorn_vidc10_device::pal_data_display_w )
+{
+ update_4bpp_palette(offset+0x100, data);
+ //printf("%02x: %01x %01x %01x [%d]\n",offset,r,g,b,screen().vpos());
+
+ // 8bpp
+ for(int idx=0;idx<0x100;idx+=0x10)
+ {
+ int b = ((data & 0x700) >> 8) | ((idx & 0x80) >> 4);
+ int g = ((data & 0x030) >> 4) | ((idx & 0x60) >> 3);
+ int r = ((data & 0x007) >> 0) | ((idx & 0x10) >> 1);
+
+ set_pen_color(offset + idx, pal4bit(r), pal4bit(g), pal4bit(b) );
+ }
+}
+
+WRITE32_MEMBER( acorn_vidc10_device::pal_data_cursor_w )
+{
+ update_4bpp_palette(offset+0x110, data);
+}
+
+WRITE32_MEMBER( acorn_vidc10_device::control_w )
+{
+ // TODO: not sure what the commented out bits do
+ m_pixel_clock = (data & 0x03);
+ m_bpp_mode = ((data & 0x0c) >> 2);
+ //m_dma_request_mode = ((data & 0x30) >> 4);
+ m_crtc_interlace = ((data & 0x40) >> 6);
+ //m_composite_sync = BIT(data, 7);
+ //m_test_mode = (data & 0xc100) != 0xc100;
+
+ //todo: vga/svga modes sets 0x1000?
+ screen_vblank_line_update();
+ screen_dynamic_res_change();
+}
+
+WRITE32_MEMBER( acorn_vidc10_device::crtc_w )
+{
+ switch(offset)
+ {
+ case CRTC_HCR: m_crtc_regs[CRTC_HCR] = ((data >> 14)<<1)+2; break;
+// case CRTC_HSWR: m_crtc_regs[CRTC_HSWR] = (data >> 14)+1; break;
+ case CRTC_HBSR: m_crtc_regs[CRTC_HBSR] = ((data >> 14)<<1)+1; break;
+ case CRTC_HDSR: m_crtc_regs[CRTC_HDSR] = (data >> 14); break;
+ case CRTC_HDER: m_crtc_regs[CRTC_HDER] = (data >> 14); break;
+ case CRTC_HBER: m_crtc_regs[CRTC_HBER] = ((data >> 14)<<1)+1; break;
+ case CRTC_HCSR: m_crtc_regs[CRTC_HCSR] = ((data >> 13) & 0x7ff) + 6; return;
+// case CRTC_HIR: // ...
+
+ case CRTC_VCR: m_crtc_regs[CRTC_VCR] = (data >> 14)+1; break;
+ case CRTC_VSWR: m_crtc_regs[CRTC_VSWR] = (data >> 14)+1; break;
+ case CRTC_VBSR:
+ m_crtc_regs[CRTC_VBSR] = (data >> 14)+1;
+ break;
+ case CRTC_VDSR:
+ m_crtc_regs[CRTC_VDSR] = (data >> 14)+1;
+ break;
+ case CRTC_VDER:
+ m_crtc_regs[CRTC_VDER] = (data >> 14)+1;
+ screen_vblank_line_update();
+ break;
+ case CRTC_VBER:
+ m_crtc_regs[CRTC_VBER] = (data >> 14)+1;
+ break;
+ case CRTC_VCSR: m_crtc_regs[CRTC_VCSR] = ((data >> 14) & 0x3ff) + 1; return;
+ case CRTC_VCER: m_crtc_regs[CRTC_VCER] = ((data >> 14) & 0x3ff) + 1; return;
+ }
+
+ screen_dynamic_res_change();
+}
+
+inline void acorn_vidc10_device::refresh_stereo_image(uint8_t channel)
+{
+ /*
+ -111 full right
+ -110 83% right, 17% left
+ -101 67% right, 33% left
+ -100 center
+ -011 67% left, 33% right
+ -010 83% left, 17% right
+ -001 full left
+ -000 "undefined" TODO: verify what it actually means
+ */
+ const float left_gain[8] = { 1.0, 2.0, 1.66, 1.34, 1.0, 0.66, 0.34, 0.0 };
+ const float right_gain[8] = { 1.0, 0.0, 0.34, 0.66, 1.0, 1.34, 1.66, 2.0 };
+
+ m_lspeaker->set_input_gain(channel,left_gain[m_stereo_image[channel]]*m_sound_input_gain);
+ m_rspeaker->set_input_gain(channel,right_gain[m_stereo_image[channel]]*m_sound_input_gain);
+ //printf("%d %f %f\n",channel,m_lspeaker->input_gain(channel),m_rspeaker->input_gain(channel));
+}
+
+
+WRITE32_MEMBER( acorn_vidc10_device::stereo_image_w )
+{
+ uint8_t channel = (offset + 7) & 0x7;
+ m_stereo_image[channel] = data & 0x7;
+ refresh_stereo_image(channel);
+}
+
+WRITE32_MEMBER( acorn_vidc10_device::sound_frequency_w )
+{
+ m_sound_frequency_test_bit = BIT(data, 8);
+ m_sound_frequency_latch = data & 0xff;
+ if (m_sound_mode == true)
+ refresh_sound_frequency();
+}
+
+//**************************************************************************
+// MEMC comms
+//**************************************************************************
+
+void acorn_vidc10_device::write_dac(uint8_t channel, uint8_t data)
+{
+ int16_t res;
+ res = m_ulaw_lookup[data];
+ m_dac[channel & 7]->write(res);
+}
+
+void acorn_vidc10_device::refresh_sound_frequency()
+{
+ // TODO: check against test bit (reloads sound frequency if 0)
+ if (m_sound_mode == true)
+ {
+ // TODO: Range is between 3 and 256 usecs
+ double sndhz = 1e6 / ((m_sound_frequency_latch & 0xff) + 2);
+ sndhz /= 8.0;
+ m_sound_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz));
+ //printf("VIDC: audio DMA start, sound freq %d, sndhz = %f\n", (m_crtc_regs[0xc0] & 0xff)-2, sndhz);
+ }
+ else
+ m_sound_timer->adjust(attotime::never);
+}
+
+//**************************************************************************
+// Screen Update / VBlank / HBlank
+//**************************************************************************
+
+void acorn_vidc10_device::draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, u8 *vram, uint8_t bpp, int xstart, int ystart, int xsize, int ysize, bool is_cursor)
+{
+ const u16 pen_base = (bpp == 3 ? 0 : 0x100) + (is_cursor == true ? 0x10 : 0);
+ const u16 pen_masks[4] = { 1, 3, 0xf, 0xff };
+ const u16 pen_mask = pen_masks[bpp];
+ const u16 xchar_size = 1 << (3 - bpp);
+ const u8 pen_byte_sizes[4] = { 1, 2, 4, 1 };
+ const u16 pen_byte_size = pen_byte_sizes[bpp];
+ const int raster_ystart = std::max(0, cliprect.min_y-ystart);
+ xsize >>= 3-bpp;
+
+ //printf("%d %d %d %d\n",ystart, ysize, cliprect.min_y, cliprect.max_y);
+
+ for (int srcy = raster_ystart; srcy<ysize; srcy++)
+ {
+ int dsty = (srcy + ystart)*(m_crtc_interlace+1);
+ for (int srcx = 0; srcx<xsize; srcx++)
+ {
+ u8 pen = vram[srcx + srcy * xsize];
+ int dstx = (srcx*xchar_size) + xstart;
+
+ for (int xi=0;xi<xchar_size;xi++)
+ {
+ u16 dot = ((pen>>(xi*pen_byte_size)) & pen_mask);
+ if (is_cursor == true && dot == 0)
+ continue;
+ dot += pen_base;
+ bitmap.pix32(dsty, dstx+xi) = this->pen(dot);
+ if (m_crtc_interlace)
+ bitmap.pix32(dsty+1, dstx+xi) = this->pen(dot);
+ }
+ }
+ }
+}
+
+u32 acorn_vidc10_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+{
+ int xstart,ystart,xend,yend;
+ int xsize,ysize;
+ int calc_dxs = 0,calc_dxe = 0;
+ const uint8_t x_step[4] = { 19, 11, 7, 5 };
+
+ /* border color */
+ bitmap.fill(pen(0x110), cliprect);
+
+ /* define X display area through BPP mode register */
+ calc_dxs = (m_crtc_regs[CRTC_HDSR]*2)+x_step[m_bpp_mode & 3];
+ calc_dxe = (m_crtc_regs[CRTC_HDER]*2)+x_step[m_bpp_mode & 3];
+
+ /* now calculate display clip rectangle start/end areas */
+ xstart = (calc_dxs)-m_crtc_regs[CRTC_HBSR];
+ ystart = (m_crtc_regs[CRTC_VDSR]-m_crtc_regs[CRTC_VBSR]);
+ xend = (calc_dxe)+xstart;
+ yend = (m_crtc_regs[CRTC_VDER] * (m_crtc_interlace+1))+ystart;
+
+ /* disable the screen if display params are invalid */
+ if(xstart > xend || ystart > yend)
+ return 0;
+
+ xsize = calc_dxe-calc_dxs;
+ ysize = m_crtc_regs[CRTC_VDER]-m_crtc_regs[CRTC_VDSR];
+
+ if (xsize <= 0 || ysize <= 0)
+ return 0;
+
+ draw(bitmap, cliprect, m_data_vram, m_bpp_mode, xstart, ystart, xsize, ysize, false);
+ if (m_cursor_enable == true)
+ {
+ xstart = m_crtc_regs[CRTC_HCSR] - m_crtc_regs[CRTC_HBSR];
+ ystart = m_crtc_regs[CRTC_VCSR] - m_crtc_regs[CRTC_VBSR];
+ xsize = 32;
+ ysize = m_crtc_regs[CRTC_VCER] - m_crtc_regs[CRTC_VCSR];
+ if (ysize > 0)
+ draw(bitmap, cliprect, m_cursor_vram, 1, xstart, ystart, xsize, ysize, true);
+ }
+
+ return 0;
+}
+
+READ_LINE_MEMBER(acorn_vidc10_device::flyback_r )
+{
+ int vert_pos = screen().vpos();
+ bool flyback = (vert_pos <= m_crtc_regs[CRTC_VDSR] || vert_pos >= m_crtc_regs[CRTC_VDER]);
+ return flyback;
+}
diff --git a/src/devices/machine/acorn_vidc.h b/src/devices/machine/acorn_vidc.h
new file mode 100644
index 00000000000..7a73e6c277c
--- /dev/null
+++ b/src/devices/machine/acorn_vidc.h
@@ -0,0 +1,144 @@
+// license:LGPL-2.1+
+// copyright-holders:Angelo Salese, R. Belmont, Juergen Buchmueller
+/***************************************************************************
+
+ Acorn VIDC10 (VIDeo Controller) device chip
+
+***************************************************************************/
+
+#ifndef MAME_MACHINE_ACORN_VIDC_H
+#define MAME_MACHINE_ACORN_VIDC_H
+
+#pragma once
+
+#include "speaker.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> acorn_vidc10_device
+
+class acorn_vidc10_device : public device_t,
+ public device_memory_interface,
+ public device_palette_interface,
+ public device_video_interface
+{
+public:
+ // construction/destruction
+ acorn_vidc10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ // I/O operations
+ DECLARE_WRITE32_MEMBER( write );
+ DECLARE_READ_LINE_MEMBER( flyback_r );
+ auto vblank() { return m_vblank_cb.bind(); }
+ auto sound_drq() { return m_sound_drq_cb.bind(); }
+ // MEMC comms
+ void write_vram(uint32_t offset, uint8_t data) { m_data_vram[offset & (m_data_vram_mask)] = data; }
+ void write_cram(uint32_t offset, uint8_t data) { m_cursor_vram[offset & (m_cursor_vram_mask)] = data; }
+ void write_dac(uint8_t channel, uint8_t data);
+ void clear_dac(uint8_t channel) { m_dac[channel & 7]->write(0); }
+ void update_sound_mode(bool state) { m_sound_mode = state; refresh_sound_frequency(); }
+ void set_cursor_enable(bool state) { m_cursor_enable = state; }
+ uint32_t get_cursor_size() { return (m_crtc_regs[CRTC_VCER] - m_crtc_regs[CRTC_VCSR]) * (32/4); }
+
+protected:
+ acorn_vidc10_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+
+ // device-level overrides
+ //virtual void device_validity_check(validity_checker &valid) const override;
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual uint32_t palette_entries() const override;
+ virtual void device_config_complete() override;
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual space_config_vector memory_space_config() const override;
+ u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+private:
+ const address_space_config m_space_config;
+
+ void regs_map(address_map &map);
+
+ required_device<speaker_device> m_lspeaker;
+ required_device<speaker_device> m_rspeaker;
+ required_device_array<dac_16bit_r2r_twos_complement_device, 8> m_dac;
+ devcb_write_line m_vblank_cb;
+ devcb_write_line m_sound_drq_cb;
+
+ DECLARE_WRITE32_MEMBER( pal_data_display_w );
+ DECLARE_WRITE32_MEMBER( pal_data_cursor_w );
+ DECLARE_WRITE32_MEMBER( stereo_image_w );
+ DECLARE_WRITE32_MEMBER( crtc_w );
+ DECLARE_WRITE32_MEMBER( sound_frequency_w );
+ DECLARE_WRITE32_MEMBER( control_w );
+
+ uint8_t m_pixel_clock, m_bpp_mode, m_crtc_interlace;
+ //bool m_flyback;
+ enum {
+ TIMER_VIDEO = 1,
+ TIMER_SOUND = 2
+ };
+ emu_timer *m_video_timer;
+ emu_timer *m_sound_timer;
+
+ inline void screen_vblank_line_update();
+ void screen_dynamic_res_change();
+
+ enum {
+ CRTC_HCR = 0, CRTC_HSWR, CRTC_HBSR, CRTC_HDSR, CRTC_HDER, CRTC_HBER, CRTC_HCSR, CRTC_HIR,
+ CRTC_VCR, CRTC_VSWR, CRTC_VBSR, CRTC_VDSR, CRTC_VDER, CRTC_VBER, CRTC_VCSR, CRTC_VCER
+ };
+ uint32_t m_crtc_regs[16];
+ u8 *m_data_vram;
+ u8 *m_cursor_vram;
+ // TODO: correct data vram size
+ const u32 m_data_vram_mask = 0x1fffff;
+ const u32 m_cursor_vram_mask = 0x7fff;
+ const u32 m_data_vram_size = m_data_vram_mask+1;
+ const u32 m_cursor_vram_size = m_cursor_vram_mask+1;
+ bool m_cursor_enable;
+ void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, u8 *vram, uint8_t bpp, int xstart, int ystart, int xsize, int ysize, bool is_cursor);
+ inline void update_4bpp_palette(uint16_t index, uint32_t paldata);
+
+ u8 m_sound_frequency_latch;
+ bool m_sound_frequency_test_bit;
+ bool m_sound_mode;
+ u8 m_stereo_image[8];
+ const float m_sound_input_gain = 0.05;
+ const int m_sound_max_channels = 8;
+ int16_t m_ulaw_lookup[256];
+ void refresh_sound_frequency();
+ inline void refresh_stereo_image(uint8_t channel);
+};
+
+class acorn_vidc10_lcd_device : public acorn_vidc10_device
+{
+public:
+ // construction/destruction
+ acorn_vidc10_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+protected:
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(ACORN_VIDC10, acorn_vidc10_device)
+DECLARE_DEVICE_TYPE(ACORN_VIDC10_LCD, acorn_vidc10_lcd_device)
+
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+
+#endif // MAME_MACHINE_ACORN_VIDC10_H
diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp
index 4a28b7f7d38..4f92a844a45 100644
--- a/src/devices/machine/ds2404.cpp
+++ b/src/devices/machine/ds2404.cpp
@@ -10,7 +10,9 @@
#include "emu.h"
#include "ds2404.h"
-#include <time.h>
+
+#include <algorithm>
+#include <time.h> // FIXME: re-write in terms of device_rtc_interface and remove this
//**************************************************************************
@@ -34,7 +36,7 @@ ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, dev
m_a2(0),
m_state_ptr(0)
{
- memset(m_ram, 0, sizeof(m_ram));
+ std::fill(std::begin(m_ram), std::end(m_ram), 0);
}
@@ -315,23 +317,17 @@ void ds2404_device::device_timer(emu_timer &timer, device_timer_id id, int param
switch(id)
{
case 0:
- {
// tick
- for(auto & elem : m_rtc)
+ for(auto &elem : m_rtc)
{
elem++;
if(elem != 0)
- {
break;
- }
}
-
break;
- }
default:
- assert_always(false, "Unknown id in ds2404_device::device_timer");
- break;
+ throw emu_fatalerror("Unknown id in ds2404_device::device_timer");
}
}
diff --git a/src/devices/machine/i8251.cpp b/src/devices/machine/i8251.cpp
index b78ee829cb9..1712796e64d 100644
--- a/src/devices/machine/i8251.cpp
+++ b/src/devices/machine/i8251.cpp
@@ -594,7 +594,7 @@ void i8251_device::mode_w(uint8_t data)
1 = x1
2 = x16
3 = x64
-
+
Synchronous
bit 7: Number of sync characters
diff --git a/src/devices/machine/meters.cpp b/src/devices/machine/meters.cpp
index 62a1ca25092..cf36ff75177 100644
--- a/src/devices/machine/meters.cpp
+++ b/src/devices/machine/meters.cpp
@@ -64,7 +64,7 @@ void meters_device::device_reset()
void meters_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id >= m_number_mtr)
- assert_always(false, "Unknown id in meters_device::device_timer");
+ throw emu_fatalerror("Unknown id in meters_device::device_timer");
m_meter_info[param].count++;
}
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index dd119f46a30..0ceba02df1e 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -289,7 +289,7 @@ public:
{
}
- virtual plib::unique_ptr<plib::pistream> stream(const pstring &name) override;
+ virtual plib::unique_ptr<std::istream> stream(const pstring &name) override;
private:
device_t &m_dev;
pstring m_name;
@@ -300,7 +300,7 @@ class netlist_data_memregions_t : public netlist::source_t
public:
netlist_data_memregions_t(const device_t &dev);
- virtual plib::unique_ptr<plib::pistream> stream(const pstring &name) override;
+ virtual plib::unique_ptr<std::istream> stream(const pstring &name) override;
private:
const device_t &m_dev;
@@ -311,12 +311,14 @@ private:
// memregion source support
// ----------------------------------------------------------------------------------------
-plib::unique_ptr<plib::pistream> netlist_source_memregion_t::stream(const pstring &name)
+plib::unique_ptr<std::istream> netlist_source_memregion_t::stream(const pstring &name)
{
if (m_dev.has_running_machine())
{
memory_region *mem = m_dev.memregion(m_name.c_str());
- return plib::make_unique<plib::pimemstream>(mem->base(), mem->bytes());
+ auto ret(plib::make_unique<std::istringstream>(pstring(reinterpret_cast<char *>(mem->base()), mem->bytes())));
+ ret->imbue(std::locale::classic());
+ return ret;
}
else
throw memregion_not_set("memregion unavailable for {1} in source {2}", name, m_name);
@@ -347,24 +349,32 @@ static bool rom_exists(device_t &root, pstring name)
return false;
}
-plib::unique_ptr<plib::pistream> netlist_data_memregions_t::stream(const pstring &name)
+plib::unique_ptr<std::istream> netlist_data_memregions_t::stream(const pstring &name)
{
//memory_region *mem = static_cast<netlist_mame_device::netlist_mame_t &>(setup().setup().exec()).parent().memregion(name.c_str());
if (m_dev.has_running_machine())
{
memory_region *mem = m_dev.memregion(name.c_str());
if (mem != nullptr)
- return plib::make_unique<plib::pimemstream>(mem->base(), mem->bytes());
+ {
+ auto ret(plib::make_unique<std::istringstream>(std::string(reinterpret_cast<char *>(mem->base()), mem->bytes()), std::ios_base::binary));
+ ret->imbue(std::locale::classic());
+ return ret;
+ }
else
- return plib::unique_ptr<plib::pistream>(nullptr);
+ return plib::unique_ptr<std::istream>(nullptr);
}
else
{
/* validation */
if (rom_exists(m_dev.mconfig().root_device(), pstring(m_dev.tag()) + ":" + name))
- return plib::make_unique<plib::pimemstream>();
+ {
+ auto ret(plib::make_unique<std::istringstream>(std::ios_base::binary));
+ ret->imbue(std::locale::classic());
+ return ret;
+ }
else
- return plib::unique_ptr<plib::pistream>(nullptr);
+ return plib::unique_ptr<std::istream>(nullptr);
}
}
diff --git a/src/devices/machine/upd7002.cpp b/src/devices/machine/upd7002.cpp
index b00d44066e5..7dd57725147 100644
--- a/src/devices/machine/upd7002.cpp
+++ b/src/devices/machine/upd7002.cpp
@@ -61,7 +61,7 @@ void upd7002_device::device_reset()
READ_LINE_MEMBER( upd7002_device::eoc_r )
{
- return (m_status>>7)&0x01;
+ return BIT(m_status, 7);
}
@@ -71,41 +71,42 @@ void upd7002_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
case TIMER_CONVERSION_COMPLETE:
{
- int counter_value = param;
- if (counter_value==m_conversion_counter)
- {
- // this really always does a 12 bit conversion
- m_data1 = m_digitalvalue>>8;
- m_data0 = m_digitalvalue&0xf0;
-
- // set the status register with top 2 MSB, not busy and conversion complete
- m_status = (m_status & 0x0f)|((m_data1 & 0xc0)>>2)|0x40;
-
- // call the EOC function with EOC from status
- // eoc_r(0) this has just been set to 0
- if (!m_eoc_cb.isnull()) m_eoc_cb(0);
- m_conversion_counter=0;
+ int counter_value = param;
+ if (counter_value == m_conversion_counter)
+ {
+ // this really always does a 12 bit conversion
+ m_data1 = m_digitalvalue >> 8;
+ m_data0 = m_digitalvalue & 0xf0;
+
+ // set the status register with top 2 MSB, not busy and conversion complete
+ m_status = (m_status & 0x0f) | ((m_data1 & 0xc0) >> 2) | 0x40;
+
+ // call the EOC function with EOC from status
+ // eoc_r(0) this has just been set to 0
+ if (!m_eoc_cb.isnull()) m_eoc_cb(0);
+ m_conversion_counter=0;
+ }
}
break;
- }
default:
- assert_always(false, "Unknown id in upd7002_device::device_timer");
+ throw emu_fatalerror("Unknown id in upd7002_device::device_timer");
}
}
uint8_t upd7002_device::read(offs_t offset)
{
- switch(offset&0x03)
+ switch (offset & 0x03)
{
- case 0:
- return m_status;
+ case 0:
+ return m_status;
- case 1:
- return m_data1;
+ case 1:
+ return m_data1;
- case 2: case 3:
- return m_data0;
+ case 2:
+ case 3:
+ return m_data0;
}
return 0;
}
@@ -116,9 +117,9 @@ void upd7002_device::write(offs_t offset, uint8_t data)
{
/* logerror("write to uPD7002 $%02X = $%02X\n",offset,data); */
- switch(offset&0x03)
+ switch (offset & 0x03)
{
- case 0:
+ case 0:
/*
Data Latch/AD start
D0 and D1 together define which one of the four input channels is selected
@@ -152,17 +153,20 @@ void upd7002_device::write(offs_t offset, uint8_t data)
{
// 12 bit conversion takes 10ms
timer_set(attotime::from_msec(10), TIMER_CONVERSION_COMPLETE, m_conversion_counter);
- } else {
+ }
+ else
+ {
// 8 bit conversion takes 4ms
timer_set(attotime::from_msec(4), TIMER_CONVERSION_COMPLETE, m_conversion_counter);
}
break;
- case 1: case 2:
+ case 1:
+ case 2:
/* Nothing */
break;
- case 3:
+ case 3:
/* Test Mode: Used for inspecting the device, The data input-output terminals assume an input
state and are connected to the A/D counter. Therefore, the A/D conversion data
read out after this is meaningless.
diff --git a/src/devices/machine/vr0uart.cpp b/src/devices/machine/vr0uart.cpp
index cfaf69e8863..eaf62aa1073 100644
--- a/src/devices/machine/vr0uart.cpp
+++ b/src/devices/machine/vr0uart.cpp
@@ -7,9 +7,9 @@
Device by Angelo Salese
TODO:
- - The only current example (Trivia R Us touchscreen) expects to read
- stuff before transmitting anything, except for loopback test and a
- signal break enabling at POST (!?).
+ - The only current example (Trivia R Us touchscreen) expects to read
+ stuff before transmitting anything, except for loopback test and a
+ signal break enabling at POST (!?).
***************************************************************************/
@@ -67,7 +67,7 @@ void vr0uart_device::device_reset()
m_ucon = 0x001;
m_ubdr = 1;
m_urxb_fifo.clear();
-
+
update_serial_config();
}
@@ -87,11 +87,11 @@ inline uint32_t vr0uart_device::calculate_baud_rate()
void vr0uart_device::update_serial_config()
{
const parity_t parity_modes[4] = { PARITY_NONE, PARITY_NONE, PARITY_EVEN, PARITY_ODD };
-
+
uint8_t word_length = m_ucon & 1 ? 8 : 7;
- parity_t parity_mode = parity_modes[(m_ucon & 0xc) >> 2];
+ parity_t parity_mode = parity_modes[(m_ucon & 0xc) >> 2];
stop_bits_t stop_bits = m_ucon & 2 ? STOP_BITS_2 : STOP_BITS_1;
-
+
set_data_frame(1, word_length, parity_mode, stop_bits);
if (m_ucon & 0x100) // UART Enable
@@ -135,7 +135,7 @@ void vr0uart_device::rcv_complete()
}
else
m_ustat |= 1; // overrun
-
+
if (m_ucon & 0x20 && m_ustat & 0xf)
m_parent->IntReq(m_channel_num ? 16 : 13);
else
@@ -182,7 +182,7 @@ READ32_MEMBER( vr0uart_device::status_r )
{
uint32_t res = m_ustat;
if (!m_urxb_fifo.empty())
- {
+ {
res |= 0x10;
res |= (m_urxb_fifo.queue_length() << 8);
}
@@ -201,7 +201,7 @@ READ32_MEMBER( vr0uart_device::receive_buffer_r )
{
// TODO: unknown value & behaviour attempting to read this on empty FIFO (stall?)
uint8_t res = 0;
-
+
if (ACCESSING_BITS_0_7 && !m_urxb_fifo.empty())
res = m_urxb_fifo.dequeue();
diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp
index a1fdeedf536..c60a8908207 100644
--- a/src/devices/machine/vrender0.cpp
+++ b/src/devices/machine/vrender0.cpp
@@ -114,12 +114,12 @@ void vrender0soc_device::device_add_mconfig(machine_config &config)
VRENDER0_UART(config, uart, 3579500);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- // evolution soccer defaults
+ // evolution soccer defaults
m_screen->set_raw((XTAL(14'318'180)*2)/4, 455, 0, 320, 262, 0, 240);
- m_screen->set_screen_update(FUNC(vrender0soc_device::screen_update));
- m_screen->screen_vblank().set(FUNC(vrender0soc_device::screen_vblank));
- m_screen->set_palette(m_palette);
-
+ m_screen->set_screen_update(FUNC(vrender0soc_device::screen_update));
+ m_screen->screen_vblank().set(FUNC(vrender0soc_device::screen_vblank));
+ m_screen->set_palette(m_palette);
+
VIDEO_VRENDER0(config, m_vr0vid, 14318180);
#ifdef IDLE_LOOP_SPEEDUP
m_vr0vid->idleskip_cb().set(FUNC(vrender0soc_device::idle_skip_speedup_w));
@@ -145,7 +145,7 @@ void vrender0soc_device::device_start()
int i;
m_textureram = auto_alloc_array_clear(machine(), uint16_t, 0x00800000/2);
m_frameram = auto_alloc_array_clear(machine(), uint16_t, 0x00800000/2);
-
+
m_vr0vid->set_areas(m_textureram, m_frameram);
m_vr0snd->set_areas(m_textureram, m_frameram);
m_host_space = &m_host_cpu->space(AS_PROGRAM);
@@ -164,7 +164,7 @@ void vrender0soc_device::device_start()
m_uart[i]->set_channel_num(i);
m_uart[i]->set_parent(this);
}
-
+
save_item(NAME(m_inten));
save_item(NAME(m_intst));
save_item(NAME(m_IntHigh));
@@ -180,7 +180,7 @@ void vrender0soc_device::device_start()
save_item(NAME(m_dma[1].src));
save_item(NAME(m_dma[1].dst));
save_item(NAME(m_dma[1].size));
-
+
#ifdef IDLE_LOOP_SPEEDUP
save_item(NAME(m_FlipCntRead));
#endif
@@ -634,7 +634,7 @@ void vrender0soc_device::crtc_update()
uint32_t pixel_clock = (BIT(m_crtcregs[0x04 / 4], 3)) ? 14318180 : m_ext_vclk;
if (pixel_clock == 0)
fatalerror("%s: Accessing external vclk in CRTC parameters, please set it up via setter in config\n",this->tag());
-
+
if (BIT(m_crtcregs[0x04 / 4], 7))
pixel_clock *= 2;
// TODO: divider setting = 0 is reserved, guess it just desyncs the signal?
@@ -673,7 +673,7 @@ READ32_MEMBER(vrender0soc_device::sysid_r)
READ32_MEMBER(vrender0soc_device::cfgr_r)
{
- // TODO: this truly needs real HW verification,
+ // TODO: this truly needs real HW verification,
// only Cross Puzzle reads this so far so leaving a logerror
// -x-- ---- Main Clock select (0 -> External Clock)
// --xx x--- Reserved for Chip Test Mode
diff --git a/src/devices/machine/vrender0.h b/src/devices/machine/vrender0.h
index 5d2843d74f8..3efb859938b 100644
--- a/src/devices/machine/vrender0.h
+++ b/src/devices/machine/vrender0.h
@@ -62,25 +62,25 @@ private:
DECLARE_WRITE32_MEMBER( control_w );
DECLARE_READ32_MEMBER( baud_rate_div_r );
DECLARE_WRITE32_MEMBER( baud_rate_div_w );
- DECLARE_READ32_MEMBER( status_r );
+ DECLARE_READ32_MEMBER( status_r );
DECLARE_WRITE32_MEMBER( transmit_buffer_w );
DECLARE_READ32_MEMBER( receive_buffer_r );
TIMER_CALLBACK_MEMBER( break_timer_cb );
-
+
uint32_t m_ucon; // control
uint32_t m_ubdr; // baud rate
uint32_t m_ustat; // status
util::fifo<uint8_t, 16> m_urxb_fifo; // receive FIFO
-
+
void update_serial_config();
inline uint32_t calculate_baud_rate();
-
+
virtual void tra_callback() override;
virtual void tra_complete() override;
virtual void rcv_complete() override;
inline void tx_send_byte(uint8_t val);
- int m_channel_num;
+ int m_channel_num;
vrender0soc_device *m_parent;
};
@@ -98,8 +98,8 @@ public:
void regs_map(address_map &map);
void audiovideo_map(address_map &map);
template<class T> void set_host_cpu_tag(T &&tag) { m_host_cpu.set_tag(std::forward<T>(tag)); }
- void set_external_vclk(const uint32_t vclk) { m_ext_vclk = vclk; }
- void set_external_vclk(const XTAL vclk) { m_ext_vclk = vclk.value(); }
+ void set_external_vclk(const uint32_t vclk) { m_ext_vclk = vclk; }
+ void set_external_vclk(const XTAL vclk) { m_ext_vclk = vclk.value(); }
bool crt_is_blanked() { return ((m_crtcregs[0] & 0x0200) == 0x0200); }
bool crt_active_vblank_irq();
void IntReq( int num );
@@ -108,7 +108,7 @@ public:
void write_line_tx(int port, uint8_t value);
template <int Port> auto tx_callback() { return write_tx[Port].bind(); }
template <int Port> DECLARE_WRITE_LINE_MEMBER(rx_w) { m_uart[Port]->rx_w((uint8_t)state); }
-
+
protected:
// device-level overrides
//virtual void device_validity_check(validity_checker &valid) const override;
@@ -128,7 +128,7 @@ private:
required_shared_ptr <uint32_t> m_crtcregs;
uint16_t *m_textureram;
uint16_t *m_frameram;
-
+
address_space *m_host_space;
uint32_t m_ext_vclk;
@@ -185,10 +185,10 @@ private:
// Misc
DECLARE_READ32_MEMBER( sysid_r );
DECLARE_READ32_MEMBER( cfgr_r );
-
+
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank);
-
+
DECLARE_READ16_MEMBER( textureram_r );
DECLARE_WRITE16_MEMBER( textureram_w );
DECLARE_READ16_MEMBER( frameram_r );
diff --git a/src/devices/machine/wd1000.cpp b/src/devices/machine/wd1000.cpp
index 1b573fe0af9..e9ac75bad49 100644
--- a/src/devices/machine/wd1000.cpp
+++ b/src/devices/machine/wd1000.cpp
@@ -407,7 +407,7 @@ void wd1000_device::data_w(uint8_t data)
{
// Tranfer completed.
if ((m_command >> 4) == CMD_WRITE_SECTOR ||
- (m_command >> 4) == CMD_WRITE_FORMAT)
+ (m_command >> 4) == CMD_WRITE_FORMAT)
{
m_status |= S_BSY;
set_error(0);
diff --git a/src/devices/sound/2203intf.cpp b/src/devices/sound/2203intf.cpp
index 02ad8a41579..9b49479af97 100644
--- a/src/devices/sound/2203intf.cpp
+++ b/src/devices/sound/2203intf.cpp
@@ -91,7 +91,8 @@ void ym2203_device::device_start()
/* Initialize FM emurator */
int rate = clock()/72; /* ??? */
m_chip = ym2203_init(this,clock(),rate,&ym2203_device::static_timer_handler,&ym2203_device::static_irq_handler,&psgintf);
- assert_always(m_chip != nullptr, "Error creating YM2203 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym2203_device(%s): Error creating YM2203 chip", tag());
}
void ym2203_device::device_clock_changed()
diff --git a/src/devices/sound/2608intf.cpp b/src/devices/sound/2608intf.cpp
index 6c31c2aea0f..e6f24c7fef0 100644
--- a/src/devices/sound/2608intf.cpp
+++ b/src/devices/sound/2608intf.cpp
@@ -97,10 +97,11 @@ void ym2608_device::device_start()
/* initialize YM2608 */
m_chip = ym2608_init(this,clock(),rate,
- &ym2608_device::static_internal_read_byte,
- &ym2608_device::static_external_read_byte, &ym2608_device::static_external_write_byte,
- &ym2608_device::static_timer_handler,&ym2608_device::static_irq_handler,&psgintf);
- assert_always(m_chip != nullptr, "Error creating YM2608 chip");
+ &ym2608_device::static_internal_read_byte,
+ &ym2608_device::static_external_read_byte, &ym2608_device::static_external_write_byte,
+ &ym2608_device::static_timer_handler,&ym2608_device::static_irq_handler,&psgintf);
+ if (!m_chip)
+ throw emu_fatalerror("ym2608_device(%s): Error creating YM2608 chip", tag());
}
//-------------------------------------------------
diff --git a/src/devices/sound/2610intf.cpp b/src/devices/sound/2610intf.cpp
index fe4077b2d40..03c3fc218a2 100644
--- a/src/devices/sound/2610intf.cpp
+++ b/src/devices/sound/2610intf.cpp
@@ -117,9 +117,10 @@ void ym2610_device::device_start()
/**** initialize YM2610 ****/
m_chip = ym2610_init(this, clock(), rate,
- &ym2610_device::static_adpcm_a_read_byte, &ym2610_device::static_adpcm_b_read_byte,
- &ym2610_device::static_timer_handler, &ym2610_device::static_irq_handler, &psgintf);
- assert_always(m_chip != nullptr, "Error creating YM2610 chip");
+ &ym2610_device::static_adpcm_a_read_byte, &ym2610_device::static_adpcm_b_read_byte,
+ &ym2610_device::static_timer_handler, &ym2610_device::static_irq_handler, &psgintf);
+ if (!m_chip)
+ throw emu_fatalerror("ym2610_device(%s): Error creating YM2610 chip", tag());
}
//-------------------------------------------------
diff --git a/src/devices/sound/2612intf.cpp b/src/devices/sound/2612intf.cpp
index b8e440666ec..484d15dde14 100644
--- a/src/devices/sound/2612intf.cpp
+++ b/src/devices/sound/2612intf.cpp
@@ -91,7 +91,8 @@ void ym2612_device::device_start()
/**** initialize YM2612 ****/
m_chip = ym2612_init(this,clock(),rate,&ym2612_device::static_timer_handler,&ym2612_device::static_irq_handler);
- assert_always(m_chip != nullptr, "Error creating YM2612 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym2612_device(%s): Error creating YM2612 chip", tag());
}
void ym2612_device::device_clock_changed()
diff --git a/src/devices/sound/262intf.cpp b/src/devices/sound/262intf.cpp
index 0de5e274ca9..f2aee977b30 100644
--- a/src/devices/sound/262intf.cpp
+++ b/src/devices/sound/262intf.cpp
@@ -78,7 +78,8 @@ void ymf262_device::device_start()
/* stream system initialize */
m_chip = ymf262_init(this,clock(),rate);
- assert_always(m_chip != nullptr, "Error creating YMF262 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ymf262_device(%s): Error creating YMF262 chip", tag());
m_stream = machine().sound().stream_alloc(*this,0,4,rate);
diff --git a/src/devices/sound/3526intf.cpp b/src/devices/sound/3526intf.cpp
index 2418b9e65a1..dd81b0d7eb0 100644
--- a/src/devices/sound/3526intf.cpp
+++ b/src/devices/sound/3526intf.cpp
@@ -82,7 +82,8 @@ void ym3526_device::device_start()
/* stream system initialize */
m_chip = ym3526_init(this, clock(), rate);
- assert_always(m_chip != nullptr, "Error creating YM3526 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym3526_device(%s): Error creating YM3526 chip", tag());
calculate_rates();
diff --git a/src/devices/sound/3812intf.cpp b/src/devices/sound/3812intf.cpp
index 9b29af0599d..c5f5aeabb05 100644
--- a/src/devices/sound/3812intf.cpp
+++ b/src/devices/sound/3812intf.cpp
@@ -82,7 +82,8 @@ void ym3812_device::device_start()
/* stream system initialize */
m_chip = ym3812_init(this, clock(), rate);
- assert_always(m_chip != nullptr, "Error creating YM3812 chip");
+ if (!m_chip)
+ throw emu_fatalerror("ym3812_device(%s): Error creating YM3812 chip", tag());
calculate_rates();
diff --git a/src/devices/sound/8950intf.cpp b/src/devices/sound/8950intf.cpp
index 601c9861f33..af981b756be 100644
--- a/src/devices/sound/8950intf.cpp
+++ b/src/devices/sound/8950intf.cpp
@@ -81,7 +81,8 @@ void y8950_device::device_start()
/* stream system initialize */
m_chip = y8950_init(this,clock(),rate);
- assert_always(m_chip != nullptr, "Error creating Y8950 chip");
+ if (!m_chip)
+ throw emu_fatalerror("y8950_device(%s): Error creating Y8950 chip", tag());
/* ADPCM ROM data */
y8950_set_delta_t_memory(m_chip, &y8950_device::static_read_byte, &y8950_device::static_write_byte);
diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp
index 3d396c3cd00..6ae9518c29e 100644
--- a/src/devices/sound/ay8910.cpp
+++ b/src/devices/sound/ay8910.cpp
@@ -1125,7 +1125,7 @@ void ay8910_device::sound_stream_update(sound_stream &stream, stream_sample_t **
if (tone->count >= tone->period)
{
tone->duty_cycle = (tone->duty_cycle - 1) & 0x1f;
- tone->output = BIT(duty_cycle[tone_duty(tone)], tone->duty_cycle);
+ tone->output = (m_feature & PSG_HAS_EXPANDED_MODE) ? BIT(duty_cycle[tone_duty(tone)], tone->duty_cycle) : BIT(tone->duty_cycle, 0);
tone->count = 0;
}
}
@@ -1147,7 +1147,7 @@ void ay8910_device::sound_stream_update(sound_stream &stream, stream_sample_t **
// TODO : get actually algorithm for AY8930
m_rng ^= (((m_rng & 1) ^ ((m_rng >> 3) & 1)) << 17);
m_rng >>= 1;
- m_prescale_noise = 16;
+ m_prescale_noise = (m_feature & PSG_HAS_EXPANDED_MODE) ? 16 : 1;
}
m_prescale_noise--;
}
@@ -1353,7 +1353,7 @@ void ay8910_device::device_start()
/* The envelope is pacing twice as fast for the YM2149 as for the AY-3-8910, */
/* This handled by the step parameter. Consequently we use a multipler of 2 here. */
- m_channel = machine().sound().stream_alloc(*this, 0, m_streams, master_clock * 2);
+ m_channel = machine().sound().stream_alloc(*this, 0, m_streams, (m_feature & PSG_HAS_EXPANDED_MODE) ? master_clock * 2 : master_clock / 8);
ay_set_clock(master_clock);
ay8910_statesave();
@@ -1406,9 +1406,9 @@ void ay8910_device::ay_set_clock(int clock)
{
// FIXME: this doesn't belong here, it should be an input pin exposed via devcb
if ((m_feature & PSG_PIN26_IS_CLKSEL) && (m_flags & YM2149_PIN26_LOW))
- m_channel->set_sample_rate(clock);
+ m_channel->set_sample_rate((m_feature & PSG_HAS_EXPANDED_MODE) ? clock : clock / 16);
else
- m_channel->set_sample_rate(clock * 2);
+ m_channel->set_sample_rate((m_feature & PSG_HAS_EXPANDED_MODE) ? clock * 2 : clock / 8);
}
void ay8910_device::device_clock_changed()
@@ -1634,7 +1634,7 @@ ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, co
m_rng(0),
m_mode(0),
m_env_step_mask((!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? 0x0f : 0x1f),
- m_step( (!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? 32 : 16),
+ m_step( (!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? 2 : 1),
m_zero_is_off( (!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? 1 : 0),
m_par( (!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? &ay8910_param : &ym2149_param),
m_par_env( (!(feature & PSG_HAS_EXPANDED_MODE)) && (psg_type == PSG_TYPE_AY) ? &ay8910_param : &ym2149_param_env),
@@ -1663,7 +1663,7 @@ void ay8910_device::set_type(psg_type_t psg_type)
if (psg_type == PSG_TYPE_AY)
{
m_env_step_mask = 0x0f;
- m_step = 32;
+ m_step = 2;
m_zero_is_off = 1;
m_par = &ay8910_param;
m_par_env = &ay8910_param;
@@ -1671,11 +1671,13 @@ void ay8910_device::set_type(psg_type_t psg_type)
else
{
m_env_step_mask = 0x1f;
- m_step = 16;
+ m_step = 1;
m_zero_is_off = 0;
m_par = &ym2149_param;
m_par_env = &ym2149_param_env;
}
+ if (m_feature & PSG_HAS_EXPANDED_MODE)
+ m_step *= 16;
}
DEFINE_DEVICE_TYPE(AY8912, ay8912_device, "ay8912", "AY-3-8912A PSG")
diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp
index 2b3a47dbfb8..2e90311ac46 100644
--- a/src/devices/sound/discrete.cpp
+++ b/src/devices/sound/discrete.cpp
@@ -246,13 +246,15 @@ bool discrete_task::process(void)
int avail;
avail = sn->linked_outbuf->ptr - sn->ptr;
- assert_always(avail >= 0, "task_callback: available samples are negative");
+ if (avail < 0)
+ throw emu_fatalerror("discrete_task::process: available samples are negative");
if (avail < samples)
samples = avail;
}
m_samples -= samples;
- assert_always(m_samples >=0, "task_callback: task_samples got negative");
+ if (m_samples < 0)
+ throw emu_fatalerror("discrete_task::process: m_samples got negative");
while (samples > 0)
{
/* step */
diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp
index 7626025e9e9..29baecb352e 100644
--- a/src/devices/sound/pokey.cpp
+++ b/src/devices/sound/pokey.cpp
@@ -417,7 +417,7 @@ void pokey_device::device_timer(emu_timer &timer, device_timer_id id, int param,
m_IRQST |= (param & 0xff);
break;
default:
- assert_always(false, "Unknown id in pokey_device::device_timer");
+ throw emu_fatalerror("Unknown id in pokey_device::device_timer");
}
}
diff --git a/src/devices/sound/tiaintf.cpp b/src/devices/sound/tiaintf.cpp
index 9df0166ca86..da0f0c27759 100644
--- a/src/devices/sound/tiaintf.cpp
+++ b/src/devices/sound/tiaintf.cpp
@@ -33,7 +33,8 @@ void tia_device::device_start()
{
m_channel = stream_alloc(0, 1, clock());
m_chip = tia_sound_init(this, clock(), clock(), 16);
- assert_always(m_chip != nullptr, "Error creating TIA chip");
+ if (!m_chip)
+ throw emu_fatalerror("tia_device(%s): Error creating TIA chip", tag());
}
diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp
index be93f44128f..b800f6a7b0e 100644
--- a/src/devices/sound/upd7759.cpp
+++ b/src/devices/sound/upd7759.cpp
@@ -618,7 +618,7 @@ void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int para
break;
default:
- assert_always(false, "Unknown id in upd7759_device::device_timer");
+ throw emu_fatalerror("Unknown id in upd7759_device::device_timer");
}
}
diff --git a/src/devices/sound/ymf271.cpp b/src/devices/sound/ymf271.cpp
index c979ea7426e..6b05f390275 100644
--- a/src/devices/sound/ymf271.cpp
+++ b/src/devices/sound/ymf271.cpp
@@ -1346,7 +1346,7 @@ void ymf271_device::device_timer(emu_timer &timer, device_timer_id id, int param
break;
default:
- assert_always(false, "Unknown id in ymf271_device::device_timer");
+ throw emu_fatalerror("Unknown id in ymf271_device::device_timer");
break;
}
}
diff --git a/src/devices/sound/ymf278b.cpp b/src/devices/sound/ymf278b.cpp
index 71baf70aeb9..dc0c4693aab 100644
--- a/src/devices/sound/ymf278b.cpp
+++ b/src/devices/sound/ymf278b.cpp
@@ -1038,7 +1038,8 @@ void ymf278b_device::device_start()
/* stream system initialize */
int ymf262_clock = clock() / (19/8.0);
m_ymf262 = ymf262_init(this, ymf262_clock, ymf262_clock / 288);
- assert_always(m_ymf262 != nullptr, "Error creating YMF262 chip");
+ if (!m_ymf262)
+ throw emu_fatalerror("ymf278b_device(%s): Error creating YMF262 chip", tag());
m_stream_ymf262 = machine().sound().stream_alloc(*this, 0, 4, ymf262_clock / 288);
diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp
index 1ab3cd9b6a9..0b182509fb5 100644
--- a/src/devices/sound/ymz280b.cpp
+++ b/src/devices/sound/ymz280b.cpp
@@ -636,7 +636,7 @@ void ymz280b_device::device_reset()
m_ext_mem_address = 0;
/* clear other voice parameters */
- for (auto & elem : m_voice)
+ for (auto &elem : m_voice)
{
struct YMZ280BVoice *voice = &elem;
@@ -653,7 +653,7 @@ void ymz280b_device::device_timer(emu_timer &timer, device_timer_id id, int para
if (id < 8)
update_irq_state_timer_common( id );
else
- assert_always(false, "Unknown id in ymz280b_device::device_timer");
+ throw emu_fatalerror("Unknown id in ymz280b_device::device_timer");
}
diff --git a/src/devices/video/bt431.cpp b/src/devices/video/bt431.cpp
index 80aa8c7766f..b4e180d9378 100644
--- a/src/devices/video/bt431.cpp
+++ b/src/devices/video/bt431.cpp
@@ -131,7 +131,7 @@ void bt431_device::reg_w(u8 data)
LOG("cursor x low register: 0x%02x\n", data);
break;
case REG_CURSOR_X_HI:
- m_cursor_x = ((data & 0xf) << 8) | (m_cursor_x & 0xff);
+ m_cursor_x = (u16(data & 0xf) << 8) | (m_cursor_x & 0xff);
LOG("cursor x high register: 0x%02x\n", data);
break;
case REG_CURSOR_Y_LO:
@@ -139,7 +139,7 @@ void bt431_device::reg_w(u8 data)
LOG("cursor y low register: 0x%02x\n", data);
break;
case REG_CURSOR_Y_HI:
- m_cursor_y = ((data & 0xf) << 8) | (m_cursor_y & 0xff);
+ m_cursor_y = (u16(data & 0xf) << 8) | (m_cursor_y & 0xff);
LOG("cursor y high register: 0x%02x\n", data);
break;
@@ -148,7 +148,7 @@ void bt431_device::reg_w(u8 data)
LOG("window x low register: 0x%02x\n", data);
break;
case REG_WINDOW_X_HI:
- m_window_x = ((data & 0xf) << 8) | (m_window_x & 0xff);
+ m_window_x = (u16(data & 0xf) << 8) | (m_window_x & 0xff);
LOG("window x high register: 0x%02x\n", data);
break;
case REG_WINDOW_Y_LO:
@@ -156,7 +156,7 @@ void bt431_device::reg_w(u8 data)
LOG("window y low register: 0x%02x\n", data);
break;
case REG_WINDOW_Y_HI:
- m_window_y = ((data & 0xf) << 8) | (m_window_y & 0xff);
+ m_window_y = (u16(data & 0xf) << 8) | (m_window_y & 0xff);
LOG("window y high register: 0x%02x\n", data);
break;
@@ -165,7 +165,7 @@ void bt431_device::reg_w(u8 data)
LOG("window width low register: 0x%02x\n", data);
break;
case REG_WINDOW_W_HI:
- m_window_w = ((data & 0xf) << 8) | (m_window_w & 0xff);
+ m_window_w = (u16(data & 0xf) << 8) | (m_window_w & 0xff);
LOG("window width high register: 0x%02x\n", data);
break;
case REG_WINDOW_H_LO:
@@ -173,7 +173,7 @@ void bt431_device::reg_w(u8 data)
LOG("window height low register: 0x%02x\n", data);
break;
case REG_WINDOW_H_HI:
- m_window_h = ((data & 0xf) << 8) | (m_window_h & 0xff);
+ m_window_h = (u16(data & 0xf) << 8) | (m_window_h & 0xff);
LOG("window height high register: 0x%02x\n", data);
break;
diff --git a/src/devices/video/bt45x.cpp b/src/devices/video/bt45x.cpp
index acf60ce238d..5760e01711f 100644
--- a/src/devices/video/bt45x.cpp
+++ b/src/devices/video/bt45x.cpp
@@ -104,12 +104,12 @@ bt45x_mono_device_base::bt45x_mono_device_base(const machine_config &mconfig, de
}
bt451_device::bt451_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : bt45x_rgb_device_base(mconfig, BT451, tag, owner, clock, 256, 3)
+ : bt45x_rgb_device_base(mconfig, BT451, tag, owner, clock, 256, 4)
{
}
bt453_device::bt453_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : bt45x_rgb_device_base(mconfig, BT453, tag, owner, clock, 256, 3)
+ : bt45x_rgb_device_base(mconfig, BT453, tag, owner, clock, 256, 4)
{
}
@@ -123,12 +123,12 @@ bt455_device::bt455_device(const machine_config &mconfig, const char *tag, devic
{
}
bt457_device::bt457_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : bt45x_mono_device_base(mconfig, BT457, tag, owner, clock, 256, 3)
+ : bt45x_mono_device_base(mconfig, BT457, tag, owner, clock, 256, 4)
{
}
bt458_device::bt458_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : bt45x_rgb_device_base(mconfig, type, tag, owner, clock, 256, 3)
+ : bt45x_rgb_device_base(mconfig, type, tag, owner, clock, 256, 4)
{
}
diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp
index 36214bb1ad4..94ee1e49c0d 100644
--- a/src/devices/video/gba_lcd.cpp
+++ b/src/devices/video/gba_lcd.cpp
@@ -1577,16 +1577,14 @@ READ32_MEMBER(gba_lcd_device::video_r)
break;
}
- assert_always(offset < ARRAY_LENGTH(reg_names) / 2, "Not enough register names in gba_lcd_device");
+ if (offset >= ARRAY_LENGTH(reg_names) / 2)
+ throw emu_fatalerror("gba_lcd_device::video_r: Not enough register names in gba_lcd_device");
if (ACCESSING_BITS_0_15)
- {
verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2], retval & 0x0000ffff);
- }
+
if (ACCESSING_BITS_16_31)
- {
verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2 + 1], (retval & 0xffff0000) >> 16);
- }
return retval;
}
@@ -1595,16 +1593,14 @@ WRITE32_MEMBER(gba_lcd_device::video_w)
{
COMBINE_DATA(&m_regs[offset]);
- assert_always(offset < ARRAY_LENGTH(reg_names) / 2, "Not enough register names in gba_lcd_device");
+ if (offset >= ARRAY_LENGTH(reg_names) / 2)
+ throw emu_fatalerror("gba_lcd_device::video_w: Not enough register names in gba_lcd_device");
if (ACCESSING_BITS_0_15)
- {
verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2], data & 0x0000ffff);
- }
+
if (ACCESSING_BITS_16_31)
- {
verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2 + 1], (data & 0xffff0000) >> 16);
- }
switch (offset)
{
diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp
index e0686f75f2e..1bb7c5fde56 100644
--- a/src/devices/video/imagetek_i4100.cpp
+++ b/src/devices/video/imagetek_i4100.cpp
@@ -22,7 +22,7 @@
- Some gfx problems in ladykill, 3kokushi, puzzli, gakusai, seem related to how we handle
windows, wrapping, read-modify-write areas;
- puzzli: emulate hblank irq and fix video routines here (water effect not emulated?);
- - Fix flipped screen behavior
+ - Fix flipped screen behavior
============================================================================
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp
index 68ac2ee0af9..1c0862f1564 100644
--- a/src/devices/video/mc6845.cpp
+++ b/src/devices/video/mc6845.cpp
@@ -698,7 +698,7 @@ bool mc6845_device::check_cursor_visible(uint16_t ra, uint16_t line_addr)
return false;
if ((m_cursor_addr < line_addr) ||
- (m_cursor_addr >= (line_addr + m_horiz_disp)))
+ (m_cursor_addr >= (line_addr + m_horiz_disp)))
{
// Not a cursor character line.
return false;
@@ -737,7 +737,7 @@ bool hd6845s_device::check_cursor_visible(uint16_t ra, uint16_t line_addr)
return false;
if ((m_cursor_addr < line_addr) ||
- (m_cursor_addr >= (line_addr + m_horiz_disp)))
+ (m_cursor_addr >= (line_addr + m_horiz_disp)))
{
// Not a cursor character line.
return false;
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index 9ab3e8c9bc6..4549c8292be 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -1987,7 +1987,7 @@ static const uint16_t vram_fgr_shiftab[4] = { 0, 5, 6, 7 };
void snes_ppu_device::set_latch_hv(int16_t x, int16_t y)
{
m_beam.latch_vert = y;
- m_beam.latch_horz = x;
+ m_beam.latch_horz = x / m_htmult;
m_stat78 |= 0x40; // indicate we latched
// printf("latched @ H %d V %d\n", m_beam.latch_horz, m_beam.latch_vert);
@@ -2012,12 +2012,12 @@ void snes_ppu_device::dynamic_res_change()
if ((m_stat78 & 0x10) == SNES_NTSC)
{
refresh = HZ_TO_ATTOSECONDS(DOTCLK_NTSC) * SNES_HTOTAL * SNES_VTOTAL_NTSC;
- screen().configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh);
+ screen().configure(SNES_HTOTAL * m_htmult, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh);
}
else
{
refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL;
- screen().configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh);
+ screen().configure(SNES_HTOTAL * m_htmult, SNES_VTOTAL_PAL * m_interlace, visarea, refresh);
}
}
@@ -2312,7 +2312,7 @@ uint8_t snes_ppu_device::read(address_space &space, uint32_t offset, uint8_t wri
return m_ppu1_open_bus;
}
case SLHV: /* Software latch for H/V counter */
- set_latch_hv(screen().hpos() / m_htmult, screen().vpos());
+ set_latch_hv(screen().hpos(), screen().vpos());
return m_openbus_cb(space, 0); /* Return value is meaningless */
case ROAMDATA: /* Read data from OAM (DR) */
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index a38de1d475f..36ac805d218 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -5751,7 +5751,8 @@ voodoo_device::raster_info *voodoo_device::add_rasterizer(voodoo_device *vd, con
raster_info *info = &vd->rasterizer[vd->next_rasterizer++];
int hash = cinfo->compute_hash();
- assert_always(vd->next_rasterizer <= MAX_RASTERIZERS, "Out of space for new rasterizers!");
+ if (vd->next_rasterizer > MAX_RASTERIZERS)
+ throw emu_fatalerror("voodoo_device::add_rasterizer: Out of space for new rasterizers!");
/* make a copy of the info */
*info = *cinfo;
diff --git a/src/devices/video/vrender0.cpp b/src/devices/video/vrender0.cpp
index b505e69a7e1..e67675888f0 100644
--- a/src/devices/video/vrender0.cpp
+++ b/src/devices/video/vrender0.cpp
@@ -12,12 +12,12 @@
It supports alphablend with programmable factors per channel and for source and dest
color.
- TODO:
- - Dither Mode;
- - Draw select to Front buffer is untested, speculatively gonna be used for raster
- effects;
- - screen_update doesn't honor CRT Display Start registers,
- so far only psattack changes it on-the-fly, for unknown reasons;
+ TODO:
+ - Dither Mode;
+ - Draw select to Front buffer is untested, speculatively gonna be used for raster
+ effects;
+ - screen_update doesn't honor CRT Display Start registers,
+ so far only psattack changes it on-the-fly, for unknown reasons;
*****************************************************************************************/
@@ -177,7 +177,7 @@ void vr0video_device::device_reset()
{
memset(m_InternalPalette, 0, sizeof(m_InternalPalette));
m_LastPalUpdate = 0xffffffff;
-
+
m_DisplayDest = m_DrawDest = m_frameram;
}
@@ -551,7 +551,7 @@ int vr0video_device::vrender0_ProcessPacket(uint32_t PacketPtr)
if (Packet0 & 0x800)
{
m_RenderState.SrcAlphaColor = Packet[17] | ((Packet[18] & 0xff) << 16);
- m_RenderState.SrcBlend = (Packet[18] >> 8) & 0x3f;
+ m_RenderState.SrcBlend = (Packet[18] >> 8) & 0x3f;
m_RenderState.DstAlphaColor = Packet[19] | ((Packet[20] & 0xff) << 16);
m_RenderState.DstBlend = (Packet[20] >> 8) & 0x3f;
}
@@ -655,7 +655,7 @@ int vr0video_device::vrender0_ProcessPacket(uint32_t PacketPtr)
Quad.Pal = m_InternalPalette + (m_RenderState.PaletteBank * 16);
else
Quad.Pal = m_InternalPalette;
-
+
if (m_RenderState.TextureMode) //Tiled
DrawTile[m_RenderState.PixelFormat + 4 * Mode](&Quad);
else
diff --git a/src/devices/video/vrender0.h b/src/devices/video/vrender0.h
index b68b0a47f0e..809f0167ca0 100644
--- a/src/devices/video/vrender0.h
+++ b/src/devices/video/vrender0.h
@@ -77,22 +77,22 @@ private:
DECLARE_READ16_MEMBER( bank1_select_r );
DECLARE_WRITE16_MEMBER( bank1_select_w );
- bool m_bank1_select; //!< Select framebuffer bank1 address
+ bool m_bank1_select; //!< Select framebuffer bank1 address
DECLARE_READ16_MEMBER( display_bank_r );
- uint8_t m_display_bank; //!< Current display bank
+ uint8_t m_display_bank; //!< Current display bank
DECLARE_READ16_MEMBER( render_control_r );
DECLARE_WRITE16_MEMBER( render_control_w );
- bool m_draw_select; //!< If true, device draws to Front buffer instead of Back
- bool m_render_reset; //!< Reset pipeline FIFO
- bool m_render_start; //!< Enable pipeline processing
- uint8_t m_dither_mode; //!< applied on RGB888 to RGB565 conversions (00: 2x2, 01:4x4, 1x disable)
- uint8_t m_flip_count; //!< number of framebuffer "syncs" loaded in the parameter RAM,
+ bool m_draw_select; //!< If true, device draws to Front buffer instead of Back
+ bool m_render_reset; //!< Reset pipeline FIFO
+ bool m_render_start; //!< Enable pipeline processing
+ uint8_t m_dither_mode; //!< applied on RGB888 to RGB565 conversions (00: 2x2, 01:4x4, 1x disable)
+ uint8_t m_flip_count; //!< number of framebuffer "syncs" loaded in the parameter RAM,
//!< a.k.a. how many full (vblank) buffers are ready for the device to parse.
-
- uint16_t *m_DrawDest; //!< frameram pointer to draw buffer area
- uint16_t *m_DisplayDest; //!< frameram pointer to display buffer area
+
+ uint16_t *m_DrawDest; //!< frameram pointer to draw buffer area
+ uint16_t *m_DisplayDest; //!< frameram pointer to display buffer area
};
DECLARE_DEVICE_TYPE(VIDEO_VRENDER0, vr0video_device)
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index c61afae5126..cd9d9dcf743 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -2034,14 +2034,14 @@ void debugger_commands::execute_dump(int ref, const std::vector<std::string> &pa
if (params.size() > 4 && !validate_number_parameter(params[4], ascii))
return;
- u64 rowsize = 16;
- if (params.size() > 5 && !validate_number_parameter(params[5], rowsize))
- return;
-
address_space *space;
if (!validate_cpu_space_parameter((params.size() > 6) ? params[6].c_str() : nullptr, ref, space))
return;
+ u64 rowsize = space->byte_to_address(16);
+ if (params.size() > 5 && !validate_number_parameter(params[5], rowsize))
+ return;
+
int shift = space->addr_shift();
u64 granularity = shift > 0 ? 2 : 1 << -shift;
@@ -2060,9 +2060,9 @@ void debugger_commands::execute_dump(int ref, const std::vector<std::string> &pa
m_console.printf("Invalid width! (must be at least %d)\n", granularity);
return;
}
- if (rowsize == 0 || (rowsize % width) != 0)
+ if (rowsize == 0 || (rowsize % space->byte_to_address(width)) != 0)
{
- m_console.printf("Invalid row size! (must be a positive multiple of %d)\n", width);
+ m_console.printf("Invalid row size! (must be a positive multiple of %d)\n", space->byte_to_address(width));
return;
}
@@ -2081,10 +2081,7 @@ void debugger_commands::execute_dump(int ref, const std::vector<std::string> &pa
util::ovectorstream output;
output.reserve(200);
- if (shift > 0)
- width <<= shift;
- else if(shift < 0)
- width >>= -shift;
+ const unsigned delta = (shift >= 0) ? (width << shift) : (width >> -shift);
auto dis = space->device().machine().disable_side_effects();
bool be = space->endianness() == ENDIANNESS_BIG;
@@ -2098,7 +2095,7 @@ void debugger_commands::execute_dump(int ref, const std::vector<std::string> &pa
util::stream_format(output, "%0*X: ", space->logaddrchars(), i);
/* print the bytes */
- for (u64 j = 0; j < rowsize; j += width)
+ for (u64 j = 0; j < rowsize; j += delta)
{
if (i + j <= endoffset)
{
@@ -2134,7 +2131,7 @@ void debugger_commands::execute_dump(int ref, const std::vector<std::string> &pa
if (ascii)
{
util::stream_format(output, " ");
- for (u64 j = 0; j < rowsize && (i + j) <= endoffset; j += width)
+ for (u64 j = 0; j < rowsize && (i + j) <= endoffset; j += delta)
{
offs_t curaddr = i + j;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp
index 0fc33d32f10..8faf4f0de02 100644
--- a/src/emu/debug/debugcon.cpp
+++ b/src/emu/debug/debugcon.cpp
@@ -399,8 +399,10 @@ CMDERR debugger_console::validate_command(const char *command)
void debugger_console::register_command(const char *command, u32 flags, int ref, int minparams, int maxparams, std::function<void(int, const std::vector<std::string> &)> handler)
{
- assert_always(m_machine.phase() == machine_phase::INIT, "Can only call register_command() at init time!");
- assert_always((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call register_command() when debugger is not running");
+ if (m_machine.phase() != machine_phase::INIT)
+ throw emu_fatalerror("Can only call debugger_console::register_command() at init time!");
+ if (!(m_machine.debug_flags & DEBUG_FLAG_ENABLED))
+ throw emu_fatalerror("Cannot call debugger_console::register_command() when debugger is not running");
debug_command *cmd = auto_alloc_clear(m_machine, <debug_command>());
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp
index 69417db74db..953e89dc42c 100644
--- a/src/emu/diimage.cpp
+++ b/src/emu/diimage.cpp
@@ -27,26 +27,27 @@
//**************************************************************************
const image_device_type_info device_image_interface::m_device_info_array[] =
{
- { IO_UNKNOWN, "unknown", "unkn" },
- { IO_CARTSLOT, "cartridge", "cart" }, /* 0 */
- { IO_FLOPPY, "floppydisk", "flop" }, /* 1 */
- { IO_HARDDISK, "harddisk", "hard" }, /* 2 */
- { IO_CYLINDER, "cylinder", "cyln" }, /* 3 */
- { IO_CASSETTE, "cassette", "cass" }, /* 4 */
- { IO_PUNCHCARD, "punchcard", "pcrd" }, /* 5 */
- { IO_PUNCHTAPE, "punchtape", "ptap" }, /* 6 */
- { IO_PRINTER, "printout", "prin" }, /* 7 */
- { IO_SERIAL, "serial", "serl" }, /* 8 */
- { IO_PARALLEL, "parallel", "parl" }, /* 9 */
- { IO_SNAPSHOT, "snapshot", "dump" }, /* 10 */
- { IO_QUICKLOAD, "quickload", "quik" }, /* 11 */
- { IO_MEMCARD, "memcard", "memc" }, /* 12 */
- { IO_CDROM, "cdrom", "cdrm" }, /* 13 */
- { IO_MAGTAPE, "magtape", "magt" }, /* 14 */
- { IO_ROM, "romimage", "rom" }, /* 15 */
- { IO_MIDIIN, "midiin", "min" }, /* 16 */
- { IO_MIDIOUT, "midiout", "mout" }, /* 17 */
- { IO_PICTURE, "picture", "pic" } /* 18 */
+ { IO_UNKNOWN, "unknown", "unkn" }, /* 0 */
+ { IO_CARTSLOT, "cartridge", "cart" }, /* 1 */
+ { IO_FLOPPY, "floppydisk", "flop" }, /* 2 */
+ { IO_HARDDISK, "harddisk", "hard" }, /* 3 */
+ { IO_CYLINDER, "cylinder", "cyln" }, /* 4 */
+ { IO_CASSETTE, "cassette", "cass" }, /* 5 */
+ { IO_PUNCHCARD, "punchcard", "pcrd" }, /* 6 */
+ { IO_PUNCHTAPE, "punchtape", "ptap" }, /* 7 */
+ { IO_PRINTER, "printout", "prin" }, /* 8 */
+ { IO_SERIAL, "serial", "serl" }, /* 9 */
+ { IO_PARALLEL, "parallel", "parl" }, /* 10 */
+ { IO_SNAPSHOT, "snapshot", "dump" }, /* 11 */
+ { IO_QUICKLOAD, "quickload", "quik" }, /* 12 */
+ { IO_MEMCARD, "memcard", "memc" }, /* 13 */
+ { IO_CDROM, "cdrom", "cdrm" }, /* 14 */
+ { IO_MAGTAPE, "magtape", "magt" }, /* 15 */
+ { IO_ROM, "romimage", "rom" }, /* 16 */
+ { IO_MIDIIN, "midiin", "min" }, /* 17 */
+ { IO_MIDIOUT, "midiout", "mout" }, /* 18 */
+ { IO_PICTURE, "picture", "pic" }, /* 19 */
+ { IO_VIDEO, "vidfile", "vid" } /* 20 */
};
@@ -625,7 +626,8 @@ bool device_image_interface::support_command_line_image_creation() const
void device_image_interface::battery_load(void *buffer, int length, int fill)
{
- assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
+ if (!buffer || (length <= 0))
+ throw emu_fatalerror("device_image_interface::battery_load: Must specify sensical buffer/length");
osd_file::error filerr;
int bytes_read = 0;
@@ -643,7 +645,8 @@ void device_image_interface::battery_load(void *buffer, int length, int fill)
void device_image_interface::battery_load(void *buffer, int length, void *def_buffer)
{
- assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
+ if (!buffer || (length <= 0))
+ throw emu_fatalerror("device_image_interface::battery_load: Must specify sensical buffer/length");
osd_file::error filerr;
int bytes_read = 0;
@@ -670,7 +673,8 @@ void device_image_interface::battery_load(void *buffer, int length, void *def_bu
void device_image_interface::battery_save(const void *buffer, int length)
{
- assert_always(buffer && (length > 0), "Must specify sensical buffer/length");
+ if (!buffer || (length <= 0))
+ throw emu_fatalerror("device_image_interface::battery_save: Must specify sensical buffer/length");
if (!device().machine().options().nvram_save())
return;
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index fb2a317d60a..437546f27c6 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -51,7 +51,8 @@ enum iodevice_t
IO_MIDIIN, /* 17 - MIDI In port */
IO_MIDIOUT, /* 18 - MIDI Out port */
IO_PICTURE, /* 19 - A single-frame image */
- IO_COUNT /* 20 - Total Number of IO_devices for searching */
+ IO_VIDEO, /* 20 - A video file */
+ IO_COUNT /* 21 - Total Number of IO_devices for searching */
};
enum image_error_t
@@ -243,7 +244,7 @@ protected:
void clear_error();
- void check_for_file() const { assert_always(m_file, "Illegal operation on unmounted image"); }
+ void check_for_file() const { if (!m_file) throw emu_fatalerror("%s(%s): Illegal operation on unmounted image", device().shortname(), device().tag()); }
void setup_working_directory();
bool try_change_working_directory(const std::string &subdir);
diff --git a/src/emu/dinetwork.cpp b/src/emu/dinetwork.cpp
index cc1c4402759..0e9c0610566 100644
--- a/src/emu/dinetwork.cpp
+++ b/src/emu/dinetwork.cpp
@@ -31,7 +31,8 @@ void device_network_interface::interface_post_start()
int device_network_interface::send(u8 *buf, int len)
{
// TODO: enable this check when other devices implement delayed transmit
- //assert_always(!m_send_timer->enabled(), "attempted to transmit while transmit already in progress");
+ //if (m_send_timer->enabled())
+ //throw emu_fatalerror("%s(%s): attempted to transmit while transmit already in progress", device().shortname(), device().tag());
int result = 0;
@@ -65,7 +66,8 @@ TIMER_CALLBACK_MEMBER(device_network_interface::send_complete)
void device_network_interface::recv_cb(u8 *buf, int len)
{
- assert_always(!m_recv_timer->enabled(), "attempted to receive while receive already in progress");
+ if (m_recv_timer->enabled())
+ throw emu_fatalerror("%s(%s): attempted to receive while receive already in progress", device().shortname(), device().tag());
int result = 0;
diff --git a/src/emu/dipalette.cpp b/src/emu/dipalette.cpp
index 76c0c0f1c82..b5ceeb05d4c 100644
--- a/src/emu/dipalette.cpp
+++ b/src/emu/dipalette.cpp
@@ -345,7 +345,8 @@ void device_palette_interface::allocate_palette(u32 numentries)
m_shadow_group = numgroups++;
if (palette_hilights_enabled())
m_hilight_group = numgroups++;
- assert_always(numentries * numgroups <= 65536, "Palette has more than 65536 colors.");
+ if (numentries * numgroups > 65536)
+ throw emu_fatalerror("%s(%s): Palette has more than 65536 colors.", device().shortname(), device().tag());
// allocate a palette object containing all the colors and groups
m_palette = palette_t::alloc(numentries, numgroups);
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 07a48404ab3..4c8b9c96056 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -220,18 +220,6 @@ inline TYPE &operator|=(TYPE &a, TYPE b) { return a = a | b; }
#define FUNC(x) &x, #x
-// standard assertion macros
-#undef assert_always
-
-#if defined(MAME_DEBUG_FAST)
-#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("%s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
-#elif defined(MAME_DEBUG)
-#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("%s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
-#else
-#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("%s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
-#endif
-
-
// macros to convert radians to degrees and degrees to radians
template <typename T> constexpr auto RADIAN_TO_DEGREE(T const &x) { return (180.0 / M_PI) * x; }
template <typename T> constexpr auto DEGREE_TO_RADIAN(T const &x) { return (M_PI / 180.0) * x; }
diff --git a/src/emu/emupal.cpp b/src/emu/emupal.cpp
index f401a4b8cb4..6d0955f3484 100644
--- a/src/emu/emupal.cpp
+++ b/src/emu/emupal.cpp
@@ -506,7 +506,8 @@ void palette_device::device_start()
const memory_share *share_ext = memshare(tag_ext.c_str());
// make sure we have specified a format
- assert_always(m_raw_to_rgb.bytes_per_entry() > 0, "Palette has memory share but no format specified");
+ if (m_raw_to_rgb.bytes_per_entry() <= 0)
+ throw emu_fatalerror("palette_device(%s): Palette has memory share but no format specified", tag());
// determine bytes per entry and configure
int bytes_per_entry = m_raw_to_rgb.bytes_per_entry();
@@ -522,7 +523,8 @@ void palette_device::device_start()
if (m_membits_supplied)
{
// forcing width only makes sense when narrower than the native bus width
- assert_always(m_membits < share->bitwidth(), "Improper use of MCFG_PALETTE_MEMBITS");
+ if (m_membits >= share->bitwidth())
+ throw emu_fatalerror("palette_device(%s): Improper use of MCFG_PALETTE_MEMBITS", tag());
m_paletteram.set_membits(m_membits);
if (share_ext != nullptr)
m_paletteram_ext.set_membits(m_membits);
@@ -532,7 +534,8 @@ void palette_device::device_start()
if (m_endianness_supplied)
{
// forcing endianness only makes sense when the RAM is narrower than the palette format and not split
- assert_always((share_ext == nullptr && m_paletteram.membits() / 8 < bytes_per_entry), "Improper use of MCFG_PALETTE_ENDIANNESS");
+ if (share_ext || (m_paletteram.membits() / 8) >= bytes_per_entry)
+ throw emu_fatalerror("palette_device(%s): Improper use of MCFG_PALETTE_ENDIANNESS", tag());
m_paletteram.set_endianness(m_endianness);
}
}
diff --git a/src/emu/inputdev.cpp b/src/emu/inputdev.cpp
index 62aa1428b21..a9e8fee7491 100644
--- a/src/emu/inputdev.cpp
+++ b/src/emu/inputdev.cpp
@@ -277,7 +277,8 @@ input_device::~input_device()
input_item_id input_device::add_item(const char *name, input_item_id itemid, item_get_state_func getstate, void *internal)
{
- assert_always(machine().phase() == machine_phase::INIT, "Can only call input_device::add_item at init time!");
+ if (machine().phase() != machine_phase::INIT)
+ throw emu_fatalerror("Can only call input_device::add_item at init time!");
assert(name != nullptr);
assert(itemid > ITEM_ID_INVALID && itemid < ITEM_ID_MAXIMUM);
assert(getstate != nullptr);
@@ -494,7 +495,8 @@ input_class::~input_class()
input_device *input_class::add_device(const char *name, const char *id, void *internal)
{
- assert_always(machine().phase() == machine_phase::INIT, "Can only call input_class::add_device at init time!");
+ if (machine().phase() != machine_phase::INIT)
+ throw emu_fatalerror("Can only call input_class::add_device at init time!");
assert(name != nullptr);
assert(id != nullptr);
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index c65a5cb582b..e74502439fe 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -1468,7 +1468,8 @@ ioport_field *ioport_port::field(ioport_value mask) const
ioport_value ioport_port::read()
{
- assert_always(manager().safe_to_read(), "Input ports cannot be read at init time!");
+ if (!manager().safe_to_read())
+ throw emu_fatalerror("Input ports cannot be read at init time!");
// start with the digital state
ioport_value result = m_live->digital;
@@ -2716,7 +2717,8 @@ void ioport_manager::record_init()
// open the record file
osd_file::error filerr = m_record_file.open(filename);
- assert_always(filerr == osd_file::error::NONE, "Failed to open file for recording");
+ if (filerr != osd_file::error::NONE)
+ throw emu_fatalerror("ioport_manager::record_init: Failed to open file for recording");
// get the base time
system_time systime;
@@ -2738,15 +2740,18 @@ void ioport_manager::record_init()
}
-void ioport_manager::timecode_init() {
+void ioport_manager::timecode_init()
+{
// check if option -record_timecode is enabled
- if (!machine().options().record_timecode()) {
+ if (!machine().options().record_timecode())
+ {
machine().video().set_timecode_enabled(false);
return;
}
// if no file, nothing to do
const char *record_filename = machine().options().record();
- if (record_filename[0] == 0) {
+ if (record_filename[0] == 0)
+ {
machine().video().set_timecode_enabled(false);
return;
}
@@ -2759,7 +2764,8 @@ void ioport_manager::timecode_init() {
osd_printf_info("Record input timecode file: %s\n", record_filename);
osd_file::error filerr = m_timecode_file.open(filename.c_str());
- assert_always(filerr == osd_file::error::NONE, "Failed to open file for input timecode recording");
+ if (filerr != osd_file::error::NONE)
+ throw emu_fatalerror("ioport_manager::timecode_init: Failed to open file for input timecode recording");
m_timecode_file.puts(std::string("# ==========================================\n").c_str());
m_timecode_file.puts(std::string("# TIMECODE FILE FOR VIDEO PREVIEW GENERATION\n").c_str());
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 0ca233a5d38..68bf7dc74d9 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -299,7 +299,8 @@ int running_machine::run(bool quiet)
{
m_logfile = std::make_unique<emu_file>(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
osd_file::error filerr = m_logfile->open("error.log");
- assert_always(filerr == osd_file::error::NONE, "unable to open log file");
+ if (filerr != osd_file::error::NONE)
+ throw emu_fatalerror("running_machine::run: unable to open log file");
using namespace std::placeholders;
add_logerror_callback(std::bind(&running_machine::logfile_callback, this, _1));
@@ -771,9 +772,10 @@ void running_machine::toggle_pause()
void running_machine::add_notifier(machine_notification event, machine_notify_delegate callback, bool first)
{
- assert_always(m_current_phase == machine_phase::INIT, "Can only call add_notifier at init time!");
+ if (m_current_phase != machine_phase::INIT)
+ throw emu_fatalerror("Can only call running_machine::add_notifier at init time!");
- if(first)
+ if (first)
m_notifier_list[event].push_front(std::make_unique<notifier_callback_item>(callback));
// exit notifiers are added to the head, and executed in reverse order
@@ -793,8 +795,9 @@ void running_machine::add_notifier(machine_notification event, machine_notify_de
void running_machine::add_logerror_callback(logerror_callback callback)
{
- assert_always(m_current_phase == machine_phase::INIT, "Can only call add_logerror_callback at init time!");
- m_string_buffer.reserve(1024);
+ if (m_current_phase != machine_phase::INIT)
+ throw emu_fatalerror("Can only call running_machine::add_logerror_callback at init time!");
+ m_string_buffer.reserve(1024);
m_logerror_list.push_back(std::make_unique<logerror_callback_item>(callback));
}
diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h
index d8cc9cfb8ff..41b33ace105 100644
--- a/src/emu/natkeyboard.h
+++ b/src/emu/natkeyboard.h
@@ -72,8 +72,8 @@ private:
// internal keyboard code information
struct keycode_map_entry
{
- std::array<ioport_field *, SHIFT_COUNT + 1> field;
- unsigned shift;
+ std::array<ioport_field *, SHIFT_COUNT + 1> field;
+ unsigned shift;
};
typedef std::unordered_map<char32_t, keycode_map_entry> keycode_map;
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 415906b3809..58d2c2961c9 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -460,7 +460,8 @@ void render_texture::get_scaled(u32 dwidth, u32 dheight, render_texinfo &texinfo
for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
if ((lowest == -1 || m_scaled[scalenum].seqid < m_scaled[lowest].seqid) && !primlist.has_reference(m_scaled[scalenum].bitmap))
lowest = scalenum;
- assert_always(lowest != -1, "Too many live texture instances!");
+ if (-1 == lowest)
+ throw emu_fatalerror("render_texture::get_scaled: Too many live texture instances!");
// throw out any existing entries
scaled = &m_scaled[lowest];
@@ -2711,7 +2712,8 @@ bool render_target::remove_clear_extent(const render_bounds &bounds)
// make a copy of this extent
memmove(&ext[ext[1] + 2], &ext[0], (last - ext) * sizeof(*ext));
last += ext[1] + 2;
- assert_always(last < max, "Ran out of clear extents!\n");
+ if (last >= max)
+ throw emu_fatalerror("render_target::remove_clear_extent: Ran out of clear extents!");
// split the extent between pieces
ext[ext[1] + 2] = -(-ext[0] - diff);
@@ -2731,7 +2733,8 @@ bool render_target::remove_clear_extent(const render_bounds &bounds)
// make a copy of this extent
memmove(&ext[ext[1] + 2], &ext[0], (last - ext) * sizeof(*ext));
last += ext[1] + 2;
- assert_always(last < max, "Ran out of clear extents!\n");
+ if (last >= max)
+ throw emu_fatalerror("render_target::remove_clear_extent: Ran out of clear extents!");
// split the extent between pieces
ext[ext[1] + 2] = -diff;
@@ -2756,7 +2759,8 @@ bool render_target::remove_clear_extent(const render_bounds &bounds)
memmove(&xext[2], &xext[0], (last - xext) * sizeof(*xext));
last += 2;
linelast += 2;
- assert_always(last < max, "Ran out of clear extents!\n");
+ if (last >= max)
+ throw emu_fatalerror("render_target::remove_clear_extent: Ran out of clear extents!");
// split this extent into three parts
xext[0] = boundsx0 - x0;
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 98d049be8ae..0ae11f85b9b 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -209,6 +209,7 @@ public:
void set_native_aspect() { assert(!configured()); m_phys_aspect = std::make_pair(~0U, ~0U); }
void set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
{
+ assert(pixclock != 0);
m_clock = pixclock;
m_refresh = HZ_TO_ATTOSECONDS(pixclock) * htotal * vtotal;
m_vblank = m_refresh / vtotal * (vtotal - (vbstart - vbend));
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index df63d06c5c8..083b4b4ef5a 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -9,9 +9,10 @@
***************************************************************************/
#include "emu.h"
-#include "screen.h"
#include "tilemap.h"
+#include "screen.h"
+
//**************************************************************************
// INLINE FUNCTIONS
@@ -896,7 +897,6 @@ u8 tilemap_t::tile_apply_bitmask(const u8 *maskdata, u32 x0, u32 y0, u8 category
void tilemap_t::configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, u32 flags, u8 priority, u8 priority_mask)
{
// set the target bitmap
- assert(priority_bitmap.cliprect().contains(cliprect));
blit.priority = &priority_bitmap;
blit.cliprect = cliprect;
@@ -947,6 +947,8 @@ void tilemap_t::draw_common(screen_device &screen, _BitmapClass &dest, const rec
g_profiler.start(PROFILER_TILEMAP_DRAW);
// configure the blit parameters based on the input parameters
+ assert(dest.cliprect().contains(cliprect));
+ assert(screen.cliprect().contains(cliprect));
blit_parameters blit;
configure_blit_parameters(blit, screen.priority(), cliprect, flags, priority, priority_mask);
@@ -1082,6 +1084,8 @@ void tilemap_t::draw_roz_common(screen_device &screen, _BitmapClass &dest, const
g_profiler.start(PROFILER_TILEMAP_DRAW_ROZ);
// configure the blit parameters
+ assert(dest.cliprect().contains(cliprect));
+ assert(screen.cliprect().contains(cliprect));
blit_parameters blit;
configure_blit_parameters(blit, screen.priority(), cliprect, flags, priority, priority_mask);
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 185311c389a..a116f019c6c 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -298,11 +298,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_EMU_TILEMAP_H
#define MAME_EMU_TILEMAP_H
+#pragma once
+
//**************************************************************************
// CONSTANTS
diff --git a/src/emu/video/generic.cpp b/src/emu/video/generic.cpp
index 44d8f124a38..b43c9d8fa9d 100644
--- a/src/emu/video/generic.cpp
+++ b/src/emu/video/generic.cpp
@@ -143,9 +143,9 @@ const gfx_layout gfx_16x16x4_packed_lsb =
GFXLAYOUT_RAW(gfx_16x16x8_raw, 16, 16, 16*8, 16*16*8);
/*
- 16x16; grouped of 4 8x8 tiles (row align)
- 0 1
- 2 3
+ 16x16; grouped of 4 8x8 tiles (row align)
+ 0 1
+ 2 3
*/
const gfx_layout gfx_8x8x4_row_2x2_group_packed_msb =
{
@@ -173,9 +173,9 @@ const gfx_layout gfx_8x8x4_row_2x2_group_packed_lsb =
};
/*
- 16x16; grouped of 4 8x8 tiles (col align)
- 0 2
- 1 3
+ 16x16; grouped of 4 8x8 tiles (col align)
+ 0 2
+ 1 3
*/
const gfx_layout gfx_8x8x4_col_2x2_group_packed_msb =
{
diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp
index 5a0f52b0819..e0b6c0c2229 100644
--- a/src/emu/xtal.cpp
+++ b/src/emu/xtal.cpp
@@ -331,7 +331,7 @@ const double XTAL::known_xtals[] = {
29'491'200, /* 29.4912_MHz_XTAL Xerox Alto-II system clock (tagged 29.4MHz in the schematics) */
30'000'000, /* 30_MHz_XTAL Impera Magic Card */
30'209'800, /* 30.2098_MHz_XTAL Philips CD-i NTSC (1920x NTSC line rate) */
- 30'476'100, /* 30.4761_MHz_XTAL Taito JC */
+ 30'476'180, /* 30.47618_MHz_XTAL Taito F3, JC, Under Fire */
30'800'000, /* 30.8_MHz_XTAL 15IE-00-013 */
31'279'500, /* 31.2795_MHz_XTAL Wyse WY-30+ */
31'684'000, /* 31.684_MHz_XTAL TeleVideo TVI-955 132-column display clock */
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp
index 47f1a71c595..1ab0b81874f 100644
--- a/src/frontend/mame/mameopts.cpp
+++ b/src/frontend/mame/mameopts.cpp
@@ -143,7 +143,7 @@ void mame_options::parse_one_ini(emu_options &options, const char *basename, int
catch (options_exception &ex)
{
if (error_stream)
- util::stream_format(*error_stream, "While parsing %s:\n%s\n", ex.message(), file.fullpath(), ex.message());
+ util::stream_format(*error_stream, "While parsing %s:\n%s\n", file.fullpath(), ex.message());
return;
}
diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp
index f45d2823ff5..b9685d8e40f 100644
--- a/src/lib/formats/ap2_dsk.cpp
+++ b/src/lib/formats/ap2_dsk.cpp
@@ -678,6 +678,10 @@ bool a2_16sect_format::load(io_generic *io, uint32_t form_factor, floppy_image *
{
m_prodos_order = true;
}
+ else if (!memcmp("PRODOS", &sector_data[0x40], 6))
+ {
+ m_prodos_order = true;
+ }
}
fpos += 256*16;
diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile
index 08c7a309ea6..4df755e5396 100644
--- a/src/lib/netlist/build/makefile
+++ b/src/lib/netlist/build/makefile
@@ -22,7 +22,8 @@ TIDY_FLAGSX += -modernize-pass-by-value,-cppcoreguidelines-pro-type-static-cast-
TIDY_FLAGSX += -cppcoreguidelines-avoid-magic-numbers,
TIDY_FLAGSX += -cppcoreguidelines-macro-usage,
TIDY_FLAGSX += -cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,
-TIDY_FLAGSX += -bugprone-macro-parentheses,-misc-macro-parentheses
+TIDY_FLAGSX += -bugprone-macro-parentheses,-misc-macro-parentheses,
+TIDY_FLAGSX += -modernize-use-trailing-return-type
space :=
space +=
@@ -234,7 +235,7 @@ gcc9:
$(MAKE) CC=g++-9 LD=g++-9 CEXTRAFLAGS="-march=native -msse4.2 -Wall -Wpedantic -Wsign-compare -Wextra "
clang:
- $(MAKE) CC=clang++-9 LD=clang++-9 CEXTRAFLAGS="-march=native -Weverything -Werror -Wno-padded -Wno-weak-vtables -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors"
+ $(MAKE) CC=clang++-10 LD=clang++-10 CEXTRAFLAGS="-march=native -Weverything -Werror -Wno-padded -Wno-weak-vtables -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors"
clang-5:
$(MAKE) CC=clang++-5.0 LD=clang++-5.0 CEXTRAFLAGS="-march=native -Weverything -Werror -Wno-inconsistent-missing-destructor-override -Wno-unreachable-code -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wconversion -Wno-c++98-compat -Wno-float-equal -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-weak-template-vtables -Wno-exit-time-destructors"
diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp
index 6b1b3d8efc1..c8569f473c3 100644
--- a/src/lib/netlist/devices/nld_log.cpp
+++ b/src/lib/netlist/devices/nld_log.cpp
@@ -19,9 +19,13 @@ namespace netlist
{
NETLIB_CONSTRUCTOR(log)
, m_I(*this, "I")
- , m_strm(pstring(plib::pfmt("{1}.log")(this->name())))
+ , m_strm(plib::filesystem::u8path(plib::pfmt("{1}.log")(this->name())))
, m_writer(&m_strm)
{
+ if (m_strm.fail())
+ throw plib::file_open_e(plib::pfmt("{1}.log")(this->name()));
+
+ m_strm.imbue(std::locale::classic());
}
NETLIB_UPDATEI()
@@ -33,7 +37,7 @@ namespace netlist
NETLIB_RESETI() { }
protected:
analog_input_t m_I;
- plib::pofilestream m_strm;
+ std::ofstream m_strm;
plib::putf8_writer m_writer;
};
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index 64f9daefcd5..89a525ef69f 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -184,7 +184,7 @@ namespace devices
{
// FIXME: use pstonum_ne
//pati[i] = plib::pstonum<decltype(pati[i])>(pat[i]);
- pati[i] = plib::pstonum<std::int64_t, true>(pat[i]);
+ pati[i] = plib::pstonum<std::int64_t>(pat[i]);
total += pati[i];
}
netlist_time ttotal = netlist_time::zero();
diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp
index 36c850c1ae5..c62c67da3c1 100644
--- a/src/lib/netlist/devices/nlid_truthtable.cpp
+++ b/src/lib/netlist/devices/nlid_truthtable.cpp
@@ -401,7 +401,7 @@ void truthtable_parser::parse(const std::vector<pstring> &truthtable)
else
nl_assert_always(outs == "0", "Unknown value (not 0 or 1");
// FIXME: error handling
- netlist_time t = netlist_time::from_nsec(plib::pstonum<std::int64_t, true>(plib::trim(times[j])));
+ netlist_time t = netlist_time::from_nsec(plib::pstonum<std::int64_t>(plib::trim(times[j])));
uint_least8_t k=0;
while (m_timing_nt[k] != netlist_time::zero() && m_timing_nt[k] != t)
k++;
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index 81936490a66..851c7b8059f 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -20,7 +20,7 @@
#include "nl_errstr.h"
#include <cmath>
-#include <cstring>
+//#include <cstring>
#include <limits>
namespace netlist
@@ -256,22 +256,23 @@ void netlist_state_t::rebuild_lists()
void netlist_state_t::compile_defines(std::vector<std::pair<pstring, pstring>> &defs)
{
-#define ENTRY(x) { #x, PSTRINGIFY(x) }
- defs.push_back(ENTRY(PHAS_RDTSCP));
- defs.push_back(ENTRY(PUSE_ACCURATE_STATS));
- defs.push_back(ENTRY(PHAS_INT128));
- defs.push_back(ENTRY(USE_ALIGNED_OPTIMIZATIONS));
- defs.push_back(ENTRY(NVCCBUILD));
- defs.push_back(ENTRY(USE_MEMPOOL));
- defs.push_back(ENTRY(USE_QUEUE_STATS));
- defs.push_back(ENTRY(USE_COPY_INSTEAD_OF_REFERENCE));
- defs.push_back(ENTRY(USE_TRUTHTABLE_7448));
- defs.push_back(ENTRY(NL_DEBUG));
- defs.push_back(ENTRY(HAS_OPENMP));
- defs.push_back(ENTRY(USE_OPENMP));
-
- defs.push_back(ENTRY(PPMF_TYPE));
- defs.push_back(ENTRY(PHAS_PMF_INTERNAL));
+//#define ENTRY(x) { #x, PSTRINGIFY(x) }
+#define ENTRY(x) std::pair<pstring, pstring>(#x, PSTRINGIFY(x))
+ defs.emplace_back(ENTRY(PHAS_RDTSCP));
+ defs.emplace_back(ENTRY(PUSE_ACCURATE_STATS));
+ defs.emplace_back(ENTRY(PHAS_INT128));
+ defs.emplace_back(ENTRY(USE_ALIGNED_OPTIMIZATIONS));
+ defs.emplace_back(ENTRY(NVCCBUILD));
+ defs.emplace_back(ENTRY(USE_MEMPOOL));
+ defs.emplace_back(ENTRY(USE_QUEUE_STATS));
+ defs.emplace_back(ENTRY(USE_COPY_INSTEAD_OF_REFERENCE));
+ defs.emplace_back(ENTRY(USE_TRUTHTABLE_7448));
+ defs.emplace_back(ENTRY(NL_DEBUG));
+ defs.emplace_back(ENTRY(HAS_OPENMP));
+ defs.emplace_back(ENTRY(USE_OPENMP));
+
+ defs.emplace_back(ENTRY(PPMF_TYPE));
+ defs.emplace_back(ENTRY(PHAS_PMF_INTERNAL));
#undef ENTRY
}
@@ -1032,7 +1033,7 @@ nl_double param_model_t::value(const pstring &entity)
}
-plib::unique_ptr<plib::pistream> param_data_t::stream()
+plib::unique_ptr<std::istream> param_data_t::stream()
{
return device().setup().get_data_stream(str());
}
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index 2ee60c68546..eb796bf7834 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -1119,7 +1119,7 @@ namespace netlist
{
}
- plib::unique_ptr<plib::pistream> stream();
+ plib::unique_ptr<std::istream> stream();
protected:
void changed() override { }
};
@@ -1139,7 +1139,7 @@ namespace netlist
protected:
void changed() override
{
- stream()->read(reinterpret_cast<plib::pistream::value_type *>(&m_data[0]),1<<AW);
+ stream()->read(reinterpret_cast<std::istream::char_type *>(&m_data[0]),1<<AW);
}
private:
@@ -1634,7 +1634,7 @@ namespace netlist
{
auto f = stream();
if (f != nullptr)
- f->read(reinterpret_cast<plib::pistream::value_type *>(&m_data[0]),1<<AW);
+ f->read(reinterpret_cast<std::istream::char_type *>(&m_data[0]),1<<AW);
else
device.state().log().warning(MW_ROM_NOT_FOUND(str()));
}
diff --git a/src/lib/netlist/nl_errstr.h b/src/lib/netlist/nl_errstr.h
index 32e86bbef05..b42b7476934 100644
--- a/src/lib/netlist/nl_errstr.h
+++ b/src/lib/netlist/nl_errstr.h
@@ -142,6 +142,12 @@ namespace netlist
PERRMSGV(MW_MOSFET_THRESHOLD_VOLTAGE, 1, "Mosfet: Threshold voltage not specified for {1}")
+ // nl_tool.cpp
+
+ PERRMSGV(MF_FILE_OPEN_ERROR, 1, "Error opening file: {1}")
+
+
+
} // namespace netlist
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index 8162e769a54..447e78cfe2e 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -206,14 +206,17 @@ namespace netlist
return false;
}
- bool nlparse_t::parse_stream(plib::unique_ptr<plib::pistream> &&istrm, const pstring &name)
+ bool nlparse_t::parse_stream(plib::unique_ptr<std::istream> &&istrm, const pstring &name)
{
- return parser_t(std::move(plib::ppreprocessor(&m_defines).process(std::move(istrm))), *this).parse(name);
+ plib::ppreprocessor y(&m_defines);
+ plib::ppreprocessor &x(y.process(std::move(istrm)));
+ return parser_t(std::move(x), *this).parse(name);
+ //return parser_t(std::move(plib::ppreprocessor(&m_defines).process(std::move(istrm))), *this).parse(name);
}
void nlparse_t::add_define(const pstring &defstr)
{
- auto p = defstr.find("=");
+ auto p = defstr.find('=');
if (p != pstring::npos)
add_define(plib::left(defstr, p), defstr.substr(p+1));
else
@@ -351,7 +354,7 @@ std::vector<pstring> setup_t::get_terminals_for_device_name(const pstring &devna
if (plib::startsWith(t.second->name(), devname))
{
pstring tn(t.second->name().substr(devname.length()+1));
- if (tn.find(".") == pstring::npos)
+ if (tn.find('.') == pstring::npos)
terms.push_back(tn);
}
}
@@ -362,7 +365,7 @@ std::vector<pstring> setup_t::get_terminals_for_device_name(const pstring &devna
{
pstring tn(t.first.substr(devname.length()+1));
//printf("\t%s %s %s\n", t.first.c_str(), t.second.c_str(), tn.c_str());
- if (tn.find(".") == pstring::npos)
+ if (tn.find('.') == pstring::npos)
{
terms.push_back(tn);
pstring resolved = resolve_alias(t.first);
@@ -842,7 +845,7 @@ const log_type &setup_t::log() const
void models_t::register_model(const pstring &model_in)
{
- auto pos = model_in.find(" ");
+ auto pos = model_in.find(' ');
if (pos == pstring::npos)
throw nl_exception(MF_UNABLE_TO_PARSE_MODEL_1(model_in));
pstring model = plib::ucase(plib::trim(plib::left(model_in, pos)));
@@ -859,7 +862,7 @@ void models_t::model_parse(const pstring &model_in, model_map_t &map)
while (true)
{
- pos = model.find("(");
+ pos = model.find('(');
if (pos != pstring::npos) break;
key = plib::ucase(model);
@@ -890,7 +893,7 @@ void models_t::model_parse(const pstring &model_in, model_map_t &map)
std::vector<pstring> pairs(plib::psplit(remainder," ", true));
for (pstring &pe : pairs)
{
- auto pose = pe.find("=");
+ auto pose = pe.find('=');
if (pose == pstring::npos)
throw nl_exception(MF_MODEL_ERROR_ON_PAIR_1(model));
map[plib::ucase(plib::left(pe, pose))] = pe.substr(pose + 1);
@@ -901,7 +904,7 @@ pstring models_t::model_string(model_map_t &map)
{
pstring ret = map["COREMODEL"] + "(";
for (auto & i : map)
- ret = ret + i.first + "=" + i.second + " ";
+ ret += (i.first + '=' + i.second + ' ');
return ret + ")";
}
@@ -956,7 +959,7 @@ nl_double models_t::value(const pstring &model, const pstring &entity)
// FIXME: check for errors
//printf("%s %s %e %e\n", entity.c_str(), tmp.c_str(), plib::pstonum<nl_double>(tmp), factor);
bool err(false);
- nl_double val = plib::pstonum_ne<nl_double, true>(tmp, err);
+ auto val = plib::pstonum_ne<nl_double, true>(tmp, err);
if (err)
throw nl_exception(MF_MODEL_NUMBER_CONVERSION_ERROR(entity, tmp, "double", model));
return val * factor;
@@ -1015,7 +1018,7 @@ const logic_family_desc_t *setup_t::family_from_model(const pstring &model)
// Sources
// ----------------------------------------------------------------------------------------
-plib::unique_ptr<plib::pistream> setup_t::get_data_stream(const pstring &name)
+plib::unique_ptr<std::istream> setup_t::get_data_stream(const pstring &name)
{
for (auto &source : m_sources)
{
@@ -1027,7 +1030,7 @@ plib::unique_ptr<plib::pistream> setup_t::get_data_stream(const pstring &name)
}
}
log().warning(MW_DATA_1_NOT_FOUND(name));
- return plib::unique_ptr<plib::pistream>(nullptr);
+ return plib::unique_ptr<std::istream>(nullptr);
}
@@ -1196,22 +1199,27 @@ bool source_t::parse(nlparse_t &setup, const pstring &name)
}
}
-plib::unique_ptr<plib::pistream> source_string_t::stream(const pstring &name)
+plib::unique_ptr<std::istream> source_string_t::stream(const pstring &name)
{
plib::unused_var(name);
- return plib::make_unique<plib::pimemstream>(m_str.c_str(), std::strlen(m_str.c_str()));
+ auto ret(plib::make_unique<std::istringstream>(m_str));
+ ret->imbue(std::locale::classic());
+ return std::move(ret);
}
-plib::unique_ptr<plib::pistream> source_mem_t::stream(const pstring &name)
+plib::unique_ptr<std::istream> source_mem_t::stream(const pstring &name)
{
plib::unused_var(name);
- return plib::make_unique<plib::pimemstream>(m_str.c_str(), std::strlen(m_str.c_str()));
+ auto ret(plib::make_unique<std::istringstream>(m_str, std::ios_base::binary));
+ ret->imbue(std::locale::classic());
+ return std::move(ret);
}
-plib::unique_ptr<plib::pistream> source_file_t::stream(const pstring &name)
+plib::unique_ptr<std::istream> source_file_t::stream(const pstring &name)
{
plib::unused_var(name);
- return plib::make_unique<plib::pifilestream>(m_filename);
+ auto ret(plib::make_unique<std::ifstream>(plib::filesystem::u8path(m_filename)));
+ return std::move(ret);
}
bool source_proc_t::parse(nlparse_t &setup, const pstring &name)
@@ -1225,10 +1233,10 @@ bool source_proc_t::parse(nlparse_t &setup, const pstring &name)
return false;
}
-plib::unique_ptr<plib::pistream> source_proc_t::stream(const pstring &name)
+plib::unique_ptr<std::istream> source_proc_t::stream(const pstring &name)
{
plib::unused_var(name);
- plib::unique_ptr<plib::pistream> p(nullptr);
+ plib::unique_ptr<std::istream> p(nullptr);
return p;
}
diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h
index 7fd9cf9cd48..3650b3756a9 100644
--- a/src/lib/netlist/nl_setup.h
+++ b/src/lib/netlist/nl_setup.h
@@ -196,7 +196,7 @@ namespace netlist
type_t type() const { return m_type; }
protected:
- virtual plib::unique_ptr<plib::pistream> stream(const pstring &name) = 0;
+ virtual plib::unique_ptr<std::istream> stream(const pstring &name) = 0;
private:
const type_t m_type;
@@ -278,7 +278,7 @@ namespace netlist
bool device_exists(const pstring &name) const;
/* FIXME: used by source_t - need a different approach at some time */
- bool parse_stream(plib::unique_ptr<plib::pistream> &&istrm, const pstring &name);
+ bool parse_stream(plib::unique_ptr<std::istream> &&istrm, const pstring &name);
void add_define(const pstring &def, const pstring &val)
{
@@ -363,7 +363,7 @@ namespace netlist
void register_dynamic_log_devices();
void resolve_inputs();
- plib::unique_ptr<plib::pistream> get_data_stream(const pstring &name);
+ plib::unique_ptr<std::istream> get_data_stream(const pstring &name);
factory::list_t &factory() { return m_factory; }
const factory::list_t &factory() const { return m_factory; }
@@ -434,7 +434,7 @@ namespace netlist
}
protected:
- plib::unique_ptr<plib::pistream> stream(const pstring &name) override;
+ plib::unique_ptr<std::istream> stream(const pstring &name) override;
private:
pstring m_str;
@@ -450,7 +450,7 @@ namespace netlist
}
protected:
- plib::unique_ptr<plib::pistream> stream(const pstring &name) override;
+ plib::unique_ptr<std::istream> stream(const pstring &name) override;
private:
pstring m_filename;
@@ -465,7 +465,7 @@ namespace netlist
}
protected:
- plib::unique_ptr<plib::pistream> stream(const pstring &name) override;
+ plib::unique_ptr<std::istream> stream(const pstring &name) override;
private:
pstring m_str;
@@ -484,7 +484,7 @@ namespace netlist
bool parse(nlparse_t &setup, const pstring &name) override;
protected:
- plib::unique_ptr<plib::pistream> stream(const pstring &name) override;
+ plib::unique_ptr<std::istream> stream(const pstring &name) override;
private:
void (*m_setup_func)(nlparse_t &);
diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h
index 7d7582774b1..0f4536cbfd5 100644
--- a/src/lib/netlist/nltypes.h
+++ b/src/lib/netlist/nltypes.h
@@ -22,7 +22,7 @@
#include "plib/ptime.h"
#include "plib/putil.h"
-#include <cstdint>
+//#include <cstdint>
#include <unordered_map>
namespace netlist
diff --git a/src/lib/netlist/plib/mat_cr.h b/src/lib/netlist/plib/mat_cr.h
index 4cc027f0d8f..db791752cf1 100644
--- a/src/lib/netlist/plib/mat_cr.h
+++ b/src/lib/netlist/plib/mat_cr.h
@@ -21,7 +21,6 @@
#include <algorithm>
#include <array>
#include <cmath>
-#include <cstdlib>
#include <type_traits>
#include <vector>
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h
index 7a5431ea5ea..a9b03353b37 100644
--- a/src/lib/netlist/plib/palloc.h
+++ b/src/lib/netlist/plib/palloc.h
@@ -12,8 +12,8 @@
#include "pstring.h"
#include "ptypes.h"
-#include <cstddef>
-#include <cstdlib>
+#include <cstddef> // for std::max_align_t (usually long long)
+//#include <cstdlib>
#include <memory>
#include <type_traits>
#include <utility>
diff --git a/src/lib/netlist/plib/pchrono.cpp b/src/lib/netlist/plib/pchrono.cpp
index 953d948e062..f89df7dba07 100644
--- a/src/lib/netlist/plib/pchrono.cpp
+++ b/src/lib/netlist/plib/pchrono.cpp
@@ -3,8 +3,6 @@
#include "pchrono.h"
-#include <chrono>
-
namespace plib {
namespace chrono {
#if defined(__x86_64__) && !defined(_clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
diff --git a/src/lib/netlist/plib/pchrono.h b/src/lib/netlist/plib/pchrono.h
index 8ce0eca23b3..711e8908dfd 100644
--- a/src/lib/netlist/plib/pchrono.h
+++ b/src/lib/netlist/plib/pchrono.h
@@ -12,7 +12,7 @@
#include "ptypes.h"
#include <chrono>
-#include <cstdint>
+//#include <cstdint>
namespace plib {
namespace chrono {
diff --git a/src/lib/netlist/plib/pfmtlog.cpp b/src/lib/netlist/plib/pfmtlog.cpp
index a42546629cf..ef12e05fb1d 100644
--- a/src/lib/netlist/plib/pfmtlog.cpp
+++ b/src/lib/netlist/plib/pfmtlog.cpp
@@ -10,100 +10,136 @@
#include <algorithm>
#include <array>
-#include <cstdarg>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
+#include <cmath>
+#include <iomanip>
#include <iostream>
-#include <clocale>
namespace plib {
-pfmt &pfmt::format_element(const char *l, const unsigned cfmt_spec, ...)
+#if 0
+struct ptemporary_locale
{
- va_list ap;
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- std::array<char, 2048> buf = {0};
- std::size_t sl;
- bool found_abs = false;
- pstring old_locale(std::setlocale(LC_ALL, nullptr));
+ ptemporary_locale(std::locale tlocale)
+ : new_locale(tlocale), old_clocale(std::setlocale(LC_ALL, nullptr))
+ {
+ if (old_locale != tlocale)
+ std::locale::global(tlocale);
+ if (old_clocale != tlocale.name().c_str())
+ std::setlocale(LC_ALL, tlocale.name().c_str());
+ }
- if (old_locale != "C")
- std::setlocale(LC_ALL, "C");
+ ~ptemporary_locale()
+ {
+ if (old_clocale != new_locale.name().c_str())
+ std::setlocale(LC_ALL, old_clocale.c_str());
+ if (old_locale != new_locale)
+ std::locale::global(old_locale);
+ }
+private:
+ std::locale new_locale;
+ std::locale old_locale;
+ pstring old_clocale;
+};
+#endif
- m_arg++;
-
- do {
- pstring fmt("%");
- va_start(ap, cfmt_spec);
- found_abs = false;
- buf[0] = 0;
- pstring search("{");
- search += plib::to_string(m_arg);
- sl = search.size();
+pfmt::rtype pfmt::setfmt(std::stringstream &strm, char32_t cfmt_spec)
+{
+ pstring fmt;
+ pstring search("{");
+ search += plib::to_string(m_arg);
+ rtype r;
- auto p = m_str.find(search + ":");
- sl++; // ":"
- if (p == pstring::npos) // no further specifiers
+ r.sl = search.size();
+ r.p = m_str.find(search + ':');
+ r.sl++; // ":"
+ if (r.p == pstring::npos) // no further specifiers
+ {
+ r.p = m_str.find(search + '}');
+ if (r.p == pstring::npos) // not found try default
{
- p = m_str.find(search + "}");
- if (p == pstring::npos) // not found try default
- {
- sl = 2;
- p = m_str.find("{}");
- }
- else
- // found absolute positional place holder
- found_abs = true;
- if (p == pstring::npos)
+ r.sl = 2;
+ r.p = m_str.find("{}");
+ }
+ else
+ // found absolute positional place holder
+ r.ret = 1;
+ if (r.p == pstring::npos)
+ {
+ r.sl=2;
+ r.p = m_str.find("{:");
+ if (r.p != pstring:: npos)
{
- sl=2;
- p = m_str.find("{:");
- if (p != pstring:: npos)
+ auto p1 = m_str.find('}', r.p);
+ if (p1 != pstring::npos)
{
- auto p1 = m_str.find("}", p);
- if (p1 != pstring::npos)
- {
- sl = p1 - p + 1;
- fmt += m_str.substr(p+1, p1 - p - 1);
- }
+ r.sl = p1 - r.p + 1;
+ fmt += m_str.substr(r.p+2, p1 - r.p - 2);
}
}
}
- else
+ }
+ else
+ {
+ // found absolute positional place holder
+ auto p1 = m_str.find('}', r.p);
+ if (p1 != pstring::npos)
{
- // found absolute positional place holder
- auto p1 = m_str.find("}", p);
- if (p1 != pstring::npos)
- {
- sl = p1 - p + 1;
- fmt += ((m_arg>=10) ? m_str.substr(p+4, p1 - p - 4) : m_str.substr(p+3, p1 - p - 3));
- found_abs = true;
- }
+ r.sl = p1 - r.p + 1;
+ fmt += ((m_arg>=10) ? m_str.substr(r.p+4, p1 - r.p - 4) : m_str.substr(r.p+3, p1 - r.p - 3));
+ r.ret = 1;
}
- pstring::value_type pend = fmt.at(fmt.size() - 1);
- if (pstring("duxo").find(cfmt_spec) != pstring::npos)
+ }
+ if (r.p != pstring::npos)
+ {
+ // a.b format here ...
+ if (fmt != "" && pstring("duxofge").find(static_cast<pstring::value_type>(cfmt_spec)) != pstring::npos)
{
- if (pstring("duxo").find(pend) == pstring::npos)
- fmt += (pstring(l) + static_cast<pstring::value_type>(cfmt_spec));
+ r.pend = static_cast<char32_t>(fmt.at(fmt.size() - 1));
+ if (pstring("duxofge").find(static_cast<pstring::value_type>(r.pend)) == pstring::npos)
+ r.pend = cfmt_spec;
else
- fmt = plib::left(fmt, fmt.size() - 1) + pstring(l) + plib::right(fmt, 1);
+ fmt = plib::left(fmt, fmt.size() - 1);
+ }
+ else
+ // FIXME: Error
+ r.pend = cfmt_spec;
+
+ auto pdot(fmt.find('.'));
+
+ if (pdot==0)
+ strm << std::setprecision(pstonum<int>(fmt.substr(1)));
+ else if (pdot != pstring::npos)
+ {
+ //strm << std::setprecision(pstonum<int>(fmt.substr(pdot + 1))) << std::setw(pstonum<int>(left(fmt,pdot)));
+ strm << std::setprecision(pstonum<int>(fmt.substr(pdot + 1)));
+ r.width = pstonum<pstring::size_type>(left(fmt,pdot));
}
- else if (pstring("fge").find(cfmt_spec) != pstring::npos)
+ else if (fmt != "")
+ //strm << std::setw(pstonum<int>(fmt));
+ r.width = pstonum<pstring::size_type>(fmt);
+
+ switch (r.pend)
{
- if (pstring("fge").find(pend) == pstring::npos)
- fmt += cfmt_spec;
+ case 'x':
+ strm << std::hex;
+ break;
+ case 'o':
+ strm << std::oct;
+ break;
+ case 'f':
+ strm << std::fixed;
+ break;
+ case 'e':
+ strm << std::scientific;
+ break;
+ default:
+ break;
}
- else
- fmt += cfmt_spec;
- std::vsnprintf(buf.data(), buf.size(), fmt.c_str(), ap);
- if (p != pstring::npos)
- m_str = m_str.substr(0, p) + pstring(buf.data()) + m_str.substr(p + sl);
- va_end(ap);
- } while (found_abs);
- if (old_locale != "C")
- std::setlocale(LC_ALL, old_locale.c_str());
- return *this;
+ }
+ else
+ r.ret = -1;
+ return r;
+
}
} // namespace plib
diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h
index 749027bf95e..531b76fafe7 100644
--- a/src/lib/netlist/plib/pfmtlog.h
+++ b/src/lib/netlist/plib/pfmtlog.h
@@ -12,6 +12,8 @@
#include "putil.h"
#include <limits>
+#include <locale>
+#include <sstream>
namespace plib {
@@ -28,7 +30,6 @@ struct ptype_traits_base
{
static const T cast(const T &x) { return x; }
static const bool is_signed = std::numeric_limits<T>::is_signed;
- static const char *size_spec() { return ""; }
static char32_t fmt_spec() { return 'u'; }
};
@@ -37,7 +38,6 @@ struct ptype_traits_base<bool>
{
static unsigned int cast(const bool &x) { return static_cast<unsigned int>(x); }
static const bool is_signed = std::numeric_limits<bool>::is_signed;
- static const char *size_spec() { return ""; }
static char32_t fmt_spec() { return 'u'; }
};
@@ -52,14 +52,12 @@ struct ptype_traits<bool> : ptype_traits_base<bool>
template<>
struct ptype_traits<char> : ptype_traits_base<char>
{
- static const char *size_spec() { return "h"; }
static char32_t fmt_spec() { return is_signed ? 'd' : 'u'; }
};
template<>
struct ptype_traits<short> : ptype_traits_base<short>
{
- static const char *size_spec() { return "h"; }
static char32_t fmt_spec() { return 'd'; }
};
@@ -72,35 +70,30 @@ struct ptype_traits<int> : ptype_traits_base<int>
template<>
struct ptype_traits<long> : ptype_traits_base<long>
{
- static const char *size_spec() { return "l"; }
static char32_t fmt_spec() { return 'd'; }
};
template<>
struct ptype_traits<long long> : ptype_traits_base<long long>
{
- static const char *size_spec() { return "ll"; }
static char32_t fmt_spec() { return 'd'; }
};
template<>
struct ptype_traits<signed char> : ptype_traits_base<signed char>
{
- static const char *size_spec() { return "h"; }
static char32_t fmt_spec() { return 'd'; }
};
template<>
struct ptype_traits<unsigned char> : ptype_traits_base<unsigned char>
{
- static const char *size_spec() { return "h"; }
static char32_t fmt_spec() { return 'u'; }
};
template<>
struct ptype_traits<unsigned short> : ptype_traits_base<unsigned short>
{
- static const char *size_spec() { return "h"; }
static char32_t fmt_spec() { return 'u'; }
};
@@ -113,14 +106,12 @@ struct ptype_traits<unsigned int> : ptype_traits_base<unsigned int>
template<>
struct ptype_traits<unsigned long> : ptype_traits_base<unsigned long>
{
- static const char *size_spec() { return "l"; }
static char32_t fmt_spec() { return 'u'; }
};
template<>
struct ptype_traits<unsigned long long> : ptype_traits_base<unsigned long long>
{
- static const char *size_spec() { return "ll"; }
static char32_t fmt_spec() { return 'u'; }
};
@@ -154,41 +145,45 @@ class pfmt
{
public:
explicit pfmt(const pstring &fmt)
- : m_str(fmt), m_arg(0)
+ : m_str(fmt), m_locale(std::locale::classic()), m_arg(0)
{
}
+ explicit pfmt(const std::locale &loc, const pstring &fmt)
+ : m_str(fmt), m_locale(loc), m_arg(0)
+ {
+ }
+
COPYASSIGNMOVE(pfmt, default)
~pfmt() noexcept = default;
operator pstring() const { return m_str; }
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- pfmt & e(const double &x) {return format_element("", 'e', x); }
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- pfmt & g(const double &x) {return format_element("", 'g', x); }
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- pfmt & e(const float &x) {return format_element("", 'e', static_cast<double>(x)); }
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- pfmt & g(const float &x) {return format_element("", 'g', static_cast<double>(x)); }
+ template <typename T>
+ typename std::enable_if<std::is_floating_point<T>::value, pfmt &>::type
+ f(const T &x) {return format_element('f', x); }
+
+ template <typename T>
+ typename std::enable_if<std::is_floating_point<T>::value, pfmt &>::type
+ e(const T &x) {return format_element('e', x); }
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- pfmt &operator ()(const void *x) {return format_element("", 'p', x); }
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- pfmt &operator ()(const pstring &x) {return format_element("", 's', x.c_str() ); }
+ template <typename T>
+ typename std::enable_if<std::is_floating_point<T>::value, pfmt &>::type
+ g(const T &x) {return format_element('g', x); }
+
+ pfmt &operator ()(const void *x) {return format_element('p', x); }
+ pfmt &operator ()(const pstring &x) {return format_element('s', x.c_str() ); }
template<typename T>
pfmt &operator ()(const T &x)
{
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- return format_element(ptype_traits<T>::size_spec(), ptype_traits<T>::fmt_spec(), ptype_traits<T>::cast(x));
+ return format_element(ptype_traits<T>::fmt_spec(), ptype_traits<T>::cast(x));
}
template<typename T>
pfmt &operator ()(const T *x)
{
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- return format_element(ptype_traits<T *>::size_spec(), ptype_traits<T *>::fmt_spec(), ptype_traits<T *>::cast(x));
+ return format_element(ptype_traits<T *>::fmt_spec(), ptype_traits<T *>::cast(x));
}
pfmt &operator ()()
@@ -204,26 +199,70 @@ public:
}
template<typename T>
- pfmt &x(const T &x)
+ typename std::enable_if<std::is_integral<T>::value, pfmt &>::type
+ x(const T &x)
{
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- return format_element(ptype_traits<T>::size_spec(), 'x', x);
+ return format_element('x', x);
}
template<typename T>
- pfmt &o(const T &x)
+ typename std::enable_if<std::is_integral<T>::value, pfmt &>::type
+ o(const T &x)
+ {
+ return format_element('o', x);
+ }
+
+ friend std::ostream& operator<<(std::ostream &ostrm, const pfmt &fmt)
{
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- return format_element(ptype_traits<T>::size_spec(), 'o', x);
+ ostrm << fmt.m_str;
+ return ostrm;
}
protected:
- pfmt &format_element(const char *l, const unsigned fmt_spec, ...);
+ struct rtype
+ {
+ rtype() : ret(0), p(0), sl(0), pend(0), width(0) {}
+ int ret;
+ pstring::size_type p;
+ pstring::size_type sl;
+ char32_t pend;
+ pstring::size_type width;
+
+ };
+ rtype setfmt(std::stringstream &strm, char32_t cfmt_spec);
+
+ template <typename T>
+ pfmt &format_element(const char32_t cfmt_spec, T &&val)
+ {
+ rtype ret;
+
+ m_arg++;
+
+ do {
+ std::stringstream strm;
+ strm.imbue(m_locale);
+ ret = setfmt(strm, cfmt_spec);
+ if (ret.ret>=0)
+ {
+ strm << std::forward<T>(val);
+ const pstring ps(strm.str());
+ pstring pad("");
+ if (ret.width > ps.length())
+ pad = pstring(ret.width - ps.length(), ' ');
+
+ m_str = m_str.substr(0, ret.p) + pad + ps + m_str.substr(ret.p + ret.sl);
+ }
+ } while (ret.ret == 1);
+
+ return *this;
+ }
+
private:
pstring m_str;
+ std::locale m_locale;
unsigned m_arg;
};
diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp
index 46bce2b4901..efbdcee6b6b 100644
--- a/src/lib/netlist/plib/pfunction.cpp
+++ b/src/lib/netlist/plib/pfunction.cpp
@@ -63,7 +63,7 @@ void pfunction::compile_postfix(const std::vector<pstring> &inputs,
if (inputs[i] == cmd)
{
rc.m_cmd = PUSH_INPUT;
- rc.m_param = i;
+ rc.m_param = static_cast<double>(i);
stk += 1;
break;
}
diff --git a/src/lib/netlist/plib/pmain.cpp b/src/lib/netlist/plib/pmain.cpp
index b381d96dca7..1ecf0a4d032 100644
--- a/src/lib/netlist/plib/pmain.cpp
+++ b/src/lib/netlist/plib/pmain.cpp
@@ -35,10 +35,8 @@ namespace plib {
app::app()
: options()
- , pout_strm()
- , perr_strm()
- , pout(&pout_strm)
- , perr(&perr_strm)
+ , pout(&std::cout)
+ , perr(&std::cerr)
{
}
diff --git a/src/lib/netlist/plib/pmain.h b/src/lib/netlist/plib/pmain.h
index 4f4be779251..cfa73844f57 100644
--- a/src/lib/netlist/plib/pmain.h
+++ b/src/lib/netlist/plib/pmain.h
@@ -16,10 +16,10 @@
#include "pstring.h"
#include "putil.h"
-#include <cwchar>
#include <memory>
#ifdef _WIN32
+#include <cwchar>
#define PMAIN(appclass) \
extern "C" int wmain(int argc, wchar_t *argv[]) { return plib::app::mainrun<appclass, wchar_t>(argc, argv); }
#else
@@ -45,9 +45,6 @@ namespace plib {
virtual pstring usage() = 0;
virtual int execute() = 0;
- plib::pstdout pout_strm;
- plib::pstderr perr_strm;
-
plib::putf8_fmt_writer pout;
plib::putf8_fmt_writer perr;
diff --git a/src/lib/netlist/plib/pmatrix2d.h b/src/lib/netlist/plib/pmatrix2d.h
index eab533688d7..7d6072fc358 100644
--- a/src/lib/netlist/plib/pmatrix2d.h
+++ b/src/lib/netlist/plib/pmatrix2d.h
@@ -14,7 +14,7 @@
#include <algorithm>
#include <cmath>
-#include <cstdlib>
+//#include <cstdlib>
#include <type_traits>
#include <vector>
diff --git a/src/lib/netlist/plib/pmempool.h b/src/lib/netlist/plib/pmempool.h
index a341249f1eb..769d2f653b5 100644
--- a/src/lib/netlist/plib/pmempool.h
+++ b/src/lib/netlist/plib/pmempool.h
@@ -15,7 +15,7 @@
#include "putil.h"
#include <algorithm>
-#include <cstddef>
+//#include <cstddef>
#include <memory>
#include <unordered_map>
#include <utility>
diff --git a/src/lib/netlist/plib/pomp.h b/src/lib/netlist/plib/pomp.h
index f8a516df485..ecd9eacc41b 100644
--- a/src/lib/netlist/plib/pomp.h
+++ b/src/lib/netlist/plib/pomp.h
@@ -10,8 +10,9 @@
#define POMP_H_
#include "pconfig.h"
+#include "ptypes.h"
-#include <cstddef>
+#include <cstdint>
#if HAS_OPENMP
#include "omp.h"
diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp
index 416b79e39d3..fa9a343815e 100644
--- a/src/lib/netlist/plib/poptions.cpp
+++ b/src/lib/netlist/plib/poptions.cpp
@@ -118,7 +118,7 @@ namespace plib {
if (has_equal_arg)
{
for (std::size_t j = 1; j < v.size() - 1; j++)
- opt_arg = opt_arg + v[j] + "=";
+ opt_arg += (v[j] + "=");
opt_arg += v[v.size()-1];
}
}
diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp
index ab065495f41..2b365f22811 100644
--- a/src/lib/netlist/plib/pparser.cpp
+++ b/src/lib/netlist/plib/pparser.cpp
@@ -9,7 +9,7 @@
#include "palloc.h"
#include "putil.h"
-#include <cstdarg>
+//#include <cstdarg>
namespace plib {
// ----------------------------------------------------------------------------------------
@@ -264,7 +264,7 @@ void ptokenizer::error(const pstring &errs)
// ----------------------------------------------------------------------------------------
ppreprocessor::ppreprocessor(defines_map_type *defines)
-: pistream()
+: std::istream(new st(this))
, m_ifflag(0)
, m_level(0)
, m_lineno(0)
@@ -296,18 +296,6 @@ void ppreprocessor::error(const pstring &err)
throw pexception("PREPRO ERROR: " + err);
}
-pstream::size_type ppreprocessor::vread(value_type *buf, const pstream::size_type n)
-{
- size_type bytes = std::min(m_buf.size() - m_pos, n);
-
- if (bytes==0)
- return 0;
-
- std::memcpy(buf, m_buf.c_str() + m_pos, bytes);
- m_pos += bytes;
- return bytes;
-}
-
#define CHECKTOK2(p_op, p_prio) \
else if (tok == # p_op) \
{ \
@@ -357,7 +345,7 @@ int ppreprocessor::expr(const std::vector<pstring> &sexpr, std::size_t &start, i
else
{
// FIXME: error handling
- val = plib::pstonum<decltype(val), true>(tok);
+ val = plib::pstonum<decltype(val)>(tok);
start++;
}
}
diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h
index 1eca20e99ad..123786602e0 100644
--- a/src/lib/netlist/plib/pparser.h
+++ b/src/lib/netlist/plib/pparser.h
@@ -12,7 +12,7 @@
#include "pstream.h"
#include "pstring.h"
-#include <cstdint>
+//#include <cstdint>
#include <unordered_map>
@@ -22,7 +22,12 @@ class ptokenizer
public:
template <typename T>
ptokenizer(T &&strm) // NOLINT(misc-forwarding-reference-overload, bugprone-forwarding-reference-overload)
- : m_strm(std::forward<T>(strm)), m_lineno(0), m_cur_line(""), m_px(m_cur_line.begin()), m_unget(0), m_string('"')
+ : m_strm(std::forward<T>(strm))
+ , m_lineno(0)
+ , m_cur_line("")
+ , m_px(m_cur_line.begin())
+ , m_unget(0)
+ , m_string('"')
{
}
@@ -120,6 +125,7 @@ public:
token_t get_token_internal();
void error(const pstring &errs);
+ putf8_reader &stream() { return m_strm; }
protected:
virtual void verror(const pstring &msg, int line_num, const pstring &line) = 0;
@@ -153,7 +159,7 @@ private:
};
-class ppreprocessor : public pistream
+class ppreprocessor : public std::istream
{
public:
@@ -169,7 +175,10 @@ public:
using defines_map_type = std::unordered_map<pstring, define_t>;
explicit ppreprocessor(defines_map_type *defines = nullptr);
- ~ppreprocessor() override = default;
+ ~ppreprocessor() override
+ {
+ delete rdbuf();
+ }
template <typename T>
ppreprocessor & process(T &&istrm)
@@ -190,7 +199,8 @@ public:
ppreprocessor(ppreprocessor &&s) noexcept
- : m_defines(std::move(s.m_defines))
+ : std::istream(new st(this))
+ , m_defines(std::move(s.m_defines))
, m_expr_sep(std::move(s.m_expr_sep))
, m_ifflag(s.m_ifflag)
, m_level(s.m_level)
@@ -204,13 +214,36 @@ public:
protected:
- size_type vread(value_type *buf, const size_type n) override;
- void vseek(const pos_type n) override
+ class st : public std::streambuf
{
- plib::unused_var(n);
- /* FIXME throw exception - should be done in base unless implemented */
- }
- pos_type vtell() const override { return m_pos; }
+ public:
+ st(ppreprocessor *strm) : m_strm(strm) { setg(nullptr, nullptr, nullptr); }
+ st(st &&rhs) noexcept : m_strm(rhs.m_strm) {}
+ int_type underflow() override
+ {
+ //printf("here\n");
+ if (this->gptr() == this->egptr())
+ {
+ /* clang reports sign error - weird */
+ std::size_t bytes = pstring_mem_t_size(m_strm->m_buf) - static_cast<std::size_t>(m_strm->m_pos);
+
+ if (bytes > m_buf.size())
+ bytes = m_buf.size();
+ std::copy(m_strm->m_buf.c_str() + m_strm->m_pos, m_strm->m_buf.c_str() + m_strm->m_pos + bytes, m_buf.data());
+ //printf("%ld\n", (long int)bytes);
+ this->setg(m_buf.data(), m_buf.data(), m_buf.data() + bytes);
+
+ m_strm->m_pos += static_cast</*pos_type*/long>(bytes);
+ }
+ return this->gptr() == this->egptr()
+ ? std::char_traits<char>::eof()
+ : std::char_traits<char>::to_int_type(*this->gptr());
+ }
+ private:
+ ppreprocessor *m_strm;
+ std::array<char_type, 1024> m_buf;
+ };
+ //friend class st;
int expr(const std::vector<pstring> &sexpr, std::size_t &start, int prio);
define_t *get_define(const pstring &name);
@@ -224,6 +257,7 @@ private:
PROCESS,
LINE_CONTINUATION
};
+
pstring process_line(pstring line);
pstring process_comments(pstring line);
@@ -234,7 +268,7 @@ private:
int m_level;
int m_lineno;
pstring_t<pu8_traits> m_buf;
- pos_type m_pos;
+ std::istream::pos_type m_pos;
state_e m_state;
pstring m_line;
bool m_comment;
diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h
index d31b238cf6d..9ee759befa4 100644
--- a/src/lib/netlist/plib/ppmf.h
+++ b/src/lib/netlist/plib/ppmf.h
@@ -10,7 +10,7 @@
#include "pconfig.h"
-#include <cstdint>
+#include <cstdint> // uintptr_t
#include <utility>
/*
diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp
index a7acdaafb52..1e805825af3 100644
--- a/src/lib/netlist/plib/pstream.cpp
+++ b/src/lib/netlist/plib/pstream.cpp
@@ -10,7 +10,7 @@
#include <algorithm>
#include <cstdio>
-#include <cstdlib>
+//#include <cstdlib>
// VS2015 prefers _dup
#ifdef _WIN32
@@ -21,278 +21,6 @@
namespace plib {
-// -----------------------------------------------------------------------------
-// pistream: input stream
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// postream: output stream
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// Input file stream
-// -----------------------------------------------------------------------------
-
-pifilestream::pifilestream(const pstring &fname)
-: pistream(0)
-, m_file(fopen(fname.c_str(), "rb"))
-, m_pos(0)
-, m_actually_close(true)
-, m_filename(fname)
-{
- if (m_file == nullptr)
- throw file_open_e(fname);
- else
- init();
-}
-
-pifilestream::pifilestream(void *file, const pstring &name, const bool do_close)
-: pistream(0), m_file(file), m_pos(0), m_actually_close(do_close), m_filename(name)
-{
- if (m_file == nullptr)
- throw null_argument_e(m_filename);
- init();
-}
-
-void pifilestream::init()
-{
- if (ftell(static_cast<FILE *>(m_file)) >= 0)
- {
- if (fseek(static_cast<FILE *>(m_file), 0, SEEK_SET) >= 0)
- set_flag(FLAG_SEEKABLE);
- }
-}
-
-pifilestream::~pifilestream()
-{
- if (m_actually_close)
- {
- fclose(static_cast<FILE *>(m_file));
- }
-}
-
-pifilestream::pos_type pifilestream::vread(value_type *buf, const pos_type n)
-{
- pos_type r = fread(buf, 1, n, static_cast<FILE *>(m_file));
- if (r < n)
- {
- if (feof(static_cast<FILE *>(m_file)))
- set_flag(FLAG_EOF);
- if (ferror(static_cast<FILE *>(m_file)))
- throw file_read_e(m_filename);
- }
- m_pos += r;
- return r;
-}
-
-void pifilestream::vseek(const pos_type n)
-{
- if (fseek(static_cast<FILE *>(m_file), static_cast<long>(n), SEEK_SET) < 0)
- throw file_e("File seek failed: {}", m_filename);
- else
- m_pos = n;
- if (feof(static_cast<FILE *>(m_file)))
- set_flag(FLAG_EOF);
- else
- clear_flag(FLAG_EOF);
- if (ferror(static_cast<FILE *>(m_file)))
- throw file_e("Generic file operation failed: {}", m_filename);
-}
-
-pifilestream::pos_type pifilestream::vtell() const
-{
- long ret = ftell(static_cast<FILE *>(m_file));
- if (ret < 0)
- {
- return m_pos;
- }
- else
- return static_cast<pos_type>(ret);
-}
-
-// -----------------------------------------------------------------------------
-// pstdin: reads from stdin
-// -----------------------------------------------------------------------------
-
-pstdin::pstdin()
-: pifilestream(stdin, "<stdin>", false)
-{
- /* nothing to do */
-}
-
-// -----------------------------------------------------------------------------
-// Output file stream
-// -----------------------------------------------------------------------------
-
-pofilestream::pofilestream(const pstring &fname)
-: postream(0), m_file(fopen(fname.c_str(), "wb")), m_pos(0), m_actually_close(true), m_filename(fname)
-{
- if (m_file == nullptr)
- throw file_open_e(m_filename);
- init();
-}
-
-pofilestream::pofilestream(void *file, const pstring &name, const bool do_close)
-: postream(0), m_file(file), m_pos(0), m_actually_close(do_close), m_filename(name)
-{
- if (m_file == nullptr)
- throw null_argument_e(m_filename);
- init();
-}
-
-void pofilestream::init()
-{
- if (ftell(static_cast<FILE *>(m_file)) >= 0)
- if (fseek(static_cast<FILE *>(m_file), 0, SEEK_SET) >= 0)
- set_flag(FLAG_SEEKABLE);
-}
-
-pofilestream::~pofilestream()
-{
- if (m_actually_close)
- {
- fflush(static_cast<FILE *>(m_file));
- fclose(static_cast<FILE *>(m_file));
- }
-}
-
-void pofilestream::vwrite(const value_type *buf, const pos_type n)
-{
- std::size_t r = fwrite(buf, 1, n, static_cast<FILE *>(m_file));
- if (r < n)
- {
- if (ferror(static_cast<FILE *>(m_file)))
- throw file_write_e(m_filename);
- }
- m_pos += r;
-}
-
-void pofilestream::vseek(const pos_type n)
-{
- if (fseek(static_cast<FILE *>(m_file), static_cast<long>(n), SEEK_SET) < 0)
- throw file_e("File seek failed: {}", m_filename);
- else
- {
- m_pos = n;
- if (ferror(static_cast<FILE *>(m_file)))
- throw file_e("Generic file operation failed: {}", m_filename);
- }
-}
-
-pstream::pos_type pofilestream::vtell() const
-{
- std::ptrdiff_t ret = ftell(static_cast<FILE *>(m_file));
- if (ret < 0)
- {
- return m_pos;
- }
- else
- return static_cast<pos_type>(ret);
-}
-
-// -----------------------------------------------------------------------------
-// pstderr: write to stderr
-// -----------------------------------------------------------------------------
-
-pstderr::pstderr()
-#ifdef _WIN32
-: pofilestream(fdopen(_dup(fileno(stderr)), "wb"), "<stderr>", true)
-#else
-: pofilestream(fdopen(dup(fileno(stderr)), "wb"), "<stderr>", true)
-#endif
-{
-}
-
-// -----------------------------------------------------------------------------
-// pstdout: write to stdout
-// -----------------------------------------------------------------------------
-
-pstdout::pstdout()
-#ifdef _WIN32
-: pofilestream(fdopen(_dup(fileno(stdout)), "wb"), "<stdout>", true)
-#else
-: pofilestream(fdopen(dup(fileno(stdout)), "wb"), "<stdout>", true)
-#endif
-{
-}
-
-// -----------------------------------------------------------------------------
-// Memory stream
-// -----------------------------------------------------------------------------
-
-pimemstream::pimemstream(const void *mem, const pos_type len)
- : pistream(FLAG_SEEKABLE), m_pos(0), m_len(len), m_mem(static_cast<const char *>(mem))
-{
-}
-
-pimemstream::pimemstream()
- : pistream(FLAG_SEEKABLE), m_pos(0), m_len(0), m_mem(static_cast<const char *>(nullptr))
-{
-}
-
-pimemstream::pimemstream(const pomemstream &ostrm)
-: pistream(FLAG_SEEKABLE), m_pos(0), m_len(ostrm.size()), m_mem(reinterpret_cast<const char *>(ostrm.memory()))
-{
-}
-
-pimemstream::pos_type pimemstream::vread(value_type *buf, const pos_type n)
-{
- pos_type ret = (m_pos + n <= m_len) ? n : m_len - m_pos;
-
- if (ret > 0)
- {
- std::copy(m_mem + m_pos, m_mem + m_pos + ret, reinterpret_cast<char *>(buf));
- m_pos += ret;
- }
-
- if (ret < n)
- set_flag(FLAG_EOF);
-
- return ret;
-}
-
-void pimemstream::vseek(const pos_type n)
-{
- m_pos = (n>=m_len) ? m_len : n;
- clear_flag(FLAG_EOF);
-
-}
-
-pimemstream::pos_type pimemstream::vtell() const
-{
- return m_pos;
-}
-
-// -----------------------------------------------------------------------------
-// Output memory stream
-// -----------------------------------------------------------------------------
-
-pomemstream::pomemstream()
-: postream(FLAG_SEEKABLE), m_pos(0), m_mem(1024)
-{
- m_mem.clear();
-}
-
-void pomemstream::vwrite(const value_type *buf, const pos_type n)
-{
- if (m_pos + n >= m_mem.size())
- m_mem.resize(m_pos + n);
-
- std::copy(buf, buf + n, &m_mem[0] + m_pos);
- m_pos += n;
-}
-
-void pomemstream::vseek(const pos_type n)
-{
- m_pos = n;
- if (m_pos>=m_mem.size())
- m_mem.resize(m_pos);
-}
-
-pstream::pos_type pomemstream::vtell() const
-{
- return m_pos;
-}
bool putf8_reader::readline(pstring &line)
{
@@ -308,7 +36,7 @@ bool putf8_reader::readline(pstring &line)
if (c == 10)
break;
else if (c != 13) /* ignore CR */
- m_linebuf += putf8string(c);
+ m_linebuf += putf8string(1, c);
if (!this->readcode(c))
break;
}
diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h
index 93497eb1423..ca21bca795a 100644
--- a/src/lib/netlist/plib/pstream.h
+++ b/src/lib/netlist/plib/pstream.h
@@ -14,423 +14,16 @@
#include "pfmtlog.h"
#include "pstring.h"
-#define USE_CSTREAM (0)
-
#include <array>
#include <type_traits>
#include <vector>
-
-#if USE_CSTREAM
+#include <ios>
#include <fstream>
-//#include <strstream>
+#include <iostream>
#include <sstream>
-#endif
namespace plib {
-#if USE_CSTREAM
-typedef std::ostream postream;
-typedef std::ofstream pofilestream;
-typedef std::ostringstream postringstream;
-typedef std::ostringstream pomemstream;
-
-#endif
-
-// -----------------------------------------------------------------------------
-// pstream: things common to all streams
-// -----------------------------------------------------------------------------
-
-class pstream
-{
-public:
-
- using pos_type = std::size_t;
- using size_type = std::size_t;
-
- static constexpr pos_type SEEK_EOF = static_cast<pos_type>(-1);
-
- COPYASSIGN(pstream, delete)
- pstream &operator=(pstream &&) noexcept = delete;
-
- bool seekable() const { return ((m_flags & FLAG_SEEKABLE) != 0); }
-
- void seekp(const pos_type n)
- {
- vseek(n);
- }
-
- pos_type tellp() const
- {
- return vtell();
- }
-
-protected:
- pstream() : m_flags(0)
- {
- }
- explicit pstream(const unsigned flags) : m_flags(flags)
- {
- }
- pstream(pstream &&src) noexcept = default;
-
- virtual ~pstream() = default;
-
- virtual void vseek(const pos_type n) = 0;
- virtual pos_type vtell() const = 0;
-
- static constexpr unsigned FLAG_EOF = 0x01;
- static constexpr unsigned FLAG_SEEKABLE = 0x04;
-
- void set_flag(const unsigned flag)
- {
- m_flags |= flag;
- }
- void clear_flag(const unsigned flag)
- {
- m_flags &= ~flag;
- }
- unsigned flags() const { return m_flags; }
-private:
-
- unsigned m_flags;
-};
-
-// -----------------------------------------------------------------------------
-// pistream: input stream
-// -----------------------------------------------------------------------------
-
-template <typename T>
-class pistream_base : public pstream
-{
-public:
-
- using value_type = T;
-
- ~pistream_base() noexcept override = default;
-
- COPYASSIGN(pistream_base, delete)
- pistream_base &operator=(pistream_base &&src) noexcept = delete;
-
- bool eof() const { return ((flags() & FLAG_EOF) != 0); }
-
- pos_type read(T *buf, const pos_type n)
- {
- return vread(buf, n);
- }
-
-protected:
- pistream_base() : pstream(0) {}
- explicit pistream_base(const unsigned flags) : pstream(flags) {}
- pistream_base(pistream_base &&src) noexcept : pstream(std::move(src)) {}
-
- /* read up to n bytes from stream */
- virtual size_type vread(T *buf, const size_type n) = 0;
-};
-
-using pistream = pistream_base<char>;
-
-// -----------------------------------------------------------------------------
-// postream: output stream
-// -----------------------------------------------------------------------------
-
-#if !USE_CSTREAM
-template <typename T>
-class postream_base : public pstream
-{
-public:
-
- using value_type = T;
-
- postream_base() = default;
- ~postream_base() noexcept override = default;
-
- COPYASSIGN(postream_base, delete)
- postream_base &operator=(postream_base &&src) noexcept = delete;
-
- void write(const T *buf, const size_type n)
- {
- vwrite(buf, n);
- }
-
-protected:
- explicit postream_base(unsigned flags) : pstream(flags) {}
- postream_base(postream_base &&src) noexcept : pstream(std::move(src)) {}
-
- /* write n bytes to stream */
- virtual void vwrite(const T *buf, const size_type n) = 0;
-
-private:
-};
-
-using postream = postream_base<char>;
-
-// -----------------------------------------------------------------------------
-// pomemstream: output string stream
-// -----------------------------------------------------------------------------
-
-class pomemstream : public postream
-{
-public:
-
- pomemstream();
-
- COPYASSIGN(pomemstream, delete)
-
- pomemstream(pomemstream &&src) noexcept
- : postream(std::move(src))
- , m_pos(src.m_pos)
- , m_mem(std::move(src.m_mem))
- {
- }
- pomemstream &operator=(pomemstream &&src) = delete;
-
- ~pomemstream() override = default;
-
- const char *memory() const { return m_mem.data(); }
- pos_type size() const { return m_mem.size(); }
-
-protected:
- /* write n bytes to stream */
- void vwrite(const value_type *buf, const pos_type) override;
- void vseek(const pos_type n) override;
- pos_type vtell() const override;
-
-private:
- pos_type m_pos;
- std::vector<char> m_mem;
-};
-
-class postringstream : public postream
-{
-public:
-
- postringstream() : postream(0) { }
- postringstream(postringstream &&src) noexcept
- : postream(std::move(src))
- , m_buf(std::move(src.m_buf))
- { src.m_buf = ""; }
-
- COPYASSIGN(postringstream, delete)
- postringstream &operator=(postringstream &&src) = delete;
-
- ~postringstream() override = default;
-
- const pstring &str() { return m_buf; }
-
-protected:
- /* write n bytes to stream */
- void vwrite(const value_type *buf, const pos_type n) override
- {
- m_buf += pstring(reinterpret_cast<const pstring::mem_t *>(buf), n);
- }
- void vseek(const pos_type n) override { unused_var(n); }
- pos_type vtell() const override { return m_buf.size(); }
-
-private:
- pstring m_buf;
-};
-
-// -----------------------------------------------------------------------------
-// pofilestream: file output stream
-// -----------------------------------------------------------------------------
-
-class pofilestream : public postream
-{
-public:
-
- pofilestream(const pstring &fname);
- pofilestream(pofilestream &&src) noexcept
- : postream(std::move(src))
- , m_file(src.m_file)
- , m_pos(src.m_pos)
- , m_actually_close(src.m_actually_close)
- , m_filename(std::move(src.m_filename))
- {
- src.m_file = nullptr;
- src.m_actually_close = false;
- }
- COPYASSIGN(pofilestream, delete)
- pofilestream &operator=(pofilestream &&src) = delete;
-
- ~pofilestream() override;
-
-protected:
- pofilestream(void *file, const pstring &name, const bool do_close);
- /* write n bytes to stream */
- void vwrite(const value_type *buf, const pos_type n) override;
- void vseek(const pos_type n) override;
- pos_type vtell() const override;
-
-private:
- void *m_file;
- pos_type m_pos;
- bool m_actually_close;
- pstring m_filename;
-
- void init();
-};
-
-// -----------------------------------------------------------------------------
-// pstderr: write to stderr
-// -----------------------------------------------------------------------------
-#endif
-
-class pstderr : public pofilestream
-{
-public:
- pstderr();
- pstderr(pstderr &&src) noexcept = default;
- pstderr &operator=(pstderr &&src) = delete;
- COPYASSIGN(pstderr, delete)
-
- ~pstderr() noexcept override= default;
-};
-
-// -----------------------------------------------------------------------------
-// pstdout: write to stdout
-// -----------------------------------------------------------------------------
-
-class pstdout : public pofilestream
-{
-public:
- pstdout();
- pstdout(pstdout &&src) noexcept = default;
- pstdout &operator=(pstdout &&src) = delete;
- COPYASSIGN(pstdout, delete)
-
- ~pstdout() noexcept override = default;
-};
-
-// -----------------------------------------------------------------------------
-// pifilestream: file input stream
-// -----------------------------------------------------------------------------
-
-class pifilestream : public pistream
-{
-public:
-
- pifilestream(const pstring &fname);
- ~pifilestream() override;
-
- pifilestream(pifilestream &&src) noexcept
- : pistream(std::move(src))
- , m_file(src.m_file)
- , m_pos(src.m_pos)
- , m_actually_close(src.m_actually_close)
- , m_filename(std::move(src.m_filename))
- {
- src.m_actually_close = false;
- src.m_file = nullptr;
- }
- COPYASSIGN(pifilestream, delete)
- pifilestream &operator=(pifilestream &&src) = delete;
-
-protected:
- pifilestream(void *file, const pstring &name, const bool do_close);
-
- /* read up to n bytes from stream */
- pos_type vread(value_type *buf, const pos_type n) override;
- void vseek(const pos_type n) override;
- pos_type vtell() const override;
-
-private:
- void *m_file;
- pos_type m_pos;
- bool m_actually_close;
- pstring m_filename;
-
- void init();
-};
-
-// -----------------------------------------------------------------------------
-// pstdin: reads from stdin
-// -----------------------------------------------------------------------------
-
-class pstdin : public pifilestream
-{
-public:
-
- pstdin();
- pstdin(pstdin &&src) noexcept = default;
- pstdin &operator=(pstdin &&src) = delete;
- COPYASSIGN(pstdin, delete)
- ~pstdin() override = default;
-};
-
-// -----------------------------------------------------------------------------
-// pimemstream: input memory stream
-// -----------------------------------------------------------------------------
-
-class pimemstream : public pistream
-{
-public:
-
- pimemstream(const void *mem, const pos_type len);
- pimemstream();
-
- pimemstream(pimemstream &&src) noexcept
- : pistream(std::move(src))
- , m_pos(src.m_pos)
- , m_len(src.m_len)
- , m_mem(src.m_mem)
- {
- src.m_mem = nullptr;
- }
- COPYASSIGN(pimemstream, delete)
- pimemstream &operator=(pimemstream &&src) = delete;
-
- explicit pimemstream(const pomemstream &ostrm);
-
- ~pimemstream() override = default;
-
- pos_type size() const { return m_len; }
-protected:
-
- void set_mem(const void *mem, const pos_type len)
- {
- m_mem = static_cast<const char *>(mem);
- m_len = len;
- }
-
- /* read up to n bytes from stream */
- pos_type vread(value_type *buf, const pos_type n) override;
- void vseek(const pos_type n) override;
- pos_type vtell() const override;
-
-private:
- pos_type m_pos;
- pos_type m_len;
- const char *m_mem;
-};
-
-// -----------------------------------------------------------------------------
-// pistringstream: input string stream
-// -----------------------------------------------------------------------------
-
-class pistringstream : public pimemstream
-{
-public:
- pistringstream(const pstring &str)
- : pimemstream()
- , m_str(str)
- {
- set_mem(m_str.c_str(), std::strlen(m_str.c_str()));
- }
- pistringstream(pistringstream &&src) noexcept
- : pimemstream(std::move(src)), m_str(src.m_str)
- {
- set_mem(m_str.c_str(), std::strlen(m_str.c_str()));
- }
- COPYASSIGN(pistringstream, delete)
- pistringstream &operator=(pistringstream &&src) = delete;
-
- ~pistringstream() override = default;
-
-private:
- /* only needed for a reference till destruction */
- const pstring m_str;
-};
-
// -----------------------------------------------------------------------------
// putf8reader_t: reader on top of istream
// -----------------------------------------------------------------------------
@@ -441,7 +34,7 @@ private:
template <typename T>
struct constructor_helper
{
- plib::unique_ptr<pistream> operator()(T &&s) { return std::move(plib::make_unique<T>(std::move(s))); }
+ plib::unique_ptr<std::istream> operator()(T &&s) { return std::move(plib::make_unique<T>(std::move(s))); }
};
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
@@ -464,39 +57,46 @@ public:
bool eof() const { return m_strm->eof(); }
bool readline(pstring &line);
- bool readbyte1(pistream::value_type &b)
+ bool readbyte1(std::istream::char_type &b)
{
- return (m_strm->read(&b, 1) == 1);
+ if (m_strm->eof())
+ return false;
+ m_strm->read(&b, 1);
+ return true;
}
-
bool readcode(putf8string::traits_type::code_t &c)
{
- std::array<pistream::value_type, 4> b{0};
- if (m_strm->read(&b[0], 1) != 1)
+ std::array<std::istream::char_type, 4> b{0};
+ if (m_strm->eof())
return false;
+ m_strm->read(&b[0], 1);
const std::size_t l = putf8string::traits_type::codelen(reinterpret_cast<putf8string::traits_type::mem_t *>(&b));
for (std::size_t i = 1; i < l; i++)
- if (m_strm->read(&b[i], 1) != 1)
+ {
+ if (m_strm->eof())
return false;
+ m_strm->read(&b[i], 1);
+ }
c = putf8string::traits_type::code(reinterpret_cast<putf8string::traits_type::mem_t *>(&b));
return true;
}
+ std::istream &stream() { return *m_strm; }
private:
- plib::unique_ptr<pistream> m_strm;
+ plib::unique_ptr<std::istream> m_strm;
putf8string m_linebuf;
};
template <>
struct constructor_helper<putf8_reader>
{
- plib::unique_ptr<pistream> operator()(putf8_reader &&s) { return std::move(s.m_strm); }
+ plib::unique_ptr<std::istream> operator()(putf8_reader &&s) { return std::move(s.m_strm); }
};
template <>
-struct constructor_helper<plib::unique_ptr<pistream>>
+struct constructor_helper<plib::unique_ptr<std::istream>>
{
- plib::unique_ptr<pistream> operator()(plib::unique_ptr<pistream> &&s) { return std::move(s); }
+ plib::unique_ptr<std::istream> operator()(plib::unique_ptr<std::istream> &&s) { return std::move(s); }
};
@@ -507,7 +107,7 @@ struct constructor_helper<plib::unique_ptr<pistream>>
class putf8_writer
{
public:
- explicit putf8_writer(postream *strm) : m_strm(strm) {}
+ explicit putf8_writer(std::ostream *strm) : m_strm(strm) {}
putf8_writer(putf8_writer &&src) noexcept : m_strm(src.m_strm) {}
@@ -526,7 +126,7 @@ public:
{
// NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
const putf8string conv_utf8(text);
- m_strm->write(reinterpret_cast<const pistream::value_type *>(conv_utf8.c_str()), conv_utf8.mem_t_size());
+ m_strm->write(conv_utf8.c_str(), static_cast<std::streamsize>(plib::strlen(conv_utf8.c_str())));
}
void write(const pstring::value_type c) const
@@ -536,14 +136,14 @@ public:
}
private:
- postream *m_strm;
+ std::ostream *m_strm;
};
class putf8_fmt_writer : public pfmt_writer_t<putf8_fmt_writer>, public putf8_writer
{
public:
- explicit putf8_fmt_writer(postream *strm)
+ explicit putf8_fmt_writer(std::ostream *strm)
: pfmt_writer_t()
, putf8_writer(strm)
{
@@ -566,24 +166,24 @@ private:
class pbinary_writer
{
public:
- explicit pbinary_writer(postream &strm) : m_strm(strm) {}
+ explicit pbinary_writer(std::ostream &strm) : m_strm(strm) {}
pbinary_writer(pbinary_writer &&src) noexcept : m_strm(src.m_strm) {}
COPYASSIGN(pbinary_writer, delete)
- postringstream &operator=(pbinary_writer &&src) = delete;
+ pbinary_writer &operator=(pbinary_writer &&src) = delete;
virtual ~pbinary_writer() = default;
template <typename T>
void write(const T &val)
{
- m_strm.write(reinterpret_cast<const postream::value_type *>(&val), sizeof(T));
+ m_strm.write(reinterpret_cast<const std::ostream::char_type *>(&val), sizeof(T));
}
void write(const pstring &s)
{
- const auto sm = reinterpret_cast<const postream::value_type *>(s.c_str());
- const std::size_t sl = std::strlen(s.c_str());
+ const auto sm = reinterpret_cast<const std::ostream::char_type *>(s.c_str());
+ const std::streamsize sl(static_cast<std::streamsize>(pstring_mem_t_size(s)));
write(sl);
m_strm.write(sm, sl);
}
@@ -591,19 +191,19 @@ public:
template <typename T>
void write(const std::vector<T> &val)
{
- std::size_t sz = val.size();
+ const std::streamsize sz(static_cast<std::streamsize>(val.size()));
write(sz);
- m_strm.write(reinterpret_cast<const postream::value_type *>(val.data()), sizeof(T) * sz);
+ m_strm.write(reinterpret_cast<const std::ostream::char_type *>(val.data()), sz * static_cast<std::streamsize>(sizeof(T)));
}
private:
- postream &m_strm;
+ std::ostream &m_strm;
};
class pbinary_reader
{
public:
- explicit pbinary_reader(pistream &strm) : m_strm(strm) {}
+ explicit pbinary_reader(std::istream &strm) : m_strm(strm) {}
pbinary_reader(pbinary_reader &&src) noexcept : m_strm(src.m_strm) { }
COPYASSIGN(pbinary_reader, delete)
@@ -614,7 +214,7 @@ public:
template <typename T>
void read(T &val)
{
- m_strm.read(reinterpret_cast<pistream::value_type *>(&val), sizeof(T));
+ m_strm.read(reinterpret_cast<std::istream::char_type *>(&val), sizeof(T));
}
void read( pstring &s)
@@ -622,7 +222,7 @@ public:
std::size_t sz = 0;
read(sz);
std::vector<plib::string_info<pstring>::mem_t> buf(sz+1);
- m_strm.read(buf.data(), sz);
+ m_strm.read(buf.data(), static_cast<std::streamsize>(sz));
buf[sz] = 0;
s = pstring(buf.data());
}
@@ -633,19 +233,22 @@ public:
std::size_t sz = 0;
read(sz);
val.resize(sz);
- m_strm.read(reinterpret_cast<pistream::value_type *>(val.data()), sizeof(T) * sz);
+ m_strm.read(reinterpret_cast<std::istream::char_type *>(val.data()), static_cast<std::streamsize>(sizeof(T) * sz));
}
private:
- pistream &m_strm;
+ std::istream &m_strm;
};
-inline void copystream(postream &dest, pistream &src)
+inline void copystream(std::ostream &dest, std::istream &src)
{
- std::array<postream::value_type, 1024> buf; // NOLINT(cppcoreguidelines-pro-type-member-init)
- pstream::pos_type r;
- while ((r=src.read(buf.data(), 1024)) > 0)
- dest.write(buf.data(), r);
+ // FIXME: optimize
+ std::array<std::ostream::char_type, 1024> buf; // NOLINT(cppcoreguidelines-pro-type-member-init)
+ while (!src.eof())
+ {
+ src.read(buf.data(), 1);
+ dest.write(buf.data(), 1);
+ }
}
struct perrlogger
@@ -658,12 +261,24 @@ struct perrlogger
private:
static putf8_fmt_writer &h()
{
- static plib::pstderr perr_strm;
- static plib::putf8_fmt_writer perr(&perr_strm);
+ static plib::putf8_fmt_writer perr(&std::cerr);
return perr;
}
};
+// -----------------------------------------------------------------------------
+// c++17 preparation
+// -----------------------------------------------------------------------------
+
+namespace filesystem
+{
+ template< class Source >
+ pstring /*path */ u8path( const Source& source )
+ {
+ return pstring(source);
+ }
+
+}
} // namespace plib
diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h
index cb4ad651548..96ab0bd0fa5 100644
--- a/src/lib/netlist/plib/pstring.h
+++ b/src/lib/netlist/plib/pstring.h
@@ -9,7 +9,6 @@
#include "ptypes.h"
-#include <cstring>
#include <exception>
#include <iterator>
#include <limits>
@@ -126,9 +125,10 @@ public:
pstring_t &operator=(const pstring_t &string) = default;
pstring_t &operator=(pstring_t &&string) noexcept = default;
- explicit pstring_t(code_t code)
+ explicit pstring_t(size_type n, code_t code)
{
- *this += code;
+ while (n--)
+ *this += code;
}
template <typename T,
@@ -186,6 +186,7 @@ public:
pstring_t& operator+=(const code_t c) { traits_type::encode(c, m_str); return *this; }
friend pstring_t operator+(const pstring_t &lhs, const pstring_t &rhs) { return pstring_t(lhs) += rhs; }
friend pstring_t operator+(const pstring_t &lhs, const code_t rhs) { return pstring_t(lhs) += rhs; }
+ friend pstring_t operator+(const code_t lhs, const pstring_t &rhs) { return pstring_t(1, lhs) += rhs; }
// comparison operators
bool operator==(const pstring_t &string) const { return (compare(string) == 0); }
@@ -196,16 +197,21 @@ public:
bool operator>(const pstring_t &string) const { return (compare(string) > 0); }
bool operator>=(const pstring_t &string) const { return (compare(string) >= 0); }
+ friend std::ostream& operator<<(std::ostream &ostrm, const pstring_t &str)
+ {
+ ostrm << str.m_str;
+ return ostrm;
+ }
+
const_reference at(const size_type pos) const { return *reinterpret_cast<const ref_value_type *>(F::nthcode(m_str.c_str(),pos)); }
+ static constexpr const size_type npos = static_cast<size_type>(-1);
+
/* the following are extensions to <string> */
+ // FIXME: remove those
size_type mem_t_size() const { return m_str.size(); }
- const string_type &cpp_string() const { return m_str; }
-
- static constexpr const size_type npos = static_cast<size_type>(-1);
-
private:
string_type m_str;
};
@@ -476,9 +482,12 @@ extern template struct pstring_t<putf16_traits>;
extern template struct pstring_t<pwchar_traits>;
#if (PSTRING_USE_STD_STRING)
-typedef std::string pstring;
+using pstring = std::string;
+static inline pstring::size_type pstring_mem_t_size(const pstring &s) { return s.size(); }
#else
using pstring = pstring_t<putf8_traits>;
+template <typename T>
+static inline pstring::size_type pstring_mem_t_size(const pstring_t<T> &s) { return s.mem_t_size(); }
#endif
using putf8string = pstring_t<putf8_traits>;
using pu16string = pstring_t<putf16_traits>;
@@ -602,13 +611,22 @@ namespace plib
template<typename T>
bool startsWith(const T &str, const char *arg)
{
- return (left(str, std::strlen(arg)) == arg);
+ return startsWith(str, static_cast<pstring>(arg));
}
template<typename T>
bool endsWith(const T &str, const char *arg)
{
- return (right(str, std::strlen(arg)) == arg);
+ return endsWith(str, static_cast<pstring>(arg));
+ }
+
+ template<typename T>
+ std::size_t strlen(const T *str)
+ {
+ const T *p = str;
+ while (*p)
+ p++;
+ return static_cast<std::size_t>(p - str);
}
template<typename T>
@@ -670,7 +688,7 @@ namespace std
{
using argument_type = pstring_t<T>;
using result_type = std::size_t;
- result_type operator()(argument_type const& s) const
+ result_type operator()(const argument_type & s) const
{
const typename argument_type::mem_t *string = s.c_str();
result_type result = 5381;
diff --git a/src/lib/netlist/plib/ptime.h b/src/lib/netlist/plib/ptime.h
index 6d91f14912b..9668e0cf428 100644
--- a/src/lib/netlist/plib/ptime.h
+++ b/src/lib/netlist/plib/ptime.h
@@ -11,7 +11,7 @@
#include "ptypes.h"
#include <cmath> // std::floor
-#include <cstdint>
+//#include <cstdint>
// ----------------------------------------------------------------------------------------
// netlist_time
diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp
index b62cbf60865..a9531006904 100644
--- a/src/lib/netlist/plib/putil.cpp
+++ b/src/lib/netlist/plib/putil.cpp
@@ -6,8 +6,8 @@
#include "ptypes.h"
#include <algorithm>
-#include <cstdlib>
-#include <cstring>
+//#include <cstdlib>
+//#include <cstring>
#include <initializer_list>
namespace plib
@@ -25,7 +25,7 @@ namespace plib
#ifdef _WIN32
ret = ret + '\\' + elem;
#else
- ret = ret + '/' + elem;
+ ret += ('/' + elem);
#endif
}
return ret;
@@ -137,30 +137,15 @@ namespace plib
int penum_base::from_string_int(const char *str, const char *x)
{
int cnt = 0;
- const char *cur = str;
- std::size_t lx = strlen(x);
- while (*str)
+ for (auto &s : psplit(str, ",", false))
{
- if (*str == ',')
- {
- std::ptrdiff_t l = str-cur;
- if (static_cast<std::size_t>(l) == lx)
- if (strncmp(cur, x, lx) == 0)
- return cnt;
- }
- else if (*str == ' ')
- {
- cur = str + 1;
- cnt++;
- }
- str++;
- }
- std::ptrdiff_t l = str-cur;
- if (static_cast<std::size_t>(l) == lx)
- if (strncmp(cur, x, lx) == 0)
+ if (s == x)
return cnt;
+ cnt++;
+ }
return -1;
}
+
std::string penum_base::nthstr(int n, const char *str)
{
return psplit(str, ",", false)[static_cast<std::size_t>(n)];
diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h
index d738a459027..e6e6153d840 100644
--- a/src/lib/netlist/plib/putil.h
+++ b/src/lib/netlist/plib/putil.h
@@ -12,8 +12,10 @@
#include "pstring.h"
#include <algorithm>
#include <initializer_list>
+#include <locale>
#include <sstream>
#include <vector>
+#include <iostream>
#define PSTRINGIFY_HELP(y) # y
#define PSTRINGIFY(x) PSTRINGIFY_HELP(x)
@@ -129,66 +131,68 @@ namespace plib
// number conversions
// ----------------------------------------------------------------------------------------
- template <typename T, bool CLOCALE, typename E = void>
+ template <typename T, typename S>
+ T pstonum_locale(const std::locale &loc, const S &arg, std::size_t *idx)
+ {
+ std::stringstream ss;
+ ss.imbue(loc);
+ ss << arg;
+ auto len(ss.tellp());
+ T x(constants<T>::zero());
+ if (ss >> x)
+ {
+ auto pos(ss.tellg());
+ if (pos == static_cast<decltype(pos)>(-1))
+ pos = len;
+ *idx = static_cast<std::size_t>(pos);
+ }
+ else
+ *idx = constants<std::size_t>::zero();
+ //printf("%s, %f, %lu %ld\n", arg, (double)x, *idx, (long int) ss.tellg());
+ return x;
+ }
+
+ template <typename T, typename E = void>
struct pstonum_helper;
- template<typename T, bool CLOCALE>
- struct pstonum_helper<T, CLOCALE, typename std::enable_if<std::is_integral<T>::value
- && std::is_signed<T>::value>::type>
+ template<typename T>
+ struct pstonum_helper<T, typename std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value>::type>
{
template <typename S>
- long long operator()(const S &arg, std::size_t *idx)
+ long long operator()(std::locale loc, const S &arg, std::size_t *idx)
{
- return std::stoll(arg, idx);
+ //return std::stoll(arg, idx);
+ return pstonum_locale<long long>(loc, arg, idx);
}
};
- template<typename T, bool CLOCALE>
- struct pstonum_helper<T, CLOCALE, typename std::enable_if<std::is_integral<T>::value
- && !std::is_signed<T>::value>::type>
+ template<typename T>
+ struct pstonum_helper<T, typename std::enable_if<std::is_integral<T>::value && !std::is_signed<T>::value>::type>
{
template <typename S>
- unsigned long long operator()(const S &arg, std::size_t *idx)
+ unsigned long long operator()(std::locale loc, const S &arg, std::size_t *idx)
{
- return std::stoull(arg, idx);
+ //return std::stoll(arg, idx);
+ return pstonum_locale<unsigned long long>(loc, arg, idx);
}
};
- template<typename T, bool CLOCALE>
- struct pstonum_helper<T, CLOCALE, typename std::enable_if<std::is_floating_point<T>::value>::type>
+ template<typename T>
+ struct pstonum_helper<T, typename std::enable_if<std::is_floating_point<T>::value>::type>
{
template <typename S>
- long double operator()(const S &arg, std::size_t *idx)
+ long double operator()(std::locale loc, const S &arg, std::size_t *idx)
{
- if (CLOCALE)
- {
- std::stringstream ss;
- ss.imbue(std::locale::classic());
- ss << arg;
- long int len(ss.tellp());
- auto x(constants<long double>::zero());
- long int pos(0);
- if (ss >> x)
- {
- pos = static_cast<long int>(ss.tellg());
- if (pos == -1)
- pos = len;
- }
- *idx = static_cast<std::size_t>(pos);
- //printf("%s, %f, %lu %ld\n", arg, (double)x, *idx, (long int) ss.tellg());
- return x;
- }
- else
- return std::stold(arg, idx);
+ return pstonum_locale<long double>(loc, arg, idx);
}
};
- template<typename T, bool CLOCALE, typename S>
- T pstonum(const S &arg)
+ template<typename T, typename S>
+ T pstonum(const S &arg, std::locale loc = std::locale::classic())
{
decltype(arg.c_str()) cstr = arg.c_str();
std::size_t idx(0);
- auto ret = pstonum_helper<T, CLOCALE>()(cstr, &idx);
+ auto ret = pstonum_helper<T>()(loc, cstr, &idx);
using ret_type = decltype(ret);
if (ret >= static_cast<ret_type>(std::numeric_limits<T>::lowest())
&& ret <= static_cast<ret_type>(std::numeric_limits<T>::max()))
@@ -205,12 +209,12 @@ namespace plib
}
template<typename R, bool CLOCALE, typename T>
- R pstonum_ne(const T &str, bool &err) noexcept
+ R pstonum_ne(const T &str, bool &err, std::locale loc = std::locale::classic()) noexcept
{
try
{
err = false;
- return pstonum<R, CLOCALE>(str);
+ return pstonum<R>(str, loc);
}
catch (...)
{
diff --git a/src/lib/netlist/plib/vector_ops.h b/src/lib/netlist/plib/vector_ops.h
index d1d28261f5f..bdeb24ae502 100644
--- a/src/lib/netlist/plib/vector_ops.h
+++ b/src/lib/netlist/plib/vector_ops.h
@@ -13,6 +13,7 @@
#include "pconfig.h"
#include <algorithm>
+#include <array>
#include <cmath>
#include <type_traits>
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp
index ee0b80f7e08..1c5256654b1 100644
--- a/src/lib/netlist/prg/nltool.cpp
+++ b/src/lib/netlist/prg/nltool.cpp
@@ -11,11 +11,15 @@
#include "netlist/plib/pmain.h"
#include "netlist/devices/net_lib.h"
#include "netlist/nl_parser.h"
+#include "netlist/nl_errstr.h"
#include "netlist/nl_setup.h"
#include "netlist/solver/nld_solver.h"
#include "netlist/tools/nl_convert.h"
-#include <cstring>
+#include <cstdio> // scanf
+#include <iomanip> // scanf
+#include <iostream> // scanf
+#include <ios>
#define NLTOOL_VERSION 20190420
@@ -135,20 +139,17 @@ public:
{
}
- plib::unique_ptr<plib::pistream> stream(const pstring &file) override
+ plib::unique_ptr<std::istream> stream(const pstring &file) override
{
pstring name = m_folder + "/" + file;
- try
+ auto strm(plib::make_unique<std::ifstream>(plib::filesystem::u8path(name)));
+ if (strm->fail())
+ return plib::unique_ptr<std::istream>(nullptr);
+ else
{
- auto strm = plib::make_unique<plib::pifilestream>(name);
+ strm->imbue(std::locale::classic());
return std::move(strm);
}
- catch (const plib::pexception &e)
- {
- if (dynamic_cast<const plib::file_open_e *>(&e) == nullptr )
- throw;
- }
- return plib::unique_ptr<plib::pistream>(nullptr);
}
private:
@@ -292,7 +293,7 @@ struct input_t
std::array<char, 400> buf; // NOLINT(cppcoreguidelines-pro-type-member-init)
double t;
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- int e = sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &m_value);
+ int e = std::sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &m_value);
if (e != 3)
throw netlist::nl_exception(plib::pfmt("error {1} scanning line {2}\n")(e)(line));
m_time = netlist::netlist_time::from_double(t);
@@ -328,7 +329,10 @@ static std::vector<input_t> read_input(const netlist::setup_t &setup, const pstr
std::vector<input_t> ret;
if (fname != "")
{
- plib::putf8_reader r = plib::putf8_reader(plib::pifilestream(fname));
+ plib::putf8_reader r = plib::putf8_reader(std::ifstream(plib::filesystem::u8path(fname)));
+ if (r.stream().fail())
+ throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(fname));
+ r.stream().imbue(std::locale::classic());
pstring l;
while (r.readline(l))
{
@@ -383,7 +387,10 @@ void tool_app_t::run()
// FIXME: error handling
if (opt_loadstate.was_specified())
{
- plib::pifilestream strm(opt_loadstate());
+ std::ifstream strm(plib::filesystem::u8path(opt_loadstate()));
+ if (strm.fail())
+ throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_loadstate()));
+ strm.imbue(std::locale::classic());
plib::pbinary_reader reader(strm);
std::vector<char> loadstate;
reader.read(loadstate);
@@ -418,7 +425,11 @@ void tool_app_t::run()
if (opt_savestate.was_specified())
{
auto savestate = nt.save_state();
- plib::pofilestream strm(opt_savestate());
+ std::ofstream strm(plib::filesystem::u8path(opt_savestate()), std::ios_base::binary);
+ if (strm.fail())
+ throw plib::file_open_e(opt_savestate());
+ strm.imbue(std::locale::classic());
+
plib::pbinary_writer writer(strm);
writer.write(savestate);
}
@@ -486,14 +497,13 @@ void tool_app_t::static_compile()
// no reset needed ...
- plib::putf8_writer w(&pout_strm);
std::map<pstring, pstring> mp;
nt.solver()->create_solver_code(mp);
for (auto &e : mp)
{
- w.write(e.second);
+ pout.write(e.second);
}
nt.stop();
@@ -727,18 +737,21 @@ void tool_app_t::listdevices()
void tool_app_t::convert()
{
pstring contents;
- plib::postringstream ostrm;
+ std::stringstream ostrm;
+ ostrm.imbue(std::locale::classic());
if (opt_file() == "-")
{
- plib::pstdin f;
- plib::copystream(ostrm, f);
+ plib::copystream(ostrm, std::cin);
}
else
{
- plib::pifilestream f(opt_file());
- plib::copystream(ostrm, f);
+ std::ifstream strm(plib::filesystem::u8path(opt_file()));
+ if (strm.fail())
+ throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_file()));
+ strm.imbue(std::locale::classic());
+ plib::copystream(ostrm, strm);
}
- contents = ostrm.str();
+ contents = pstring(ostrm.str());
pstring result;
if (opt_type.as_string() == "spice")
@@ -794,6 +807,8 @@ int tool_app_t::execute()
if (opt_help())
{
+ pout(plib::pfmt("{:10.3}\n").f(20.0));
+ //pout(plib::pfmt("{10.3}\n").f(20));
pout(usage());
return 0;
}
@@ -857,7 +872,21 @@ int tool_app_t::execute()
perr("plib exception caught: {}\n", e.text());
return 2;
}
-
+#if 0
+ std::cout.imbue(std::locale("de_DE.utf8"));
+ std::cout.imbue(std::locale("C.UTF-8"));
+ std::cout << std::fixed << 20.003 << "\n";
+ std::cout << std::setw(20) << std::left << "01234567890" << "|" << "\n";
+ std::cout << std::setw(20) << "Общая ком" << "|" << "\n";
+ std::cout << "Общая ком" << pstring(20 - pstring("Общая ком").length(), ' ') << "|" << "\n";
+ std::cout << plib::pfmt("{:20}")("Общая ком") << "|" << "\n";
+
+ //char x = 'a';
+ //auto b= U'щ';
+
+ auto b= U'\U00000449';
+ std::cout << "b: <" << b << ">";
+#endif
return 0;
}
diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp
index 683bb8a1c55..3974dde1f3a 100644
--- a/src/lib/netlist/prg/nlwav.cpp
+++ b/src/lib/netlist/prg/nlwav.cpp
@@ -7,7 +7,7 @@
#include "plib/ppmf.h"
#include "plib/pstream.h"
-#include <cstring>
+#include <cstdio>
/* From: https://ffmpeg.org/pipermail/ffmpeg-devel/2007-October/038122.html
* The most compatible way to make a wav header for unknown length is to put
@@ -24,11 +24,12 @@ class wav_t
{
public:
// XXNOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
- wav_t(plib::postream &strm, std::size_t sr, std::size_t channels)
+ wav_t(std::ostream &strm, bool is_seekable, std::size_t sr, std::size_t channels)
: m_f(strm)
+ , m_stream_is_seekable(is_seekable)
/* force "play" to play and warn about eof instead of being silent */
, m_fmt(static_cast<std::uint16_t>(channels), static_cast<std::uint32_t>(sr))
- , m_data(m_f.seekable() ? 0 : 0xffffffff)
+ , m_data(is_seekable ? 0 : 0xffffffff)
{
write(m_fh);
@@ -40,7 +41,7 @@ public:
~wav_t()
{
- if (m_f.seekable())
+ if (m_stream_is_seekable)
{
m_fh.filelen = m_data.len + sizeof(m_data) + sizeof(m_fh) + sizeof(m_fmt) - 8;
m_f.seekp(0);
@@ -58,7 +59,7 @@ public:
template <typename T>
void write(const T &val)
{
- m_f.write(reinterpret_cast<const plib::postream::value_type *>(&val), sizeof(T));
+ m_f.write(reinterpret_cast<const std::ostream::char_type *>(&val), sizeof(T));
}
void write_sample(int *sample)
@@ -106,7 +107,8 @@ private:
// data follows
};
- plib::postream &m_f;
+ std::ostream &m_f;
+ bool m_stream_is_seekable;
riff_chunk_t m_fh;
riff_format_t m_fmt;
@@ -146,7 +148,7 @@ public:
{
// sscanf is very fast ...
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- sscanf(line.c_str(), "%lf %lf", &m_e[i].t, &m_e[i].v);
+ std::sscanf(line.c_str(), "%lf %lf", &m_e[i].t, &m_e[i].v);
m_e[i].need_more = false;
}
}
@@ -155,7 +157,7 @@ public:
return success;
}
- void process(std::vector<plib::unique_ptr<plib::pistream>> &is)
+ void process(std::vector<plib::unique_ptr<std::istream>> &is)
{
std::vector<plib::putf8_reader> readers;
for (auto &i : is)
@@ -238,7 +240,7 @@ private:
class wavwriter
{
public:
- wavwriter(plib::postream &fo, std::size_t channels, std::size_t sample_rate, double ampa)
+ wavwriter(std::ostream &fo, bool is_seekable, std::size_t channels, std::size_t sample_rate, double ampa)
: mean(channels, 0.0)
, means(channels, 0.0)
, maxsam(channels, -1e9)
@@ -248,7 +250,7 @@ public:
, m_last_time(0)
, m_fo(fo)
, m_amp(ampa)
- , m_wo(m_fo, sample_rate, channels)
+ , m_wo(m_fo, is_seekable, sample_rate, channels)
{ }
void process(std::size_t chan, double time, double outsam)
@@ -279,7 +281,7 @@ public:
private:
- plib::postream &m_fo;
+ std::ostream &m_fo;
double m_amp;
wav_t m_wo;
};
@@ -294,7 +296,7 @@ public:
ANALOG
};
- vcdwriter(plib::postream &fo, const std::vector<pstring> &channels,
+ vcdwriter(std::ostream &fo, const std::vector<pstring> &channels,
format_e format, double high_level = 2.0, double low_level = 1.0)
: m_channels(channels.size())
, m_last_time(0)
@@ -304,7 +306,7 @@ public:
, m_format(format)
{
for (pstring::value_type c = 64; c < 64+26; c++)
- m_ids.emplace_back(pstring(c));
+ m_ids.emplace_back(pstring(1, c));
write("$date Sat Jan 19 14:14:17 2019\n");
write("$end\n");
write("$version Netlist nlwav 0.1\n");
@@ -355,15 +357,13 @@ public:
private:
void write(const pstring &line)
{
- auto p = static_cast<const char *>(line.c_str());
- std::size_t len = std::strlen(p);
- m_fo.write(p, len);
+ m_fo.write(line.c_str(), static_cast<std::streamsize>(plib::strlen(line.c_str())));
}
std::size_t m_channels;
double m_last_time;
- plib::postream &m_fo;
+ std::ostream &m_fo;
std::vector<pstring> m_ids;
pstring m_buf;
double m_high_level;
@@ -420,10 +420,8 @@ private:
plib::option_bool opt_help;
plib::option_example opt_ex1;
plib::option_example opt_ex2;
- plib::pstdin pin_strm;
-
- std::vector<plib::unique_ptr<plib::pistream>> m_instrms;
- plib::postream *m_outstrm;
+ std::vector<plib::unique_ptr<std::istream>> m_instrms;
+ std::ostream *m_outstrm;
};
void nlwav_app::convert_wav()
@@ -431,7 +429,7 @@ void nlwav_app::convert_wav()
double dt = 1.0 / static_cast<double>(opt_rate());
- plib::unique_ptr<wavwriter> wo = plib::make_unique<wavwriter>(*m_outstrm, m_instrms.size(), opt_rate(), opt_amp());
+ plib::unique_ptr<wavwriter> wo = plib::make_unique<wavwriter>(*m_outstrm, opt_out() != "-", m_instrms.size(), opt_rate(), opt_amp());
plib::unique_ptr<aggregator> ago = plib::make_unique<aggregator>(m_instrms.size(), dt, aggregator::callback_type(&wavwriter::process, wo.get()));
aggregator::callback_type agcb = log_processor::callback_type(&aggregator::process, ago.get());
@@ -501,13 +499,24 @@ int nlwav_app::execute()
return 0;
}
- m_outstrm = (opt_out() == "-" ? &pout_strm : plib::pnew<plib::pofilestream>(opt_out()));
+ m_outstrm = (opt_out() == "-" ? &std::cout : plib::pnew<std::ofstream>(plib::filesystem::u8path(opt_out())));
+ if (m_outstrm->fail())
+ throw plib::file_open_e(opt_out());
+ m_outstrm->imbue(std::locale::classic());
for (auto &oi: opt_args())
{
- plib::unique_ptr<plib::pistream> fin = (oi == "-" ?
- plib::make_unique<plib::pstdin>()
- : plib::make_unique<plib::pifilestream>(oi));
+ plib::unique_ptr<std::istream> fin;
+
+ if (oi == "-")
+ {
+ auto temp(plib::make_unique<std::stringstream>());
+ plib::copystream(*temp, std::cin);
+ fin = std::move(temp);
+ }
+ else
+ fin = plib::make_unique<std::ifstream>(plib::filesystem::u8path(oi));
+ fin->imbue(std::locale::classic());
m_instrms.push_back(std::move(fin));
}
diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h
index 85e6c861238..e227802c1a2 100644
--- a/src/lib/netlist/solver/nld_ms_gcr.h
+++ b/src/lib/netlist/solver/nld_ms_gcr.h
@@ -262,10 +262,11 @@ namespace devices
template <typename FT, int SIZE>
pstring matrix_solver_GCR_t<FT, SIZE>::static_compile_name()
{
- plib::postringstream t;
+ std::stringstream t;
+ t.imbue(std::locale::classic());
plib::putf8_fmt_writer w(&t);
csc_private(w);
- std::hash<pstring> h;
+ std::hash<typename std::remove_const<std::remove_reference<decltype(t.str())>::type>::type> h;
return plib::pfmt("nl_gcr_{1:x}_{2}")(h( t.str() ))(mat.nz_num);
}
@@ -273,7 +274,8 @@ namespace devices
template <typename FT, int SIZE>
std::pair<pstring, pstring> matrix_solver_GCR_t<FT, SIZE>::create_solver_code()
{
- plib::postringstream t;
+ std::stringstream t;
+ t.imbue(std::locale::classic());
plib::putf8_fmt_writer strm(&t);
pstring name = static_compile_name();
@@ -281,7 +283,7 @@ namespace devices
strm.writeline("{\n");
csc_private(strm);
strm.writeline("}\n");
- return std::pair<pstring, pstring>(name, t.str());
+ return std::pair<pstring, pstring>(name, pstring(t.str()));
}
template <typename FT, int SIZE>
diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp
index 101408b2652..0aa7e6f584c 100644
--- a/src/lib/netlist/solver/nld_solver.cpp
+++ b/src/lib/netlist/solver/nld_solver.cpp
@@ -386,7 +386,7 @@ namespace devices
ms->setup(grp);
log().verbose("Solver {1}", ms->name());
- log().verbose(" ==> {2} nets", grp.size());
+ log().verbose(" ==> {1} nets", grp.size());
log().verbose(" has {1} elements", ms->has_dynamic_devices() ? "dynamic" : "no dynamic");
log().verbose(" has {1} elements", ms->has_timestep_devices() ? "timestep" : "no timestep");
for (auto &n : grp)
diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp
index 4a88da7d5a3..3e705910bf4 100644
--- a/src/lib/netlist/tools/nl_convert.cpp
+++ b/src/lib/netlist/tools/nl_convert.cpp
@@ -43,7 +43,8 @@ using lib_map_t = std::unordered_map<pstring, lib_map_entry>;
static lib_map_t read_lib_map(const pstring &lm)
{
- auto reader = plib::putf8_reader(plib::pistringstream(lm));
+ auto reader = plib::putf8_reader(std::istringstream(lm));
+ reader.stream().imbue(std::locale::classic());
lib_map_t m;
pstring line;
while (reader.readline(line))
@@ -62,6 +63,27 @@ nl_convert_base_t::nl_convert_base_t()
: out(&m_buf)
, m_numberchars("0123456789-+e.")
{
+ m_buf.imbue(std::locale::classic());
+ m_units = {
+ {"T", "", 1.0e12 },
+ {"G", "", 1.0e9 },
+ {"MEG", "RES_M({1})", 1.0e6 },
+ {"k", "RES_K({1})", 1.0e3 }, /* eagle */
+ {"K", "RES_K({1})", 1.0e3 },
+ {"", "{1}", 1.0e0 },
+ {"M", "CAP_M({1})", 1.0e-3 },
+ {"u", "CAP_U({1})", 1.0e-6 }, /* eagle */
+ {"U", "CAP_U({1})", 1.0e-6 },
+ {"μ", "CAP_U({1})", 1.0e-6 },
+ {"µ", "CAP_U({1})", 1.0e-6 },
+ {"N", "CAP_N({1})", 1.0e-9 },
+ {"pF", "CAP_P({1})", 1.0e-12},
+ {"P", "CAP_P({1})", 1.0e-12},
+ {"F", "{1}e-15", 1.0e-15},
+
+ {"MIL", "{1}", 25.4e-6}
+ };
+
}
nl_convert_base_t::~nl_convert_base_t()
@@ -182,25 +204,20 @@ void nl_convert_base_t::dump_nl()
const pstring nl_convert_base_t::get_nl_val(const double val)
{
+ for (auto &e : m_units)
{
- int i = 0;
- while (pstring(m_units[i].m_unit) != "-" )
- {
- if (m_units[i].m_mult <= std::abs(val))
- break;
- i++;
- }
- return plib::pfmt(pstring(m_units[i].m_func))(val / m_units[i].m_mult);
+ if (e.m_mult <= std::abs(val))
+ return plib::pfmt(e.m_func)(val / e.m_mult);
}
+ return plib::pfmt("{1}")(val);
}
+
double nl_convert_base_t::get_sp_unit(const pstring &unit)
{
- int i = 0;
- while (pstring(m_units[i].m_unit) != "-")
+ for (auto &e : m_units)
{
- if (pstring(m_units[i].m_unit) == unit)
- return m_units[i].m_mult;
- i++;
+ if (e.m_unit == unit)
+ return e.m_mult;
}
plib::perrlogger("Unit {} unknown\n", unit);
return 0.0;
@@ -213,11 +230,12 @@ double nl_convert_base_t::get_sp_val(const pstring &sin)
++p;
pstring val = plib::left(sin, p);
pstring unit = sin.substr(p);
- double ret = get_sp_unit(unit) * plib::pstonum<double, true>(val);
+ double ret = get_sp_unit(unit) * plib::pstonum<double>(val);
return ret;
}
-nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = {
+#if 0
+std::vector<nl_convert_base_t::unit_t> nl_convert_base_t::m_units = {
{"T", "", 1.0e12 },
{"G", "", 1.0e9 },
{"MEG", "RES_M({1})", 1.0e6 },
@@ -234,11 +252,9 @@ nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = {
{"P", "CAP_P({1})", 1.0e-12},
{"F", "{1}e-15", 1.0e-15},
- {"MIL", "{1}", 25.4e-6},
-
- {"-", "{1}", 1.0 }
+ {"MIL", "{1}", 25.4e-6}
};
-
+#endif
void nl_convert_spice_t::convert(const pstring &contents)
{
@@ -257,7 +273,7 @@ void nl_convert_spice_t::convert(const pstring &contents)
// Basic preprocessing
pstring inl = plib::ucase(plib::trim(i));
if (plib::startsWith(inl, "+"))
- line = line + inl.substr(1);
+ line += inl.substr(1);
else
{
process_line(line);
@@ -470,7 +486,8 @@ void nl_convert_eagle_t::tokenizer::verror(const pstring &msg, int line_num, con
void nl_convert_eagle_t::convert(const pstring &contents)
{
- tokenizer tok(*this, plib::putf8_reader(plib::pistringstream(contents)));
+ tokenizer tok(*this, plib::putf8_reader(std::istringstream(contents)));
+ tok.stream().stream().imbue(std::locale::classic());
out("NETLIST_START(dummy)\n");
add_term("GND", "GND");
@@ -532,7 +549,7 @@ void nl_convert_eagle_t::convert(const pstring &contents)
else if (plib::ucase(sval) == "LOW")
add_device("TTL_INPUT", name, 0);
else
- add_device("ANALOG_INPUT", name, plib::pstonum<double, true>(sval));
+ add_device("ANALOG_INPUT", name, plib::pstonum<double>(sval));
add_pin_alias(name, "1", "Q");
break;
case 'D':
@@ -617,7 +634,8 @@ void nl_convert_rinf_t::tokenizer::verror(const pstring &msg, int line_num, cons
void nl_convert_rinf_t::convert(const pstring &contents)
{
- tokenizer tok(*this, plib::putf8_reader(plib::pistringstream(contents)));
+ tokenizer tok(*this, plib::putf8_reader(std::istringstream(contents)));
+ tok.stream().stream().imbue(std::locale::classic());
auto lm = read_lib_map(s_lib_map);
out("NETLIST_START(dummy)\n");
diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h
index 731d1f58647..e070514d5ed 100644
--- a/src/lib/netlist/tools/nl_convert.h
+++ b/src/lib/netlist/tools/nl_convert.h
@@ -29,7 +29,7 @@ public:
virtual ~nl_convert_base_t();
- const pstring &result() { return m_buf.str(); }
+ pstring result() { return pstring(m_buf.str()); }
virtual void convert(const pstring &contents) = 0;
@@ -117,8 +117,8 @@ private:
};
struct unit_t {
- const char *m_unit;
- const char *m_func;
+ pstring m_unit;
+ pstring m_func;
double m_mult;
};
@@ -139,14 +139,14 @@ private:
void add_device(plib::unique_ptr<dev_t> dev);
- plib::postringstream m_buf;
+ std::stringstream m_buf;
std::vector<plib::unique_ptr<dev_t>> m_devs;
std::unordered_map<pstring, plib::unique_ptr<net_t> > m_nets;
std::vector<pstring> m_ext_alias;
std::unordered_map<pstring, plib::unique_ptr<pin_alias_t>> m_pins;
- static unit_t m_units[];
+ std::vector<unit_t> m_units;
pstring m_numberchars;
};
diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp
index 728781dd8fc..bd93cbe1847 100644
--- a/src/lib/util/aviio.cpp
+++ b/src/lib/util/aviio.cpp
@@ -366,8 +366,8 @@ public:
avi_file::error huffyuv_decompress_to_yuy16(const std::uint8_t *data, std::uint32_t numbytes, bitmap_yuy16 &bitmap) const;
// Uncompressed helpers
- avi_file::error uncompressed_rgb24_to_rgb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_rgb32 &bitmap) const;
- avi_file::error uncompressed_yuv420p_to_rgb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_rgb32 &bitmap) const;
+ avi_file::error uncompressed_rgb24_to_argb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_argb32 &bitmap) const;
+ avi_file::error uncompressed_yuv420p_to_argb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_argb32 &bitmap) const;
private:
struct huffyuv_table
@@ -460,7 +460,7 @@ public:
virtual movie_info const &get_movie_info() const override;
virtual std::uint32_t first_sample_in_frame(std::uint32_t framenum) const override;
- virtual error read_uncompressed_video_frame(std::uint32_t framenum, bitmap_rgb32 &bitmap) override;
+ virtual error read_uncompressed_video_frame(std::uint32_t framenum, bitmap_argb32 &bitmap) override;
virtual error read_video_frame(std::uint32_t framenum, bitmap_yuy16 &bitmap) override;
virtual error read_sound_samples(int channel, std::uint32_t firstsample, std::uint32_t numsamples, std::int16_t *output) override;
@@ -1489,11 +1489,11 @@ avi_file::error avi_stream::huffyuv_decompress_to_yuy16(const std::uint8_t *data
/*-------------------------------------------------
- uncompressed_rgb24_to_rgb32 - convert a raw
- RGB24-encoded frame to an RGB32 bitmap
+ uncompressed_rgb24_to_argb32 - convert a raw
+ RGB24-encoded frame to an ARGB32 bitmap
-------------------------------------------------*/
-avi_file::error avi_stream::uncompressed_rgb24_to_rgb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_rgb32 &bitmap) const
+avi_file::error avi_stream::uncompressed_rgb24_to_argb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_argb32 &bitmap) const
{
std::uint32_t dataoffs = 0;
@@ -1517,11 +1517,11 @@ avi_file::error avi_stream::uncompressed_rgb24_to_rgb32(const std::uint8_t *data
/*-------------------------------------------------
- uncompressed_yuv420p_to_rgb32 - convert a
- YUV420p-encoded frame to an RGB32 bitmap
+ uncompressed_yuv420p_to_argb32 - convert a
+ YUV420p-encoded frame to an ARGB32 bitmap
-------------------------------------------------*/
-avi_file::error avi_stream::uncompressed_yuv420p_to_rgb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_rgb32 &bitmap) const
+avi_file::error avi_stream::uncompressed_yuv420p_to_argb32(const std::uint8_t *data, std::uint32_t numbytes, bitmap_argb32 &bitmap) const
{
const int width = bitmap.width();
const int height = bitmap.height();
@@ -1676,10 +1676,10 @@ std::uint32_t avi_file_impl::first_sample_in_frame(std::uint32_t framenum) const
/*-------------------------------------------------
read_uncompressed_video_frame - read raw video
data for a particular frame from the AVI file,
- converting to RGB32 format
+ converting to ARGB32 format
-------------------------------------------------*/
-avi_file::error avi_file_impl::read_uncompressed_video_frame(std::uint32_t framenum, bitmap_rgb32 &bitmap)
+avi_file::error avi_file_impl::read_uncompressed_video_frame(std::uint32_t framenum, bitmap_argb32 &bitmap)
{
/* get the video stream */
avi_stream *const stream = get_video_stream();
@@ -1718,9 +1718,9 @@ avi_file::error avi_file_impl::read_uncompressed_video_frame(std::uint32_t frame
{
/* uncompressed YUV420p */
if (stream->format() == FORMAT_I420)
- avierr = stream->uncompressed_yuv420p_to_rgb32(&m_tempbuffer[8], stream->chunk(framenum).length - 8, bitmap);
+ avierr = stream->uncompressed_yuv420p_to_argb32(&m_tempbuffer[8], stream->chunk(framenum).length - 8, bitmap);
else
- avierr = stream->uncompressed_rgb24_to_rgb32(&m_tempbuffer[8], stream->chunk(framenum).length - 8, bitmap);
+ avierr = stream->uncompressed_rgb24_to_argb32(&m_tempbuffer[8], stream->chunk(framenum).length - 8, bitmap);
}
else
{
diff --git a/src/lib/util/aviio.h b/src/lib/util/aviio.h
index 8497a039a53..c951f71b22f 100644
--- a/src/lib/util/aviio.h
+++ b/src/lib/util/aviio.h
@@ -119,7 +119,7 @@ public:
virtual movie_info const &get_movie_info() const = 0;
virtual std::uint32_t first_sample_in_frame(std::uint32_t framenum) const = 0;
- virtual error read_uncompressed_video_frame(std::uint32_t framenum, bitmap_rgb32 &bitmap) = 0;
+ virtual error read_uncompressed_video_frame(std::uint32_t framenum, bitmap_argb32 &bitmap) = 0;
virtual error read_video_frame(std::uint32_t framenum, bitmap_yuy16 &bitmap) = 0;
virtual error read_sound_samples(int channel, std::uint32_t firstsample, std::uint32_t numsamples, std::int16_t *output) = 0;
diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt
index 97394fa2838..647a6ba204a 100644
--- a/src/mame/arcade.flt
+++ b/src/mame/arcade.flt
@@ -557,6 +557,7 @@ invqix.cpp
iqblock.cpp
irobot.cpp
ironhors.cpp
+island.cpp
istellar.cpp
istrebiteli.cpp
iteagle.cpp
@@ -639,7 +640,6 @@ lastbank.cpp
lastduel.cpp
lastfght.cpp
laz_aftrshok.cpp
-laz_awetoss.cpp
laz_ribrac.cpp
lazercmd.cpp
lbeach.cpp
diff --git a/src/mame/audio/geebee.cpp b/src/mame/audio/geebee.cpp
index 76f79bb1c86..037a398dc3b 100644
--- a/src/mame/audio/geebee.cpp
+++ b/src/mame/audio/geebee.cpp
@@ -58,13 +58,13 @@ void geebee_sound_device::device_timer(emu_timer &timer, device_timer_id id, int
{
switch (id)
{
- case TIMER_VOLUME_DECAY:
- if (--m_volume < 0)
- m_volume = 0;
- break;
+ case TIMER_VOLUME_DECAY:
+ if (--m_volume < 0)
+ m_volume = 0;
+ break;
- default:
- assert_always(false, "Unknown id in geebee_device::device_timer");
+ default:
+ throw emu_fatalerror("Unknown id in geebee_device::device_timer");
}
}
diff --git a/src/mame/audio/snes_snd.cpp b/src/mame/audio/snes_snd.cpp
index e4f1b91a517..2f8a23f48da 100644
--- a/src/mame/audio/snes_snd.cpp
+++ b/src/mame/audio/snes_snd.cpp
@@ -240,10 +240,7 @@ inline void snes_sound_device::update_timer_tick(u8 which)
void snes_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id != TIMER_TICK_ID)
- {
- assert_always(false, "Unknown id in snes_sound_device::device_timer");
- return;
- }
+ throw emu_fatalerror("Unknown id in snes_sound_device::device_timer");
for (int ch = 0; ch < 3; ch++)
update_timer_tick(ch);
diff --git a/src/mame/audio/t5182.cpp b/src/mame/audio/t5182.cpp
index 2cc831bf63d..b867a5777a5 100644
--- a/src/mame/audio/t5182.cpp
+++ b/src/mame/audio/t5182.cpp
@@ -225,11 +225,11 @@ void t5182_device::device_timer(emu_timer &timer, device_timer_id id, int param,
{
switch (id)
{
- case SETIRQ_CB:
- setirq_callback(ptr, param);
- break;
- default:
- assert_always(false, "Unknown id in t5182_device::device_timer");
+ case SETIRQ_CB:
+ setirq_callback(ptr, param);
+ break;
+ default:
+ throw emu_fatalerror("Unknown id in t5182_device::device_timer");
}
}
diff --git a/src/mame/audio/taito_en.cpp b/src/mame/audio/taito_en.cpp
index 790b99f2129..103d138540b 100644
--- a/src/mame/audio/taito_en.cpp
+++ b/src/mame/audio/taito_en.cpp
@@ -195,7 +195,7 @@ WRITE8_MEMBER(taito_en_device::duart_output)
void taito_en_device::device_add_mconfig(machine_config &config)
{
/* basic machine hardware */
- M68000(config, m_audiocpu, XTAL(30'476'100) / 2);
+ M68000(config, m_audiocpu, XTAL(30'476'180) / 2);
m_audiocpu->set_addrmap(AS_PROGRAM, &taito_en_device::en_sound_map);
m_audiocpu->set_addrmap(m68000_device::AS_CPU_SPACE, &taito_en_device::fc7_map);
@@ -216,12 +216,12 @@ void taito_en_device::device_add_mconfig(machine_config &config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- ESQ_5505_5510_PUMP(config, m_pump, XTAL(30'476'100) / (2 * 16 * 32));
+ ESQ_5505_5510_PUMP(config, m_pump, XTAL(30'476'180) / (2 * 16 * 32));
m_pump->set_esp(m_esp);
m_pump->add_route(0, "lspeaker", 1.0);
m_pump->add_route(1, "rspeaker", 1.0);
- ES5505(config, m_ensoniq, XTAL(30'476'100) / 2);
+ ES5505(config, m_ensoniq, XTAL(30'476'180) / 2);
m_ensoniq->sample_rate_changed().set(FUNC(taito_en_device::es5505_clock_changed));
m_ensoniq->set_region0("ensoniq.0");
m_ensoniq->set_region1("ensoniq.0");
diff --git a/src/mame/audio/warpwarp.cpp b/src/mame/audio/warpwarp.cpp
index 9e482e3a538..2e4075771ea 100644
--- a/src/mame/audio/warpwarp.cpp
+++ b/src/mame/audio/warpwarp.cpp
@@ -75,18 +75,18 @@ void warpwarp_sound_device::device_timer(emu_timer &timer, device_timer_id id, i
{
switch (id)
{
- case TIMER_SOUND_VOLUME_DECAY:
- if (--m_sound_volume < 0)
- m_sound_volume = 0;
- break;
-
- case TIMER_MUSIC_VOLUME_DECAY:
- if (--m_music_volume < 0)
- m_music_volume = 0;
- break;
-
- default:
- assert_always(false, "Unknown id in warpwarp_sound_device::device_timer");
+ case TIMER_SOUND_VOLUME_DECAY:
+ if (--m_sound_volume < 0)
+ m_sound_volume = 0;
+ break;
+
+ case TIMER_MUSIC_VOLUME_DECAY:
+ if (--m_music_volume < 0)
+ m_music_volume = 0;
+ break;
+
+ default:
+ throw emu_fatalerror("Unknown id in warpwarp_sound_device::device_timer");
}
}
diff --git a/src/mame/drivers/2mindril.cpp b/src/mame/drivers/2mindril.cpp
index ecb9912134e..6301efc8d0f 100644
--- a/src/mame/drivers/2mindril.cpp
+++ b/src/mame/drivers/2mindril.cpp
@@ -143,7 +143,7 @@ void _2mindril_state::device_timer(emu_timer &timer, device_timer_id id, int par
m_defender_sensor = param;
break;
default:
- assert_always(false, "Unknown id in _2mindril_state::device_timer");
+ throw emu_fatalerror("Unknown id in _2mindril_state::device_timer");
}
}
#endif
diff --git a/src/mame/drivers/4dpi.cpp b/src/mame/drivers/4dpi.cpp
index 4180b810bea..3dd7cf3d86f 100644
--- a/src/mame/drivers/4dpi.cpp
+++ b/src/mame/drivers/4dpi.cpp
@@ -31,7 +31,7 @@
* - https://github.com/NetBSD/src/tree/trunk/sys/arch/sgimips/
*
* TODO:
- * - graphics, audio, printer
+ * - audio, printer
* - devicify ioc1 and ctl1
*
* Status:
@@ -224,6 +224,11 @@ private:
u8 m_mapindex;
std::unique_ptr<u16 []> m_dmahi;
offs_t m_dmaaddr;
+
+ u32 m_gdma_dabr; // descriptor array base
+ u32 m_gdma_bufadr; // buffer address
+ u16 m_gdma_burst; // burst/delay
+ u16 m_gdma_buflen; // buffer length
};
void pi4d2x_state::map(address_map &map)
@@ -378,7 +383,7 @@ void pi4d2x_state::map(address_map &map)
//map(0x1f9d0004, 0x1f9d0007).rw().umask32(0x0000ffff); // prdmalo - dma low addr reg
//map(0x1f9e0000, 0x1f9e0003).rw().umask32(0x000000ff); // mapindex - printer map index (5-bit)
//map(0x1f9e0004, 0x1f9e0007).w().umask32(0xff000000); // dmastop
- //map(0x1f9e0008, 0x1f9e000b).w().umask32(?); // prswack - soft ack
+ //map(0x1f9e0008, 0x1f9e000b).w().umask32(0x000000ff); // prswack - soft ack
//map(0x1f9e000c, 0x1f9e000f).w().umask32(0xff000000); // dmastart
//map(0x1f9f0000, 0x1f9f0003).r().umask32(0xff000000); // prdy - turn off reset
//map(0x1f9f0004, 0x1f9f0007).r().umask32(0xff000000); // prst - turn on reset
@@ -417,10 +422,10 @@ void pi4d2x_state::map(address_map &map)
m_refresh_timer = machine().time();
});
- //map(0x1fa40008, 0x1fa4000b); // GDMA_DABR_PHYS descriptor array base register
- //map(0x1fa4000c, 0x1fa4000f); // GDMA_BUFADR_PHYS buffer address register
- map(0x1fa40010, 0x1fa40013).nopw().umask32(0xffff0000); // GDMA_BURST_PHYS burst/delay register (FIXME: silenced)
- //map(0x1fa40010, 0x1fa40013).umask32(0x0000ffff); // GDMA_BUFLEN_PHYS buffer length register
+ map(0x1fa40008, 0x1fa4000b).lrw32("gdma_dabr_phys", [this]() { return m_gdma_dabr; }, [this](u32 data) { m_gdma_dabr = data; });
+ map(0x1fa4000c, 0x1fa4000f).lrw32("gdma_bufadr_phys", [this]() { return m_gdma_bufadr; }, [this](u32 data) { m_gdma_bufadr = data; });
+ map(0x1fa40010, 0x1fa40013).lrw16("gdma_burst_phys", [this]() { return m_gdma_burst; }, [this](u16 data) { m_gdma_burst = data; }).umask32(0xffff0000);
+ map(0x1fa40010, 0x1fa40013).lrw16("gdma_buflen_phys", [this]() { return m_gdma_buflen; }, [this](u16 data) { m_gdma_buflen = data; }).umask32(0x0000ffff);
map(0x1fa60000, 0x1fa60003).lrw8("vmermw", [this]() { m_sysid |= SYSID_VMERMW; return 0; }, [this](u8 data) { m_sysid |= SYSID_VMERMW; }).umask32(0xff000000);
//map(0x1fa60004, 0x1fa60007).rw("actpup").umask32(0xff000000); // turn on active bus pullup
@@ -439,6 +444,8 @@ void pi4d2x_state::map(address_map &map)
map(0x1faa0000, 0x1faa0003).lrw8("clrerr", [this](offs_t offset) { m_parerr &= ~(PARERR_BYTE | (1 << offset)); return 0; }, [this](offs_t offset) { m_parerr &= ~(PARERR_BYTE | (1 << offset)); });
map(0x1faa0004, 0x1faa0007).lr8("parerr", [this]() { return m_parerr; }).umask32(0x00ff0000);
+ map(0x1fac0000, 0x1fac0003).lrw8("vrrst", [this]() { lio_interrupt<LIO_VR>(1); return 0; }, [this](u8 data) { lio_interrupt<LIO_VR>(1); }).umask32(0xff000000);
+
map(0x1fb00000, 0x1fb00003).rw(m_scsi, FUNC(wd33c93_device::indir_addr_r), FUNC(wd33c93_device::indir_addr_w)).umask32(0x00ff0000);
map(0x1fb00100, 0x1fb00103).rw(m_scsi, FUNC(wd33c93_device::indir_reg_r), FUNC(wd33c93_device::indir_reg_w)).umask32(0x00ff0000);
@@ -597,16 +604,17 @@ void pi4d2x_state::common(machine_config &config)
m_serial[1]->dcd_handler().set(m_duart[1], FUNC(scn2681_device::ip2_w));
// graphics
- SGI_GR12(config, m_gfx, 0);
+ SGI_GR1(config, m_gfx);
m_gfx->out_vblank().set(
[this](int state)
{
if (state)
- m_lio_isr |= (1U << LIO_VRSTAT);
- else
+ {
m_lio_isr &= ~(1U << LIO_VRSTAT);
-
- lio_interrupt<LIO_VR>(!state);
+ lio_interrupt<LIO_VR>(0);
+ }
+ else
+ m_lio_isr |= (1U << LIO_VRSTAT);
});
m_gfx->out_int_ge().set(*this, FUNC(pi4d2x_state::lio_interrupt<LIO_GE>)).invert();
m_gfx->out_int_fifo().set(*this, FUNC(pi4d2x_state::lio_interrupt<LIO_FIFO>)).invert();
@@ -635,6 +643,7 @@ void pi4d2x_state::initialize()
void pi4d2x_state::lio_interrupt(unsigned number, int state)
{
+ // TODO: special handling for fifo half-full interrupt
u16 const mask = 1 << number;
// record interrupt state
@@ -645,7 +654,7 @@ void pi4d2x_state::lio_interrupt(unsigned number, int state)
// update interrupt line
bool const lio_int = ~m_lio_isr & m_lio_imr;
- if (m_lio_imr ^ lio_int)
+ if (m_lio_int ^ lio_int)
{
m_lio_int = lio_int;
m_cpu->set_input_line(INPUT_LINE_IRQ1, m_lio_int);
diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp
index b9f66bcaf2c..824f15bcb41 100644
--- a/src/mame/drivers/aa310.cpp
+++ b/src/mame/drivers/aa310.cpp
@@ -95,6 +95,7 @@
#include "machine/ram.h"
#include "machine/wd_fdc.h"
#include "sound/volt_reg.h"
+#include "screen.h"
#include "softlist.h"
#include "speaker.h"
@@ -198,7 +199,7 @@ void aa310_state::aa310_mem(address_map &map)
map(0x00000000, 0x01ffffff).rw(FUNC(aa310_state::archimedes_memc_logical_r), FUNC(aa310_state::archimedes_memc_logical_w));
map(0x02000000, 0x02ffffff).ram().share("physicalram"); /* physical RAM - 16 MB for now, should be 512k for the A310 */
map(0x03000000, 0x033fffff).rw(FUNC(aa310_state::archimedes_ioc_r), FUNC(aa310_state::archimedes_ioc_w));
- map(0x03400000, 0x035fffff).rom().region("extension", 0x000000).w(FUNC(aa310_state::archimedes_vidc_w));
+ map(0x03400000, 0x035fffff).rom().region("extension", 0x000000).w(m_vidc, FUNC(acorn_vidc10_device::write));
map(0x03600000, 0x037fffff).rom().region("extension", 0x200000).w(FUNC(aa310_state::archimedes_memc_w));
map(0x03800000, 0x03ffffff).rom().region("maincpu", 0).w(FUNC(aa310_state::archimedes_memc_page_w));
}
@@ -428,12 +429,12 @@ void aa310_state::aa310(machine_config &config)
I2CMEM(config, "i2cmem", 0).set_data_size(0x100);
- /* video hardware */
- SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- m_screen->set_raw(16_MHz_XTAL, 1024, 0, 735, 624/2, 0, 292); // RiscOS 3 default screen settings
- m_screen->set_screen_update(FUNC(archimedes_state::screen_update));
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- PALETTE(config, m_palette).set_entries(32768);
+ ACORN_VIDC10(config, m_vidc, 24_MHz_XTAL);
+ m_vidc->set_screen("screen");
+ m_vidc->vblank().set(FUNC(aa310_state::vblank_irq));
+ m_vidc->sound_drq().set(FUNC(aa310_state::sound_drq));
RAM(config, m_ram).set_default_size("1M");
@@ -448,21 +449,6 @@ void aa310_state::aa310(machine_config &config)
SOFTWARE_LIST(config, "flop_list").set_original("archimedes");
- SPEAKER(config, "speaker").front_center();
- for (int i = 0; i < 8; i++)
- {
- DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, "speaker", 0.1); // unknown DAC
- }
- voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
- vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac5", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac5", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac6", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac6", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac7", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac7", -1.0, DAC_VREF_NEG_INPUT);
-
/* Expansion slots - 2-card backplane */
}
@@ -546,7 +532,12 @@ void aa310_state::aa4(machine_config &config)
m_maincpu->set_clock(24_MHz_XTAL); // ARM3
/* video hardware */
- m_screen->set_type(SCREEN_TYPE_LCD);
+ SCREEN(config.replace(), "screen", SCREEN_TYPE_LCD);
+
+ ACORN_VIDC10_LCD(config.replace(), m_vidc, 24_MHz_XTAL);
+ m_vidc->set_screen("screen");
+ m_vidc->vblank().set(FUNC(aa310_state::vblank_irq));
+ m_vidc->sound_drq().set(FUNC(aa310_state::sound_drq));
/* 765 FDC */
@@ -619,7 +610,7 @@ ROM_START( aa305 )
ROMX_LOAD( "0276,148-01.ic26", 0x000002, 0x10000, CRC(1ab02f2d) SHA1(dd7d216967524e64d1a03076a6081461ec8528c3), ROM_BIOS(8) | ROM_SKIP(3) )
ROMX_LOAD( "0276,149-01.ic27", 0x000003, 0x10000, CRC(5fd6a406) SHA1(790af8a4c74d0f6714d528f7502443ce5898a618), ROM_BIOS(8) | ROM_SKIP(3) )
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x400000, "extension", ROMREGION_ERASE00 )
ROM_REGION( 0x100, "i2cmem", ROMREGION_ERASE00 )
@@ -663,7 +654,7 @@ ROM_START( aa3000 )
ROM_SYSTEM_BIOS( 5, "319", "RISC OS 3.19 (09 Jun 1993)" ) // Parts 0296,241-01, 0296,242-01, 0296,243-01, 0296,244-01,
ROMX_LOAD( "riscos319.bin", 0x000000, 0x200000, CRC(00c7a3d3) SHA1(be7a8cba5d6c6c0e1c4838712524056cf4b8c8cb), ROM_BIOS(5) )
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x400000, "extension", ROMREGION_ERASE00 )
ROM_REGION( 0x100, "i2cmem", ROMREGION_ERASE00 )
@@ -700,7 +691,7 @@ ROM_START( aa5000 )
ROM_SYSTEM_BIOS( 3, "319", "RISC OS 3.19 (09 Jun 1993)" ) // Parts 0296,241-01, 0296,242-01, 0296,243-01, 0296,244-01,
ROMX_LOAD( "riscos319.bin", 0x000000, 0x200000, CRC(00c7a3d3) SHA1(be7a8cba5d6c6c0e1c4838712524056cf4b8c8cb), ROM_BIOS(3) )
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x400000, "extension", ROMREGION_ERASE00 )
ROM_REGION( 0x100, "i2cmem", ROMREGION_ERASE00 )
@@ -714,7 +705,7 @@ ROM_START( aa4 )
ROM_LOAD32_WORD( "0296,061-01.ic4", 0x000000, 0x100000, CRC(b77fe215) SHA1(57b19ea4b97a9b6a240aa61211c2c134cb295aa0) )
ROM_LOAD32_WORD( "0296,062-01.ic15", 0x000002, 0x100000, CRC(d42e196e) SHA1(64243d39d1bca38b10761f66a8042c883bde87a4) )
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x400000, "extension", ROMREGION_ERASE00 )
/* Power Management */
ROM_LOAD32_BYTE( "0296,063-01.ic38", 0x000003, 0x010000, CRC(9ca3a6be) SHA1(75905b031f49960605d55c3e7350d309559ed440) )
@@ -728,7 +719,7 @@ ROM_START( aa3010 )
ROM_LOAD32_WORD( "0296,061-02.ic17", 0x000000, 0x100000, CRC(552fc3aa) SHA1(b2f1911e53d7377f2e69e1a870139745d3df494b) )
ROM_LOAD32_WORD( "0296,062-02.ic18", 0x000002, 0x100000, CRC(308d5a4a) SHA1(b309e1dd85670a06d77ec504dbbec6c42336329f) )
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x400000, "extension", ROMREGION_ERASE00 )
ROM_REGION( 0x100, "i2cmem", ROMREGION_ERASE00 )
diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp
index 96d9c1219ef..810937ac4e2 100644
--- a/src/mame/drivers/acefruit.cpp
+++ b/src/mame/drivers/acefruit.cpp
@@ -101,7 +101,7 @@ void acefruit_state::acefruit_update_irq(int vpos)
switch( color )
{
case 0x0c:
- m_maincpu->set_input_line(0, HOLD_LINE );
+ m_maincpu->set_input_line(0, HOLD_LINE);
break;
}
}
@@ -116,15 +116,15 @@ void acefruit_state::device_timer(emu_timer &timer, device_timer_id id, int para
{
case TIMER_ACEFRUIT_REFRESH:
- m_screen->update_partial(vpos );
- acefruit_update_irq(vpos);
+ m_screen->update_partial(vpos);
+ acefruit_update_irq(vpos);
- vpos = ( ( vpos / 8 ) + 1 ) * 8;
+ vpos = ((vpos / 8) + 1) * 8;
- m_refresh_timer->adjust( m_screen->time_until_pos(vpos) );
- break;
+ m_refresh_timer->adjust(m_screen->time_until_pos(vpos));
+ break;
default:
- assert_always(false, "Unknown id in acefruit_state::device_timer");
+ throw emu_fatalerror("Unknown id in acefruit_state::device_timer");
}
}
diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp
index 5c0c93620ee..26a47bc9a6a 100644
--- a/src/mame/drivers/alpha68k.cpp
+++ b/src/mame/drivers/alpha68k.cpp
@@ -25,8 +25,17 @@
TODO:
- Super Stingray MCU irq controls timer speed, needs the MCU to be hooked up.
- Super Champion Baseball "ball speed" protection
-- Fix sound CPU crashes properly on Alpha 68k II / V HW games (nested NMIs)
-- Sky Soldiers : BGM Fade out before boss battle isn't implemented
+- II & V board: bit 15 of palette RAM isn't hooked up, according to Sky Adventure
+ service mode enables "bright", it is actually same as NeoGeo device;
+- II & V board: Fix sound CPU crashes properly (nested NMIs)
+- Sky Soldiers: BGM Fade out before boss battle isn't implemented
+- Sky Adventure, probably others: on a real PCB reference BGM stutters when using
+ 30 Hz autofire (not enough sound resources?)
+- Sky Adventure, probably others: sprite drawing is off-sync, cfr. notes in video file;
+- Gold Medalist: attract mode has missing finger on button 1, may be btanb;
+- Gold Medalist: missing blank effect on shooting pistol for dash events (palette bank actually used?);
+- Refactor sprite chips into proper devices, they all have 8-bit data buses and
+ have suspicious similarities with other SNK/Alpha HWs.
General notes:
@@ -665,14 +674,21 @@ void alpha68k_state::alpha68k_V_map(address_map &map)
map(0x0e0000, 0x0e0001).nopr(); /* IRQ ack? */
map(0x0e8000, 0x0e8001).nopr(); /* watchdog? */
map(0x100000, 0x100fff).ram().w(FUNC(alpha68k_state::videoram_w)).share("videoram");
- map(0x200000, 0x207fff).ram().share("spriteram");
+ map(0x200000, 0x207fff).ram().share("spriteram"); // 16k for gang wars/sky adventure, 32k for sbaseball (mirror?)
map(0x300000, 0x303fff).r(FUNC(alpha68k_state::alpha_V_trigger_r));
map(0x300000, 0x3001ff).w(FUNC(alpha68k_state::alpha_microcontroller_w));
map(0x303e00, 0x303fff).w(FUNC(alpha68k_state::alpha_microcontroller_w)); /* Gang Wars mirror */
- map(0x400000, 0x401fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
+ map(0x400000, 0x401fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // upper bank actually a mirror?
map(0x800000, 0x83ffff).rom().region("maincpu", 0x40000);
}
+void alpha68k_state::alpha68k_III_map(address_map &map)
+{
+ alpha68k_V_map(map);
+ map(0x300000, 0x3001ff).rw(FUNC(alpha68k_state::alpha_II_trigger_r), FUNC(alpha68k_state::alpha_microcontroller_w));
+ map(0x300200, 0x303fff).unmaprw();
+}
+
u16 alpha68k_state::sound_cpu_r(){ return 1; }
void alpha68k_state::tnextspc_map(address_map &map)
@@ -1225,23 +1241,25 @@ static INPUT_PORTS_START( skysoldr )
INPUT_PORTS_END
static INPUT_PORTS_START( goldmedl )
- PORT_START("IN0") /* 3 buttons per player, no joystick */
+ // 3 buttons per player, no joystick
+ // arrangement confirmed by attract mode
+ PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* START3 is mapped elsewhere */
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // START3 is mapped on dip
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN1") /* 3 buttons per player, no joystick */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
@@ -1252,19 +1270,20 @@ static INPUT_PORTS_START( goldmedl )
PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW)
/* 2 physical sets of _6_ dip switches */
- PORT_DIPNAME( 0x04, 0x00, "Event Select" ) PORT_DIPLOCATION("SW1:1")
+ // defaults are retrieved from Gold Medalist Romstar manual
+ PORT_DIPNAME( 0x04, 0x04, "Event Select" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x88, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:2,6")
+ PORT_DIPNAME( 0x88, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:2,6")
PORT_DIPSETTING( 0x00, "Upright 2 Players" )
PORT_DIPSETTING( 0x80, "Upright 4 Players" )
PORT_DIPSETTING( 0x88, DEF_STR( Cocktail ) )
- //PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) ) /* Not documented. */
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 ) PORT_DIPLOCATION("SW1:3") /* Listed as "Always OFF". */
- PORT_DIPNAME( 0x20, 0x20, "Speed For 100M Dash" ) PORT_DIPLOCATION("SW1:4")
+ PORT_DIPSETTING( 0x08, "Cocktail (duplicate)" ) // not documented in manual
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 ) PORT_DIPLOCATION("SW1:3") // dip listed as "Always OFF" in manual, is start3 really routed here?
+ PORT_DIPNAME( 0x20, 0x00, "Speed For 100M Dash" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00, "10 Beats For Max Speed" )
PORT_DIPSETTING( 0x20, "14 Beats For Max Speed" )
- PORT_DIPNAME( 0x40, 0x40, "Computer Demonstration" ) PORT_DIPLOCATION("SW1:5")
+ PORT_DIPNAME( 0x40, 0x00, "Computer Demonstration" ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
@@ -1275,6 +1294,7 @@ static INPUT_PORTS_START( goldmedl )
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) )
ALPHA68K_COINAGE_BITS_2TO4
+ // TODO: default is actually demo sounds OFF
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1482,8 +1502,6 @@ static INPUT_PORTS_START( sbasebal )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
-
-
static INPUT_PORTS_START( sbasebalj )
PORT_START("IN0")
ALPHA68K_PLAYER_INPUT_LSB( 1, IPT_BUTTON3, IPT_START1, IP_ACTIVE_LOW )
@@ -2198,6 +2216,16 @@ void alpha68k_state::alpha68k_V_sb(machine_config &config)
m_screen->set_screen_update(FUNC(alpha68k_state::screen_update_alpha68k_V_sb));
}
+// goldmedla
+void alpha68k_state::alpha68k_III(machine_config &config)
+{
+ // TODO: we conveniently override this, base should really be shuffled around in the first place.
+ alpha68k_V_sb(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &alpha68k_state::alpha68k_III_map);
+ m_maincpu->set_vblank_int("screen", FUNC(alpha68k_state::irq1_line_hold));
+ m_maincpu->set_periodic_int(FUNC(alpha68k_state::irq2_line_hold), attotime::from_hz(60*3)); // MCU irq
+}
+
void alpha68k_state::tnextspc(machine_config &config)
{
/* basic machine hardware */
@@ -2777,8 +2805,7 @@ ROM_START( goldmedla )
ROM_LOAD( "alpha.mcu", 0x000, 0x1000, NO_DUMP )
ROM_REGION( 0x010000, "gfx1", 0 ) /* chars */
- ROM_LOAD16_BYTE( "gm.6", 0x00001, 0x08000, CRC(56020b13) SHA1(17e176a9c82ed0d6cb5c4014034ce4e16b8ef4fb) )
- ROM_LOAD16_BYTE( "gm.5", 0x00000, 0x08000, CRC(667f33f1) SHA1(6d05603b49927f09c9bb34e787b003eceaaf7062) )
+ ROM_LOAD( "gm5-1.bin", 0x000000, 0x10000, CRC(77c601a3) SHA1(5db88b0000fa5e460aa431ca7b75e8fcf629e31e) )
ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
ROM_LOAD32_BYTE( "goldchr3.c46", 0x000000, 0x80000, CRC(6faaa07a) SHA1(8c81ac35220835691d7620b334e83f1fb4f79a52) )
@@ -2786,8 +2813,9 @@ ROM_START( goldmedla )
ROM_LOAD32_BYTE( "goldchr1.c44", 0x000002, 0x80000, CRC(55db41cd) SHA1(15fa192ea2b829dc6dc0cb88fc2c5e5a30af6c91) )
ROM_LOAD32_BYTE( "goldchr0.c43", 0x000003, 0x80000, CRC(76572c3f) SHA1(e7a1abf4240510810a0f9663295c0fbab9e55a63) )
- ROM_REGION( 0x10000, "user1", 0 ) // unknown
- ROM_LOAD( "gm5-1.bin", 0x000000, 0x10000, CRC(77c601a3) SHA1(5db88b0000fa5e460aa431ca7b75e8fcf629e31e) )
+ ROM_REGION( 0x10000, "user1", 0 ) // TODO: legacy gfx roms, are these even on this specific board?
+ ROM_LOAD16_BYTE( "gm.6", 0x00001, 0x08000, BAD_DUMP CRC(56020b13) SHA1(17e176a9c82ed0d6cb5c4014034ce4e16b8ef4fb) )
+ ROM_LOAD16_BYTE( "gm.5", 0x00000, 0x08000, BAD_DUMP CRC(667f33f1) SHA1(6d05603b49927f09c9bb34e787b003eceaaf7062) )
ROM_END
//AT: the bootleg set has strong resemblance of "goldmed7" on an Alpha-68K96III system board
@@ -2806,10 +2834,7 @@ ROM_START( goldmedlb )
ROM_LOAD( "1.bin", 0x30000, 0x10000, CRC(1e78062c) SHA1(821c037edf32eb8b03e5c487d3bab0622337e80b) )
ROM_REGION( 0x010000, "gfx1", 0 ) /* chars */
- ROM_LOAD16_BYTE( "gm.6", 0x00001, 0x08000, CRC(56020b13) SHA1(17e176a9c82ed0d6cb5c4014034ce4e16b8ef4fb) )
- ROM_LOAD16_BYTE( "gm.5", 0x00000, 0x08000, CRC(667f33f1) SHA1(6d05603b49927f09c9bb34e787b003eceaaf7062) )
- // TODO: recover this!
- // ROM_LOAD( "33.bin", 0x00000, 0x10000, CRC(05600b13) )
+ ROM_LOAD( "l_5.bin", 0x00000, 0x10000, CRC(77c601a3) SHA1(5db88b0000fa5e460aa431ca7b75e8fcf629e31e) ) // identical to gm5-1.bin in "goldmed7"
/* I haven't yet verified if these are the same as the bootleg */
@@ -2819,8 +2844,11 @@ ROM_START( goldmedlb )
ROM_LOAD32_BYTE( "goldchr1.c44", 0x000002, 0x80000, CRC(55db41cd) SHA1(15fa192ea2b829dc6dc0cb88fc2c5e5a30af6c91) )
ROM_LOAD32_BYTE( "goldchr0.c43", 0x000003, 0x80000, CRC(76572c3f) SHA1(e7a1abf4240510810a0f9663295c0fbab9e55a63) )
- ROM_REGION( 0x10000, "user1", 0 ) //AT: banked data for the main 68k code?
- ROM_LOAD( "l_5.bin", 0x00000, 0x10000, CRC(77c601a3) SHA1(5db88b0000fa5e460aa431ca7b75e8fcf629e31e) ) // identical to gm5-1.bin in "goldmed7"
+ ROM_REGION( 0x10000, "user1", 0 ) // TODO: legacy gfx roms, are these even on this specific board?
+ ROM_LOAD16_BYTE( "gm.6", 0x00001, 0x08000, BAD_DUMP CRC(56020b13) SHA1(17e176a9c82ed0d6cb5c4014034ce4e16b8ef4fb) )
+ ROM_LOAD16_BYTE( "gm.5", 0x00000, 0x08000, BAD_DUMP CRC(667f33f1) SHA1(6d05603b49927f09c9bb34e787b003eceaaf7062) )
+ // TODO: recover this!
+ // ROM_LOAD( "33.bin", 0x00000, 0x10000, CRC(05600b13) )
ROM_END
ROM_START( skyadvnt )
@@ -2840,7 +2868,7 @@ ROM_START( skyadvnt )
ROM_REGION( 0x08000, "gfx1", 0 ) /* chars */
ROM_LOAD( "sa.7", 0x000000, 0x08000, CRC(ea26e9c5) SHA1(13cb5a5955c813cd48f98f62f045a4cbc61806a1) )
- ROM_REGION( 0x280000, "gfx2", 0 ) /* sprites */
+ ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
ROM_LOAD32_BYTE( "sachr3", 0x000000, 0x80000, CRC(a986b8d5) SHA1(e8e2f3e0f85b9565243eab7dc8606168811f41e4) )
ROM_LOAD32_BYTE( "sachr2", 0x000001, 0x80000, CRC(504b07ae) SHA1(ba74f74c1cb04dd1ab4acf518099605ec9c71f94) )
ROM_LOAD32_BYTE( "sachr1", 0x000002, 0x80000, CRC(e734dccd) SHA1(24258dd5994f1b14600fc354b0ab36f870967afc) )
@@ -2864,7 +2892,7 @@ ROM_START( skyadvntu )
ROM_REGION( 0x08000, "gfx1", 0 ) /* chars */
ROM_LOAD( "sa.7", 0x000000, 0x08000, CRC(ea26e9c5) SHA1(13cb5a5955c813cd48f98f62f045a4cbc61806a1) )
- ROM_REGION( 0x280000, "gfx2", 0 ) /* sprites */
+ ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
ROM_LOAD32_BYTE( "sachr3", 0x000000, 0x80000, CRC(a986b8d5) SHA1(e8e2f3e0f85b9565243eab7dc8606168811f41e4) )
ROM_LOAD32_BYTE( "sachr2", 0x000001, 0x80000, CRC(504b07ae) SHA1(ba74f74c1cb04dd1ab4acf518099605ec9c71f94) )
ROM_LOAD32_BYTE( "sachr1", 0x000002, 0x80000, CRC(e734dccd) SHA1(24258dd5994f1b14600fc354b0ab36f870967afc) )
@@ -2888,7 +2916,7 @@ ROM_START( skyadvntj )
ROM_REGION( 0x08000, "gfx1", 0 ) /* chars */
ROM_LOAD( "sa.7", 0x000000, 0x08000, CRC(ea26e9c5) SHA1(13cb5a5955c813cd48f98f62f045a4cbc61806a1) )
- ROM_REGION( 0x280000, "gfx2", 0 ) /* sprites */
+ ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
ROM_LOAD32_BYTE( "sachr3", 0x000000, 0x80000, CRC(a986b8d5) SHA1(e8e2f3e0f85b9565243eab7dc8606168811f41e4) )
ROM_LOAD32_BYTE( "sachr2", 0x000001, 0x80000, CRC(504b07ae) SHA1(ba74f74c1cb04dd1ab4acf518099605ec9c71f94) )
ROM_LOAD32_BYTE( "sachr1", 0x000002, 0x80000, CRC(e734dccd) SHA1(24258dd5994f1b14600fc354b0ab36f870967afc) )
@@ -3081,7 +3109,7 @@ ROM_START( sbasebal )
ROM_REGION( 0x10000, "gfx1", 0 ) /* chars */
ROM_LOAD( "sb-7.l3", 0x000000, 0x10000, CRC(8f3c2e25) SHA1(a5b3880f3079cce607678fd4ea5971560ce9ed8d) )
- ROM_REGION( 0x280000, "gfx2", 0 ) /* sprites */
+ ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
ROM_LOAD32_BYTE( "kcb-chr3.h21", 0x000000, 0x80000, CRC(719071c7) SHA1(47eded73eae25af04cf369f1a8ee657fd06b6480) )
ROM_LOAD32_BYTE( "kcb-chr2.h19", 0x000001, 0x80000, CRC(014f0f90) SHA1(e80594f06faf303c4034a711fe55dad046ebf9aa) )
ROM_LOAD32_BYTE( "kcb-chr1.h18", 0x000002, 0x80000, CRC(a5ce1e10) SHA1(c91cad45a918166155be3f93f4ed299389579f4a) )
@@ -3105,7 +3133,7 @@ ROM_START( sbasebalj )
ROM_REGION( 0x10000, "gfx1", 0 ) /* chars */
ROM_LOAD( "sb-7.l3", 0x000000, 0x10000, CRC(8f3c2e25) SHA1(a5b3880f3079cce607678fd4ea5971560ce9ed8d) )
- ROM_REGION( 0x280000, "gfx2", 0 ) /* sprites */
+ ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
ROM_LOAD32_BYTE( "kcb-chr3.h21", 0x000000, 0x80000, CRC(719071c7) SHA1(47eded73eae25af04cf369f1a8ee657fd06b6480) )
ROM_LOAD32_BYTE( "kcb-chr2.h19", 0x000001, 0x80000, CRC(014f0f90) SHA1(e80594f06faf303c4034a711fe55dad046ebf9aa) )
ROM_LOAD32_BYTE( "kcb-chr1.h18", 0x000002, 0x80000, CRC(a5ce1e10) SHA1(c91cad45a918166155be3f93f4ed299389579f4a) )
@@ -3368,9 +3396,9 @@ GAME( 1988, skysoldr, 0, alpha68k_II, skysoldr, alpha68k_state, init
GAME( 1988, skysoldrbl,skysoldr, alpha68k_II, skysoldr, alpha68k_state, init_skysoldr, ROT90, "bootleg", "Sky Soldiers (bootleg)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, goldmedl, 0, alpha68k_II_gm, goldmedl, alpha68k_state, init_goldmedl, ROT0, "SNK", "Gold Medalist (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, goldmedla, goldmedl, alpha68k_II_gm, goldmedl, alpha68k_state, init_goldmedla, ROT0, "SNK", "Gold Medalist (set 2)", MACHINE_SUPPORTS_SAVE|MACHINE_UNEMULATED_PROTECTION|MACHINE_IMPERFECT_GRAPHICS ) // current handling never really accesses video banking other than boot time.
-GAME( 1988, goldmedlb, goldmedl, alpha68k_II_gm, goldmedl, alpha68k_state, init_goldmedla, ROT0, "bootleg", "Gold Medalist (bootleg)", MACHINE_UNEMULATED_PROTECTION|MACHINE_IMPERFECT_GRAPHICS ) // same as above
+GAME( 1988, goldmedl, 0, alpha68k_II_gm, goldmedl, alpha68k_state, init_goldmedl, ROT0, "SNK", "Gold Medalist (set 1, Alpha68k II PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, goldmedla, goldmedl, alpha68k_III, goldmedl, alpha68k_state, init_goldmedla, ROT0, "SNK", "Gold Medalist (set 2, Alpha68k III PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, goldmedlb, goldmedl, alpha68k_III, goldmedl, alpha68k_state, init_goldmedla, ROT0, "bootleg", "Gold Medalist (bootleg, Alpha68k III PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, skyadvnt, 0, alpha68k_V, skyadvnt, alpha68k_state, init_skyadvnt, ROT90, "Alpha Denshi Co.", "Sky Adventure (World)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, skyadvntu, skyadvnt, alpha68k_V, skyadvntu, alpha68k_state, init_skyadvntu, ROT90, "Alpha Denshi Co. (SNK of America license)", "Sky Adventure (US)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp
index 7c8dd90d45c..58cd91fd1ee 100644
--- a/src/mame/drivers/amust.cpp
+++ b/src/mame/drivers/amust.cpp
@@ -168,7 +168,7 @@ void amust_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_beep->set_state(0);
break;
default:
- assert_always(false, "Unknown id in amust_state::device_timer");
+ throw emu_fatalerror("Unknown id in amust_state::device_timer");
}
}
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp
index d4efe41a5a2..b70bbfc61a4 100644
--- a/src/mame/drivers/apple2e.cpp
+++ b/src/mame/drivers/apple2e.cpp
@@ -1658,8 +1658,8 @@ READ8_MEMBER(apple2e_state::c000_r)
return rv;
}
- case 0x11: // read LCRAM2 (LC Dxxx bank), also reads like $C010 without strobe reset
- return (m_lcram2 ? 0x80 : 0x00) | m_strobe | m_transchar;
+ case 0x11: // read LCRAM2 (LC Dxxx bank)
+ return (m_lcram2 ? 0x80 : 0x00) | m_transchar;
case 0x12: // read LCRAM (is LC readable?)
return (m_lcram ? 0x80 : 0x00) | m_transchar;
diff --git a/src/mame/drivers/argo.cpp b/src/mame/drivers/argo.cpp
index 869cf2da03b..afb228bed4b 100644
--- a/src/mame/drivers/argo.cpp
+++ b/src/mame/drivers/argo.cpp
@@ -434,7 +434,7 @@ void argo_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in argo_state::device_timer");
+ throw emu_fatalerror("Unknown id in argo_state::device_timer");
}
}
diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp
index 434531d1d29..f9faaf5c073 100644
--- a/src/mame/drivers/aristmk4.cpp
+++ b/src/mame/drivers/aristmk4.cpp
@@ -1754,7 +1754,7 @@ void aristmk4_state::device_timer(emu_timer &timer, device_timer_id id, int para
switch (id)
{
case TIMER_POWER_FAIL: power_fail(); break;
- default: assert_always(false, "Unknown id in aristmk4_state::device_timer");
+ default: throw emu_fatalerror("Unknown id in aristmk4_state::device_timer");
}
}
diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp
index 95aec608b5b..dca98b1d51e 100644
--- a/src/mame/drivers/aristmk5.cpp
+++ b/src/mame/drivers/aristmk5.cpp
@@ -590,8 +590,6 @@
#include "machine/nvram.h"
#include "machine/ins8250.h"
#include "machine/ticket.h"
-#include "sound/volt_reg.h"
-#include "speaker.h"
// Non-US button layouts Bet buttons Lines Gamble Other
#include "aristmk5.lh" // 1, 2, 3, 5, 10 20 suits Take Win/Start Feature
@@ -1155,7 +1153,7 @@ void aristmk5_state::aristmk5_map(address_map &map)
map(0x03320000, 0x0333ffff).rw(FUNC(aristmk5_state::sram_r), FUNC(aristmk5_state::sram_w)).umask32(0x000000ff);
- map(0x03400000, 0x035fffff).w(FUNC(aristmk5_state::archimedes_vidc_w));
+ map(0x03400000, 0x035fffff).w(m_vidc, FUNC(acorn_vidc10_device::write));
map(0x03600000, 0x037fffff).w(FUNC(aristmk5_state::archimedes_memc_w));
map(0x03800000, 0x039fffff).w(FUNC(aristmk5_state::archimedes_memc_page_w));
@@ -2294,14 +2292,12 @@ void aristmk5_state::aristmk5(machine_config &config)
/* TODO: this isn't supposed to access a keyboard ... */
AAKART(config, m_kart, 12000000/128); // TODO: frequency
- SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- m_screen->set_refresh_hz(60);
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
- m_screen->set_size(640, 400);
- m_screen->set_visarea(0, 640-1, 0, 400-1);
- m_screen->set_screen_update(FUNC(archimedes_state::screen_update));
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- PALETTE(config, m_palette).set_entries(0x200);
+ ACORN_VIDC10(config, m_vidc, MASTER_CLOCK/3);
+ m_vidc->set_screen("screen");
+ m_vidc->vblank().set(FUNC(aristmk5_state::vblank_irq));
+ m_vidc->sound_drq().set(FUNC(aristmk5_state::sound_drq));
EEPROM_93C56_16BIT(config, m_eeprom[0]);
EEPROM_93C56_16BIT(config, m_eeprom[1]);
@@ -2337,21 +2333,6 @@ void aristmk5_state::aristmk5(machine_config &config)
DS1302(config, m_rtc, 32.768_kHz_XTAL);
HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW);
-
- SPEAKER(config, "speaker").front_center();
- for (int i = 0; i < 8; i++)
- {
- DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, "speaker", 0.1); // unknown DAC
- }
- voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
- vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac5", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac5", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac6", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac6", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac7", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac7", -1.0, DAC_VREF_NEG_INPUT);
}
@@ -2422,7 +2403,7 @@ ROM_START( aristmk5 )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 )
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2448,7 +2429,7 @@ ROM_START( adonis )
ROM_LOAD32_WORD( "0200751v.u12", 0x100002, 0x80000, CRC(443a7b6d) SHA1(c19a1c50fb8774826a1e12adacba8bbfce320891) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2473,7 +2454,7 @@ ROM_START( adonisa )
ROM_LOAD32_WORD( "0100751v.u12", 0x100002, 0x80000, CRC(77090858) SHA1(76ebc15b26f378ac95276f0aa26d077e3646a6f1) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2500,7 +2481,7 @@ ROM_START( adonisu )
ROM_LOAD32_WORD( "bhg1508.u12", 0x100002, 0x80000, CRC(b8995b25) SHA1(ad39ad11dc02dbbe8be99d81c96e9fc3191726ad) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2528,7 +2509,7 @@ ROM_START( adonisce )
ROM_LOAD32_WORD( "0201005v.u13", 0x200002, 0x80000, CRC(e005a7e8) SHA1(cbb313f5d1d04c5a441b3f92b7a90a281ddb4885) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2558,7 +2539,7 @@ ROM_START( alchemst )
ROM_LOAD32_WORD( "01j02046.u13", 0x200002, 0x80000, CRC(6b791adf) SHA1(f00923101f926034603243a3c63e1010b044829e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2585,7 +2566,7 @@ ROM_START( baddog )
ROM_LOAD32_WORD( "0200428v.u13", 0x200002, 0x80000, CRC(883b2ec3) SHA1(5b431d8c9c8eabca65ab22dcf2bdb22d49445bb1) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2611,7 +2592,7 @@ ROM_START( blackpnt )
ROM_LOAD32_WORD( "0200818v.u12", 0x100002, 0x80000, BAD_DUMP CRC(bb2bf7bb) SHA1(f88208238a69fc79e33af17f39e25cd2857d7172) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2639,7 +2620,7 @@ ROM_START( bootsctn )
ROM_LOAD32_WORD( "0100812v.u14", 0x300002, 0x80000, CRC(75b9b89e) SHA1(08d487b3722f2ea5d2d18c78f571a44c78616dbe) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2672,7 +2653,7 @@ ROM_START( bootsctnu )
ROM_LOAD32_WORD( "ghg101202.u14", 0x300002, 0x80000, CRC(18934c51) SHA1(f7c9c95c687dbfe89747e7877157fde37bc1119e) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2701,7 +2682,7 @@ ROM_START( bootsctnua )
ROM_LOAD32_WORD( "ghg100803.u14", 0x300002, 0x80000, CRC(9759692e) SHA1(7666027e21af27329720127367a780776973c515) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2731,7 +2712,7 @@ ROM_START( bootsctnub )
ROM_LOAD32_WORD( "ahg1547.u14", 0x300002, 0x80000, CRC(de2888e2) SHA1(f614d68c0e09912e9126cb024f54ed32ee50b57e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2763,7 +2744,7 @@ ROM_START( bparty )
ROM_LOAD32_WORD( "bhg1248.u14", 0x300002, 0x80000, CRC(b276d61a) SHA1(8bee7fa551caec3da03afa061612c153f7b48cdb) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2787,7 +2768,7 @@ ROM_START( bpartya )
ROM_LOAD32_WORD( "bhg1579.u14", 0x300002, 0x7ff94, BAD_DUMP CRC(34ffe312) SHA1(34432e57e2e3dd90c15dd3ff7cb16d8381343be8) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2809,7 +2790,7 @@ ROM_START( bumblbug )
ROM_LOAD32_WORD( "0200510v.u11", 0x000002, 0x80000, CRC(5d888245) SHA1(bbbe61e09bebd5fcb79f060d5caee15100c9a685) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2834,7 +2815,7 @@ ROM_START( bumblbugql )
ROM_LOAD32_WORD( "0200456v.u12", 0x100002, 0x80000, CRC(9f0d7615) SHA1(1453b1476510e1dd68bc14feba72dc59b9dfe676) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2863,7 +2844,7 @@ ROM_START( bumblbugu )
ROM_LOAD32_WORD( "chg047903.u12", 0x100002, 0x80000, CRC(7dbb634b) SHA1(f7a752240989032af142f4cd6e4260a12a5b4c0a) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2893,7 +2874,7 @@ ROM_START( bumblbugua )
ROM_LOAD32_WORD( "chg047999.u12", 0x100002, 0x80000, CRC(7dbb634b) SHA1(f7a752240989032af142f4cd6e4260a12a5b4c0a) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2918,7 +2899,7 @@ ROM_START( buttdeli )
ROM_LOAD32_WORD( "0200143v.u12", 0x100002, 0x80000, CRC(0d58cf28) SHA1(aa65b7ee88b5bc872008a46e60bd49d9e5eda153) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2937,7 +2918,7 @@ ROM_START( canrose )
ROM_LOAD32_WORD( "ahg1463.u12", 0x100002, 0x7f4fc, CRC(5fe736c2) SHA1(d7c1a3f003085848e413aa499d9eaecca74773da) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2962,7 +2943,7 @@ ROM_START( cashcat )
ROM_LOAD32_WORD( "0100676v.u12", 0x100002, 0x80000, CRC(a7199f5f) SHA1(6a46935c095b1d89307921e3a53b48032e6f45fa) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -2987,7 +2968,7 @@ ROM_START( cashcata )
ROM_LOAD32_WORD( "0100557v.u12", 0x100002, 0x80000, CRC(bdeeafd3) SHA1(a95a44ff8534bb030d696a37821f3e53072f2947) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3005,7 +2986,7 @@ ROM_START( cashcatnz )
ROM_LOAD32_WORD( "0300863v.u12", 0x100002, 0x80000, CRC(f930fc07) SHA1(cb3fdbd5b87af7b14067f7999740470d3cf434df) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3030,7 +3011,7 @@ ROM_START( cashcham )
ROM_LOAD32_WORD( "0100438v.u12", 0x100002, 0x80000, CRC(7ae3b5db) SHA1(238698b72f529ac4fb292d08267069d1da01b43b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3055,7 +3036,7 @@ ROM_START( cashchama )
ROM_LOAD32_WORD( "0200437v.u12", 0x100002, 0x80000, CRC(571aab82) SHA1(03895d1a08d2dd868fd594db1aaeb29b295f0d98) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3073,7 +3054,7 @@ ROM_START( cashchamnz )
ROM_LOAD32_WORD( "0300781v.u12", 0x100002, 0x80000, CRC(2aeb0265) SHA1(50e526ecccfdd35f7e156e1873cf4c81fb117069) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3101,7 +3082,7 @@ ROM_START( cashchamu )
ROM_LOAD32_WORD( "dhg407899.u12", 0x100002, 0x80000, CRC(2fd087f8) SHA1(f16414abf58e1a7a8ca08380993bdeca6f9c7317) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3126,7 +3107,7 @@ ROM_START( cashcra5 )
ROM_LOAD32_WORD( "0300467v.u12", 0x100002, 0x80000, CRC(570c7f8a) SHA1(7c9527e0b37970b7960c723727c3c650a48e8125) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3144,7 +3125,7 @@ ROM_START( cashcra5a )
ROM_LOAD32_WORD( "0300447v.u12", 0x100002, 0x7fe36, BAD_DUMP CRC(ef641efa) SHA1(52e54ed933352cde0f280ba2b3e9bae01c4aae7e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3169,7 +3150,7 @@ ROM_START( chariotc )
ROM_LOAD32_WORD( "0100787v.u12", 0x100002, 0x80000, CRC(b44cf571) SHA1(04447820e015425493cade5611b3eb2f21e48c2e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3196,7 +3177,7 @@ ROM_START( chariotcv )
ROM_LOAD32_WORD( "04j00714.u12", 0x100002, 0x80000, CRC(b8d4a5ec) SHA1(097e44cdb30b9aafd7f5358c8f0cdd130ec0615e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3224,7 +3205,7 @@ ROM_START( checkma5 )
ROM_LOAD32_WORD( "01j00681.u13", 0x200002, 0x80000, CRC(ad12a718) SHA1(0c36729cb8da800668f533f65fcc870f5dfc0f6a) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3250,7 +3231,7 @@ ROM_START( chickna5 )
ROM_LOAD32_WORD( "0100351v.u13", 0x200002, 0x80000, CRC(88a1ccae) SHA1(e242f48f99044b4fdf1bf36d8e105df09f94aa50) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3279,7 +3260,7 @@ ROM_START( chickna5ql )
ROM_LOAD32_WORD( "0200530v.u14", 0x300002, 0x80000, CRC(e87cf6c9) SHA1(a330644658da6100d7231b1c47260dc7f2e88448) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3314,7 +3295,7 @@ ROM_START( chickna5u )
ROM_LOAD32_WORD( "rhg073003.u14", 0x300002, 0x80000, CRC(240f7759) SHA1(1fa5ba0185b027101dae207ec5d28b07d3d73fc2) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3347,7 +3328,7 @@ ROM_START( chickna5ua )
ROM_LOAD32_WORD( "rhg073099.u14", 0x300002, 0x80000, CRC(240f7759) SHA1(1fa5ba0185b027101dae207ec5d28b07d3d73fc2) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3376,7 +3357,7 @@ ROM_START( chickna5v )
ROM_LOAD32_WORD( "01j01886.u13", 0x200002, 0x80000, BAD_DUMP CRC(231ca698) SHA1(eb237652974228994e793f0dc87de93095db3c9c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3401,7 +3382,7 @@ ROM_START( coralrc2 )
ROM_LOAD32_WORD( "0100919v.u12", 0x100002, 0x80000, CRC(9ea140b5) SHA1(11f6b9ab60117f236b464c9dbc939dfb8f240359) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3426,7 +3407,7 @@ ROM_START( cuckoo )
ROM_LOAD32_WORD( "0200753v.u12", 0x100002, 0x80000, CRC(cb706eb7) SHA1(cbd6235ca7a29c78ef2cb659d9c21466ed39b360) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3454,7 +3435,7 @@ ROM_START( cuckoou )
ROM_LOAD32_WORD( "chg1195.u12", 0x100002, 0x80000, CRC(00bb7597) SHA1(f4d6b21091e320a82d59477469340633b001ed0d) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -3491,7 +3472,7 @@ ROM_START( dstbloom )
ROM_LOAD32_WORD( "0300111v.u12", 0x100002, 0x80000, CRC(10cf45b3) SHA1(3f47682ed95f65bdb267f911e113e329ad448167) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3517,7 +3498,7 @@ ROM_START( dstblooma )
ROM_LOAD32_WORD( "0200111v.u12", 0x100002, 0x80000, CRC(0ad41815) SHA1(131efc6ed45d8f44a667bd30380c9e37c64f2c42) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3538,7 +3519,7 @@ ROM_START( diamdest )
ROM_LOAD32_WORD( "ahg1533.u13", 0x200002, 0x7ffeb, BAD_DUMP CRC(612a6bf2) SHA1(01ee8854204da0610aa4ab3a36c3e517906d2ab4) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3566,7 +3547,7 @@ ROM_START( diamdove )
ROM_LOAD32_WORD( "0101018v.u13", 0x200002, 0x80000, CRC(952a850f) SHA1(66da391af532f9ef531d10995c96a90eb71cd09a) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3588,7 +3569,7 @@ ROM_START( dmdfever )
ROM_LOAD32_WORD( "0200302v.u11", 0x000002, 0x80000, CRC(29620f05) SHA1(172b6226c443931f0c4ddc44a63c8fc0e6be3824) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASEFF )
ROM_END
@@ -3607,7 +3588,7 @@ ROM_START( dimtouch )
ROM_LOAD32_WORD( "0400433v.u12", 0x100002, 0x80000, CRC(9e0d08e2) SHA1(38b10f7c37f1cefe9271549073dc0a4fed409aec) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASEFF )
ROM_END
@@ -3629,7 +3610,7 @@ ROM_START( dolphntr )
ROM_LOAD32_WORD( "0200424v.u11", 0x000002, 0x80000, CRC(bcb732ea) SHA1(838300914846c6e740780e5a24b9db7304a8a88d) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3655,7 +3636,7 @@ ROM_START( dolphntra )
ROM_LOAD32_WORD( "0100424v.u12", 0x100002, 0x80000, CRC(6abd9309) SHA1(c405a13f5bfe447c1ab20d92e140e4fb145920d4) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3680,7 +3661,7 @@ ROM_START( dolphntrb )
ROM_LOAD32_WORD( "0100388v.u12", 0x100002, 0x80000, CRC(1a1fbbcf) SHA1(6e3772dcccd9b5958bec3bfac9af22b2eabca32e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3712,7 +3693,7 @@ ROM_START( dolphntrce )
ROM_LOAD32_WORD( "ahg1607.u14", 0x300002, 0x80000, CRC(6f522ffb) SHA1(0fbba6b8df15631e4361daf505469f2214ad8695) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3744,7 +3725,7 @@ ROM_START( dolphntrcea )
ROM_LOAD32_WORD( "ahg1606.u14", 0x300002, 0x80000, CRC(c6c59ed6) SHA1(0ce8e5824c5937ffe2eeb34320db9dc568bca7cb) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3776,7 +3757,7 @@ ROM_START( dolphntrceb )
ROM_LOAD32_WORD( "ahg1519.u14", 0x300002, 0x80000, CRC(f2da081c) SHA1(5202741719d72a9290bda2c646d37e8c8ad41c04) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3801,7 +3782,7 @@ ROM_START( dolphntrql )
ROM_LOAD32_WORD( "0101250v.u12", 0x100002, 0x80000, CRC(35236e6f) SHA1(f196f12a1761a235ad66f4e181ca249b1df7e245) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3828,7 +3809,7 @@ ROM_START( dolphntru )
ROM_LOAD32_WORD( "fhg407702.u12", 0x100002, 0x80000, CRC(8ee1c2d3) SHA1(e6ecaaac0cb4518ecc0d36532ab532f46e3e628b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -3863,7 +3844,7 @@ ROM_START( drgneye )
ROM_LOAD32_WORD( "0100521v.u11", 0x000002, 0x80000, CRC(2bb47749) SHA1(796f610e5202b5eb26a6e901d43ee5d9e3f95332) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3882,7 +3863,7 @@ ROM_START( dreamwv )
ROM_LOAD32_WORD( "0200586v.u12", 0x100002, 0x80000, CRC(0b3e03d3) SHA1(966ec84aff686ad360d440995b81ae469539a5b5) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3909,7 +3890,7 @@ ROM_START( dynajack )
ROM_LOAD32_WORD( "01j00081.u13", 0x200002, 0x80000, CRC(d204ff9c) SHA1(8ac5533928fb3ca247dc85cea67da45a6743f732) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3930,7 +3911,7 @@ ROM_START( dynajacku )
ROM_LOAD32_WORD( "chg1562.u13", 0x200002, 0x80000, CRC(5a2220d7) SHA1(aca5fefb60af93ba776cc695e9a7ea406f527937) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3952,7 +3933,7 @@ ROM_START( eldorda5 )
ROM_LOAD32_WORD( "0100652v.u11", 0x000002, 0x80000, CRC(35233cf8) SHA1(e02477526f2f9e2663c1876f543d138b2caf28df) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3974,7 +3955,7 @@ ROM_START( eforsta5 )
ROM_LOAD32_WORD( "0400122v.u11", 0x000002, 0x80000, CRC(7a97adc8) SHA1(b52f7fdc7edf9ad92351154c01b8003c0576ed94) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -3998,7 +3979,7 @@ ROM_START( eforsta5ce )
ROM_LOAD32_WORD( "chg1536.u14", 0x300002, 0x80000, CRC(113238a6) SHA1(145467e1f015543d23bb4a377d71949693f21c34) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4031,7 +4012,7 @@ ROM_START( eforsta5cea )
ROM_LOAD32_WORD( "ahg1615.u14", 0x300002, 0x80000, CRC(961fd1b3) SHA1(59c2280258b98bc0153b6dc08d1af026de5b3ed3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4060,7 +4041,7 @@ ROM_START( eforsta5u )
ROM_LOAD32_WORD( "jhg041503.u12", 0x100002, 0x80000, CRC(c968471f) SHA1(9d54a5c396e6f83690db2fcb7ddcc8a47a7dd777) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4089,7 +4070,7 @@ ROM_START( eforsta5ua )
ROM_LOAD32_WORD( "jhg041599.u12", 0x100002, 0x80000, CRC(c968471f) SHA1(9d54a5c396e6f83690db2fcb7ddcc8a47a7dd777) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4114,7 +4095,7 @@ ROM_START( fastfort )
ROM_LOAD32_WORD( "0100651v.u12", 0x100002, 0x80000, CRC(d591dfb6) SHA1(9a1c1070b7e8774928d684c45481d72ce5108bf1) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4143,7 +4124,7 @@ ROM_START( fortellr )
ROM_LOAD32_WORD( "01j00131.u14", 0x300002, 0x80000, CRC(507bbe10) SHA1(01b1982c02a00b60aa39ee1b408d653365f728d4) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4166,7 +4147,7 @@ ROM_START( fortfvr )
ROM_LOAD32_WORD( "bhg1566.u14", 0x300002, 0x7ffff, BAD_DUMP CRC(4fba6570) SHA1(46bb22ba10dc69c70241dfbb00e86ffa5b28fd1c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4195,7 +4176,7 @@ ROM_START( gambler )
ROM_LOAD32_WORD( "ehg091602.u12", 0x100002, 0x80000, CRC(ebe957f9) SHA1(539945ec9beafe2c83051208370588fce2334f16) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4216,7 +4197,7 @@ ROM_START( geisha )
ROM_LOAD32_WORD( "0101408v.u13", 0x200002, 0x80000, CRC(5ef6323e) SHA1(82a720d814ca06c6d286c59bbf325d9a1034375a) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4239,7 +4220,7 @@ ROM_START( genmagi )
ROM_LOAD32_WORD( "0200894v.u14", 0x300002, 0x80000, CRC(52092ffb) SHA1(6ed591a510e9186588470ec745caf8001712012e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4270,7 +4251,7 @@ ROM_START( glizrdce )
ROM_LOAD32_WORD( "ahg1623.u14", 0x300002, 0x80000, CRC(5ceb871c) SHA1(42b8a087fa39261818dd333ea3d8c1ef269671bf) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4295,7 +4276,7 @@ ROM_START( gnomeatw )
ROM_LOAD32_WORD( "0100767v.u12", 0x100002, 0x80000, CRC(49eb3869) SHA1(d98fe385c667872f26d656a3240f557a70ba924f) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4324,7 +4305,7 @@ ROM_START( goldpyr )
ROM_LOAD32_WORD( "ahg120503.u12", 0x100002, 0x80000, CRC(8bbf45d0) SHA1(f58f28e7cc4ac225197959566d81973b5aa0e836) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4353,7 +4334,7 @@ ROM_START( goldpyra )
ROM_LOAD32_WORD( "ahg120699.u12", 0x100002, 0x80000, CRC(13021157) SHA1(6beb8dea66659b5ec9cbb8dcd921c30a621049a9) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4385,7 +4366,7 @@ ROM_START( goldpyrb )
ROM_LOAD32_WORD( "0100878v.u13", 0x200002, 0x80000, CRC(0df660be) SHA1(73d370d90655dada34f2b5b2209652632c34a22e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4412,7 +4393,7 @@ ROM_START( goldenra )
ROM_LOAD32_WORD( "0101164v.u13", 0x200002, 0x80000, CRC(8f62ccc5) SHA1(5105313192ab8dfd522b921c70b8b03a8a61ac63) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4439,7 +4420,7 @@ ROM_START( honeypot )
ROM_LOAD32_WORD( "03j00241.u13", 0x200002, 0x80000, CRC(d98e20eb) SHA1(6274ceee7ad49a9052b354d9dfc7e3cfa4e61017) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4470,7 +4451,7 @@ ROM_START( hnktonku )
ROM_LOAD32_WORD( "bhg1455.u13", 0x200002, 0x80000, CRC(18dd37fe) SHA1(432a4959886fad4f4a55de31b7cc42c51d7f2792) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4496,7 +4477,7 @@ ROM_START( incasun )
ROM_LOAD32_WORD( "0100872v.u13", 0x200002, 0x80000, CRC(00407593) SHA1(4c759fe3267b1782ae84d8ed9134295dfaa0faaf) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4523,7 +4504,7 @@ ROM_START( incasunsp )
ROM_LOAD32_WORD( "sp__0100872v.u13", 0x200002, 0x80000, CRC(6d66c6b4) SHA1(2106f2ede58bd4d09334e32a1553f02a154bb767) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4543,7 +4524,7 @@ ROM_START( incasunnz )
ROM_LOAD32_WORD( "0101108v.u13", 0x200002, 0x80000, CRC(472f4097) SHA1(5ebe72b138cdc67989db17c82979eeddc60a081e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4570,7 +4551,7 @@ ROM_START( incasunu )
ROM_LOAD32_WORD( "chg1458.u13", 0x200002, 0x80000, CRC(2e573a8d) SHA1(aa8ac4f4a427829f0a5929273c618edb4ecf7b36) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -4611,7 +4592,7 @@ ROM_START( incasunua )
ROM_LOAD32_WORD( "dhg1577.u13", 0x200002, 0x80000, CRC(f7c30ef9) SHA1(44d7213e1220d6b89715408d009ef1484de2696f) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4638,7 +4619,7 @@ ROM_START( incasunv )
ROM_LOAD32_WORD( "01j01946.u13", 0x200002, 0x80000, CRC(0efdd830) SHA1(de0be1cd3f691299f48d7a184df6bb59fef22de2) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4663,7 +4644,7 @@ ROM_START( indrema5 )
ROM_LOAD32_WORD( "0100845v.u12", 0x100002, 0x80000, CRC(4bbe67f6) SHA1(928f88387da66697f1de54f086531f600f80a15e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4689,7 +4670,7 @@ ROM_START( indrema5ql )
ROM_LOAD32_WORD( "0101340v.u13", 0x200002, 0x80000, CRC(7ec9557e) SHA1(8f143c1ee1c82d822ff66ec5b3dac03b0c911223) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4707,7 +4688,7 @@ ROM_START( jumpbean )
ROM_LOAD32_WORD( "0100161v.u12", 0x100002, 0x7fa54, BAD_DUMP CRC(d1d6cfba) SHA1(8c8ee5a97bc3c8cd21cd291701cebf214ca388f3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4732,7 +4713,7 @@ ROM_START( jumpjoey )
ROM_LOAD32_WORD( "0100383v.u12", 0x100002, 0x80000, CRC(defce2e9) SHA1(95f88f8647c52f99dceb4920780696d7f7c1c24b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4761,7 +4742,7 @@ ROM_START( jungjuic )
ROM_LOAD32_WORD( "0200240v.u12", 0x100002, 0x80000, CRC(ffa3d0ba) SHA1(e60e01d4d425aea483387fa2f9ae5bb69b80f829) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4787,7 +4768,7 @@ ROM_START( kgalah )
ROM_LOAD32_WORD( "0200536v.u12", 0x100002, 0x80000, CRC(15d5bfb4) SHA1(7c48dabfd83cc30fe2ffd0b4de63fbc9dc56ee2f) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4813,7 +4794,7 @@ ROM_START( kgalaha )
ROM_LOAD32_WORD( "0100536v.u12", 0x100002, 0x80000, CRC(ddde1739) SHA1(d2dec30baef8b43b2f3bc1d572353b5afe01be4b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4845,7 +4826,7 @@ ROM_START( kgalahce )
ROM_LOAD32_WORD( "ahg1625.u14", 0x300002, 0x80000, CRC(499419db) SHA1(6df8c7a9a69d60e746eb266127647327d4b88919) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4870,7 +4851,7 @@ ROM_START( kgbirda5 )
ROM_LOAD32_WORD( "0200024v.u12", 0x100002, 0x80000, CRC(df176c5a) SHA1(dcaecdefb7c880b9425a6445dbed969968fe3d1c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4900,7 +4881,7 @@ ROM_START( koalamnt )
ROM_LOAD32_WORD( "chg1573.u14", 0x300002, 0x80000, CRC(5e4776e9) SHA1(d44851cbfaa054cd5675a841a3089a8f4fdc8421) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4925,7 +4906,7 @@ ROM_START( kookabuk )
ROM_LOAD32_WORD( "0100677v.u12", 0x100002, 0x80000, CRC(b2f2fd15) SHA1(9614f3ae6e82a40ecf44090d0b8d7bd8b6b1f830) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4957,7 +4938,7 @@ ROM_START( kyhatonu )
ROM_LOAD32_WORD( "bhg1204.u14", 0x300002, 0x80000, CRC(490a9eb5) SHA1(30df13960614f82deac5426ff754885ffb429603) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -4979,7 +4960,7 @@ ROM_START( locoloot )
ROM_LOAD32_WORD( "0100473v.u11", 0x000002, 0x80000, CRC(0c0c2697) SHA1(0fc1dec8fba488a4b59c81b5bab7a11d62be2599) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5001,7 +4982,7 @@ ROM_START( locoloota )
ROM_LOAD32_WORD( "0100472v.u11", 0x000002, 0x80000, CRC(21332a1a) SHA1(76a4c30d1c9624984175e9bd117c68c9204f01df) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5019,7 +5000,7 @@ ROM_START( locolootnz )
ROM_LOAD32_WORD( "0600725v.u12", 0x100002, 0x80000, CRC(29f03505) SHA1(c173167f43cc2eef0e063118e03bc37a87188391) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5046,7 +5027,7 @@ ROM_START( locolootu )
ROM_LOAD32_WORD( "ahg1513.u12", 0x100002, 0x80000, CRC(5bf7b4b1) SHA1(2282ec8d0ddd1aea715005fba2171468831513f4) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5068,7 +5049,7 @@ ROM_START( lonewolf )
ROM_LOAD32_WORD( "0100587v.u11", 0x000002, 0x80000, CRC(0ed6fb6b) SHA1(a2baa4154fe762e2c1b40a97b2d27265df8b5dab) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5090,7 +5071,7 @@ ROM_START( luckyclo )
ROM_LOAD32_WORD( "0300109v.u11", 0x000002, 0x80000, CRC(4be1cdef) SHA1(8633077a6ddde80b2e7a3c4439ccb5a3f2b83695) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5118,7 +5099,7 @@ ROM_START( mgarden )
ROM_LOAD32_WORD( "ahg121199.u12", 0x100002, 0x80000, CRC(4b252c2c) SHA1(8be41fb2b8f8d2829c18ea123a02f3e61c136206) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5146,7 +5127,7 @@ ROM_START( magimask )
ROM_LOAD32_WORD( "ahg1549.u12", 0x100002, 0x80000, CRC(d008deab) SHA1(fd544767356bfdf44ec4af7218c9f2990581e620) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5173,7 +5154,7 @@ ROM_START( magimaska )
ROM_LOAD32_WORD( "ahg1548.u12", 0x100002, 0x80000, CRC(cf4cd569) SHA1(408edcd746587d249c4286f7a99f33ad94214f7c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -5214,7 +5195,7 @@ ROM_START( magimaskb )
ROM_LOAD32_WORD( "dhg1309.u12", 0x100002, 0x80000, CRC(6829a7bf) SHA1(97eed83763d0ec5e753d6ad194e906b1307c4940) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -5247,7 +5228,7 @@ ROM_START( magtcha5 )
ROM_LOAD32_WORD( "0300455v.u13", 0x200002, 0x80000, CRC(5e54ed88) SHA1(5fe9a74e210bc2c1b158e7a3bb01fdcc96ea0075) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5269,7 +5250,7 @@ ROM_START( magtcha5a )
ROM_LOAD32_WORD( "0200455v.u13", 0x200002, 0x80000, CRC(cfd2a86e) SHA1(66891a1b0e85ad7146b733f4b5d806db789d8821) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5294,7 +5275,7 @@ ROM_START( mammothm )
ROM_LOAD32_WORD( "0100425v.u12", 0x100002, 0x80000, CRC(58171e9b) SHA1(7f375aeb8cabe22fcc6f61cac5ef6f72f0c99899) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5321,7 +5302,7 @@ ROM_START( marmagic )
ROM_LOAD32_WORD( "01j00101.u13", 0x200002, 0x80000, CRC(3f702945) SHA1(a6c9a848d059c1e564fdc5a65bf8c9600853edfa) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5352,7 +5333,7 @@ ROM_START( marmagicu )
ROM_LOAD32_WORD( "ehg1558.u14", 0x300002, 0x80000, CRC(a2096cb3) SHA1(c2bba35396f9c83b17d692a384b6406f3441c8f5) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5384,7 +5365,7 @@ ROM_START( marmagicua )
ROM_LOAD32_WORD( "ehg1559.u14", 0x300002, 0x80000, CRC(bdfdc0e4) SHA1(0e56f08abc0cdd9dfa5d8e51bb6fe06fa356b3b3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5409,7 +5390,7 @@ ROM_START( minemine )
ROM_LOAD32_WORD( "0400115v.u12", 0x100002, 0x80000, CRC(b0607ccf) SHA1(f7b35d02170620060c8cdf90b9cb6aac86e26a52) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5436,7 +5417,7 @@ ROM_START( minemineu )
ROM_LOAD32_WORD( "vhg041699.u12", 0x100002, 0x80000, CRC(26c01532) SHA1(ec68ad44b703609c7bc27275f8d9250a16d9067c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -5477,7 +5458,7 @@ ROM_START( minemineua )
ROM_LOAD32_WORD( "nhg0416.u12", 0x100002, 0x80000, CRC(fc3f18ff) SHA1(f2afc6bdd7a702e4ac4037749613ac4a40446511) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5502,7 +5483,7 @@ ROM_START( monmouse )
ROM_LOAD32_WORD( "0400469v.u12", 0x100002, 0x80000, CRC(72d992ed) SHA1(94560305dacbe776ddc95114ad5e5ffaa234937c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5528,7 +5509,7 @@ ROM_START( monmousea )
ROM_LOAD32_WORD( "0300469v.u12", 0x100002, 0x80000, CRC(2be9bce0) SHA1(3768e616e4f03f253074e1f06aa628181db9dce8) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5548,7 +5529,7 @@ ROM_START( montree )
ROM_LOAD32_WORD( "0201397v.u13", 0x200002, 0x80000, CRC(e1f23c3f) SHA1(fe74c219c738625257fb62806e271a60075aaa07) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5570,7 +5551,7 @@ ROM_START( mountmon )
ROM_LOAD32_WORD( "0100294v.u11", 0x000002, 0x80000, CRC(4fb2a4dc) SHA1(23895b701387f7442a31969989d21cefe2a25efd) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5592,7 +5573,7 @@ ROM_START( mountmona )
ROM_LOAD32_WORD( "0100289v.u11", 0x000002, 0x80000, CRC(565b76ff) SHA1(559d4ec4f1a727cd293d842b7f777c99dcf488bc) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5616,7 +5597,7 @@ ROM_START( mountmonce )
ROM_LOAD32_WORD( "ahg1629.u14", 0x300002, 0x7ffff, BAD_DUMP CRC(57f31de5) SHA1(aceb1d700c3b41e29e0abd613d59008d7dc259c9) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5639,7 +5620,7 @@ ROM_START( mountmonu )
ROM_LOAD32_WORD( "bhg1465.u14", 0x300002, 0x80000, CRC(62f9b2af) SHA1(bddf24c7a412e911cf75316723f3139be99acbdd) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5670,7 +5651,7 @@ ROM_START( mountmonua )
ROM_LOAD32_WORD( "bhg1464.u14", 0x300002, 0x80000, CRC(5b1e5888) SHA1(4cfb0a7af2553037fed650085bbe11e3d043797b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5697,7 +5678,7 @@ ROM_START( multidrw )
ROM_LOAD32_WORD( "0200956v.u13", 0x200002, 0x80000, CRC(0d6f7ec5) SHA1(0a80257eb464e50292554f45583f3d7b85de2bc3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5719,7 +5700,7 @@ ROM_START( mystgard )
ROM_LOAD32_WORD( "0100275v.u11", 0x000002, 0x80000, CRC(6e618fc5) SHA1(a02e7ca2433cf8128d74792833d9708a3ba5df4b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5739,7 +5720,7 @@ ROM_START( one4all )
ROM_LOAD32_WORD( "0101503v.u13", 0x200002, 0x80000, CRC(3b116e0d) SHA1(5df873c00c1103304c2cb77cedf05a5db83ece29) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5765,7 +5746,7 @@ ROM_START( orchidms )
ROM_LOAD32_WORD( "0200849v.u12", 0x100002, 0x80000, CRC(165a762d) SHA1(8487d2e32bd2fab5a9114380ba2be6d34b097b11) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5792,7 +5773,7 @@ ROM_START( orchidmsa )
ROM_LOAD32_WORD( "0100849v.u12", 0x100002, 0x80000, CRC(4b5baf9d) SHA1(2fd13cbb22aff14936cbe2da582a0aa3984ab4a2) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5810,7 +5791,7 @@ ROM_START( orchidmsnz )
ROM_LOAD32_WORD( "0101241v.u12", 0x100002, 0x80000, CRC(141e2b47) SHA1(e311693d730bfff99ad75995e47606e9822ba722) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5832,7 +5813,7 @@ ROM_START( oscara5 )
ROM_LOAD32_WORD( "0200348v.u11", 0x000002, 0x80000, CRC(11394e80) SHA1(1c6e7e954a6118e04da9d761fef8ec00c46d2af8) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5858,7 +5839,7 @@ ROM_START( oscara5a )
ROM_LOAD32_WORD( "0100348v.u12", 0x100002, 0x80000, CRC(fd1c5c7b) SHA1(61b29459e39912ea3c2bf290e1f3061ce13ea648) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5883,7 +5864,7 @@ ROM_START( pantmag )
ROM_LOAD32_WORD( "0101046v.u12", 0x100002, 0x80000, CRC(eae75fa9) SHA1(576c8cf98ad4032bbdde12162e2c1bdd10056762) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5908,7 +5889,7 @@ ROM_START( pantmaga )
ROM_LOAD32_WORD( "0100716v.u12", 0x100002, 0x80000, CRC(6adfd0ab) SHA1(3b6479bcd95812f5678a27adc7decbc881cd6caa) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5937,7 +5918,7 @@ ROM_START( partygrs )
ROM_LOAD32_WORD( "ahg1567.u12", 0x100002, 0x80000, CRC(00d1395c) SHA1(d9a66d6cdb5aa4f583d8c23306b1416646cbde93) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -5977,7 +5958,7 @@ ROM_START( partygrsa )
ROM_LOAD32_WORD( "bhg1284.u12", 0x100002, 0x80000, CRC(090ce72f) SHA1(a4783ca84aabd365613357a53a19a3dd48f4df0c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -5997,7 +5978,7 @@ ROM_START( partygrsb )
ROM_LOAD32_WORD( "ahg1568.u12", 0x100002, 0x7f7da, BAD_DUMP CRC(43764888) SHA1(cfd59692f17e9ca70dc882423238f6de59dafbed) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6022,7 +6003,7 @@ ROM_START( peaflut )
ROM_LOAD32_WORD( "02j00011.u12", 0x100002, 0x80000, CRC(2d96c449) SHA1(af98a864b9ed3f95227fd0d6edc6a38c0544c93f) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6047,7 +6028,7 @@ ROM_START( pengpay )
ROM_LOAD32_WORD( "0200460v.u12", 0x100002, 0x80000, CRC(90864742) SHA1(f6491e4fbce5d642b9d0224118923b56625338b1) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6072,7 +6053,7 @@ ROM_START( pengpaya )
ROM_LOAD32_WORD( "0200357v.u12", 0x100002, 0x80000, CRC(123cbe90) SHA1(b51b84f79e0822a1be71485bbad514ab9fa55622) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6098,7 +6079,7 @@ ROM_START( pengpayb )
ROM_LOAD32_WORD( "0200359v.u12", 0x100002, 0x80000, CRC(d2882682) SHA1(dd42edca8ef9d28dd5b16fe8132f8e0fb3c85979) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6123,7 +6104,7 @@ ROM_START( pengpayc )
ROM_LOAD32_WORD( "0200113v.u12", 0x100002, 0x80000, CRC(a1865467) SHA1(572558bab639145c8260884a95646fc424687b47) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6141,7 +6122,7 @@ ROM_START( pengpayd )
ROM_LOAD32_WORD( "0300113v.u12", 0x100002, 0x7fb27, BAD_DUMP CRC(7206dc37) SHA1(4d2f8551daeb4be13e73e3123e158dc1e1e4e067) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6169,7 +6150,7 @@ ROM_START( pengpayu )
ROM_LOAD32_WORD( "bhi041703.u12", 0x100002, 0x80000, CRC(d959a048) SHA1(92f69090d599f95b48e79213e5b7d486e083d8f4) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -6209,7 +6190,7 @@ ROM_START( pengpayua )
ROM_LOAD32_WORD( "ohg041703.u12", 0x100002, 0x80000, CRC(9eae7f7b) SHA1(23bd952de1d6d5d69e5565cc2bc241c2cd775453) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6237,7 +6218,7 @@ ROM_START( pengpayub )
ROM_LOAD32_WORD( "ohg041702.u12", 0x100002, 0x80000, CRC(9eae7f7b) SHA1(23bd952de1d6d5d69e5565cc2bc241c2cd775453) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6270,7 +6251,7 @@ ROM_START( pengpayce )
ROM_LOAD32_WORD( "ahg1544.u14", 0x300002, 0x80000, CRC(4ef4f063) SHA1(d6e9928f80f19d3fdd0e7acb0bfb6f9b2ae5724b) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6301,7 +6282,7 @@ ROM_START( pengpuck )
ROM_LOAD32_WORD( "ehg1257.u14", 0x300002, 0x80000, CRC(b6cb5809) SHA1(84288a41d2a3980bf68e9a32b9402652ac6a16d6) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6326,7 +6307,7 @@ ROM_START( penpir )
ROM_LOAD32_WORD( "0100674v.u12", 0x100002, 0x80000, CRC(acdbbbe6) SHA1(5909135163af18c3ecd84934612e3751ca62ae74) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6351,7 +6332,7 @@ ROM_START( penpira )
ROM_LOAD32_WORD( "0200578v.u12", 0x100002, 0x80000, CRC(7ea30a52) SHA1(70d7640ea237197be4b2b8c64c2a97ad7b608cc0) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6384,7 +6365,7 @@ ROM_START( penpir2 )
ROM_LOAD32_WORD( "0100869v.u13", 0x200002, 0x80000, CRC(e1dbfd58) SHA1(687b7254279734e1835e1713d032b5aa2cf70812) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6409,7 +6390,7 @@ ROM_START( petshop )
ROM_LOAD32_WORD( "0100731v.u12", 0x100002, 0x80000, CRC(6e74cd57) SHA1(9092e656cbd8627b208b81ca0d737483a779bce1) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6426,7 +6407,7 @@ ROM_START( petshopa )
ROM_LOAD32_WORD( "0100679v.u12", 0x100002, 0x80000, BAD_DUMP CRC(2cd12986) SHA1(b6b0bd6dd8c964498edc3763cb5c450795042a8d) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6451,7 +6432,7 @@ ROM_START( phantpay )
ROM_LOAD32_WORD( "0500005v.u12", 0x100002, 0x80000, CRC(d43a092a) SHA1(5f851bd179b14ef3983b460ed932810f3713d3e5) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6478,7 +6459,7 @@ ROM_START( przfight )
ROM_LOAD32_WORD( "0100299v.u13", 0x200002, 0x80000, CRC(c16197d5) SHA1(716c4afdf2acde10ff09ad90b03bc5e689f0a737) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6503,7 +6484,7 @@ ROM_START( qcash )
ROM_LOAD32_WORD( "0100706v.u12", 0x100002, 0x80000, CRC(bfedb3fc) SHA1(e115db94b8ee7babb29e31e64b96d181f5c6491b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6529,7 +6510,7 @@ ROM_START( qnile )
ROM_LOAD32_WORD( "0300439v.u12", 0x100002, 0x80000, CRC(eec01bb4) SHA1(146fdce6b32a21659dc775e4a5f3bb027bd09825) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6555,7 +6536,7 @@ ROM_START( qnilea )
ROM_LOAD32_WORD( "0200439v.u12", 0x100002, 0x80000, CRC(2a0f7feb) SHA1(27c89dadf759e6c892121650758c44ec50990cb6) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6581,7 +6562,7 @@ ROM_START( qnileb )
ROM_LOAD32_WORD( "0100439v.u12", 0x100002, 0x80000, CRC(bdcec4eb) SHA1(ef3658460263cd2e68e10015efdc016ad705213e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6615,7 +6596,7 @@ ROM_START( qnilebr )
ROM_LOAD32_WORD( "0101707v.u13", 0x200002, 0x80000, CRC(1b5da8ca) SHA1(9a6cfbadba24677a0d82a61ffdc25772ecbac287) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6640,7 +6621,7 @@ ROM_START( qnilec )
ROM_LOAD32_WORD( "0300440v.u12", 0x100002, 0x80000, CRC(52bd3694) SHA1(bcfa3054c7577f7a1653b756828d048a5f1776e7) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6671,7 +6652,7 @@ ROM_START( qnilece )
ROM_LOAD32_WORD( "ahg1609.u14", 0x300002, 0x80000, CRC(fe7817f3) SHA1(a3579ed7ce6d999b0f71482f2a2e3ade693668fb) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6703,7 +6684,7 @@ ROM_START( qnilecea )
ROM_LOAD32_WORD( "ahg1525.u14", 0x300002, 0x80000, CRC(520452d4) SHA1(6d501b82a7b35a6e53a0991cbc384b752a295edf) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6736,7 +6717,7 @@ ROM_START( qnileceb )
ROM_LOAD32_WORD( "ahg1608.u14", 0x300002, 0x80000, CRC(4d0f1d12) SHA1(980775e628e9508398cb5227af10ed9ff0555b8a) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6763,7 +6744,7 @@ ROM_START( qniled )
ROM_LOAD32_WORD( "0101139v.u13", 0x200002, 0x80000, CRC(160fbbb5) SHA1(fe2ce9b915b0dfcbc60deed30a95550a21a18127) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6790,7 +6771,7 @@ ROM_START( qnilefl )
ROM_LOAD32_WORD( "0101670v.u13", 0x200002, 0x80000, CRC(715e7789) SHA1(b734aa88e7e65fba988e7fffd711039c4f554b2c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6819,7 +6800,7 @@ ROM_START( qnilemax )
ROM_LOAD32_WORD( "0401072v.u14", 0x300002, 0x80000, CRC(4fbccf72) SHA1(97d6bb400caf78cb673a324d48d2580f1bbb1acd) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6844,7 +6825,7 @@ ROM_START( qnilenl )
ROM_LOAD32_WORD( "0301059v.u12", 0x100002, 0x80000, CRC(e505912a) SHA1(ae71aa6d56d424383add3b9cbc17473ab0a13bdc) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6865,7 +6846,7 @@ ROM_START( qnilenz )
ROM_LOAD32_WORD( "0300785v.u13", 0x200002, 0x80000, CRC(b267d25a) SHA1(8065601190540e5f0b4a91fed1deffcdb2606f94) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6890,7 +6871,7 @@ ROM_START( qnileql )
ROM_LOAD32_WORD( "0201200v.u12", 0x100002, 0x80000, CRC(38332f4e) SHA1(53c90103df06e5a28bbaf32504a0984b7c65bec7) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6918,7 +6899,7 @@ ROM_START( qnileu )
ROM_LOAD32_WORD( "ghg409102.u12", 0x100002, 0x80000, CRC(7871a846) SHA1(ac1d741092afda842e1864f1a7a14137a9ee46d9) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -6961,7 +6942,7 @@ ROM_START( qnileua )
ROM_LOAD32_WORD( "ghg4091.u12", 0x100002, 0x80000, CRC(7871a846) SHA1(ac1d741092afda842e1864f1a7a14137a9ee46d9) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -6988,7 +6969,7 @@ ROM_START( qnilev )
ROM_LOAD32_WORD( "04j00784.u12", 0x100002, 0x80000, CRC(621adc77) SHA1(2fecef64139c502b0baee5c945fe5671532aacab) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7013,7 +6994,7 @@ ROM_START( qtbird )
ROM_LOAD32_WORD( "0500009v.u12", 0x100002, 0x80000, CRC(bb8344a9) SHA1(8b0e904b937c7f34470ad946076240b0c54bf434) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7043,7 +7024,7 @@ ROM_START( rainwrce )
ROM_LOAD32_WORD( "0101332v.u14", 0x300002, 0x80000, CRC(92274626) SHA1(fae8d89efba9bf3d171bfe484015d009786ce40d) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7068,7 +7049,7 @@ ROM_START( reelpwr )
ROM_LOAD32_WORD( "0100400v.u12", 0x100002, 0x80000, CRC(e6033756) SHA1(82603f02fcec2b01f5a1cfc13d50129669e84dc7) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7094,7 +7075,7 @@ ROM_START( reelrock )
ROM_LOAD32_WORD( "0100779v.u12", 0x100002, 0x80000, CRC(4ac20679) SHA1(0ac732ffe6a33806e4a06e87ec875a3e1314e06b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7121,7 +7102,7 @@ ROM_START( reelrockql )
ROM_LOAD32_WORD( "0101460v.u13", 0x200002, 0x80000, NO_DUMP )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7146,7 +7127,7 @@ ROM_START( retrsam )
ROM_LOAD32_WORD( "0400549v.u12", 0x100002, 0x80000, CRC(fdf22d5b) SHA1(664fa003a350c0a3b515b7c384d32176158c2d3e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7169,7 +7150,7 @@ ROM_START( retrsama )
ROM_LOAD32_WORD( "0200549v.u11", 0x000002, 0x80000, CRC(99f61822) SHA1(88a726a5c9cae3a7d3120cb9013ca4d38ef8c560) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7191,7 +7172,7 @@ ROM_START( retrsamb )
ROM_LOAD32_WORD( "0200506v.u11", 0x000002, 0x80000, CRC(e662404b) SHA1(f0da3384c81d01ec17d24b2191d3a0b0eaf48d12) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7218,7 +7199,7 @@ ROM_START( rushrst )
ROM_LOAD32_WORD( "0200534v.u13", 0x200002, 0x80000, CRC(dfe02424) SHA1(798ce31ef23cf5bd7d5b04dc21ffd99b2f6243b3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7244,7 +7225,7 @@ ROM_START( sbuk2 )
ROM_LOAD32_WORD( "0400501v.u12", 0x100002, 0x80000, CRC(f9b65d2b) SHA1(f519fc284aaa08d3619e4d88e92e690320cf5432) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7263,7 +7244,7 @@ ROM_START( sbuk2a )
ROM_LOAD32_WORD( "0300006v.u12", 0x100002, 0x80000, NO_DUMP )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7288,7 +7269,7 @@ ROM_START( sbuk3 )
ROM_LOAD32_WORD( "0200711v.u12", 0x100002, 0x80000, CRC(a585172d) SHA1(3c74efb11285ff78ce76a7e8af2f936d3dc31290) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7314,7 +7295,7 @@ ROM_START( sbuk3a )
ROM_LOAD32_WORD( "0100711v.u12", 0x100002, 0x80000, CRC(0ce0ba8d) SHA1(7fc6ee6281bb3c474fa0cf4d879e735ae03bb1ed) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7344,7 +7325,7 @@ ROM_START( sldeluxe )
ROM_LOAD32_WORD( "ahg1575.u14", 0x300002, 0x80000, CRC(bd890100) SHA1(c82b2891287429a3e77ccaf9b66139f0548f1902) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7369,7 +7350,7 @@ ROM_START( slvrwolf )
ROM_LOAD32_WORD( "0100673v.u12", 0x100002, 0x80000, CRC(122816dd) SHA1(5c37b29179262a79d8c68c92035ff14fc2885150) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7391,7 +7372,7 @@ ROM_START( snowcat )
ROM_LOAD32_WORD( "0100405v.u11", 0x000002, 0x80000, CRC(9f9e2637) SHA1(3d4992cec760360931bc5de400c7a27329f8b953) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7416,7 +7397,7 @@ ROM_START( sumospin )
ROM_LOAD32_WORD( "0200606v.u12", 0x100002, 0x80000, CRC(ba3eede2) SHA1(708a25af0908a1aa874b3ca4897816c65b0c9178) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7438,7 +7419,7 @@ ROM_START( swhr2 )
ROM_LOAD32_WORD( "0200465v.u11", 0x000002, 0x80000, CRC(dcf51719) SHA1(1ea07091ce22245f77b6de5dcd994efb94c4ba58) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7461,7 +7442,7 @@ ROM_START( swhr2a )
ROM_LOAD32_WORD( "0200004v.u11", 0x000002, 0x80000, CRC(bde067d7) SHA1(cbf2cbd0644f1daeb5c3cd08d72f3d7aafe521ec) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7490,7 +7471,7 @@ ROM_START( swhr2u )
ROM_LOAD32_WORD( "phg074202.u12", 0x100002, 0x80000, CRC(885cde6c) SHA1(a6ccf94ecdae2092a703075c9917d0b4004efa52) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7513,7 +7494,7 @@ ROM_START( swhr2v )
ROM_LOAD32_WORD( "01j01986.u11", 0x000002, 0x80000, CRC(bd7ead91) SHA1(9f775428a4aa0b0a8ee17aed9be620edc2020c5e) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7538,7 +7519,7 @@ ROM_START( thor )
ROM_LOAD32_WORD( "0200319v.u12", 0x100002, 0x80000, CRC(a4b27820) SHA1(75bb554300372c8bccea79ab55aa60688b7597fa) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7563,7 +7544,7 @@ ROM_START( thndh )
ROM_LOAD32_WORD( "0200333v.u12", 0x100002, 0x80000, CRC(522b0459) SHA1(d9f0e94223897ef8935558593b1d261ad953a3ec) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7588,7 +7569,7 @@ ROM_START( thndha )
ROM_LOAD32_WORD( "0200334v.u12", 0x100002, 0x80000, CRC(77c0d46d) SHA1(a183eca1ebdc305dce75caa311635ec98477909d) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7610,7 +7591,7 @@ ROM_START( topbana )
ROM_LOAD32_WORD( "0100550v.u11", 0x000002, 0x80000, CRC(1c64b3b6) SHA1(80bbc6e3f47ab932e9c07e0c6063197a2d8e81f7) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7639,7 +7620,7 @@ ROM_START( toutango )
ROM_LOAD32_WORD( "0100782v.u14", 0x300002, 0x80000, CRC(69f2acde) SHA1(cda52548e675a06677a2d9fee89b33f9abb96f64) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7667,7 +7648,7 @@ ROM_START( toutangonl )
ROM_LOAD32_WORD( "0301388v.u14", 0x300002, 0x80000, CRC(fbb37975) SHA1(648b56df5047b8ae60b41bdf29f35f8bf8fe2d29) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7692,7 +7673,7 @@ ROM_START( trstrove )
ROM_LOAD32_WORD( "01j00161.u12", 0x100002, 0x80000, CRC(715f53cb) SHA1(364c35fc2d36180c13127c8004a8729126f68db1) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7719,7 +7700,7 @@ ROM_START( tritreat )
ROM_LOAD32_WORD( "0201692v.u13", 0x200002, 0x80000, CRC(0a0b0ce1) SHA1(41a4d613cf1828df1832c087f0bc18d31076f056) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7746,7 +7727,7 @@ ROM_START( trojhors )
ROM_LOAD32_WORD( "01j00851.u13", 0x200002, 0x80000, CRC(b6d1ceb6) SHA1(b41200620aaa905697ac73b4c86496a53f070ed3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7771,7 +7752,7 @@ ROM_START( trpdlght )
ROM_LOAD32_WORD( "0100269v.u12", 0x100002, 0x80000, CRC(88978d4e) SHA1(cd2b747fd858f7d84b889bf87865c4fbb349e1b7) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7800,7 +7781,7 @@ ROM_START( trpdlghtu )
ROM_LOAD32_WORD( "phg062502.u12", 0x100002, 0x80000, CRC(0190804b) SHA1(7acb29fb7f77e78bb2afeb74d341475cd089dafb) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7825,7 +7806,7 @@ ROM_START( unicornd )
ROM_LOAD32_WORD( "0100791v.u12", 0x100002, 0x80000, CRC(14afdeda) SHA1(1eb2a297e903dc1a0683425b37669e0af4ae4218) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7850,7 +7831,7 @@ ROM_START( unicornda )
ROM_LOAD32_WORD( "0100813v.u12", 0x100002, 0x80000, CRC(b712dcd1) SHA1(f4080185f909d385e93edc73954d05de1dc6aa65) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7868,7 +7849,7 @@ ROM_START( unicorndnz )
ROM_LOAD32_WORD( "0101228v.u12", 0x100002, 0x80000, CRC(00d4cd6e) SHA1(eb941164cf421f22bcc9864f198348c4f30d904c) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7895,7 +7876,7 @@ ROM_START( unicorndu )
ROM_LOAD32_WORD( "bhg1584.u12", 0x100002, 0x80000, CRC(c1e878b5) SHA1(4e4e9dee4d85fbb77dc6f7d39c2dc5b0bf438aef) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7922,7 +7903,7 @@ ROM_START( venicea5 )
ROM_LOAD32_WORD( "02j02056.u14", 0x300002, 0x80000, CRC(7b695bf3) SHA1(89ea3252c9915aab81a85c6c028b21911bf8b4c4) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7950,7 +7931,7 @@ ROM_START( wafricau )
ROM_LOAD32_WORD( "ahg1535.u12", 0x100002, 0x80000, CRC(f569843c) SHA1(ccf1b727ad1dc49bca609ee0887b36a29223cace) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7972,7 +7953,7 @@ ROM_START( wamazon )
ROM_LOAD32_WORD( "0200507v.u11", 0x000002, 0x80000, CRC(2e24756a) SHA1(247db8316e7815be7524aefc43a5756fad84779a) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -7997,7 +7978,7 @@ ROM_START( wamazona )
ROM_LOAD32_WORD( "0200285v.u12", 0x100002, 0x80000, CRC(fdb10dd3) SHA1(cbf4fe97c75652f83b8ddb929b06941a70b36388) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8023,7 +8004,7 @@ ROM_START( wamazonv )
ROM_LOAD32_WORD( "01j01996.u12", 0x100002, 0x80000, CRC(945e0a05) SHA1(db7580b39c537a7b50898ee99cfceb5eb71be19a) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8048,7 +8029,7 @@ ROM_START( wikwin )
ROM_LOAD32_WORD( "0100553v.u12", 0x100002, 0x80000, CRC(06cf5d68) SHA1(5469e8087371f8b59fd9b2b413682efe2ea0f279) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8070,7 +8051,7 @@ ROM_START( wildbill )
ROM_LOAD32_WORD( "0100297v.u11", 0x000002, 0x80000, CRC(57b3c340) SHA1(4f95ed7fed697cf2bfbde8215f6e35768cf20334) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8095,7 +8076,7 @@ ROM_START( wcougar )
ROM_LOAD32_WORD( "0100167v.u12", 0x100002, 0x80000, CRC(85bb41a7) SHA1(335f29f10f216e202b93b46a376958c3f5271461) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8122,7 +8103,7 @@ ROM_START( wcougaru )
ROM_LOAD32_WORD( "nhg029604.u12", 0x100002, 0x80000, CRC(fe2bafdc) SHA1(e8b454db44a532d75b3aff323855340695688f0f) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_REGION16_BE( 0x100, "eeprom0", 0 )
@@ -8163,7 +8144,7 @@ ROM_START( wcougarua )
ROM_LOAD32_WORD( "nhg029607.u12", 0x100002, 0x80000, CRC(fe2bafdc) SHA1(e8b454db44a532d75b3aff323855340695688f0f) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8191,7 +8172,7 @@ ROM_START( wcougarub )
ROM_LOAD32_WORD( "nhg029699.u12", 0x100002, 0x80000, CRC(fe2bafdc) SHA1(e8b454db44a532d75b3aff323855340695688f0f) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8220,7 +8201,7 @@ ROM_START( wcougaruc )
ROM_LOAD32_WORD( "ahg1531.u12", 0x100002, 0x80000, CRC(5aac8336) SHA1(d1bfd21579bdcf5b46e0f4db1181d10159f0b643) ) // base
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8239,7 +8220,7 @@ ROM_START( wcoyote )
ROM_LOAD32_WORD( "ahg1515.u12", 0x100002, 0x7ff14, BAD_DUMP CRC(0068bce4) SHA1(37517f6bd53660deab471f41a4d63c4b03bf22b3) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8265,7 +8246,7 @@ ROM_START( wizways )
ROM_LOAD32_WORD( "0200396v.u12", 0x100002, 0x80000, CRC(934d7286) SHA1(205f72b62d83667e9068141346bda3bcb9742a83) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8290,7 +8271,7 @@ ROM_START( wldangel )
ROM_LOAD32_WORD( "0100337v.u12", 0x100002, 0x80000, CRC(81f0d1c8) SHA1(1e91c9457593f592c0ca4a186a49b00b2cfe256f) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8317,7 +8298,7 @@ ROM_START( wnpost )
ROM_LOAD32_WORD( "rhg041804.u12", 0x100002, 0x80000, CRC(ff70b305) SHA1(3c832ed20b1d00318fd3d2428bb469735f68965b) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8342,7 +8323,7 @@ ROM_START( wthing )
ROM_LOAD32_WORD( "0101158v.u12", 0x100002, 0x80000, CRC(450a4f4f) SHA1(e59fb3260755a125c47ff6c1a042a48b0eace72d) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8362,7 +8343,7 @@ ROM_START( wthinga )
ROM_LOAD32_WORD( "0201176v.u13", 0x200002, 0x7ffdb, BAD_DUMP CRC(026317bc) SHA1(94a48b33ddc60d6271ac0a89fc86b9f1be68f9a6) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8384,7 +8365,7 @@ ROM_START( wtiger )
ROM_LOAD32_WORD( "0200954v.u11", 0x000002, 0x80000, CRC(38e888b1) SHA1(acc857eb2be19140bbb58d70583e08f24807b9f2) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
@@ -8411,7 +8392,7 @@ ROM_START( yukongl5 )
ROM_LOAD32_WORD( "03j00191.u13", 0x200002, 0x80000, CRC(e514b87f) SHA1(5423215bc03ab8468d5ebec0dba6ba7820cdcd50) )
ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) /* ARM Code */
- ROM_REGION( 0x200000, "vram", ROMREGION_ERASE00 )
+
ROM_REGION( 0x20000*4, "sram", ROMREGION_ERASE00 )
ROM_END
diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp
index 3189eb3d0f0..17f2081eb28 100644
--- a/src/mame/drivers/artmagic.cpp
+++ b/src/mame/drivers/artmagic.cpp
@@ -128,7 +128,7 @@ void artmagic_state::device_timer(emu_timer &timer, device_timer_id id, int para
update_irq_state();
break;
default:
- assert_always(false, "Unknown id in artmagic_state::device_timer");
+ throw emu_fatalerror("Unknown id in artmagic_state::device_timer");
}
}
diff --git a/src/mame/drivers/asterix.cpp b/src/mame/drivers/asterix.cpp
index 9e63c1d90ec..94019c13c53 100644
--- a/src/mame/drivers/asterix.cpp
+++ b/src/mame/drivers/asterix.cpp
@@ -73,7 +73,7 @@ void asterix_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in asterix_state::device_timer");
+ throw emu_fatalerror("Unknown id in asterix_state::device_timer");
}
}
diff --git a/src/mame/drivers/astinvad.cpp b/src/mame/drivers/astinvad.cpp
index 81af8cee125..cdf277b5356 100644
--- a/src/mame/drivers/astinvad.cpp
+++ b/src/mame/drivers/astinvad.cpp
@@ -262,7 +262,7 @@ void astinvad_state::device_timer(emu_timer &timer, device_timer_id id, int para
kamizake_int_gen(ptr, param);
break;
default:
- assert_always(false, "Unknown id in astinvad_state::device_timer");
+ throw emu_fatalerror("Unknown id in astinvad_state::device_timer");
}
}
diff --git a/src/mame/drivers/asuka.cpp b/src/mame/drivers/asuka.cpp
index 871aa31f7b8..1556a996993 100644
--- a/src/mame/drivers/asuka.cpp
+++ b/src/mame/drivers/asuka.cpp
@@ -243,7 +243,7 @@ void asuka_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(5, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in asuka_state::device_timer");
+ throw emu_fatalerror("Unknown id in asuka_state::device_timer");
}
}
diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp
index 78efdf3e29c..486005b882e 100644
--- a/src/mame/drivers/at.cpp
+++ b/src/mame/drivers/at.cpp
@@ -903,9 +903,13 @@ ROM_START( ibm5170 )
ROMX_LOAD( "6480090.u27", 0x10000, 0x8000, CRC(99703aa9) SHA1(18022e93a0412c8477e58f8c61a87718a0b9ab0e), ROM_SKIP(1) | ROM_BIOS(1))
ROMX_LOAD( "6480091.u47", 0x10001, 0x8000, CRC(013ef44b) SHA1(bfa15d2180a1902cb6d38c6eed3740f5617afd16), ROM_SKIP(1) | ROM_BIOS(1))
-// ROM_SYSTEM_BIOS( 2, "atdiag", "IBM PC/AT 5170 w/Super Diagnostics")
-// ROMX_LOAD( "atdiage.bin", 0xf8000, 0x4000, CRC(e8855d0c) SHA1(c9d53e61c08da0a64f43d691bf6cadae5393843a), ROM_SKIP(1) | ROM_BIOS(2))
-// ROMX_LOAD( "atdiago.bin", 0xf8001, 0x4000, CRC(606fa71d) SHA1(165e45bae7ae2da274f1e645c763c5bfcbde027b), ROM_SKIP(1) | ROM_BIOS(2))
+ ROM_SYSTEM_BIOS( 2, "landmark", "Landmark/Supersoft diagnostic ROMs") // use Hercules or MDA
+ ROMX_LOAD( "5170_even_u27_ 27256.bin", 0x10000, 0x8000, CRC(6790392d) SHA1(c4a5310341f346dd072d096152060ef5e4430a7f), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD( "5170_odd_u47_ 27256.bin", 0x10001, 0x8000, CRC(4c0f3db4) SHA1(97a0cf589b93551ed1d03bd622cbc8fd5634512f), ROM_SKIP(1) | ROM_BIOS(2))
+
+// ROM_SYSTEM_BIOS( 3, "atdiag", "IBM PC/AT 5170 w/Super Diagnostics")
+// ROMX_LOAD( "atdiage.bin", 0xf8000, 0x4000, CRC(e8855d0c) SHA1(c9d53e61c08da0a64f43d691bf6cadae5393843a), ROM_SKIP(1) | ROM_BIOS(3))
+// ROMX_LOAD( "atdiago.bin", 0xf8001, 0x4000, CRC(606fa71d) SHA1(165e45bae7ae2da274f1e645c763c5bfcbde027b), ROM_SKIP(1) | ROM_BIOS(3))
/* Mainboard PALS */
ROM_REGION( 0x2000, "pals", 0 )
@@ -1508,8 +1512,8 @@ ROM_START( at )
// 28: CDTEK - BIOS-String: DSUN-1202-042088-K0 286-BIOS AMI for CDTEK - ISA8:2, ISA16:6 - Chipset ICs plus SN76LS612N, RTC MC146818P
ROM_SYSTEM_BIOS(28, "cdtekchips", "CDTEK 286") // ISA8:2, ISA16: 6 - OSC: 12.000, 14.31818, 16000.00KHz
ROMX_LOAD( "286-cdtek2-even_32k.bin", 0x10000, 0x8000, CRC(94867e8d) SHA1(12e61cc8b875b57324c93276c9f6093f2bd0e277), ROM_SKIP(1) | ROM_BIOS(28) )
- ROMX_LOAD( "286-cdtek2-odd_32k.bin", 0x10001, 0x8000, CRC(153ed3bd) SHA1(10b711e0f0d79e0b6d181f24fe66544d2d72a310), ROM_SKIP(1) | ROM_BIOS(28) )
- // 29: This board looks identical to #2 but has different chips fitted: SN76LS612N = Zymos HCT612, Chips P82A204 = TACT80204FN, P82A203 = STK-5134, P82A205 = STK-5135,
+ ROMX_LOAD( "286-cdtek2-odd_32k.bin", 0x10001, 0x8000, CRC(153ed3bd) SHA1(10b711e0f0d79e0b6d181f24fe66544d2d72a310), ROM_SKIP(1) | ROM_BIOS(28) )
+ // 29: This board looks identical to #2 but has different chips fitted: SN76LS612N = Zymos HCT612, Chips P82A204 = TACT80204FN, P82A203 = STK-5134, P82A205 = STK-5135,
// P82C201 = STK-5132, P82C202 = STK-5133 - BIOS-String: Phoenix 80286 ROM BIOS Version 3.06
ROM_SYSTEM_BIOS(29, "286tact", "286 TACT") // OSC: 20.0000MHz, 14.31818 - 24.000MHz
ROMX_LOAD( "286-tact-320548-1_32k.bin", 0x10000, 0x8000, CRC(0b528d19) SHA1(15f5a94d89461655c0f74681bbae5745db009ac2), ROM_SKIP(1) | ROM_BIOS(29) )
@@ -1579,11 +1583,11 @@ ROM_START( atvga )
ROMX_LOAD( "286-at system 6m8m10m-l_32k.bin", 0x10000, 0x8000, CRC(37e0e1c1) SHA1(f5cd17658554a73bb86c5c8e630dac3e34b38e51), ROM_SKIP(1) | ROM_BIOS(15) )
ROMX_LOAD( "286-at system 6m8m10m-r_32k.bin", 0x10001, 0x8000, CRC(c672efff) SHA1(7224bb6b4d25ef34bc0aa9d7c450baf9b47fd917), ROM_SKIP(1) | ROM_BIOS(15) )
// 16: same as BIOS '28' in VGA
- ROM_SYSTEM_BIOS(16, "cdtekchips", "CDTEK 286")
+ ROM_SYSTEM_BIOS(16, "cdtekchips", "CDTEK 286")
ROMX_LOAD( "286-cdtek2-even_32k.bin", 0x10000, 0x8000, CRC(94867e8d) SHA1(12e61cc8b875b57324c93276c9f6093f2bd0e277), ROM_SKIP(1) | ROM_BIOS(16) )
- ROMX_LOAD( "286-cdtek2-odd_32k.bin", 0x10001, 0x8000, CRC(153ed3bd) SHA1(10b711e0f0d79e0b6d181f24fe66544d2d72a310), ROM_SKIP(1) | ROM_BIOS(16) )
+ ROMX_LOAD( "286-cdtek2-odd_32k.bin", 0x10001, 0x8000, CRC(153ed3bd) SHA1(10b711e0f0d79e0b6d181f24fe66544d2d72a310), ROM_SKIP(1) | ROM_BIOS(16) )
// 17: same as BIOS '29' in VGA
- ROM_SYSTEM_BIOS(17, "286tact", "286 TACT")
+ ROM_SYSTEM_BIOS(17, "286tact", "286 TACT")
ROMX_LOAD( "286-tact-320548-1_32k.bin", 0x10000, 0x8000, CRC(0b528d19) SHA1(15f5a94d89461655c0f74681bbae5745db009ac2), ROM_SKIP(1) | ROM_BIOS(17) )
ROMX_LOAD( "286-tact-320548-2_32k.bin", 0x10001, 0x8000, CRC(418aa2d0) SHA1(b6af0b8aa595d8f8de6c0fc851bf1c226dcc7ca7), ROM_SKIP(1) | ROM_BIOS(17) )
ROM_END
@@ -1615,7 +1619,7 @@ ROM_START( neat )
ROM_SYSTEM_BIOS(5, "bam1611", "VIP BAM/16-11") // OSC: 18.432 - 14.318 - 32.000MHz
ROMX_LOAD( "286-vip bam-6-11 m215100-lo_32k.bin", 0x10000, 0x8000, CRC(b51b8bc1) SHA1(a7ebbced98aca32a7f0cdf80d1b832dfeb92d5e7), ROM_SKIP(1) | ROM_BIOS(5) )
ROMX_LOAD( "286-vip bam-6-11 m215100-hi_32k.bin", 0x10001, 0x8000, CRC(46ddd5a6) SHA1(fd4267af298c7f70e062a7c4e023caf852bbf082), ROM_SKIP(1) | ROM_BIOS(5) )
- // 6: CP-805 - BIOS-String: ENET-1138-030390-K0
+ // 6: CP-805 - BIOS-String: ENET-1138-030390-K0
ROM_SYSTEM_BIOS(6, "cp805", "CP-805")
ROMX_LOAD( "286-chips ami78384 even.bin", 0x10000, 0x8000, CRC(5280fee0) SHA1(25051ad6bbccddc0738861b614dbafbca5c3bff5), ROM_SKIP(1) | ROM_BIOS(6) )
ROMX_LOAD( "286-chips ami78384 odd.bin", 0x10001, 0x8000, CRC(24526bf3) SHA1(8f8b46fe2e708fa53d0eeb44a16924cd878bdd33), ROM_SKIP(1) | ROM_BIOS(6) )
@@ -1791,7 +1795,7 @@ ROM_END
ROM_START( headg2 )
ROM_REGION( 0x20000, "bios", 0)
- // 0: 286 board with Headland GC101A-PC; GC102-PC chipset and Phoenix BIOS 2493119, ISA8: 2, ISA16: 5
+ // 0: 286 board with Headland GC101A-PC; GC102-PC chipset and Phoenix BIOS 2493119, ISA8: 2, ISA16: 5
ROM_SYSTEM_BIOS(0, "head_ph_1", "Headland/Phoenix #1") // Phoenix 80286 ROM BIOS PLUS Version 3.10.21 ((BIOS release date:: 15-01-1988)
ROMX_LOAD( "286-headland-lo_32k.bin", 0x10000, 0x8000, CRC(21b68bed) SHA1(1e4acda50b12ad463c169ba615805f5dcf257b18), ROM_SKIP(1) | ROM_BIOS(0) )
ROMX_LOAD( "286-headland-hi_32k.bin", 0x10001, 0x8000, CRC(04c8ab12) SHA1(b46c14528aca15464e4050b423c2f621a4313a85), ROM_SKIP(1) | ROM_BIOS(0) )
@@ -1819,7 +1823,7 @@ ROM_START( kma202f )
ROM_REGION(0x20000, "bios", 0)
ROMX_LOAD( "286_lo.bin", 0x10000, 0x8000, CRC(0ce69691) SHA1(6904ac54f30f2244058653aaa623804dd02b4332), ROM_SKIP(1) )
ROMX_LOAD( "286_hi.bin", 0x10001, 0x8000, CRC(1330b6f2) SHA1(691bb4a51ce3d9a026ee33c3fd02fc4e13b4a184), ROM_SKIP(1) )
-ROM_END
+ROM_END
// ***** Motherboards using the 5 chip VLSI chipset
@@ -1829,11 +1833,11 @@ ROM_START( vlsi5 )
// 0: MG Products (Japanese) - Chipset: VLSI VL82C102A; VLSI VL82C101B; VLSI VL82C104; VLSI VL82C103A; VLSI VL82C100; (VLSI 8908BT; 8906BT; 8852BT; 8907BT; 8906BT)
// BIOS: AMI 286 BIOS+ - BIOS-String: D286-9987-092588-K0 - ISA8: 2, ISA16: 8
// (BIOS release date:: 25-09-1988) (ISA8: 3, ISA16: 5)
- ROM_SYSTEM_BIOS(0, "286vlsij", "Japanese 286 VLSI")
+ ROM_SYSTEM_BIOS(0, "286vlsij", "Japanese 286 VLSI")
ROMX_LOAD( "286-vlsi_japan-2-even_32k.bin", 0x10000, 0x8000, CRC(e3e64cbc) SHA1(5259e3c8686f2239a5fb0dc38aa80380ef9ec5fa), ROM_SKIP(1) | ROM_BIOS(0) )
ROMX_LOAD( "286-vlsi_japan-2-odd_32k.bin", 0x10001, 0x8000, CRC(aa533f39) SHA1(d88c7d4029a283b94b99e2017d29fbf9eb9105b1), ROM_SKIP(1) | ROM_BIOS(0) )
// 1: BIOS-String: D286-1223-121589-K0 - 286-BIOS AMI for MBVLSI-168 - ISA8: 3, ISA16: 5
- ROM_SYSTEM_BIOS(1, "mbvlsi168", "MBVLSI-168")
+ ROM_SYSTEM_BIOS(1, "mbvlsi168", "MBVLSI-168")
ROMX_LOAD( "286-vlsi-002350-041_32k.bin", 0x10000, 0x8000, CRC(0e0e2bc9) SHA1(0af05b15ea8141ece84fb4420e6a21720f01c7a6), ROM_SKIP(1) | ROM_BIOS(1) )
ROMX_LOAD( "286-vlsi-002350-042_32k.bin", 0x10001, 0x8000, CRC(5ef7b91d) SHA1(d57c7f4c8d28708f128c5f0b1251d5943c7cdf76), ROM_SKIP(1) | ROM_BIOS(1) )
ROM_END
@@ -1862,7 +1866,7 @@ ROM_END
// SUNTAC Chipset, http://toastytech.com/manuals/Magitronic%20B233%20Manual.pdf
// SUNTAC ST62BC002-B, ST62BC005-B, ST62BC003-B, ST62BC001-B, ST62C00B, ST62BC004-B1
ROM_START( magb233 )
- ROM_REGION(0x20000, "bios", 0) // BIOS-String: DSUN-1105-043089-K0
+ ROM_REGION(0x20000, "bios", 0) // BIOS-String: DSUN-1105-043089-K0
ROMX_LOAD( "magitronic_b233_ami_1986_286_bios_plus_even_sa027343.bin", 0x10000, 0x8000, CRC(d4a18444) SHA1(d95242104fc9b51cf26de72ef5b6c52d99ccce30), ROM_SKIP(1) )
ROMX_LOAD( "magitronic_b233_ami_1986_286_bios_plus_odd_sa027343.bin", 0x10001, 0x8000, CRC(7ac3db56) SHA1(4340140450c4f8b4f6a19eae50a5dc5449edfdf6), ROM_SKIP(1) )
// ROM_LOAD("magitronic_b233_ami_1986_keyboard_bios_plus_a025352.bin", 0x0000, 0x1000), CRC(84fd28fd) SHA1(43da0f49e52c921844e60b6f3d22f2a316d865cc) )
@@ -1926,13 +1930,13 @@ ROM_START( ht12a )
// Headland HT12/A; HM6818A RTC; AMI K053770 keyboard BIOS
// Jumpers at right edge of board are labeled "KEYLOCK" (J6), "SPEAKER" (J7), "TURBO LED" (J8), "TURBO S.W." (J9), "RESET" (J10)
// XTALs X3 and X4 in top right corner (behind 80C287) are both unpopulated
- ROM_SYSTEM_BIOS(0, "dh12-k0", "AMI DH12-K0")
+ ROM_SYSTEM_BIOS(0, "dh12-k0", "AMI DH12-K0")
ROMX_LOAD( "286_headland_even.bin", 0x10000, 0x8000, CRC(a2530914) SHA1(1aca289240caa6d4bf811d301c338c157b6902a1), ROM_SKIP(1) | ROM_BIOS(0) )
ROMX_LOAD( "286_headland_odd.bin", 0x10001, 0x8000, CRC(b5f69002) SHA1(ee9ceef1fc7a328ee82006cd504e72e16f21b3c8), ROM_SKIP(1) | ROM_BIOS(0) )
// 1: 286 board with Headland Headland HT12/A chipset, one ROM market IQS, Phoenix BIOS 3479808 - ISA8: 1, ISA16: 6
ROM_SYSTEM_BIOS(1, "head_ph_2", "Headland/Phoenix #2") // Phoenix BIOS A286 Version 1.01 - BIOS ID JLI01101 - IT9109 - Reference ID 01 - (BIOS release date:: 19-04-1990)
ROMX_LOAD( "286-headland-iqs-lo_32k.bin", 0x10000, 0x8000, CRC(60424e9d) SHA1(aa813bf48939fe7fcbbfec3133e702bfdff6234e), ROM_SKIP(1) | ROM_BIOS(1) )
- ROMX_LOAD( "286-headland-iqs-hi_32k.bin", 0x10001, 0x8000, CRC(e56212e0) SHA1(2441845d632d19adc0592e094beb5ec1fbe074f6), ROM_SKIP(1) | ROM_BIOS(1) )
+ ROMX_LOAD( "286-headland-iqs-hi_32k.bin", 0x10001, 0x8000, CRC(e56212e0) SHA1(2441845d632d19adc0592e094beb5ec1fbe074f6), ROM_SKIP(1) | ROM_BIOS(1) )
ROM_END
@@ -2108,7 +2112,7 @@ ROM_START( n8810m16c )
ROM_END
// Nixdorf 8810 M16 Laptop - PC17 - VGA version - boot from harddisk doesn't work
-// Chipset: MX8945G/MX16C4520C, Chps P82C212B-12, P82C215, P82C206, WD37C65BJM, P82C211-12, Chips F82C455,
+// Chipset: MX8945G/MX16C4520C, Chps P82C212B-12, P82C215, P82C206, WD37C65BJM, P82C211-12, Chips F82C455,
ROM_START( n8810m16v )
// ROM_LOAD("8810m16vga_27c256_221vb_123g1.bin", 0x00000, 0x4000, CRC(3bc80739) SHA1(3d6d7fb01681eccbc0b560818654d5aa1e3c5230)) // C&T VGA BIOS for 82C455
ROM_REGION(0x20000, "bios", 0 )
@@ -2163,44 +2167,52 @@ ROM_START( at386 )
ROM_SYSTEM_BIOS(2, "amicg", "AMI CG")
ROMX_LOAD( "amicg.1", 0x10000, 0x10000,CRC(8408965a) SHA1(9893d3ac851e01b06a68a67d3721df36ca2c96f5), ROM_BIOS(2))
// 3:
- ROM_SYSTEM_BIOS(3, "msi386", "MSI 386") // MSI 386 mainboard, initializes graphics card, then hangs - Chipset: Chips P82A304, P82A303, P82A302C, 2xP82B305, P82C301C, P82A306A,
+ ROM_SYSTEM_BIOS(3, "msi386", "MSI 386") // MSI 386 mainboard, initializes graphics card, then hangs - Chipset: Chips P82A304, P82A303, P82A302C, 2xP82B305, P82C301C, P82A306A,
ROMX_LOAD( "ami_386_msi_02297_even.bin", 0x10000, 0x8000, CRC(768590a0) SHA1(90c5203d78591a093fd4f54ceb8d9827f1e64f39), ROM_SKIP(1) | ROM_BIOS(3) )
ROMX_LOAD( "ami_386_msi_02297_odd.bin", 0x10001, 0x8000, CRC(7b1360dc) SHA1(552ccda9f90826621e88d9abdc47306b9c2b2b15), ROM_SKIP(1) | ROM_BIOS(3) )
- // 4: BIOS-String: 20-0200-DF1121-00101111-102591-SYM_386B-0 / 386DX/SX (S1A.P)
- ROM_SYSTEM_BIOS(4, "386sc2c", "386-SC-2C") // Chipset: SYMPHONY SL82C362, SL82C461, SL82C465
- ROMX_LOAD("386-sc-2c_ami_za492668.bin", 0x10000, 0x10000, CRC(b408eeb7) SHA1(cf1974492119e1aae623fa366d5760343e827e52), ROM_BIOS(4) )
- // 5: BIOS-String: EC&T-1332-040990-K0
- ROM_SYSTEM_BIOS(5, "cs8230", "CS8230")
- ROMX_LOAD( "ami_386_cs8230_chipset.bin", 0x10000, 0x10000, CRC(1ee766d0) SHA1(75dba3c9817dfe6caca46f5f4f2f1d76ba88d3c7), ROM_BIOS(5) )
- // 6
- ROM_SYSTEM_BIOS(6, "ami2939", "AMI2939") // no display
- ROMX_LOAD( "ami2939e.rom", 0x10000, 0x8000, CRC(65cbbd32) SHA1(d7d26b496f8e86f01722ad9f171a68f9fcdc477c), ROM_SKIP(1) | ROM_BIOS(6) )
- ROMX_LOAD( "ami2939o.rom", 0x10001, 0x8000, CRC(8db6e739) SHA1(cdd47709d6036fad4be40c15bff41752d831d4b8), ROM_SKIP(1) | ROM_BIOS(6) )
- // 7: NCR 386 slot CPU - Upgrade card for e.g. NCR PC-8 - set graphics card to CGA to see a "Timer One Error" message
- ROM_SYSTEM_BIOS(7, "ncr386", "NCR 386 CPU card") // Chipset: SN76LS612PN, 2xAM9517A-5JC, NCR 006-3500402PT M472018 8650A
- ROMX_LOAD( "ncr_386_card_04152_u44_ver5.0.bin", 0x10000, 0x10000, CRC(80e44318) SHA1(54e1d4d646a577c53c65b2292b383ed6d91b65b2), ROM_BIOS(7))
+ // 4: BIOS-String: EC&T-1332-040990-K0
+ ROM_SYSTEM_BIOS(4, "cs8230", "CS8230")
+ ROMX_LOAD( "ami_386_cs8230_chipset.bin", 0x10000, 0x10000, CRC(1ee766d0) SHA1(75dba3c9817dfe6caca46f5f4f2f1d76ba88d3c7), ROM_BIOS(4) )
+ // 5
+ ROM_SYSTEM_BIOS(5, "ami2939", "AMI2939") // no display
+ ROMX_LOAD( "ami2939e.rom", 0x10000, 0x8000, CRC(65cbbd32) SHA1(d7d26b496f8e86f01722ad9f171a68f9fcdc477c), ROM_SKIP(1) | ROM_BIOS(5) )
+ ROMX_LOAD( "ami2939o.rom", 0x10001, 0x8000, CRC(8db6e739) SHA1(cdd47709d6036fad4be40c15bff41752d831d4b8), ROM_SKIP(1) | ROM_BIOS(5) )
+ // 6: NCR 386 slot CPU - Upgrade card for e.g. NCR PC-8 - set graphics card to CGA to see a "Timer One Error" message
+ ROM_SYSTEM_BIOS(6, "ncr386", "NCR 386 CPU card") // Chipset: SN76LS612PN, 2xAM9517A-5JC, NCR 006-3500402PT M472018 8650A
+ ROMX_LOAD( "ncr_386_card_04152_u44_ver5.0.bin", 0x10000, 0x10000, CRC(80e44318) SHA1(54e1d4d646a577c53c65b2292b383ed6d91b65b2), ROM_BIOS(6))
// ROM_LOAD ("ncr_386_card_keyboard_04181_u27_ver5.6.bin", 0x0000, 0x800, CRC(6c9004e7) SHA1(0fe77f47ff77333d1ff9bfcf8d6d92193ab1f208))
- // 8: BIOS-String: Phoenix 80386 ROM BIOS PLUS Version 1.10 22
- ROM_SYSTEM_BIOS(8, "cbm386", "Commodore 386")
- ROMX_LOAD( "cbm-386-bios-lo-v1.022e-8100.bin", 0x10000, 0x8000, CRC(a054a1b8) SHA1(d952b02cc10534325c1c5aaa8b6dfb77bc20a179), ROM_SKIP(1) | ROM_BIOS(8))
- ROMX_LOAD( "cbm-386-bios-hi-v1.022e-d100.bin", 0x10001, 0x8000, CRC(b9541f3d) SHA1(e37c704521e85b07369d21b0521f4d1871c318dd), ROM_SKIP(1) | ROM_BIOS(8))
- // 9: flashing "K/B controller incorrect" - Chipset: ALi M1217-40
- ROM_SYSTEM_BIOS(9, "gmb386sat", "GMB-386SAT_V1.0")
- ROMX_LOAD( "gmb-386sat_v1.0.bin", 0x10000, 0x10000, CRC(59ecc773) SHA1(f2007fce76b3a91f51bfb5f43c1539d5ae06d35f), ROM_BIOS(9))
- // 10: BIOS-String: X0-0100-000000-00101111-060692-RC2018A-0 / Ver 1.4b / Texas Instruments 486 DLC [S3Q]
- ROM_SYSTEM_BIOS(10, "ti486dlc", "TI 486DLC") // board is equipped with a TI486DLC
- ROMX_LOAD( "ti_486dlc_rev.s3q.bin", 0x10000, 0x10000, CRC(39b150ed) SHA1(5fc96c6232dd3a066349d8e707e938af55893297), ROM_BIOS(10))
- // 11: BIOS-String: 40-0400-001107-00101111-111192-U4800VLX-0 / UNICHIP BIOS VER 2.0A 09/27/1993
- ROM_SYSTEM_BIOS(11, "386bw367", "386BW367 Rev. 1.0")
- ROMX_LOAD( "unichip_386bw_367_rev_1.0.bin", 0x10000, 0x10000, CRC(7922a8f9) SHA1(785008e10edfd393dc39e921a12d1a07a14bac25), ROM_BIOS(11))
- // 12:
- // Chipset: Ali M1429 A1 and M1431 A2, doesn't boot
- ROM_SYSTEM_BIOS(12, "386ali", "386 board with Ali chipset")
- ROMX_LOAD( "386_ali_ami_511767.bin", 0x10000, 0x10000, CRC(3c218db4) SHA1(785ea7c36e8be5e7410524e90170d4985cbc9c24), ROM_BIOS(12))
- //13: BIOS-String: 40-0100-001266-00101111-121291-UMCAUTO-0 - 3DIUD-1.2
+ // 7: BIOS-String: Phoenix 80386 ROM BIOS PLUS Version 1.10 22
+ ROM_SYSTEM_BIOS(7, "cbm386", "Commodore 386")
+ ROMX_LOAD( "cbm-386-bios-lo-v1.022e-8100.bin", 0x10000, 0x8000, CRC(a054a1b8) SHA1(d952b02cc10534325c1c5aaa8b6dfb77bc20a179), ROM_SKIP(1) | ROM_BIOS(7))
+ ROMX_LOAD( "cbm-386-bios-hi-v1.022e-d100.bin", 0x10001, 0x8000, CRC(b9541f3d) SHA1(e37c704521e85b07369d21b0521f4d1871c318dd), ROM_SKIP(1) | ROM_BIOS(7))
+ // 8: flashing "K/B controller incorrect" - Chipset: ALi M1217-40
+ ROM_SYSTEM_BIOS(8, "gmb386sat", "GMB-386SAT_V1.0")
+ ROMX_LOAD( "gmb-386sat_v1.0.bin", 0x10000, 0x10000, CRC(59ecc773) SHA1(f2007fce76b3a91f51bfb5f43c1539d5ae06d35f), ROM_BIOS(8))
+ // 9: BIOS-String: X0-0100-000000-00101111-060692-RC2018A-0 / Ver 1.4b / Texas Instruments 486 DLC [S3Q]
+ ROM_SYSTEM_BIOS(9, "ti486dlc", "TI 486DLC") // board is equipped with a TI486DLC
+ ROMX_LOAD( "ti_486dlc_rev.s3q.bin", 0x10000, 0x10000, CRC(39b150ed) SHA1(5fc96c6232dd3a066349d8e707e938af55893297), ROM_BIOS(9))
+ // 10: BIOS-String: 40-0400-001107-00101111-111192-U4800VLX-0 / UNICHIP BIOS VER 2.0A 09/27/1993
+ ROM_SYSTEM_BIOS(10, "386bw367", "386BW367 Rev. 1.0")
+ ROMX_LOAD( "unichip_386bw_367_rev_1.0.bin", 0x10000, 0x10000, CRC(7922a8f9) SHA1(785008e10edfd393dc39e921a12d1a07a14bac25), ROM_BIOS(10))
+ // 11: BIOS-String: 40-0100-001266-00101111-121291-UMCAUTO-0 - 3DIUD-1.2
// Chipset: // UMC UM92C206F, UM82C482AF, UM82C481BF - MB manufacturer according to BIOS is Modula Tech Co
- ROM_SYSTEM_BIOS(13, "3diud", "386 UMC 3DIUD")
- ROMX_LOAD( "386-umc-3flud.bin", 0x10000, 0x10000, CRC(2e795a01) SHA1(02e9e2871c1c1a542f44ab5eef66aee4b04225c1), ROM_BIOS(13))
+ ROM_SYSTEM_BIOS(11, "3diud", "386 UMC 3DIUD")
+ ROMX_LOAD( "386-umc-3flud.bin", 0x10000, 0x10000, CRC(2e795a01) SHA1(02e9e2871c1c1a542f44ab5eef66aee4b04225c1), ROM_BIOS(11))
+ // 12: BIOS-String: 305-3.2 000-00 - Chipset: TACT82206FN; Intel A82385-33 - Keyboard Controller: P/N: 191106-2 C/S E4F4 Rev. 1.4
+ // Board with Tandon and Micronics stickers - BIOS: 192475-305A V305 3.2
+ // ISA8: 2, ISA16: 5 - OSC: 14.31818 MHz - 66.0000 MHz, CPU: Intel 80386DX-33, FPU: Intel 80387DX-33
+ ROM_SYSTEM_BIOS(12, "tanmic385", "Tandon/Micronics with 385")
+ ROMX_LOAD( "386-micronics-09-00021-even_32k.bin", 0x10000, 0x8000, CRC(0d4f0093) SHA1(f66364a82c957862a0e54afc3a2f85f911adfd49), ROM_SKIP(1) | ROM_BIOS(12))
+ ROMX_LOAD( "386-micronics-09-00021-odd_32k.bin", 0x10001, 0x8000, CRC(54195986) SHA1(f3536340ef1697763e5cd70d0de7bb9b2a4ecde9), ROM_SKIP(1) | ROM_BIOS(12))
+ // 13: Board is only marked "rev.0.3, looks like 386GRN - CPU: AMD AM386DX-40 - OSC: 14.31818 - ISA8: 1, ISA16: 5
+ // Chipset: UMC UM82C491F - BIOS-String: 08/30/93-UMC-491-214X2000-OO - BIOS: Award 386 D2026361 - Keyboard BIOS: JETkey V3.0
+ ROM_SYSTEM_BIOS(13, "386grn", "386GRN-like board rev.03")
+ ROMX_LOAD( "386dx40-27c512.bin", 0x10000, 0x10000, CRC(692a4d52) SHA1(7970a05586eacfe4bfdc575b17bbbfb7ff1c86b0), ROM_BIOS(13))
+ // 14: MB1325PM - Chipset: Chips P82C206 µIC MI9382 MI9381A
+ // BIOS: AMI 386 BIOS - BIOS-String: 30-0101-D61223-00101111-050591-OPBC-F / MB-1325PM. - Keyboard-BIOS: AMI
+ // CPU: AMD 386DX/DXL-25 - ISA8: 1, ISA16: 6, ISA8/Memory: 1
+ ROM_SYSTEM_BIOS(14, "mb1325pm", "MB1325PM")
+ ROMX_LOAD( "386-mb1325pm ok.bin", 0x10000, 0x10000, CRC(768689c1) SHA1(ce46b3baf3cd2586ffaccdded789a54583b73a3b), ROM_BIOS(14))
ROM_END
@@ -2208,6 +2220,64 @@ ROM_END
// 80386 SX and DX motherboard
//**************************************************************************
+// Octek Jaguar V rev.1.4 - Chipset: MX83C: MX83C305FC, MX83C306FC
+// CPU: AMD 386DX-40, FPU socket provided - OSC: 80.000MHz, 14.31818
+ROM_START( ocjagv )
+ ROM_REGION(0x20000, "bios", 0)
+ // 0: MR BIOS (r) V1.40
+ ROM_SYSTEM_BIOS(0, "jagvmr14", "Jaguar V MR-BIOS 1.40")
+ ROMX_LOAD( "bios.bin", 0x10000, 0x10000, CRC(a552d6ad) SHA1(91bae14c3ec7edbc9ef240fec1be17f3582d7ec2), ROM_BIOS(0))
+ //1: AMI BIOS// BIOS: AMI 386DX ISA BIOS AA0797325 - BIOS-String: 31-0100-426069-00101111-121291-MXIC-0 MX-DIR_001
+ // Keyboard-BIOS: Intel
+ ROM_SYSTEM_BIOS(1, "jagvami", "Jaguar V AMI BIOS")
+ ROMX_LOAD( "octek_jaguar_v_ami_bios_isa386dx.bin", 0x10000, 0x10000, CRC(f8d14914) SHA1(14e8ecc4794920dc530fc6bd12ad64494e2544e5), ROM_BIOS(1))
+ROM_END
+
+
+// ASUS ISA-386C - Chipset : SIS Rabbit : 85C310 / 85C320 / 85C330 / 85C206
+// BIOS : AMI 05/05/1991, on a 27C512 type EPROM (64KB) - BIOS-String : 30-0105-001292-00101111-050591-SISDFC-386
+// ISA8: 2, ISA16:5, ISA16/Memory: 1
+ROM_START( isa386c )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "asus_isa-386c_bios.bin", 0x10000, 0x10000, CRC(55e6d1bb) SHA1(e1ac490a30f63b6e4d6d9d0fbaea3d132b8ff053))
+ROM_END
+
+// ASUS ISA-386U30 REV.2.2 - Chipset:UMC UM82C481AF, UM82C482AF, 82C206F - CPU: AM386DX-40 - OSC: 14.31818MHz, 32.000MHz - ISA8: 1, ISA16: 6
+// BIOS: AMI 386DX BIOS AA0974582 - BIOS-String: - Keyboard-BIOS: AMI U2518640 MEGA-KB-F-WP
+ROM_START( isa386u30 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "386-isa-386u30.bin", 0x10000, 0x10000, CRC(6d45a044) SHA1(63c06568f9db5ce12dc8dd0fb1ad1009a9fb24f6))
+ROM_END
+
+// Shuttle HOT-304 - Chipset: Opti F82C382, Opti (erased), UMC UM82C206L - OSC: 14.31818MHz, 50.000MHz
+// BIOS: AMI, Ser.Nr. 150796 - BIOS-String: 30-0101-DK1343-00001111-050591-OPBC-0 - Keyboard BIOS: AMI Ser.Nr. 209210 - ISA8: 1, ISA16: 6, ISA16/Memory: 1
+ROM_START( hot304 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "386-hot-304.bin", 0x10000, 0x10000, CRC(cd4ad4ec) SHA1(50f1b7a15096fff7442d575a47728ba4709b2f39))
+ROM_END
+
+// TAM/33/40-MA0 (CM318R00,M31-R00) - Chipset: MX83C305, MX83C306 - CPU: AMD Am386DX-40 - ISA16:8
+// OSC: 80.000MHz - 14.31818 - BIOS: AMI 386 BIOS PLUS S/N OA2050592 - BIOS-String: 31-0100-001105-00101111-121291-MXIC-0 - 386DX/Cx486DLX TAM/33,30-MA0/MA01, 09/10/1992
+ROM_START( tam3340ma0 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "tam_33_40-ma0.bin", 0x10000, 0x10000, CRC(56411a9f) SHA1(a6c80ea531912b758fd5b573d4fa125172cacce7))
+ROM_END
+
+// DTK PEM 2530 - Chipset: VLSI 9032BT/217203/VL82C100-0C
+// Board's original ROMs were damaged (Datatech dtk 386 V4.26 A1763), "original" ROMs came from another user, V3.10 ROMs from a different board
+// ISA8: 2, ISA16: 5, Memory connector: 1 - OSC: 40.000 MHz - 14.31818 MHz
+ROM_START( pem2530 )
+ ROM_REGION(0x20000, "bios", 0)
+ // Phoenix 80386 ROM BIOS PLUS Version 1.10 01 KENITEC TECHNOLOGIES
+ ROM_SYSTEM_BIOS(0, "pem2530ori", "DTK PEM 2530 original")
+ ROMX_LOAD( "386-dtk_pem-2530_bios-low.bin", 0x10000, 0x8000, CRC(d9aad218) SHA1(a7feaad2889820852e3543229b0b103288470732), ROM_SKIP(1) | ROM_BIOS(0))
+ ROMX_LOAD( "386-dtk_pem-2530_bios-high.bin", 0x10001, 0x8000, CRC(550c4d77) SHA1(05aba1a98e738f9b706b5a8f09b5b6c86bd336e2), ROM_SKIP(1) | ROM_BIOS(0))
+ // 80386 BIOS Version 3.10 Rev. 2.06 (BIOS not original, works in PEM 2530)
+ ROM_SYSTEM_BIOS(1, "pem2530", "DTK PEM 2530")
+ ROMX_LOAD( "386-dtk pem-2530-high_32k.bin", 0x10000, 0x8000, CRC(56a822c0) SHA1(b65797c0f87a0815b393758af9c059e6d7172ae9), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD( "386-dtk pem-2530-low_32k.bin", 0x10001, 0x8000, CRC(8688d883) SHA1(c3034c8b343786cb89de48fb2f4992160414f89e), ROM_SKIP(1) | ROM_BIOS(1))
+ROM_END
+
// 386-4N-D04A - BIOS-String: 40-0102-428003-00101111-080893-UMC491F-0 - UMC 4913 386 IVN 1.0 1993.12.22
// Chipset: UMC UM82C493F, UM82C491F
ROM_START( 4nd04a )
@@ -2264,15 +2334,6 @@ ROM_START( cxsxd )
ROM_LOAD( "award_cx-sxd_v4.50.srd.bin", 0x10000, 0x10000, CRC(ef1c74d7) SHA1(b40b1cb7143c4e352798bdf3b488d9342a4029a7))
ROM_END
-// Chips & Technologies CS8230 chip set: P82C301C, P82C302C, P82A303, P82A304, 2x P82B305, P82A306 A, P82C206
-// 8x SIMM, 5x 16-bit ISA, 2x 8-bit ISA, 1x 32-bit proprietary memory expansion slot
-ROM_START( ecs38632 )
- ROM_REGION(0x20000, "bios", 0)
- // BIOS-String: EC&T-1131-030389-K0
- ROMX_LOAD( "ami_ecs-386_32_lo.bin", 0x10000, 0x8000, CRC(e119d6a4) SHA1(bcc6164173b44832b8ebfa1883e22efc167e2cd4), ROM_SKIP(1))
- ROMX_LOAD( "ami_ecs-386_32_hi.bin", 0x10001, 0x8000, CRC(e3072bf8) SHA1(74eec72e190f682cfd5ae5425ebdc854e0ba7bc9), ROM_SKIP(1))
-ROM_END
-
// UMC UM82C482AF, UM82C391A, UM82C206F
// 8x SIMM, 8x ISA
ROM_START( ecsum386 )
@@ -2289,7 +2350,60 @@ ROM_START( fu340 )
ROM_LOAD( "ami_abit_fu340.bin", 0x10000, 0x10000,CRC(9ea90d90) SHA1(091bdae7b1e36ac5168823d80d5907af2a95e583))
ROM_END
-// Forex FRX36C300 + FRX46C402; SiS 85C206
+
+// Motherboards using the OPTi495XLC chipset
+
+// Chipset: OPTi 82C495XLC F82C206, BIOS: AMI 386DX BIOS Ser.#:AA2602776
+// Keyboard-BIOS: Lance LT38C41 - ISA8: 1, ISA16: 5
+ROM_START( opti495xlc )
+ ROM_REGION(0x20000, "bios", 0)
+ // 0: BIOS-String: 40-081L-001343-00101111-080893-OP495XLC-F / OPTi495XLC For 386
+ ROM_SYSTEM_BIOS(0, "optimini", "OPTi Mini 82C495XLC")
+ ROMX_LOAD( "386-opti-mini.bio", 0x10000, 0x10000, CRC(04c75e45) SHA1(d5bf92421dda3191c6da12ae2fa31c9ee7a831e1), ROM_BIOS(0) )
+ // 1: MR BIOS (r) V1.60
+ ROM_SYSTEM_BIOS(1, "mr495xlc", "MR BIOS for OPTi 82C495XLC") // use Hercules
+ ROMX_LOAD( "mr-3dx94.rom", 0x10000, 0x10000, CRC(6925759c) SHA1(540177fe2c10e20037893c9763b0bf6e35163c9c), ROM_BIOS(1) )
+ROM_END
+
+// Motherboards using the Symphony SL82C362 SL82C461 SL82C465 chipset
+
+// 386 SC Rev A2 - BIOS: AMI 386 BIOS Ser.#: ZZ006975, BIOS-String: 30-0200-DF1211-00101111-042591-SYMP-0 / 386DX BIOS for SYMLABS SL82C360 - Keyboard-BIOS: AMI #Z357365
+ROM_START( 386sc ) // CPU: unreadable, FPU: Cyrix 387DX-25 - OSC: 40.000MHz, 14.31818 - ISA8: 1, ISA16: 7
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "386_sc_symphony.bin", 0x10000, 0x10000, CRC(fabe369c) SHA1(211ff63dd874c273135d1427db3562d752c2bade))
+ROM_END
+
+// BIOS-String: 20-0200-DF1121-00101111-102591-SYM_386B-0 / 386DX/SX (S1A.P)
+ // ROM_SYSTEM_BIOS(4, "386sc2c", "386-SC-2C") // Chipset: SYMPHONY SL82C362, SL82C461, SL82C465
+ROM_START( 386sc2c )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "386-sc-2c_ami_za492668.bin", 0x10000, 0x10000, CRC(b408eeb7) SHA1(cf1974492119e1aae623fa366d5760343e827e52))
+ROM_END
+
+
+// Motherboards using the Ali M1429 A1 and M1431 A2 chipsets ... they both hang before initializing the graphics card
+
+ROM_START( alim1429 )
+ ROM_REGION(0x20000, "bios", 0)
+ // 0:
+ ROM_SYSTEM_BIOS(0, "386ali", "386 board with Ali chipset")
+ ROMX_LOAD( "386_ali_ami_511767.bin", 0x10000, 0x10000, CRC(3c218db4) SHA1(785ea7c36e8be5e7410524e90170d4985cbc9c24), ROM_BIOS(0))
+ // 1: SER-386AD III (written on the underside of the board) - CPU: AMD Am386DX-40 - ISA16: 5
+ // BIOS : AMIBIOS 04/04/1993 Ser.# 579092 - BIOS-String : 40-0212-001133-00101111-040493-ALI1429-F - Keyboard BIOS: Regional HT6542
+ ROM_SYSTEM_BIOS(1, "ser386ad", "SER-386AD III")
+ ROMX_LOAD( "ser386ad3.bin", 0x10000, 0x10000, CRC(d80d6deb) SHA1(9f889f7464255431c13ac91d7df31b325447fef5), ROM_BIOS(1))
+ROM_END
+
+
+// Motherboards using the Forex FRX36C300 + FRX46C402; SiS 85C206 chipset
+
+// Chipset: FOREX FRX46C402 FRX36C300 SIS 85C206 SiS 85C206 - CPU: Intel 80386DX-16 - ISA16: 7, ISA16/Memory: 1 - OSC: 66.000MHz
+// BIOS: AMI 386 BIOS PLUS - Ser. 006707 - BIOS-String: 30-0400-ZZ1266-00101111-070791-FORX-0 / FRX/386DX CACHE SYSTEM
+ROM_START( frxc402 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "386-forex.bin", 0x10000, 0x10000, CRC(4a883c14) SHA1(1c2de190ccd152ff894f9fd128e028d4fa63109a))
+ROM_END
+
// 8x SIMM, 8x ISA
ROM_START( smih0107 )
ROM_REGION(0x20000, "bios", 0)
@@ -2298,6 +2412,55 @@ ROM_START( smih0107 )
ROM_END
+// Motherboards using the Forex FRX46C402 + FRX46C411 + SiS 85C206 chipset
+
+// PT-581392 - CPU: AMD 386DX-40 FPU: ULSI Advanced Math Coprocessor DX/DLC 40MHz US83C87
+// BIOS : AMI 07/07/1991, on a 27C512 type EPROM (64KB) Ser.# 007139, BIOS-String : 30-0400-ZZ1101-00101111-070791-FORX-0 FRX/386DX CACHE SYSTEM
+// Keyboard-BIOS: AMI, Ser.# 007139 - OSC: 14.31818, 80.000MHz - ISA16: 8
+ROM_START( pt581392 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROM_LOAD( "pt-581392 386dx.bin", 0x10000, 0x10000, CRC(389a93de) SHA1(8f1320b1d163167272cfad073f58c355e31fcf6f))
+ROM_END
+
+
+// Motherboards using the Chips & Technologies CS8230 chip set: P82C301C, P82C302C, P82A303, P82A304, 2x P82B305, P82A306 A, P82C206
+
+// 8x SIMM, 5x 16-bit ISA, 2x 8-bit ISA, 1x 32-bit proprietary memory expansion slot
+ROM_START( ecs38632 )
+ ROM_REGION(0x20000, "bios", 0)
+ // BIOS-String: EC&T-1131-030389-K0
+ ROMX_LOAD( "ami_ecs-386_32_lo.bin", 0x10000, 0x8000, CRC(e119d6a4) SHA1(bcc6164173b44832b8ebfa1883e22efc167e2cd4), ROM_SKIP(1) )
+ ROMX_LOAD( "ami_ecs-386_32_hi.bin", 0x10001, 0x8000, CRC(e3072bf8) SHA1(74eec72e190f682cfd5ae5425ebdc854e0ba7bc9), ROM_SKIP(1) )
+ROM_END
+
+// SY-012 16/25 386MB VER: 5.2 - Chipset: Chips P82C301C; P82A306; P82A303; P82C206; P82A304; P82C302; P82B305
+// BIOS: AMI 386 BIOS 10084 - BIOS-String: DC&T-1102-082588-K0 - CPU: i386DX-33, ISA8: 2, ISA16: 5, Memory: 1
+// OSC: 14.31818 - 20.000 MHz - 50.000 MHz - 32.000 MHz
+ROM_START( sy012 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "386-sy-012-l_32k.bin", 0x10000, 0x8000, CRC(6ab197f4) SHA1(7efd9033af3a0b36bc5be64cb28c6218cda4d13c), ROM_SKIP(1) )
+ ROMX_LOAD( "386-sy-012-h_32k.bin", 0x10001, 0x8000, CRC(61aedfdb) SHA1(0f492dc8102386a1c475c5637fb7853d81d3efb6), ROM_SKIP(1) )
+ROM_END
+
+// Goldstar 611-606A - Chipset: CHIPS P82C206 P82C301 P82A303 P82C302 P82A304 2xP82A305 -
+// OSC: 14.318 - 9.6000000 MHz - 40.000000 MHz - 16.000000 MHz
+// BIOS: TI CMC3000 - BIOS-String: Phoenix 80386 ROM BIOS PLUS Version 1.10 01 - release 2.7B
+ROM_START( gs611606a )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "386-goldstar-e_32k.bin", 0x10000, 0x8000, CRC(3f358257) SHA1(1570f3de1955895c29c1c4240e1cd47aadff1be0), ROM_SKIP(1) )
+ ROMX_LOAD( "386-goldstar-o_32k.bin", 0x10001, 0x8000, CRC(c5d75635) SHA1(70ceb4089bfd3af6853c3d6e28dbded0c43f6a40), ROM_SKIP(1) )
+ROM_END
+
+// DFI386-20.REV0 - Chipset: Chips 2xP82B305 P82A304, P82C302 P82C301 P82C206, two unreadable - initializes graphics card then hangs
+// BIOS: AMI 386 BIOS PLUS Ser.#: 102856 - Keyboard BIOS: AMI 386 BIOS PLUS Ser.#:102856
+// CPU: i386DX-20 - ISA8: 1, ISA16: 5, Memory: 1 - Memory card shown in photos
+// OSC: OSC1: 14.31818, OSC2: 16.000MHz, OSC3: unreadable, OSC4: 40.000MHz
+ROM_START( dfi386 )
+ ROM_REGION(0x20000, "bios", 0)
+ ROMX_LOAD( "386-dfi-386-20_even_32k.bin", 0x10000, 0x8000, CRC(2d1309f8) SHA1(a75816b97d1f763dba39bdccf8e58729a58b0e56), ROM_SKIP(1) )
+ ROMX_LOAD( "386-dfi-386-20_odd_32k.bin", 0x10001, 0x8000, CRC(1968fe11) SHA1(b5662daa57751859d2cfa7740f708277cbe35080), ROM_SKIP(1) )
+ROM_END
+
//**************************************************************************
// 80386 SX and DX Laptop/Notebook
//**************************************************************************
@@ -2701,6 +2864,8 @@ COMP( 1994, a486sp3g, ibm5170, 0, at486, 0, at_state, init_at
COMP( 1995, aa486s, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "PCI/I-A486S", MACHINE_NOT_WORKING )
COMP( 1994, a486sv1, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "VL/EISA-486SV1", MACHINE_NOT_WORKING )
COMP( 1994, a486sv2g, ibm5170, 0, at486, 0, at_state, init_at, "Asus", "VL/I-486SV2G", MACHINE_NOT_WORKING )
+COMP( 199?, isa386u30, ibm5170, 0, at386, 0, at_state, init_at, "Asus", "ISA-386U30 REV.2.2", MACHINE_NOT_WORKING )
+COMP( 1989, isa386c, ibm5170, 0, at386, 0, at_state, init_at, "Asus", "ISA-386C", MACHINE_NOT_WORKING )
COMP( 199?, mb8433uud, ibm5170, 0, at486, 0, at_state, init_at, "Biostar", "MB8433-UUD-A", MACHINE_NOT_WORKING ) // lands in Award BootBlock BIOS
COMP( 199?, mb1212c, ibm5170, 0, atvga, 0, at_state, init_at, "Biostar", "MB-1212C", MACHINE_NOT_WORKING )
COMP( 1990, c386sx16, ibm5170, 0, at386sx, 0, at_state, init_at, "Commodore Business Machines", "386SX-16", MACHINE_NOT_WORKING )
@@ -2721,6 +2886,7 @@ COMP( 1988, dsys200, ibm5170, 0, atvga, 0, at_state, init_at
COMP( 1995, ficpio2, ibm5170, 0, ficpio2, 0, at_state, init_atpci, "First International Computer", "486-PIO-2", MACHINE_NOT_WORKING )
COMP( 1994, ficvipio, ibm5170, 0, at486, 0, at_state, init_at, "First International Computer", "486-VIP-IO", MACHINE_NOT_WORKING )
COMP( 199?, ficvipio2, ibm5170, 0, at486, 0, at_state, init_at, "First International Computer", "486-VIP-IO2", MACHINE_NOT_WORKING )
+COMP( 198?, hot304, ibm5170, 0, at386, 0, at_state, init_at, "Shuttle Computer International", "HOT-304", MACHINE_NOT_WORKING )
COMP( 199?, hot409, ibm5170, 0, at486, 0, at_state, init_at, "Shuttle Computer International", "HOT-409", MACHINE_NOT_WORKING )
COMP( 198?, aubam12s2, ibm5170, 0, atvga, 0, at_state, init_at, "AUVA COMPUTER, INC.", "BAM/12-S2", MACHINE_NOT_WORKING )
COMP( 198?, wy220001, ibm5170, 0, ibm5162, 0, at_state, init_at, "Wyse", "WYSEpc 286", MACHINE_NOT_WORKING )
@@ -2739,6 +2905,10 @@ COMP( 199?, headg2, ibm5170, 0, atvga, 0, at_state, init_at
COMP( 199?, sy019hi, ibm5170, 0, at386, 0, at_state, init_at, "Soyo", "SY-019H and SY-019I", MACHINE_NOT_WORKING )
COMP( 199?, suntac5, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "286 motherboards with 5-chip SUNTAC chipset", MACHINE_NOT_WORKING )
COMP( 198?, vlsi5, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "286 motherboards with 5-chip VLSI chipset", MACHINE_NOT_WORKING )
+COMP( 199?, frxc402, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 motherboards with a FOREX FRX46C402/FRX36C300/SIS85C206 chipset", MACHINE_NOT_WORKING )
+COMP( 199?, opti495xlc,ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 motherboards using a OPTi 82C495XLC chipset", MACHINE_NOT_WORKING )
+COMP( 198?, dfi386, ibm5170, 0, at386, 0, at_state, init_at, "DFI", "386-20.REV0", MACHINE_NOT_WORKING )
+COMP( 198?, pem2530, ibm5170, 0, at386, 0, at_state, init_at, "DTK", "PEM 2539", MACHINE_NOT_WORKING )
COMP( 198?, u3911v3, ibm5170, 0, atvga, 0, at_state, init_at, "Uniron", "U3911-V3", MACHINE_NOT_WORKING )
COMP( 199?, mba009, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "HLB-286 MBA-009", MACHINE_NOT_WORKING )
COMP( 1985, k286i, ibm5170, 0, k286i, 0, at_state, init_at, "Kaypro", "286i", MACHINE_NOT_WORKING )
@@ -2750,6 +2920,13 @@ COMP( 199?, sm38640f, ibm5170, 0, at386, 0, at_state, init_at
COMP( 199?, 4nd04a, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386-4N-D04A (UMC chipset)", MACHINE_NOT_WORKING )
COMP( 199?, bi025c, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "BI-025C HT-12 286 (HT12/A chipset)", MACHINE_NOT_WORKING )
COMP( 199?, kma202f, ibm5170, 0, atvga, 0, at_state, init_at, "<unknown>", "KMA-202F-12R (Winbond chipset)", MACHINE_NOT_WORKING )
+COMP( 199?, sy012, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "SY-012 16/25 386MB VER: 5.2", MACHINE_NOT_WORKING )
+COMP( 198?, gs611606a, ibm5170, 0, at386, 0, at_state, init_at, "Goldstar", "GOLDSTAR P/N 611-606A Rev 1.0A", MACHINE_NOT_WORKING )
+COMP( 199?, tam3340ma0,ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "TAM/33/40-MA0 (CM318R00,M31-R00)", MACHINE_NOT_WORKING )
+COMP( 199?, alim1429, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 motherboards using the ALi M1429 A1 and M1431 A2 chipset", MACHINE_NOT_WORKING )
+COMP( 199?, 386sc, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 SC Rev A2", MACHINE_NOT_WORKING )
+COMP( 199?, 386sc2c, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 motherboard using the Symphony chipset", MACHINE_NOT_WORKING )
+COMP( 199?, pt581392, ibm5170, 0, at386, 0, at_state, init_at, "<unknown>", "386 Motherboard using the Forex FRX46C402 + FRX46C411 + SiS 85C206 chipset", MACHINE_NOT_WORKING )
COMP( 1986, pcd2, ibm5170, 0, ibm5170, 0, at_state, init_at, "Siemens", "PCD-2", MACHINE_NOT_WORKING )
COMP( 199?, pcd3nsx, ibm5170, 0, at386sx, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-3Nsx Notebook Computer", MACHINE_NOT_WORKING )
COMP( 199?, pcd4x, ibm5170, 0, at486, 0, at_state, init_at, "Siemens-Nixdorf", "PCD-4H, PCD-4M", MACHINE_NOT_WORKING )
@@ -2779,4 +2956,5 @@ COMP( 1986, n8810m55, ibm5170, 0, n8810m55, 0, at_state, init_at
COMP( 1987, m290, ibm5170, 0, atvga, 0, at_state, init_at, "Olivetti", "M290", MACHINE_NOT_WORKING )
COMP( 1993, lion3500, ibm5170, 0, at486, 0, at_state, init_at, "Lion", "3500", MACHINE_NOT_WORKING )
COMP( 198?, o286foxii, ibm5170, 0, atvga, 0, at_state, init_at, "Octek", "Fox II", MACHINE_NOT_WORKING )
+COMP( 1992, ocjagv, ibm5170, 0, at386, 0, at_state, init_at, "Octek", "Jaguar V v1.4", MACHINE_NOT_WORKING )
//COMP( 1988, nws286, ibm5170, 0, ews286, 0, at_state, at, "Nokia Data", "Nokia Data WS286", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp
index 8ef9ff076b9..e9245d092ee 100644
--- a/src/mame/drivers/atarist.cpp
+++ b/src/mame/drivers/atarist.cpp
@@ -69,7 +69,7 @@ void st_state::device_timer(emu_timer &timer, device_timer_id id, int param, voi
blitter_tick();
break;
default:
- assert_always(false, "Unknown id in st_state::device_timer");
+ throw emu_fatalerror("Unknown id in st_state::device_timer");
}
}
diff --git a/src/mame/drivers/atpci.cpp b/src/mame/drivers/atpci.cpp
index 716722de7bf..90706bd53a3 100644
--- a/src/mame/drivers/atpci.cpp
+++ b/src/mame/drivers/atpci.cpp
@@ -102,6 +102,7 @@ void at586_state::at_softlists(machine_config &config)
SOFTWARE_LIST(config, "pc_disk_list").set_original("ibm5150");
SOFTWARE_LIST(config, "at_disk_list").set_original("ibm5170");
SOFTWARE_LIST(config, "at_cdrom_list").set_original("ibm5170_cdrom");
+ SOFTWARE_LIST(config, "midi_disk_list").set_compatible("midi_flop");
}
void at586_state::at586(machine_config &config)
diff --git a/src/mame/drivers/beezer.cpp b/src/mame/drivers/beezer.cpp
index 9796313388f..950bd9f2a94 100644
--- a/src/mame/drivers/beezer.cpp
+++ b/src/mame/drivers/beezer.cpp
@@ -302,7 +302,7 @@ void beezer_state::device_timer(emu_timer &timer, device_timer_id id, int param,
{
case TIMER_DAC: dac_update_cb(); break;
case TIMER_SCANLINE: scanline_cb(); break;
- default: assert_always(false, "Unknown id in beezer_state::device_timer");
+ default: throw emu_fatalerror("Unknown id in beezer_state::device_timer");
}
}
diff --git a/src/mame/drivers/boxer.cpp b/src/mame/drivers/boxer.cpp
index 0eccc410514..8a6c13cd1b5 100644
--- a/src/mame/drivers/boxer.cpp
+++ b/src/mame/drivers/boxer.cpp
@@ -103,7 +103,7 @@ void boxer_state::device_timer(emu_timer &timer, device_timer_id id, int param,
periodic_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in boxer_state::device_timer");
+ throw emu_fatalerror("Unknown id in boxer_state::device_timer");
}
}
diff --git a/src/mame/drivers/c10.cpp b/src/mame/drivers/c10.cpp
index 59462dfbea2..511b6741ffe 100644
--- a/src/mame/drivers/c10.cpp
+++ b/src/mame/drivers/c10.cpp
@@ -81,7 +81,7 @@ void c10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in c10_state::device_timer");
+ throw emu_fatalerror("Unknown id in c10_state::device_timer");
}
}
diff --git a/src/mame/drivers/c2color.cpp b/src/mame/drivers/c2color.cpp
index 53c7d94e519..8eed63b0ed4 100644
--- a/src/mame/drivers/c2color.cpp
+++ b/src/mame/drivers/c2color.cpp
@@ -26,6 +26,8 @@
#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
@@ -39,6 +41,7 @@ class c2_color_state : public driver_device
public:
c2_color_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
, m_cart(*this, "cartslot")
, m_cart_region(nullptr)
, m_palette(*this, "palette")
@@ -56,6 +59,12 @@ private:
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
+ u8 cart_r(offs_t offset);
+
+ void prog_map(address_map &map);
+ void ext_map(address_map &map);
+
+ required_device<mcs51_cpu_device> m_maincpu;
required_device<generic_slot_device> m_cart;
memory_region *m_cart_region;
required_device<palette_device> m_palette;
@@ -94,12 +103,30 @@ DEVICE_IMAGE_LOAD_MEMBER(c2_color_state::cart_load)
return image_init_result::PASS;
}
+u8 c2_color_state::cart_r(offs_t offset)
+{
+ // skip past 32-byte header
+ return m_cart->read_rom(offset + 32);
+}
+
+void c2_color_state::prog_map(address_map &map)
+{
+ map(0x0000, 0xffff).r(FUNC(c2_color_state::cart_r));
+}
+
+void c2_color_state::ext_map(address_map &map)
+{
+ map(0x2400, 0x2400).nopr();
+}
+
static INPUT_PORTS_START( c2_color )
INPUT_PORTS_END
void c2_color_state::c2_color(machine_config &config)
{
- // unknown CPU
+ I8032(config, m_maincpu, 12'000'000); // exact type and clock unknown
+ m_maincpu->set_addrmap(AS_PROGRAM, &c2_color_state::prog_map);
+ m_maincpu->set_addrmap(AS_IO, &c2_color_state::ext_map);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp
index 9fdb8438fb9..96a31ab31ea 100644
--- a/src/mame/drivers/capbowl.cpp
+++ b/src/mame/drivers/capbowl.cpp
@@ -130,7 +130,7 @@ void capbowl_state::device_timer(emu_timer &timer, device_timer_id id, int param
update(ptr, param);
break;
default:
- assert_always(false, "Unknown id in capbowl_state::device_timer");
+ throw emu_fatalerror("Unknown id in capbowl_state::device_timer");
}
}
diff --git a/src/mame/drivers/cat.cpp b/src/mame/drivers/cat.cpp
index 950b7dd2d1b..d1ed24efad5 100644
--- a/src/mame/drivers/cat.cpp
+++ b/src/mame/drivers/cat.cpp
@@ -902,7 +902,7 @@ void cat_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
counter_6ms_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in cat_state::device_timer");
+ throw emu_fatalerror("Unknown id in cat_state::device_timer");
}
}
diff --git a/src/mame/drivers/cball.cpp b/src/mame/drivers/cball.cpp
index b022aeade1a..38d9d82e31c 100644
--- a/src/mame/drivers/cball.cpp
+++ b/src/mame/drivers/cball.cpp
@@ -110,7 +110,7 @@ void cball_state::device_timer(emu_timer &timer, device_timer_id id, int param,
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in cball_state::device_timer");
+ throw emu_fatalerror("Unknown id in cball_state::device_timer");
}
}
diff --git a/src/mame/drivers/cbnt2039.cpp b/src/mame/drivers/cbnt2039.cpp
new file mode 100644
index 00000000000..7df68a507de
--- /dev/null
+++ b/src/mame/drivers/cbnt2039.cpp
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/************************************************************************************************************
+
+ Skeleton driver for Cablenet, Inc. 2039 coax/twinax Lexmark printer controller card.
+
+ Main CPU is a Chips & Technologies F8680 PC/CHIP (x86 with custom opcodes).
+
+************************************************************************************************************/
+
+#include "emu.h"
+//#include "cpu/i86/f8680.h"
+#include "cpu/bcp/dp8344.h"
+//#include "machine/eepromser.h"
+
+
+class cbnt2039_state : public driver_device
+{
+public:
+ cbnt2039_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_bcp(*this, "bcp")
+ {
+ }
+
+ void cbnt2039(machine_config &config);
+
+private:
+ void bcp_prog_map(address_map &map);
+ void bcp_data_map(address_map &map);
+
+ required_device<dp8344_device> m_bcp;
+};
+
+void cbnt2039_state::bcp_prog_map(address_map &map)
+{
+ map(0x0000, 0x1fff).rom().region("sbprom", 0x10906); // FIXME: should be RAM (2x MCM6264CP25), with code uploaded by F8680
+}
+
+void cbnt2039_state::bcp_data_map(address_map &map)
+{
+}
+
+
+static INPUT_PORTS_START(cbnt2039)
+INPUT_PORTS_END
+
+
+void cbnt2039_state::cbnt2039(machine_config &config)
+{
+ //F8680(config, m_maincpu, OSC1);
+
+ DP8344(config, m_bcp, 18.8696_MHz_XTAL); // DP8344BV; Y1 = "RXD8.000"; Y2 = "RXD18.86"
+ m_bcp->set_addrmap(AS_PROGRAM, &cbnt2039_state::bcp_prog_map);
+ m_bcp->set_addrmap(AS_DATA, &cbnt2039_state::bcp_data_map);
+
+ //EEPROM_93C56_16BIT(config, "eeprom");
+}
+
+
+ROM_START(cbnt2039)
+ ROM_REGION16_LE(0x20000, "sbprom", 0)
+ ROM_LOAD("sbprom_27c_2ea2-1001.u12", 0x00000, 0x20000, CRC(4ee02833) SHA1(17c8b02bbef7b855a91dfb8bd9758ffb5cc9b9e7)) // handwritten label
+ROM_END
+
+
+COMP(1993, cbnt2039, 0, 0, cbnt2039, cbnt2039, cbnt2039_state, empty_init, "Cablenet", "2039 Controller", MACHINE_IS_SKELETON)
diff --git a/src/mame/drivers/cfx9850.cpp b/src/mame/drivers/cfx9850.cpp
index fa965bbdae8..f26d3485f92 100644
--- a/src/mame/drivers/cfx9850.cpp
+++ b/src/mame/drivers/cfx9850.cpp
@@ -75,7 +75,7 @@ void cfx9850_state::cfx9850_mem(address_map &map)
// AM_RANGE( 0x100000, 0x10ffff ) // some memory mapped i/o???
// AM_RANGE( 0x110000, 0x11ffff ) // some memory mapped i/o???
map(0x200000, 0x27ffff).rom().region("bios", 0);
- map(0x400000, 0x40ffff).ram();
+ map(0x400000, 0x407fff).mirror(0x008000).ram();
map(0x600000, 0x6007ff).mirror(0xf800).ram().share("display_ram");
// AM_RANGE( 0xe10000, 0xe1ffff ) // some memory mapped i/o???
}
diff --git a/src/mame/drivers/cidelsa.cpp b/src/mame/drivers/cidelsa.cpp
index 7a484d6d181..4e998a5bc26 100644
--- a/src/mame/drivers/cidelsa.cpp
+++ b/src/mame/drivers/cidelsa.cpp
@@ -364,7 +364,7 @@ void cidelsa_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_reset = 1;
break;
default:
- assert_always(false, "Unknown id in cidelsa_state::device_timer");
+ throw emu_fatalerror("Unknown id in cidelsa_state::device_timer");
}
}
diff --git a/src/mame/drivers/clpoker.cpp b/src/mame/drivers/clpoker.cpp
index 10a41c9ec71..372c788d257 100644
--- a/src/mame/drivers/clpoker.cpp
+++ b/src/mame/drivers/clpoker.cpp
@@ -27,9 +27,7 @@ There also are unpopulated locations that might fit a YM3812 and YM3014.
*/
#include "emu.h"
-#include "screen.h"
-#include "speaker.h"
-#include "tilemap.h"
+
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/nvram.h"
@@ -37,6 +35,11 @@ There also are unpopulated locations that might fit a YM3812 and YM3014.
#include "sound/ay8910.h"
#include "video/ramdac.h"
+#include "screen.h"
+#include "speaker.h"
+#include "tilemap.h"
+
+
class clpoker_state : public driver_device
{
public:
@@ -49,6 +52,12 @@ public:
{
}
+ void clpoker(machine_config &config);
+
+protected:
+ virtual void video_start() override;
+
+private:
DECLARE_WRITE8_MEMBER(output_a_w);
DECLARE_WRITE8_MEMBER(output_b_w);
DECLARE_WRITE8_MEMBER(output_c_w);
@@ -58,14 +67,10 @@ public:
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void clpoker(machine_config &config);
void io_map(address_map &map);
void prg_map(address_map &map);
void ramdac_map(address_map &map);
-protected:
- virtual void video_start() override;
-private:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp
index d477845ccea..d43b0e56a96 100644
--- a/src/mame/drivers/cps1.cpp
+++ b/src/mame/drivers/cps1.cpp
@@ -10647,6 +10647,10 @@ ROM_END
Sets b and c:
Turbo mode on SW(C):1.
Press start to change character mid-game. (bug: screen goes dark when changing character, happens in attract mode as well).
+
+ MSTREET-6 repair info:
+ Frequent cause of dead board is u104 (gal/palce20v8) becoming corrupted somehow. Luckily a working unsecured chip was found and dumped :)
+ May also work for other bootlegs (there are many very similar bootlegs out there), in that case the reference (u104) may vary.
*/
ROM_START( sf2cems6a ) /* 920313 USA (this set matches "sf2ceuab4" in FBA) */
@@ -10683,6 +10687,9 @@ ROM_START( sf2cems6a ) /* 920313 USA (this set matches "sf2ceuab4" in FBA) */
ROM_REGION( 0x10000, "user1", 0 ) /* unknown, priority? */
ROM_LOAD( "ms6.u133", 0x00000, 0x10000, CRC(13ea1c44) SHA1(5b05fe4c3920e33d94fac5f59e09ff14b3e427fe) ) // == loads other bootleg sets
+
+ ROM_REGION( 0x0200, "plds", 0 ) /* pld devices */
+ ROM_LOAD( "ms6_gal20v8a.u104", 0x0000, 0x0157, CRC(67b56d29) SHA1(261ae6e968100d5a9c1ee68ea684bb2b1eef3cf8) )
ROM_END
ROM_START( sf2cems6b ) /* 920322 USA */
@@ -10727,6 +10734,9 @@ ROM_START( sf2cems6b ) /* 920322 USA */
ROM_REGION( 0x10000, "user1", 0 ) /* unknown, priority? */
ROM_LOAD( "ms6.u133", 0x00000, 0x10000, CRC(13ea1c44) SHA1(5b05fe4c3920e33d94fac5f59e09ff14b3e427fe) )
+
+ ROM_REGION( 0x0200, "plds", 0 ) /* pld devices */
+ ROM_LOAD( "ms6_gal20v8a.u104", 0x0000, 0x0157, CRC(67b56d29) SHA1(261ae6e968100d5a9c1ee68ea684bb2b1eef3cf8) )
ROM_END
ROM_START( sf2cems6c ) /* 920322 USA */
@@ -10771,6 +10781,9 @@ ROM_START( sf2cems6c ) /* 920322 USA */
ROM_REGION( 0x10000, "user1", 0 ) /* unknown, priority? */
ROM_LOAD( "ms6.u133", 0x00000, 0x10000, CRC(13ea1c44) SHA1(5b05fe4c3920e33d94fac5f59e09ff14b3e427fe) )
+
+ ROM_REGION( 0x0200, "plds", 0 ) /* pld devices */
+ ROM_LOAD( "ms6_gal20v8a.u104", 0x0000, 0x0157, CRC(67b56d29) SHA1(261ae6e968100d5a9c1ee68ea684bb2b1eef3cf8) )
ROM_END
/* B-Board 89625B-1 */
diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp
index 6b575a291cb..a6297f201e5 100644
--- a/src/mame/drivers/cps3.cpp
+++ b/src/mame/drivers/cps3.cpp
@@ -15,10 +15,6 @@ SCSI code by ElSemi
Known Issues:
-Tilemap Global X/Y flip not emulated
- Street Fighter 3 2nd Impact uses Y-flipped tilemaps during flashing.
- Warzard uses X-flipped tilemaps during special effects.
-
Whole screen flip not emulated
Miscellaneous TO-DOs:
@@ -162,9 +158,13 @@ key and it didn't run so it is known that the custom CPU will not run standard (
The flashROM in the cart contains an encrypted program which is decrypted by the CPU in the cart. The CPU has built-in
decryption and the key is held in some static RAM on the CPU die and kept there by a battery. The code is executed by
the CPU to boot the system. Even though the code in the flashROM is encrypted, the cart can run it even if it is
-dead/suicided because it has been discovered that the program contains a hidden security menu allowing the cart to be
-loaded with the security data. This proves the cart runs the code even if the battery is dead. The special security
-menu is not normally available but is likely accessed with a special key/button combination which is currently unknown.
+dead/suicided.
+It is thought that when a cartridge dies it will set the decryption keys identical to the ones of SFIII-2nd Impact, so
+removing the battery and changing the content of the flashROM (if it's not a 2nd Impact) will make it run as a normal
+SFIII-2nd Impact cartridge (verified).
+Decryption always applied when reading boot flash ROM or SH-2's On-chip cache areas. Based of the fact, what SFIII-2nd uses
+encrypted boot ROM but plain not encrypted SIMMs 1&2 code&data - besides of key, static RAM inside of CPU also
+should contain decryption range for SIMMs1&2, or some flag which enable or disable it.
Because the CPU in the cart is always powered by the battery, it has stealth capability that allows it to continually
monitor the situation. If the custom CPU detects any tampering (generally things such as voltage fluctuation or voltage
@@ -173,10 +173,6 @@ inside the CPU which effectively kills the security cart. It is known (from deca
cart contains an amount of static RAM for data storage and a SH2 core based on the Hitachi SH7010-series (SH7014)
SuperH RISC engine family of Microprocessors.
-It is thought that when a cartridge dies it will set the decryption keys identical to the ones of SFIII-2nd Impact, so
-removing the battery and changing the content of the flashROM (if it's not a 2nd Impact) will make it run as a normal
-SFIII-2nd Impact cartridge (verified).
-
The main board uses the familiar Capcom SIMM modules to hold the data from the CDROM so that the life of the CD drive
is maximized. The SIMMs don't contain RAM, but instead TSOP48 surface mounted flashROMs that can be updated with
different games on bootup using a built-in software updating system.
@@ -377,10 +373,7 @@ Cartridge types A/B are identical and cartridge types C/D are identical.
Type A/B have extra space on the back side to solder a 28F400 SOP44 flashROM which shares all electrical connections
with the 29F400 TSOP48 flashROM on the front side of the PCB. Either chip can be used to store the 512k cart program,
but no cart has been seen with a SOP44 flashROM populated, nor with both SOP44 and TSOP48 populated on one cart.
-A and B cartridges also contain a FM1208S NVRAM which holds game settings or other per-game data. It is definitely
-used. If the NVRAM data is not present when the game boots or the NVRAM is not working or inaccessible a message is
-displayed 'EEPROM ERROR' and the game halts. This error can also occur if the security cart edge connector is dirty
-and not contacting properly.
+A and B cartridges also contain a FM1208S NVRAM, it is NOT used to save settings or game data, purpose is unknown.
C and D cartridges lack the extra space to solder a SOP44 flashROM. A space is available on the back side for a FM1208S
NVRAM but it is not populated. A MACH111 CPLD is present on the back side and stamped 'CP3B1A'
@@ -461,111 +454,111 @@ hardware modification to the security cart.....
Hardware registers info
----------------------
- PPU registers (read only)
- 0x040C0000 - 0x040C000D
-
- Offset: Bits: Desc:
- 0C ---- ---- ---- -2-- Palette DMA active |
- ---- ---- ---- --1- Character DMA active | several parts of game code assume only 1 of these might be active at the same time
- ---- ---- ---- ---0 Sprite list DMA/copy active, see register 82 description
-
- PPU registers (write only)
- 0x040C0000 - 0x040C00AF
-
- Offset: Bits: Desc:
- 00 ---- --xx xxxx xxxx Global Scroll 0 X
- 02 ---- --xx xxxx xxxx Global Scroll 0 Y
- 04-1F Global Scrolls 1-7
- 20 xxxx xxxx xxxx xxxx Tilemap 0 Scroll X
- 22 xxxx xxxx xxxx xxxx Tilemap 0 Scroll Y
- 24 ---- -a98 76-- ---- Tilemap 0 ?? always 0
- ---- ---- ---4 3210 Tilemap 0 Width (in tiles)
- 26 f--- ---- ---- ---- Tilemap 0 Enable
- -e-- ---- ---- ---- Tilemap 0 Line Scroll Enable
- --d- ---- ---- ---- Tilemap 0 Line Zoom Enable (seems unused in games, but might be enabled in jojo dev.menu BG test)
- ---c ---- ---- ---- Tilemap 0 ?? set together with Zoom
- ---- b--- ---- ---- Tilemap 0 Flip X (not implemented, Warzard demo fights during special moves)
- ---- -a-- ---- ---- Tilemap 0 Flip Y (not implemented, Capcom logos background during sfiii2 flashing)
- ---- --98 7654 3210 Tilemap 0 ?? always 0
- 28 -edc ba98 ---- ---- Tilemap 0 Line Scroll and Zoom Base address (1st word is scroll, 2nd word is zoom)
- ---- ---- -654 3210 Tilemap 0 Tiles Base address
- 2A-2F unused
- 30-5F Tilemaps 1-3
- Values: 384 495 "wide"
- 60 xxxx xxxx xxxx xxxx H Sync end* 42 35
- 62 xxxx xxxx xxxx xxxx H Blank end 111 118
- 64 xxxx xxxx xxxx xxxx H Screen end 495 613
- 66 xxxx xxxx xxxx xxxx H Total end* 454 454
- 68 ---- --xx xxxx xxxx H ?? Zoom Master? 0 0 +128 if flip screen, might be not zoom-related but global H scroll
- 6A xxxx xxxx xxxx xxxx H ?? Zoom Offset? 0 0
- 6C xxxx xxxx xxxx xxxx H ?? Zoom Size? 1023 1023 (511 at BIOS init)
- 6E xxxx xxxx xxxx xxxx H Zoom Scale 64 64
- 70 xxxx xxxx xxxx xxxx V Sync end 3 3
- 72 xxxx xxxx xxxx xxxx V Blank end 21 21
- 74 xxxx xxxx xxxx xxxx V Screen end 245 245
- 76 xxxx xxxx xxxx xxxx V Total end 262 262
- 78 ---- --xx xxxx xxxx V ?? Zoom Master? 0 0 might be not zoom-related but global V scroll
- 7A xxxx xxxx xxxx xxxx V ?? Zoom Offset? 0 0
- 7C xxxx xxxx xxxx xxxx V ?? Zoom Size? 1023 1023 (261 at BIOS init)
- 7E xxxx xxxx xxxx xxxx V Zoom Scale 64 64
- 80 ---- ---- ---- -210 Pixel clock 3 5 base clock is 42.954545MHz, 3 = /5 divider, 5 = /4 divider.
- ---- ---- ---4 3--- Flip screen X/Y (or Y/X)
- ---- ---- --5- ---- ?? always set to 1, 0 in unused 24KHz mode (pixel clock divider?)
- ---- ---- -6-- ---- ?? set to 0 by BIOS init, then set to 1 after video mode selection, 0 in unused 24KHz mode (pixel clock divider?)
- f--- ---- ---- ---- ?? always 0, but there is code which may set it
- 82 ---- ---- ---- 3--0 Sprite list DMA/copy to onchip RAM ? after new list upload to sprite RAM games write here 8/9/8/9 pattern, then wait until register 0C bit 0 became 0, then write 0.
- 84 ---- b--- ---- ---- ?? always set to 0x0800
- 86 ---- ---- ---- 3210 Character RAM bank
- 88 ---- ---- --54 3210 Gfx flash ROM bank
- 8A ---- ---- ---- ---- ?? set to 0 by BIOS init, never writen later
- 8E ---- ---- 7-5- ---- ?? set to 0x00A0 by BIOS init after Pal/Char DMA registers, never writen later (Char/Pal DMA IRQ enable ?)
- 96 xxxx xxxx xxxx xxxx Character DMA Source low bits
- 98 ---- ---- --54 3210 Character DMA Source high bits
- ---- ---- -6-- ---- Character DMA Start
- A0 ---- -a98 7654 3210 Palette DMA Source high bits
- A2 xxxx xxxx xxxx xxxx Palette DMA Source low bits
- A4 ---- ---- ---- ---0 Palette DMA Destination high bit
- A6 xxxx xxxx xxxx xxxx Palette DMA Destination low bits
- A8 -edc ba98 -654 3210 Palette DMA Fade low bits
- AA ---- ---- -654 3210 Palette DMA Fade high bits
- AC xxxx xxxx xxxx xxxx Palette DMA Lenght low bits
- AE ---- ---- ---- ---0 Palette DMA Lenght high bit
- ---- ---- ---- --1- Palette DMA Start
-
- All CRTC-related values is last clock/line of given area, i.e. actual sizes is +1 to value.
-
- (*) H Total value is same for all 15KHz modes, uses fixed clock (not affected by pixel clock modifier) -
- 42.954545MHz/6 (similar to SSV) /(454+1) = 15734.25Hz /(262+1) = 59.826Hz
- unused 24KHz 512x384 mode uses H Total 293 V Total 424 (42.954545MHz/6 /(293+1) = 24350.62Hz /(424+1) = 57.29Hz)
-
-
- 'SS' foreground tilemap layer generator (presumable located in 'SSU' chip) registers (write only?)
- 0x05050000 - 0x05050029 area, even bytes only.
-
- Offset: Bits: Desc: Values: 384 495 "wide"
- 00 xxxx xxxx H Sync* 42 35 same as PPU
- 01 xxxx xxxx H Start L
- 02 xxxx xxxx H Start H 62 64
- 03 xxxx xxxx H Blank L
- 04 xxxx xxxx H Blank H 534 671
- 05 xxxx xxxx H Total L*
- 06 xxxx xxxx H Total H* 454 454* same as PPU
- 07 xxxx xxxx H Scroll L
- 08 xxxx xxxx H Scroll H -101 -107 +128 if flip screen
- 09 xxxx xxxx V Sync 3 3 same as PPU
- 0a xxxx xxxx V Start L
- 0b xxxx xxxx V Start H 21 21 same as PPU
- 0c xxxx xxxx V Blank L
- 0d xxxx xxxx V Blank H 247 247 PPU value +2
- 0e xxxx xxxx V Total L
- 0f xxxx xxxx V Total H 262 262 same as PPU
- 10 xxxx xxxx V Scroll L
- 11 xxxx xxxx V Scroll H -24 -24 +288 if flip screen
- 12 xxxx xxxx Palette base
- 13 ---- -210 Pixel clock 3 5 not clear how it works
- 14 ---- --10 Flip screen X/Y (or Y/X?)
-
- (*) H Total value is same for all 15KHz modes, same as PPU.
+ PPU registers (read only)
+ 0x040C0000 - 0x040C000D
+
+ Offset: Bits: Desc:
+ 0C ---- ---- ---- -2-- Palette DMA active |
+ ---- ---- ---- --1- Character DMA active | several parts of game code assume only 1 of these might be active at the same time
+ ---- ---- ---- ---0 Sprite list DMA/copy active, see register 82 description
+
+ PPU registers (write only)
+ 0x040C0000 - 0x040C00AF
+
+ Offset: Bits: Desc:
+ 00 ---- --xx xxxx xxxx Global Scroll 0 X
+ 02 ---- --xx xxxx xxxx Global Scroll 0 Y
+ 04-1F Global Scrolls 1-7
+ 20 xxxx xxxx xxxx xxxx Tilemap 0 Scroll X
+ 22 xxxx xxxx xxxx xxxx Tilemap 0 Scroll Y
+ 24 ---- -a98 76-- ---- Tilemap 0 ?? always 0
+ ---- ---- ---4 3210 Tilemap 0 Width (in tiles)
+ 26 f--- ---- ---- ---- Tilemap 0 Enable
+ -e-- ---- ---- ---- Tilemap 0 Line Scroll Enable
+ --d- ---- ---- ---- Tilemap 0 Line Zoom Enable (seems unused in games, but might be enabled in jojo dev.menu BG test)
+ ---c ---- ---- ---- Tilemap 0 ?? set together with Zoom
+ ---- b--- ---- ---- Tilemap 0 Flip X (not implemented, Warzard demo fights during special moves)
+ ---- -a-- ---- ---- Tilemap 0 Flip Y (not implemented, Capcom logos background during sfiii2 flashing)
+ ---- --98 7654 3210 Tilemap 0 ?? always 0
+ 28 -edc ba98 ---- ---- Tilemap 0 Line Scroll and Zoom Base address (1st word is scroll, 2nd word is zoom)
+ ---- ---- -654 3210 Tilemap 0 Tiles Base address
+ 2A-2F unused
+ 30-5F Tilemaps 1-3
+ Values: 384 495 "wide"
+ 60 xxxx xxxx xxxx xxxx H Sync end* 42 35
+ 62 xxxx xxxx xxxx xxxx H Blank end 111 118
+ 64 xxxx xxxx xxxx xxxx H Screen end 495 613
+ 66 xxxx xxxx xxxx xxxx H Total end* 454 454
+ 68 ---- --xx xxxx xxxx H ?? Zoom Master? 0 0 +128 if flip screen, might be not zoom-related but global H scroll
+ 6A xxxx xxxx xxxx xxxx H ?? Zoom Offset? 0 0
+ 6C xxxx xxxx xxxx xxxx H ?? Zoom Size? 1023 1023 (511 at BIOS init)
+ 6E xxxx xxxx xxxx xxxx H Zoom Scale 64 64
+ 70 xxxx xxxx xxxx xxxx V Sync end 3 3
+ 72 xxxx xxxx xxxx xxxx V Blank end 21 21
+ 74 xxxx xxxx xxxx xxxx V Screen end 245 245
+ 76 xxxx xxxx xxxx xxxx V Total end 262 262
+ 78 ---- --xx xxxx xxxx V ?? Zoom Master? 0 0 might be not zoom-related but global V scroll
+ 7A xxxx xxxx xxxx xxxx V ?? Zoom Offset? 0 0
+ 7C xxxx xxxx xxxx xxxx V ?? Zoom Size? 1023 1023 (261 at BIOS init)
+ 7E xxxx xxxx xxxx xxxx V Zoom Scale 64 64
+ 80 ---- ---- ---- -210 Pixel clock 3 5 base clock is 42.954545MHz, 3 = /5 divider, 5 = /4 divider.
+ ---- ---- ---4 3--- Flip screen X/Y (or Y/X)
+ ---- ---- --5- ---- ?? always set to 1, 0 in unused 24KHz mode (pixel clock divider?)
+ ---- ---- -6-- ---- ?? set to 0 by BIOS init, then set to 1 after video mode selection, 0 in unused 24KHz mode (pixel clock divider?)
+ f--- ---- ---- ---- ?? always 0, but there is code which may set it
+ 82 ---- ---- ---- 3--0 Sprite list DMA/copy to onchip RAM ? after new list upload to sprite RAM games write here 8/9/8/9 pattern, then wait until register 0C bit 0 became 0, then write 0.
+ 84 ---- b--- ---- ---- ?? always set to 0x0800
+ 86 ---- ---- ---- 3210 Character RAM bank
+ 88 ---- ---- --54 3210 Gfx flash ROM bank
+ 8A ---- ---- ---- ---- ?? set to 0 by BIOS init, never writen later
+ 8E ---- ---- 7-5- ---- ?? set to 0x00A0 by BIOS init after Pal/Char DMA registers, never writen later (Char/Pal DMA IRQ enable ?)
+ 96 xxxx xxxx xxxx xxxx Character DMA Source low bits
+ 98 ---- ---- --54 3210 Character DMA Source high bits
+ ---- ---- -6-- ---- Character DMA Start
+ A0 ---- -a98 7654 3210 Palette DMA Source high bits
+ A2 xxxx xxxx xxxx xxxx Palette DMA Source low bits
+ A4 ---- ---- ---- ---0 Palette DMA Destination high bit
+ A6 xxxx xxxx xxxx xxxx Palette DMA Destination low bits
+ A8 -edc ba98 -654 3210 Palette DMA Fade low bits
+ AA ---- ---- -654 3210 Palette DMA Fade high bits
+ AC xxxx xxxx xxxx xxxx Palette DMA Lenght low bits
+ AE ---- ---- ---- ---0 Palette DMA Lenght high bit
+ ---- ---- ---- --1- Palette DMA Start
+
+ All CRTC-related values is last clock/line of given area, i.e. actual sizes is +1 to value.
+
+ (*) H Total value is same for all 15KHz modes, uses fixed clock (not affected by pixel clock modifier) -
+ 42.954545MHz/6 (similar to SSV) /(454+1) = 15734.25Hz /(262+1) = 59.826Hz
+ unused 24KHz 512x384 mode uses H Total 293 V Total 424 (42.954545MHz/6 /(293+1) = 24350.62Hz /(424+1) = 57.29Hz)
+
+
+ 'SS' foreground tilemap layer generator (presumable located in 'SSU' chip) registers (write only?)
+ 0x05050000 - 0x05050029 area, even bytes only.
+
+ Offset: Bits: Desc: Values: 384 495 "wide"
+ 00 xxxx xxxx H Sync* 42 35 same as PPU
+ 01 xxxx xxxx H Start L
+ 02 xxxx xxxx H Start H 62 64
+ 03 xxxx xxxx H Blank L
+ 04 xxxx xxxx H Blank H 534 671
+ 05 xxxx xxxx H Total L*
+ 06 xxxx xxxx H Total H* 454 454* same as PPU
+ 07 xxxx xxxx H Scroll L
+ 08 xxxx xxxx H Scroll H -101 -107 +128 if flip screen
+ 09 xxxx xxxx V Sync 3 3 same as PPU
+ 0a xxxx xxxx V Start L
+ 0b xxxx xxxx V Start H 21 21 same as PPU
+ 0c xxxx xxxx V Blank L
+ 0d xxxx xxxx V Blank H 247 247 PPU value +2
+ 0e xxxx xxxx V Total L
+ 0f xxxx xxxx V Total H 262 262 same as PPU
+ 10 xxxx xxxx V Scroll L
+ 11 xxxx xxxx V Scroll H -24 -24 +288 if flip screen
+ 12 xxxx xxxx Palette base
+ 13 ---- -210 Pixel clock 3 5 not clear how it works
+ 14 ---- --10 Flip screen X/Y (or Y/X?)
+
+ (*) H Total value is same for all 15KHz modes, same as PPU.
*/
#include "emu.h"
@@ -583,8 +576,6 @@ Hardware registers info
#include "sfiii2.lh"
-#define MASTER_CLOCK 42954500
-
#define DEBUG_PRINTF 0
@@ -765,17 +756,24 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
if (c != transparent_color)
{
/* blending isn't 100% understood */
- // is it really ORed or bits should be replaced same as in Seta/SSV hardware ?
+ // is it really ORed or bits should be replaced same as in Seta/SSV hardware ? both produce same results in games
if (gfx->granularity() == 64)
{
- // OK for sfiii2 spotlight
+ // OK for sfiii world map spotlight
+#if 1
dest[x] |= (c & 0xf) << 13;
- //if (c & 0xf0) dest[x] = machine().rand(); // ?? not used?
+#else
+ dest[x] = (dest[x] & 0x01fff) | ((c & 0xf) << 13);
+#endif
}
else
{
// OK for jojo intro, and warzard swords, and various shadows in sf games
+#if 1
dest[x] |= ((c & 1) << 15) | ((color & 1) << 16);
+#else
+ dest[x] = (dest[x] & 0x07fff) | ((c & 1) << 15) | ((color & 1) << 16);
+#endif
}
}
x_index += dx;
@@ -891,8 +889,7 @@ void cps3_state::init_crypt(u32 key1, u32 key2, int altEncryption)
m_maincpu->sh2drc_set_options(SH2DRC_STRICT_VERIFY);
m_maincpu->sh2drc_add_fastram(0x02000000, 0x0207ffff, 0, &m_mainram[0]);
m_maincpu->sh2drc_add_fastram(0x04000000, 0x0407ffff, 0, &m_spriteram[0]);
- m_maincpu->sh2drc_add_fastram(0x040C0020, 0x040C002b, 0, &m_tilemap20_regs_base[0]);
- m_maincpu->sh2drc_add_fastram(0x040C0030, 0x040C003b, 0, &m_tilemap30_regs_base[0]);
+ m_maincpu->sh2drc_add_fastram(0x040C0020, 0x040C005f, 0, &m_tilemap_regs[0]);
decrypt_bios();
}
@@ -937,16 +934,12 @@ static const gfx_layout cps3_tiles8x8_layout =
static inline u8 get_fade(int c, int f)
{
- // bit 7 unknown
+ // bit 7 unused, explicit masked out
// bit 6 fade enable / disable
- // bit 5 fade mode
+ // bit 5 fade mode (1 = invert input values and output)
// bit 4-0 fade value
if (f & 0x40) // Fading enable / disable
- {
- f &= 0x3f;
- c = (f & 0x20) ? (c + (((0x1f - c) * (f & 0x1f)) / 0x1f)) : ((c * f) / 0x1f);
- c = std::max(0, std::min(0x1f, c));
- }
+ c = (f & 0x20) ? ((((c ^ 0x1f) * (~f & 0x1f)) >> 5) ^ 0x1f) : (c * (f & 0x1f) >> 5);
return c;
}
@@ -959,8 +952,6 @@ void cps3_state::set_mame_colours(int colournum, u16 data, u32 fadeval)
/* is this 100% correct? */
if (fadeval & 0x40400040)
{
- //logerror("fadeval %08x\n",fadeval);
-
r = get_fade(r, (fadeval & 0x7f000000)>>24);
g = get_fade(g, (fadeval & 0x007f0000)>>16);
b = get_fade(b, (fadeval & 0x0000007f)>>0);
@@ -1009,82 +1000,61 @@ void cps3_state::video_start()
save_pointer(NAME(m_spritelist), 0x80000/4);
}
-static inline int to_s10(int data)
+void cps3_state::draw_tilemapsprite_line(u32 *regs, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- return (data & 0x1ff) - (data & 0x200);
-}
+ if (!(regs[1] & 0x00008000)) return;
-// the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped)
+ int scrollx = (regs[0] & 0xffff0000) >> 16;
+ int scrolly = (regs[0] & 0x0000ffff) >> 0;
+ bool linescroll_enable = (regs[1] & 0x00004000) >> 14;
+ int global_flip_x = (regs[1] & 0x00000800) >> 11; // warzard special moves
+ int global_flip_y = (regs[1] & 0x00000400) >> 10; // sfiii2 loading screens (capcom background and title logo during flashing)
+ u32 linebase = (regs[2] & 0x7f000000) >> 24;
+ u32 mapbase = (regs[2] & 0x007f0000) >> 16;
-void cps3_state::draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- u32* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base };
- if (tmnum > 3)
- {
- logerror("draw_tilemapsprite_line Illegal tilemap number %d\n", tmnum);
- return;
- }
- u32* regs = tmapregs[tmnum];
+ mapbase <<= 10;
+ linebase <<= 10;
+ scrolly += 4;
- int scrolly = ((regs[0] & 0x0000ffff) >> 0) + 4;
int line = drawline + scrolly;
line &= 0x3ff;
- if (!(regs[1] & 0x00008000)) return;
+ if (global_flip_y) line ^= 0x3ff; // these probably needs compensation of our scrolly and tileline tweaks, but it's fine for sfiii2.
+ int xflip_mask = (global_flip_x) ? 0x3f : 0;
- u32 mapbase = (regs[2] & 0x007f0000) >> 16;
- u32 linebase = (regs[2] & 0x7f000000) >> 24;
- int linescroll_enable = (regs[1] & 0x00004000);
-
- int scrollx;
int tileline = (line / 16) + 1;
int tilesubline = line % 16;
- rectangle clip;
- mapbase = mapbase << 10;
- linebase = linebase << 10;
+ if (linescroll_enable)
+ scrollx += (m_spriteram[linebase + ((line + 16) & 0x3ff)] >> 16) & 0x3ff; // test case: sfiii Ryu's stage 2nd round floor
- if (!linescroll_enable)
- {
- scrollx = (regs[0] & 0xffff0000) >> 16;
- }
- else
- {
- //logerror("linebase %08x\n", linebase);
-
- scrollx = (regs[0] & 0xffff0000) >> 16;
- scrollx += (m_spriteram[linebase + ((line + 16 - 4) & 0x3ff)] >> 16) & 0x3ff;
-
- }
-
- //zoombase = (layerregs[1] & 0xffff0000)>>16;
-
- drawline &= 0x3ff;
-
- if (drawline > cliprect.bottom() + 4) return;
-
- clip.set(cliprect.left(), cliprect.right(), drawline, drawline);
+ rectangle clip(cliprect.left(), cliprect.right(), drawline, drawline);
for (int x = cliprect.left() / 16; x < (cliprect.right() / 16) + 2; x++)
{
- u32 const dat = m_spriteram[mapbase + ((tileline & 63) * 64) + ((x + scrollx / 16) & 63)];
+ u32 const dat = m_spriteram[mapbase + ((tileline & 63) * 64) + (((x + scrollx / 16) & 63) ^ xflip_mask)];
u32 const tileno = (dat & 0xfffe0000) >> 17;
- bool const xflip = (dat & 0x00001000) >> 12;
+ //u32 tilenoH = (dat & 0x00008000) >> 15; // games put here tile number's bit 16, probably for (unreleased) mobos with expanded to 16Mbyte character RAM
+ int xflip = (dat & 0x00001000) >> 12;
bool const yflip = (dat & 0x00000800) >> 11;
+ bool const alpha = (dat & 0x00000400) >> 10; // enabled at jojo's "country town" and "in air plane" stages, but associated tile is empty - shadowing have no effect, why ?
bool const bpp = (dat & 0x00000200) >> 9;
u32 const colour = (dat & 0x000001ff) >> 0;
- if (!bpp) m_gfxdecode->gfx(1)->set_granularity(256);
- else m_gfxdecode->gfx(1)->set_granularity(64);
+ int trans = alpha ? CPS3_TRANSPARENCY_PEN_INDEX_BLEND : CPS3_TRANSPARENCY_PEN_INDEX;
+
+ m_gfxdecode->gfx(1)->set_granularity(bpp ? 64 : 256);
- cps3_drawgfxzoom(bitmap, clip, m_gfxdecode->gfx(1), tileno, colour, xflip, yflip, (x * 16) - scrollx % 16, drawline - tilesubline, CPS3_TRANSPARENCY_PEN_INDEX, 0, 0x10000, 0x10000);
+ xflip ^= xflip_mask & 1;
+
+ cps3_drawgfxzoom(bitmap, clip, m_gfxdecode->gfx(1), tileno, colour, xflip, yflip, (x * 16) - scrollx % 16, drawline - tilesubline, trans, 0, 0x10000, 0x10000);
}
}
// fg layer (TODO: this could be handled with an actual tilemap)
void cps3_state::draw_fg_layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int scrolly = (-m_ss_vscroll) & 0x100; // TODO properly handle scroll value
+ int scrolly = (-m_ss_vscroll) & 0x100; // TODO properly handle scroll value
for (int line = cliprect.top(); line <= cliprect.bottom(); line++)
{
@@ -1102,8 +1072,8 @@ void cps3_state::draw_fg_layer(screen_device &screen, bitmap_rgb32 &bitmap, cons
u16 data = m_ss_ram[offset] | (m_ss_ram[offset + 1] << 8) ;
u32 tile = (data & 0x01ff) >> 0;
int pal = (data & 0x3e00) >> 9;
- int flipy = (data & 0x4000) >> 14; //
- int flipx = (data & 0x8000) >> 15; // is this right or should be vice versa ?
+ int flipy = (data & 0x4000) >> 14;
+ int flipx = (data & 0x8000) >> 15;
pal += m_ss_pal_base << 5;
cps3_drawgfxzoom(bitmap, clip, m_gfxdecode->gfx(0), tile, pal, flipx, flipy, (x * 8) - rowscroll, y * 8, CPS3_TRANSPARENCY_PEN, 0, 0x10000, 0x10000);
@@ -1159,7 +1129,7 @@ u32 cps3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const
u8 const gscroll = (m_spritelist[i + 0] & 0x70000000) >> 28;
u32 const length = (m_spritelist[i + 0] & 0x01ff0000) >> 16; // how many entries in the sprite table
u32 start = (m_spritelist[i + 0] & 0x00007ff0) >> 4;
-
+
int const xpos = (m_spritelist[i + 1] & 0x03ff0000) >> 16;
int const ypos = m_spritelist[i + 1] & 0x000003ff;
@@ -1167,13 +1137,13 @@ u32 cps3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const
bool const whichpal = (m_spritelist[i + 2] & 0x20000000) >> 29;
u8 const global_xflip = (m_spritelist[i + 2] & 0x10000000) >> 28;
u8 const global_yflip = (m_spritelist[i + 2] & 0x08000000) >> 27;
- bool const global_alpha = (m_spritelist[i + 2] & 0x04000000) >> 26; // alpha / shadow? set on sfiii2 shadows, and big black image in jojo intro
+ bool const global_alpha = (m_spritelist[i + 2] & 0x04000000) >> 26; // all games except warzard
bool const global_bpp = (m_spritelist[i + 2] & 0x02000000) >> 25;
u32 const global_pal = (m_spritelist[i + 2] & 0x01ff0000) >> 16;
//int const tilemapnum = (m_spritelist[i + 2] & 0x00000030) >> 4; // jojo and jojoba only
- int const gscrollx = (m_ppu_gscroll[gscroll] & 0x03ff0000) >> 16;
- int const gscrolly = (m_ppu_gscroll[gscroll] & 0x000003ff) >> 0;
+ int const gscrollx = (m_ppu_gscroll_buff[gscroll] & 0x03ff0000) >> 16;
+ int const gscrolly = (m_ppu_gscroll_buff[gscroll] & 0x000003ff) >> 0;
start = (start * 0x100) >> 2;
for (int j = 0; j < (length) * 4; j += 4)
@@ -1185,9 +1155,10 @@ u32 cps3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const
static const int tilestable[4] = { 8,1,2,4 };
u32 const tileno = (value1 & 0xfffe0000) >> 17;
+ //u8 unk2000 = (value1 & 0x00002000) >> 13); //? sfiii2/3 bonus stages - score numbers and balls icons, sfiii3 staff roll texts
u8 flipx = (value1 & 0x00001000) >> 12;
u8 flipy = (value1 & 0x00000800) >> 11;
- bool const alpha = (value1 & 0x00000400) >> 10; //? this one is used for alpha effects on warzard
+ bool const alpha = (value1 & 0x00000400) >> 10; // warzard alpha effects
bool const bpp = (value1 & 0x00000200) >> 9;
u32 const pal = (value1 & 0x000001ff);
@@ -1210,16 +1181,18 @@ u32 cps3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const
if (xsize2 == 0) // xsize of 0 tiles seems to be a special command to draw tilemaps
{
int tilemapnum = ((value3 & 0x00000030) >> 4);
-
- /* Urgh, the startline / endline seem to be direct screen co-ordinates regardless of fullscreen zoom
- which probably means the fullscreen zoom is applied when rendering everything, not aftewards */
+ u32* regs = &m_tilemap_regs[tilemapnum * 4];
for (int yy = 0; yy < ysizedraw2; yy++)
{
- int cury_pos = to_s10(yy - (to_s10(ypos2) + to_s10(gscrolly)) - 19); // OK for sfiii Alex's stage, but not sure if hardware realy works this way
+ // positioning similar to sprites Y coord, but relative to edge, not center
+ int cury_pos = ypos2 + gscrolly - yy;
+ cury_pos = ~cury_pos;
+ cury_pos -= 18;
+ cury_pos &= 0x3ff;
if (cury_pos >= m_renderbuffer_clip.top() && cury_pos <= m_renderbuffer_clip.bottom())
- draw_tilemapsprite_line(tilemapnum, cury_pos, m_renderbuffer_bitmap, m_renderbuffer_clip);
+ draw_tilemapsprite_line(regs, cury_pos, m_renderbuffer_bitmap, m_renderbuffer_clip);
}
}
else
@@ -1414,8 +1387,8 @@ WRITE16_MEMBER(cps3_state::spritedma_w)
u16 prev = m_spritelist_dma;
COMBINE_DATA(&m_spritelist_dma);
- // display list caching (into PPU on-chip RAM ?)
- if ((m_spritelist_dma & 8) && !(prev & 8)) // 0->1
+ // display list DMA. actual DMA probably combine coordinates and control fields from main/sub list records and gscroll registers, we just save them for further processing.
+ if (!(m_dma_status & 1) && (m_spritelist_dma & 9) == 8 && (prev & 9) == 9) // 0->1
{
for (int i = 0; i < 0x2000/4; i += 4)
{
@@ -1427,6 +1400,10 @@ WRITE16_MEMBER(cps3_state::spritedma_w)
u32 length = (dat & 0x01ff0000) >> 16;
std::copy(&m_spriteram[offs], &m_spriteram[offs + length*4], &m_spritelist[offs]); // copy sublist
}
+ std::copy(&m_ppu_gscroll[0], &m_ppu_gscroll[8], &m_ppu_gscroll_buff[0]);
+
+ m_dma_status |= 1;
+ m_spritelist_dma_timer->adjust(attotime::from_usec(4)); // slight delay to skip multiple 8/9 writes. actual DMA speed is unknown.
}
}
@@ -1762,7 +1739,7 @@ WRITE32_MEMBER(cps3_state::eeprom_w)
}
else if (addr >= 0x180 && addr <= 0x1ff)
{
- // always 00000000 ? incrememnt access?
+ // write 0 before data word write, erase ? which also means above probably may only reset data bits.
}
else
{
@@ -2045,23 +2022,23 @@ void cps3_state::process_character_dma(u32 address)
u32 real_destination = dat2 << 3;
u32 real_length = (((dat1 & 0x001fffff) + 1) << 3);
- /* 0x01000000 is the end of list marker, 0x13131313 is our default fill */
- if ((dat1 == 0x01000000) || (dat1 == 0x13131313)) break;
+ // 0x01000000 is the end of list marker
+ if (dat1 & 0x01000000) break;
//logerror("%08x %08x %08x real_source %08x (rom %d offset %08x) real_destination %08x, real_length %08x\n", dat1, dat2, dat3, real_source, real_source/0x800000, real_source%0x800000, real_destination, real_length);
switch ((dat1 >> 21) & 7)
{
- case 4: /* Sets a table used by the decompression routines */
+ case 4: /* Sets a table used by the decompression routines */
/* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */
m_current_table_address = real_source;
break;
- case 2: /* 6bpp DMA decompression
- - this is used for the majority of sprites and backgrounds */
+ case 2: /* 6bpp DMA decompression
+ - this is used for the majority of sprites and backgrounds */
do_char_dma(real_source, real_destination, real_length);
break;
- case 3: /* 8bpp DMA decompression
- - this is used on SFIII NG Sean's Stage ONLY */
+ case 3: /* 8bpp DMA decompression
+ - this is used on SFIII NG Sean's Stage ONLY */
do_alt_char_dma(real_source, real_destination, real_length);
break;
default:
@@ -2119,11 +2096,6 @@ WRITE32_MEMBER(cps3_state::characterdma_w)
}
}
-WRITE32_MEMBER(cps3_state::ppu_gscroll_w)
-{
- COMBINE_DATA(&m_ppu_gscroll[offset]);
-}
-
READ16_MEMBER(cps3_state::colourram_r)
{
return m_colourram[offset];
@@ -2149,12 +2121,8 @@ void cps3_state::cps3_map(address_map &map)
// PPU registers
map(0x040c0000, 0x040c0007).nopr(); // ?? warzard reads this but not use values, dev/debug leftovers ?
map(0x040c000c, 0x040c000d).r(FUNC(cps3_state::dma_status_r));
-
- map(0x040c0000, 0x040c001f).w(FUNC(cps3_state::ppu_gscroll_w));
- map(0x040c0020, 0x040c002b).writeonly().share("tmap20_regs");
- map(0x040c0030, 0x040c003b).writeonly().share("tmap30_regs");
- map(0x040c0040, 0x040c004b).writeonly().share("tmap40_regs");
- map(0x040c0050, 0x040c005b).writeonly().share("tmap50_regs");
+ map(0x040c0000, 0x040c001f).writeonly().share("ppu_gscroll_regs");
+ map(0x040c0020, 0x040c005f).writeonly().share("ppu_tmap_regs");
map(0x040c0060, 0x040c007f).writeonly().share("ppu_crtc_zoom");
map(0x040c0080, 0x040c0083).w(FUNC(cps3_state::spritedma_w)).umask32(0x0000ffff);
map(0x040c0084, 0x040c0087).w(FUNC(cps3_state::cram_bank_w));
@@ -2280,6 +2248,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(cps3_state::dma_interrupt)
m_maincpu->set_input_line(10, ASSERT_LINE);
}
+TIMER_DEVICE_CALLBACK_MEMBER(cps3_state::sprite_dma_cb)
+{
+ m_dma_status &= ~1;
+}
+
void cps3_state::machine_start()
{
@@ -2299,7 +2272,7 @@ void cps3_state::machine_start()
save_item(NAME(m_chardma_other));
save_item(NAME(m_current_table_address));
save_item(NAME(m_dma_status));
- save_item(NAME(m_ppu_gscroll));
+ save_item(NAME(m_ppu_gscroll_buff));
save_item(NAME(m_ss_hscroll));
save_item(NAME(m_ss_vscroll));
save_item(NAME(m_ss_pal_base));
@@ -2532,6 +2505,7 @@ void cps3_state::cps3(machine_config &config)
*/
TIMER(config, m_dma_timer).configure_generic(FUNC(cps3_state::dma_interrupt));
+ TIMER(config, m_spritelist_dma_timer).configure_generic(FUNC(cps3_state::sprite_dma_cb));
NVRAM(config, "eeprom", nvram_device::DEFAULT_ALL_0);
PALETTE(config, m_palette).set_entries(0x10000); // actually 0x20000 ...
@@ -2542,7 +2516,7 @@ void cps3_state::cps3(machine_config &config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- CPS3(config, m_cps3sound, MASTER_CLOCK / 3);
+ CPS3(config, m_cps3sound, XTAL(42'954'545) / 3);
m_cps3sound->add_route(1, "lspeaker", 1.0);
m_cps3sound->add_route(0, "rspeaker", 1.0);
}
diff --git a/src/mame/drivers/crospuzl.cpp b/src/mame/drivers/crospuzl.cpp
index e0117567235..6f3e3a4abaf 100644
--- a/src/mame/drivers/crospuzl.cpp
+++ b/src/mame/drivers/crospuzl.cpp
@@ -1,33 +1,33 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
/****************************************************************************
-
- Cross Puzzle
-
- driver by Angelo Salese, based off original crystal.cpp by ElSemi
-
- TODO:
- - Dies at POST with a SPU error,
- supposedly it should print a "running system." instead of "Ok" at the
- end of the POST routine.
- Update: it tries to load a "sdata.bin" file, which is nowhere to be found in the dump.
- Considering also that first $20000 block is empty and loading the flash linearly gives
- the reference memory size but then game isn't detected at all.
- - Hooking up nand_device instead of the custom implementation here
- makes the game to print having all memory available and no game
- detected, fun
- - I2C RTC interface should be correct but still doesn't work, sending
+
+ Cross Puzzle
+
+ driver by Angelo Salese, based off original crystal.cpp by ElSemi
+
+ TODO:
+ - Dies at POST with a SPU error,
+ supposedly it should print a "running system." instead of "Ok" at the
+ end of the POST routine.
+ Update: it tries to load a "sdata.bin" file, which is nowhere to be found in the dump.
+ Considering also that first $20000 block is empty and loading the flash linearly gives
+ the reference memory size but then game isn't detected at all.
+ - Hooking up nand_device instead of the custom implementation here
+ makes the game to print having all memory available and no game
+ detected, fun
+ - I2C RTC interface should be correct but still doesn't work, sending
unrecognized slave address 0x30 (device type might be wrong as well)
- Notes:
- - Game enables UART1 receive irq, if that irq is enable it just prints
- "___sysUART1_ISR<LF>___sysUART1_ISR_END<LF>"
-
+ Notes:
+ - Game enables UART1 receive irq, if that irq is enable it just prints
+ "___sysUART1_ISR<LF>___sysUART1_ISR_END<LF>"
+
=============================================================================
- This PCB uses ADC 'Amazon-LF' SoC, EISC CPU core - However PCBs have been
+ This PCB uses ADC 'Amazon-LF' SoC, EISC CPU core - However PCBs have been
seen with a standard VRenderZERO+ MagicEyes EISC chip
-
+
****************************************************************************/
#include "emu.h"
@@ -71,7 +71,7 @@ private:
uint32_t m_FlashAddr;
uint8_t m_FlashShift;
-// DECLARE_WRITE32_MEMBER(Banksw_w);
+// DECLARE_WRITE32_MEMBER(Banksw_w);
DECLARE_READ8_MEMBER(FlashCmd_r);
DECLARE_WRITE8_MEMBER(FlashCmd_w);
DECLARE_WRITE8_MEMBER(FlashAddr_w);
@@ -81,7 +81,7 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
void crospuzl_mem(address_map &map);
-
+
// PIO
uint32_t m_PIO;
uint32_t m_ddr;
@@ -100,7 +100,7 @@ IRQ_CALLBACK_MEMBER(crospuzl_state::icallback)
READ32_MEMBER(crospuzl_state::PIOedat_r)
{
- // TODO: this needs fixing in serflash_device
+ // TODO: this needs fixing in serflash_device
// (has a laconic constant for the ready line)
return (m_rtc->sda_r() << 19)
| (machine().rand() & 0x04000000); // serial ready line
@@ -114,12 +114,12 @@ READ8_MEMBER(crospuzl_state::FlashCmd_r)
}
if ((m_FlashCmd & 0xff) == 0x90)
{
- // Service Mode has the first two bytes of the ID printed,
+ // Service Mode has the first two bytes of the ID printed,
// in format ****/ee81
- // ee81 has no correspondence in the JEDEC flash vendor ID list,
+ // ee81 has no correspondence in the JEDEC flash vendor ID list,
// and the standard claims that the ID is 7 + 1 parity bit.
// TODO: Retrieve ID from actual HW service mode screen.
-// const uint8_t id[5] = { 0xee, 0x81, 0x00, 0x15, 0x00 };
+// const uint8_t id[5] = { 0xee, 0x81, 0x00, 0x15, 0x00 };
const uint8_t id[5] = { 0xec, 0xf1, 0x00, 0x95, 0x40 };
uint8_t res = id[m_FlashAddr];
m_FlashAddr ++;
@@ -136,7 +136,7 @@ READ8_MEMBER(crospuzl_state::FlashCmd_r)
}
WRITE8_MEMBER(crospuzl_state::FlashCmd_w)
-{
+{
m_FlashPrevCommand = m_FlashCmd;
m_FlashCmd = data;
m_FlashShift = 0;
@@ -207,13 +207,13 @@ void crospuzl_state::crospuzl_mem(address_map &map)
map(0x03000000, 0x04ffffff).m(m_vr0soc, FUNC(vrender0soc_device::audiovideo_map));
-// map(0x05000000, 0x05ffffff).bankr("mainbank");
-// map(0x05000000, 0x05000003).rw(FUNC(crospuzl_state::FlashCmd_r), FUNC(crospuzl_state::FlashCmd_w));
+// map(0x05000000, 0x05ffffff).bankr("mainbank");
+// map(0x05000000, 0x05000003).rw(FUNC(crospuzl_state::FlashCmd_r), FUNC(crospuzl_state::FlashCmd_w));
}
void crospuzl_state::machine_start()
{
-// save_item(NAME(m_Bank));
+// save_item(NAME(m_Bank));
save_item(NAME(m_FlashCmd));
save_item(NAME(m_PIO));
save_item(NAME(m_ddr));
@@ -374,13 +374,13 @@ void crospuzl_state::crospuzl(machine_config &config)
// ROM strings have references to a K9FXX08 device
// TODO: use this device, in machine/smartmed.h (has issues with is_busy() emulation)
-// NAND(config, m_nand, 0);
-// m_nand->set_nand_type(nand_device::chip::K9F1G08U0B); // TODO: exact flavor
+// NAND(config, m_nand, 0);
+// m_nand->set_nand_type(nand_device::chip::K9F1G08U0B); // TODO: exact flavor
PCF8583(config, m_rtc, 32.768_kHz_XTAL);
}
-ROM_START( crospuzl )
+ROM_START( crospuzl )
ROM_REGION( 0x80010, "maincpu", 0 )
ROM_LOAD("en29lv040a.u5", 0x000000, 0x80010, CRC(d50e8500) SHA1(d681cd18cd0e48854c24291d417d2d6d28fe35c1) )
diff --git a/src/mame/drivers/crystal.cpp b/src/mame/drivers/crystal.cpp
index 848a7ceb790..49633034fa0 100644
--- a/src/mame/drivers/crystal.cpp
+++ b/src/mame/drivers/crystal.cpp
@@ -21,21 +21,21 @@
program with the correct data
MAME driver by ElSemi
- Additional work and refactoring by Angelo Salese
-
- TODO:
- - provide NVRAM defaults where applicable;
- - add an actual reset button (helps with inp record/playback);
- - donghaer: needs "raster effect" for 2 players mode split screen, but no
- interrupt is actually provided for the task so apparently not a timer
- related effect;
- - wulybuly: strips off main RAM to texture transfers except for text after
- the first couple of frames;
- - maldaiza: PIC protection.
- - urachamu: some animation timings seems off, like bat hit animation before starting a given game.
- They were actually too fast before adding 30 Hz vblank for interlace mode, even if the game don't
- really read crtc blanking reg or use any other interrupt but the coin ones;
- - urachamu: investigate what CDMA in test mode really do, assuming it's not a dud;
+ Additional work and refactoring by Angelo Salese
+
+ TODO:
+ - provide NVRAM defaults where applicable;
+ - add an actual reset button (helps with inp record/playback);
+ - donghaer: needs "raster effect" for 2 players mode split screen, but no
+ interrupt is actually provided for the task so apparently not a timer
+ related effect;
+ - wulybuly: strips off main RAM to texture transfers except for text after
+ the first couple of frames;
+ - maldaiza: PIC protection.
+ - urachamu: some animation timings seems off, like bat hit animation before starting a given game.
+ They were actually too fast before adding 30 Hz vblank for interlace mode, even if the game don't
+ really read crtc blanking reg or use any other interrupt but the coin ones;
+ - urachamu: investigate what CDMA in test mode really do, assuming it's not a dud;
========================================================================================================
@@ -559,7 +559,7 @@ void crystal_state::crystal(machine_config &config)
VRENDER0_SOC(config, m_vr0soc, 14318180 * 3);
m_vr0soc->set_host_cpu_tag(m_maincpu);
-
+
DS1302(config, m_ds1302, 32.768_kHz_XTAL);
}
diff --git a/src/mame/drivers/ct486.cpp b/src/mame/drivers/ct486.cpp
index 0cd1035ad38..144e4b9f89f 100644
--- a/src/mame/drivers/ct486.cpp
+++ b/src/mame/drivers/ct486.cpp
@@ -188,6 +188,7 @@ void ct486_state::ct486(machine_config &config)
SOFTWARE_LIST(config, "pc_disk_list").set_original("ibm5150");
SOFTWARE_LIST(config, "at_disk_list").set_original("ibm5170");
SOFTWARE_LIST(config, "at_cdrom_list").set_original("ibm5170_cdrom");
+ SOFTWARE_LIST(config, "midi_disk_list").set_compatible("midi_flop");
}
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index 660267af136..c434575009e 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -2581,6 +2581,56 @@ ROM_START( birdtry ) /* DE-0311-0 main board, DE-0299-2 sub/rom board */
ROM_LOAD( "ek-07.8a", 0x8000, 0x8000, CRC(236549bc) SHA1(1f664a277b3451b7905638abdf98c7e428b2e935) )
ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
+ ROM_LOAD( "ek-31-1.9a", 0x0000, 0x1000, CRC(3bf41abb) SHA1(d1833f5b59547c17f2683f4f2dced7ead3608d49) ) /* revised code / game data */
+
+ ROM_REGION( 0x10000, "gfx1", 0 ) /* chars */
+ ROM_LOAD( "ek-25.15h", 0x00000, 0x08000, CRC(4df134ad) SHA1(f2cfa7e3fc4a2ac40897c2600c901ff75237e081) )
+ ROM_LOAD( "ek-26.16h", 0x08000, 0x08000, CRC(a00d3e8e) SHA1(3ac8511d55a684a5b2bc05d8d520169447a66840) )
+
+ ROM_REGION( 0x80000, "gfx2", 0 ) /* tiles */
+ ROM_LOAD( "ek-18.14d", 0x00000, 0x10000, CRC(9886fb70) SHA1(d36c41bfe217affab7f9deec64ff3f12e3efa28c) )
+ ROM_LOAD( "ek-17.12d", 0x10000, 0x10000, CRC(bed91bf7) SHA1(f0ffc557a4c216a5a2e180b4c2366e7b49630064) )
+ ROM_LOAD( "ek-20.17d", 0x20000, 0x10000, CRC(45d53965) SHA1(d54d33cc82e099bcb511de8ee26cdcc64a0b8f1d) )
+ ROM_LOAD( "ek-19.15d", 0x30000, 0x10000, CRC(c2949dd2) SHA1(d4317f8e0d9957feda54ee6d05aafb3f74f243d1) )
+ ROM_LOAD( "ek-22.14f", 0x40000, 0x10000, CRC(7f2cc80a) SHA1(f2539515fcf0b6dc90134d399baf779c50b19c0d) )
+ ROM_LOAD( "ek-21.12f", 0x50000, 0x10000, CRC(281bc793) SHA1(836fc2900b7197c886c23d9eeb1a80aed85c4d13) )
+ ROM_LOAD( "ek-24.17f", 0x60000, 0x10000, CRC(2244cc75) SHA1(67c9868927319abe80a932203e8ac6595ae455b3) )
+ ROM_LOAD( "ek-23.15f", 0x70000, 0x10000, CRC(d0ed0116) SHA1(a35e64ecac57585b83e830a1bf90a402c931f071) )
+
+ ROM_REGION( 0x10000, "gfx3", ROMREGION_ERASEFF ) /* tiles */
+ /* This game doesn't have the extra playfield chip, so no roms */
+
+ ROM_REGION( 0x80000, "gfx4", 0 ) /* sprites */
+ ROM_LOAD( "ek-15.16c", 0x00000, 0x10000, CRC(a6a041a3) SHA1(3b8d18d5821e6d354ed97a4f547f1b2bee8674f5) )
+ ROM_LOAD( "ek-16.17c", 0x10000, 0x08000, CRC(784f62b0) SHA1(b68b234a5f469149d481645290a3251667bdab27) )
+ ROM_LOAD( "ek-11.16a", 0x20000, 0x10000, CRC(9224a6b9) SHA1(547c22db1728a85035a682eb54ce654a98a4ba3d) )
+ ROM_LOAD( "ek-12.17a", 0x30000, 0x08000, CRC(12deecfa) SHA1(22e33ccc6623957533028f720e9a746f36217ded) )
+ ROM_LOAD( "ek-13.13c", 0x40000, 0x10000, CRC(1f023459) SHA1(e502edb4078168df4677a6d3aa43770eb8e49caa) )
+ ROM_LOAD( "ek-14.14c", 0x50000, 0x08000, CRC(57d54943) SHA1(9639fad61919652c1564b24926845d228d016ca0) )
+ ROM_LOAD( "ek-09.13a", 0x60000, 0x10000, CRC(6d2d488a) SHA1(40b21a4bc8a4641a6f80d7579e32fe9d69eb42f1) )
+ ROM_LOAD( "ek-10.14a", 0x70000, 0x08000, CRC(580ba206) SHA1(8e57e4ef8c732b85e494bd6ec5da6566f27540e6) )
+
+ ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
+ ROM_LOAD( "ek-08.2c", 0x0000, 0x10000, CRC(be3db6cb) SHA1(4e8b8e0bef3a3f36d7e641e27b5f48c8fe9a8b7f) )
+
+ ROM_REGION( 0x600, "proms", 0 ) /* PROMs */
+ ROM_LOAD( "mb7116e.12c", 0x000, 0x200, CRC(86e775f8) SHA1(e8dee3d56fb5ca0fd7f9ce05a84674abb139d008) ) /* Also known to be labeled as A-1 */
+ ROM_LOAD( "mb7122e.17e", 0x200, 0x400, CRC(a5cda23e) SHA1(d6c8534ae3c95b47a0701047fef67f15dd71f3fe) ) /* Also known to be labeled as A-2 */
+ROM_END
+
+ROM_START( birdtrya ) /* DE-0311-0 main board, DE-0299-2 sub/rom board */
+ ROM_REGION( 0x60000, "maincpu", 0 ) /* 6*64k for 68000 code */
+ ROM_LOAD16_BYTE( "ek-04-2.3c", 0x00000, 0x10000, CRC(5f0f4686) SHA1(5eea74f5626339ebd50e623029f21f1cd0f93135) )
+ ROM_LOAD16_BYTE( "ek-01-2.3a", 0x00001, 0x10000, CRC(47f470db) SHA1(8fcb043d02e1c04c8517781715da4dd4ee3bb8fb) )
+ ROM_LOAD16_BYTE( "ek-05-1.4c", 0x20000, 0x10000, CRC(b508cffd) SHA1(c1861a2420d99e19d889881f9164fe4ff667a1be) )
+ ROM_LOAD16_BYTE( "ek-02-1.4a", 0x20001, 0x10000, CRC(0195d989) SHA1(cff48d57b2085263e12413ae19757cdcc7028282) )
+ ROM_LOAD16_BYTE( "ek-06-1.6c", 0x40000, 0x10000, CRC(301d57d8) SHA1(64fd77aa2fbb235c86f0f84603e5272b4f4bba85) )
+ ROM_LOAD16_BYTE( "ek-03-1.6a", 0x40001, 0x10000, CRC(73b0acc5) SHA1(76b79c9f02de2e53093ded66a1639b40cd2640e8) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 ) /* 6502 Sound */
+ ROM_LOAD( "ek-07.8a", 0x8000, 0x8000, CRC(236549bc) SHA1(1f664a277b3451b7905638abdf98c7e428b2e935) )
+
+ ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
ROM_LOAD( "ek-31.9a", 0x0000, 0x1000, CRC(68831ae9) SHA1(0c8ef4903adbff68dccec04d8385c36904923a3c) )
ROM_REGION( 0x10000, "gfx1", 0 ) /* chars */
@@ -4017,7 +4067,8 @@ GAME( 1987, hbarrel, 0, hbarrel, hbarrel, dec0_state, init_hbarr
GAME( 1987, hbarrelu, hbarrel, hbarrel, hbarrel, dec0_state, init_hbarrel, ROT270, "Data East USA", "Heavy Barrel (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, baddudes, 0, baddudes, baddudes, dec0_state, init_hbarrel, ROT0, "Data East USA", "Bad Dudes vs. Dragonninja (US revision 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, drgninja, baddudes, baddudes, drgninja, dec0_state, init_hbarrel, ROT0, "Data East Corporation", "Dragonninja (Japan revision 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, birdtry, 0, birdtry, birdtry, dec0_state, init_hbarrel, ROT270, "Data East Corporation", "Birdie Try (Japan revision 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, birdtry, 0, birdtry, birdtry, dec0_state, init_hbarrel, ROT270, "Data East Corporation", "Birdie Try (Japan revision 2, revision 1 MCU)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, birdtrya, birdtry, birdtry, birdtry, dec0_state, init_hbarrel, ROT270, "Data East Corporation", "Birdie Try (Japan revision 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, robocop, 0, robocop, robocop, dec0_state, empty_init, ROT0, "Data East Corporation", "Robocop (World revision 4)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, robocopw, robocop, robocop, robocop, dec0_state, empty_init, ROT0, "Data East Corporation", "Robocop (World revision 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, robocopj, robocop, robocop, robocop, dec0_state, empty_init, ROT0, "Data East Corporation", "Robocop (Japan)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index a3d16e67156..dbc7d5f5d02 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -149,7 +149,7 @@ void dec8_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in dec8_state::device_timer");
+ throw emu_fatalerror("Unknown id in dec8_state::device_timer");
}
}
diff --git a/src/mame/drivers/deco_mlc.cpp b/src/mame/drivers/deco_mlc.cpp
index 4aaafca563a..d08332b6db9 100644
--- a/src/mame/drivers/deco_mlc.cpp
+++ b/src/mame/drivers/deco_mlc.cpp
@@ -923,17 +923,17 @@ void deco_mlc_state::descramble_sound( )
for (u32 x = 0; x < length; x++)
{
const u32 addr = bitswap<24>(x,
- 23,22,21,0, 20,
- 19,18,17,16,
- 15,14,13,12,
- 11,10,9, 8,
- 7, 6, 5, 4,
- 3, 2, 1 );
+ 23,22,21, 0,20,
+ 19,18,17,16,
+ 15,14,13,12,
+ 11,10, 9, 8,
+ 7, 6, 5, 4,
+ 3, 2, 1);
buf[addr] = rom[x];
}
- std::copy(buf.begin(),buf.end(),&rom[0]);
+ std::copy(buf.begin(), buf.end(), &rom[0]);
}
READ32_MEMBER(deco_mlc_state::avengrgs_speedup_r)
diff --git a/src/mame/drivers/dectalk.cpp b/src/mame/drivers/dectalk.cpp
index 9eec753da43..1f406494e97 100644
--- a/src/mame/drivers/dectalk.cpp
+++ b/src/mame/drivers/dectalk.cpp
@@ -854,7 +854,7 @@ void dectalk_state::device_timer(emu_timer &timer, device_timer_id id, int param
outfifo_read_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in dectalk_state::device_timer");
+ throw emu_fatalerror("Unknown id in dectalk_state::device_timer");
}
}
diff --git a/src/mame/drivers/destroyr.cpp b/src/mame/drivers/destroyr.cpp
index 50fd0907ca7..cc1cf82d3b2 100644
--- a/src/mame/drivers/destroyr.cpp
+++ b/src/mame/drivers/destroyr.cpp
@@ -170,7 +170,7 @@ void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int para
frame_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in destroyr_state::device_timer");
+ throw emu_fatalerror("Unknown id in destroyr_state::device_timer");
}
}
diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp
index 475ba24611e..6b2ec938466 100644
--- a/src/mame/drivers/ertictac.cpp
+++ b/src/mame/drivers/ertictac.cpp
@@ -21,13 +21,13 @@
PCB has a single OSC at 24MHz
*******************************************************************************************/
+
#include "emu.h"
#include "includes/archimds.h"
#include "cpu/arm/arm.h"
#include "machine/aakart.h"
#include "machine/i2cmem.h"
-#include "sound/volt_reg.h"
-#include "speaker.h"
+#include "screen.h"
class ertictac_state : public archimedes_state
@@ -73,8 +73,8 @@ void ertictac_state::ertictac_map(address_map &map)
map(0x03000000, 0x033fffff).rw(FUNC(ertictac_state::archimedes_ioc_r), FUNC(ertictac_state::archimedes_ioc_w));
map(0x03340000, 0x0334001f).r(FUNC(ertictac_state::ertictac_podule_r));
map(0x033c0000, 0x033c001f).r(FUNC(ertictac_state::ertictac_podule_r));
- map(0x03400000, 0x035fffff).rw(FUNC(ertictac_state::archimedes_vidc_r), FUNC(ertictac_state::archimedes_vidc_w));
- map(0x03600000, 0x037fffff).rw(FUNC(ertictac_state::archimedes_memc_r), FUNC(ertictac_state::archimedes_memc_w));
+ map(0x03400000, 0x035fffff).w(m_vidc, FUNC(acorn_vidc10_device::write));
+ map(0x03600000, 0x037fffff).w(FUNC(ertictac_state::archimedes_memc_w));
map(0x03800000, 0x03ffffff).rom().region("maincpu", 0).w(FUNC(ertictac_state::archimedes_memc_page_w));
}
@@ -225,34 +225,20 @@ INTERRUPT_GEN_MEMBER(ertictac_state::ertictac_podule_irq)
void ertictac_state::ertictac(machine_config &config)
{
- ARM(config, m_maincpu, XTAL(24'000'000)/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */
+ ARM(config, m_maincpu, 24_MHz_XTAL/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */
m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_map);
m_maincpu->set_periodic_int(FUNC(ertictac_state::ertictac_podule_irq), attotime::from_hz(60)); // FIXME: timing of this
I2CMEM(config, "i2cmem", 0).set_page_size(NVRAM_PAGE_SIZE).set_data_size(NVRAM_SIZE);
-// AAKART(config, m_kart, XTAL(24'000'000)/3); // TODO: frequency
-
- SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- m_screen->set_raw(XTAL(16'000'000), 1024,0,735, 624/2,0,292); // RiscOS 3 default screen settings
- m_screen->set_screen_update(FUNC(archimedes_state::screen_update));
+// AAKART(config, m_kart, 24_MHz_XTAL/3); // TODO: frequency
- PALETTE(config, m_palette).set_entries(0x200);
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
- SPEAKER(config, "speaker").front_center();
- for (int i = 0; i < 8; i++)
- {
- DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_dac[i], 0).add_route(0, "speaker", 0.05); // unknown DAC
- }
- voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
- vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac2", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac3", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac4", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac4", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac5", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac5", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac6", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac6", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "dac7", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac7", -1.0, DAC_VREF_NEG_INPUT);
+ ACORN_VIDC10(config, m_vidc, 24_MHz_XTAL);
+ m_vidc->set_screen("screen");
+ m_vidc->vblank().set(FUNC(ertictac_state::vblank_irq));
+ m_vidc->sound_drq().set(FUNC(ertictac_state::sound_drq));
}
ROM_START( ertictac )
@@ -273,8 +259,6 @@ ROM_START( ertictac )
ROM_LOAD32_BYTE( "eroti_ver01_-14-", 0xc0001, 0x10000, CRC(3029567c) SHA1(6d49bea3a3f6f11f4182a602d37b53f1f896c154) )
ROM_LOAD32_BYTE( "eroti_ver01_-15-", 0xc0002, 0x10000, CRC(500997ab) SHA1(028c7b3ca03141e5b596ab1e2ab98d0ccd9bf93a) )
ROM_LOAD32_BYTE( "eroti_ver01_-16-", 0xc0003, 0x10000, CRC(70a8d136) SHA1(50b11f5701ed5b79a5d59c9a3c7d5b7528e66a4d) )
-
- ROM_REGION(0x200000, "vram", ROMREGION_ERASE00)
ROM_END
@@ -296,8 +280,6 @@ ROM_START( ertictaca ) /* PCB had sticker printed "092121 EROTICTAC" */
ROM_LOAD32_BYTE( "eroti_ver01_-14-", 0xc0001, 0x10000, CRC(3029567c) SHA1(6d49bea3a3f6f11f4182a602d37b53f1f896c154) )
ROM_LOAD32_BYTE( "eroti_ver01_-15-", 0xc0002, 0x10000, CRC(500997ab) SHA1(028c7b3ca03141e5b596ab1e2ab98d0ccd9bf93a) )
ROM_LOAD32_BYTE( "eroti_ver01_-16-", 0xc0003, 0x10000, CRC(70a8d136) SHA1(50b11f5701ed5b79a5d59c9a3c7d5b7528e66a4d) )
-
- ROM_REGION(0x200000, "vram", ROMREGION_ERASE00)
ROM_END
ROM_START( ertictacb )
@@ -318,8 +300,6 @@ ROM_START( ertictacb )
ROM_LOAD32_BYTE( "eroti_ver01_-14-", 0xc0001, 0x10000, CRC(3029567c) SHA1(6d49bea3a3f6f11f4182a602d37b53f1f896c154) )
ROM_LOAD32_BYTE( "eroti_ver01_-15-", 0xc0002, 0x10000, CRC(500997ab) SHA1(028c7b3ca03141e5b596ab1e2ab98d0ccd9bf93a) )
ROM_LOAD32_BYTE( "eroti_ver01_-16-", 0xc0003, 0x10000, CRC(70a8d136) SHA1(50b11f5701ed5b79a5d59c9a3c7d5b7528e66a4d) )
-
- ROM_REGION(0x200000, "vram", ROMREGION_ERASE00)
ROM_END
@@ -342,8 +322,6 @@ ROM_START( poizone )
ROM_LOAD32_BYTE( "p_son22.bin", 0x140001, 0x10000, CRC(16f0bb52) SHA1(893ab1e72b84de7a38f88f9d713769968ebd4553) )
ROM_LOAD32_BYTE( "p_son23.bin", 0x140002, 0x10000, CRC(e9c118b2) SHA1(110d9a204e701b9b54d89f027f8892c3f3a819c7) )
ROM_LOAD32_BYTE( "p_son24.bin", 0x140003, 0x10000, CRC(a09d7f55) SHA1(e0d562c655c16034b40db93de801b98b7948beb2) )
-
- ROM_REGION(0x200000, "vram", ROMREGION_ERASE00)
ROM_END
GAME( 1990, ertictac, 0, ertictac, ertictac, ertictac_state, init_ertictac, ROT0, "Sisteme", "Erotictac/Tactic", MACHINE_IMPERFECT_SOUND)
diff --git a/src/mame/drivers/fgoal.cpp b/src/mame/drivers/fgoal.cpp
index b3aca7a63ef..c8031505a03 100644
--- a/src/mame/drivers/fgoal.cpp
+++ b/src/mame/drivers/fgoal.cpp
@@ -72,7 +72,7 @@ void fgoal_state::device_timer(emu_timer &timer, device_timer_id id, int param,
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in fgoal_state::device_timer");
+ throw emu_fatalerror("Unknown id in fgoal_state::device_timer");
}
}
diff --git a/src/mame/drivers/firetrap.cpp b/src/mame/drivers/firetrap.cpp
index f7e6b667d6d..c5515c2b022 100644
--- a/src/mame/drivers/firetrap.cpp
+++ b/src/mame/drivers/firetrap.cpp
@@ -137,7 +137,6 @@ Stephh's notes (based on the games Z80 code and some tests) :
1) 'firetrap' :
- US version, licensed to Data East.
- - MCU missing and simulated (init command = 0x13).
- No warning screen.
- Instructions in English
- Initials : 3 letters.
@@ -148,7 +147,6 @@ Stephh's notes (based on the games Z80 code and some tests) :
2) 'firetrapj' :
- Japan version.
- - MCU missing and simulated (init command = 0xf5).
- Additional warning screen.
- Instructions in Japanese
- Initials : 5 letters.
@@ -178,7 +176,6 @@ the MSM5205-derived interrupt assigned to the NMI line instead.
#include "cpu/z80/z80.h"
#include "cpu/m6502/m6502.h"
-#include "cpu/mcs51/mcs51.h"
#include "sound/3526intf.h"
#include "screen.h"
#include "speaker.h"
@@ -186,9 +183,11 @@ the MSM5205-derived interrupt assigned to the NMI line instead.
#define FIRETRAP_XTAL XTAL(12'000'000)
-WRITE8_MEMBER(firetrap_state::firetrap_nmi_disable_w)
+WRITE8_MEMBER(firetrap_state::nmi_disable_w)
{
m_nmi_enable = ~data & 1;
+ if (!m_nmi_enable)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
WRITE8_MEMBER(firetrap_state::firetrap_bankselect_w)
@@ -196,6 +195,59 @@ WRITE8_MEMBER(firetrap_state::firetrap_bankselect_w)
membank("bank1")->set_entry(data & 0x03);
}
+void firetrap_state::irqack_w(uint8_t data)
+{
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+}
+
+//**************************************************************************
+// PROTECTION MCU
+//**************************************************************************
+
+uint8_t firetrap_state::mcu_r()
+{
+ return m_mcu_to_maincpu;
+}
+
+void firetrap_state::mcu_w(uint8_t data)
+{
+ m_maincpu_to_mcu = data;
+ m_mcu->set_input_line(MCS51_INT0_LINE, ASSERT_LINE);
+}
+
+uint8_t firetrap_state::mcu_p0_r()
+{
+ // 7654---- unused
+ // ----3--- coin2
+ // -----2-- coin1
+ // ------1- service coin
+ // -------0 coin inserted
+
+ int coin_inserted = ((m_coins->read() & 0x0e) == 0x0e) ? 1 : 0;
+
+ return (m_coins->read() & 0x0e) | coin_inserted;
+}
+
+void firetrap_state::mcu_p3_w(uint8_t data)
+{
+ // 765----- unused
+ // ---4---- coin flip-flop reset
+ // ----3--- mcu int1
+ // -----2-- mcu int0
+ // ------1- mcu int0 ack
+ // -------0 maincpu int
+
+ if (BIT(m_mcu_p3, 0) == 1 && BIT(data, 0) == 0)
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
+
+ if (BIT(m_mcu_p3, 1) == 1 && BIT(data, 1) == 0)
+ m_mcu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE);
+
+// if (BIT(m_mcu_p3, 4) == 1 && BIT(data, 4) == 0)
+
+ m_mcu_p3 = data;
+}
+
READ8_MEMBER(firetrap_state::firetrap_8751_bootleg_r)
{
/* Check for coin insertion */
@@ -222,95 +274,6 @@ READ8_MEMBER(firetrap_state::firetrap_8751_bootleg_r)
return 0;
}
-READ8_MEMBER(firetrap_state::firetrap_8751_r)
-{
- //logerror("PC:%04x read from 8751\n",m_maincpu->pc());
- return m_i8751_return;
-}
-
-WRITE8_MEMBER(firetrap_state::firetrap_8751_w)
-{
- static const uint8_t i8751_init_data[]={
- 0xf5,0xd5,0xdd,0x21,0x05,0xc1,0x87,0x5f,0x87,0x83,0x5f,0x16,0x00,0xdd,0x19,0xd1,
- 0xf1,0xc9,0xf5,0xd5,0xfd,0x21,0x2f,0xc1,0x87,0x5f,0x16,0x00,0xfd,0x19,0xd1,0xf1,
- 0xc9,0xe3,0xd5,0xc5,0xf5,0xdd,0xe5,0xfd,0xe5,0xe9,0xe1,0xfd,0xe1,0xdd,0xe1,0xf1,
- 0xc1,0xd1,0xe3,0xc9,0xf5,0xc5,0xe5,0xdd,0xe5,0xc5,0x78,0xe6,0x0f,0x47,0x79,0x48,
- 0x06,0x00,0xdd,0x21,0x00,0xd0,0xdd,0x09,0xe6,0x0f,0x6f,0x26,0x00,0x29,0x29,0x29,
- 0x29,0xeb,0xdd,0x19,0xc1,0x78,0xe6,0xf0,0x28,0x05,0x11,0x00,0x02,0xdd,0x19,0x79,
- 0xe6,0xf0,0x28,0x05,0x11,0x00,0x04,0xdd,0x19,0xdd,0x5e,0x00,0x01,0x00,0x01,0xdd,
- 0x09,0xdd,0x56,0x00,0xdd,0xe1,0xe1,0xc1,0xf1,0xc9,0xf5,0x3e,0x01,0x32,0x04,0xf0,
- 0xf1,0xc9,0xf5,0x3e,0x00,0x32,0x04,0xf0,0xf1,0xc9,0xf5,0xd5,0xdd,0x21,0x05,0xc1,
- 0x87,0x5f,0x87,0x83,0x5f,0x16,0x00,0xdd,0x19,0xd1,0xf1,0xc9,0xf5,0xd5,0xfd,0x21,
- 0x2f,0xc1,0x87,0x5f,0x16,0x00,0xfd,0x19,0xd1,0xf1,0xc9,0xe3,0xd5,0xc5,0xf5,0xdd,
- 0xe5,0xfd,0xe5,0xe9,0xe1,0xfd,0xe1,0xdd,0xe1,0xf1,0xc1,0xd1,0xe3,0xc9,0xf5,0xc5,
- 0xe5,0xdd,0xe5,0xc5,0x78,0xe6,0x0f,0x47,0x79,0x48,0x06,0x00,0xdd,0x21,0x00,0xd0,
- 0xdd,0x09,0xe6,0x0f,0x6f,0x26,0x00,0x29,0x29,0x29,0x29,0xeb,0xdd,0x19,0xc1,0x78,
- 0xe6,0xf0,0x28,0x05,0x11,0x00,0x02,0xdd,0x19,0x79,0xe6,0xf0,0x28,0x05,0x11,0x00,
- 0x04,0xdd,0x19,0xdd,0x5e,0x00,0x01,0x00,0x01,0xdd,0x09,0xdd,0x56,0x00,0xdd,0x00
- };
- static const int i8751_coin_data[]={ 0x00, 0xb7 };
- static const int i8751_36_data[]={ 0x00, 0xbc };
-
- /* End of command - important to note, as coin input is supressed while commands are pending */
- if (data == 0x26)
- {
- m_i8751_current_command = 0;
- m_i8751_return = 0xff; /* This value is XOR'd and must equal 0 */
- m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
- return;
- }
-
- /* Init sequence command (0x13 : US - 0xf5 : Japan) */
- else if ((data == 0x13) || (data == 0xf5))
- {
- if (!m_i8751_current_command)
- m_i8751_init_ptr = 0;
- m_i8751_return = i8751_init_data[m_i8751_init_ptr++];
- }
-
- /* Used to calculate a jump address when coins are inserted */
- else if (data == 0xbd)
- {
- if (!m_i8751_current_command)
- m_i8751_init_ptr = 0;
- m_i8751_return = i8751_coin_data[m_i8751_init_ptr++];
- }
-
- else if (data == 0x36)
- {
- if (!m_i8751_current_command)
- m_i8751_init_ptr = 0;
- m_i8751_return = i8751_36_data[m_i8751_init_ptr++];
- }
-
- /* Static value commands */
- else if (data == 0x14)
- m_i8751_return = 1;
- else if (data == 0x02)
- m_i8751_return = 0;
- else if (data == 0x72)
- m_i8751_return = 3;
- else if (data == 0x69)
- m_i8751_return = 2;
- else if (data == 0xcb)
- m_i8751_return = 0;
- else if (data == 0x49)
- m_i8751_return = 1;
- else if (data == 0x17)
- m_i8751_return = 2;
- else if (data == 0x88)
- m_i8751_return = 3;
- else
- {
- m_i8751_return = 0xff;
- logerror("%04x: Unknown i8751 command %02x!\n",m_maincpu->pc(),data);
- }
-
- /* Signal main cpu task is complete */
- m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
- m_i8751_current_command=data;
-}
-
WRITE8_MEMBER(firetrap_state::sound_flip_flop_w)
{
m_msm->reset_w(!BIT(data, 0));
@@ -347,7 +310,7 @@ WRITE8_MEMBER(firetrap_state::flip_screen_w)
flip_screen_set(data);
}
-void firetrap_state::firetrap_base_map(address_map &map)
+void firetrap_state::firetrap_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
@@ -356,12 +319,12 @@ void firetrap_state::firetrap_base_map(address_map &map)
map(0xd800, 0xdfff).ram().w(FUNC(firetrap_state::firetrap_bg2videoram_w)).share("bg2videoram");
map(0xe000, 0xe7ff).ram().w(FUNC(firetrap_state::firetrap_fgvideoram_w)).share("fgvideoram");
map(0xe800, 0xe97f).ram().share("spriteram");
- map(0xf000, 0xf000).nopw(); /* IRQ acknowledge */
+ map(0xf000, 0xf000).w(FUNC(firetrap_state::irqack_w));
map(0xf001, 0xf001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0xf002, 0xf002).w(FUNC(firetrap_state::firetrap_bankselect_w));
map(0xf003, 0xf003).w(FUNC(firetrap_state::flip_screen_w));
- map(0xf004, 0xf004).w(FUNC(firetrap_state::firetrap_nmi_disable_w));
- map(0xf005, 0xf005).w(FUNC(firetrap_state::firetrap_8751_w));
+ map(0xf004, 0xf004).w(FUNC(firetrap_state::nmi_disable_w));
+ map(0xf005, 0xf005).w(FUNC(firetrap_state::mcu_w));
map(0xf008, 0xf009).w(FUNC(firetrap_state::firetrap_bg1_scrollx_w));
map(0xf00a, 0xf00b).w(FUNC(firetrap_state::firetrap_bg1_scrolly_w));
map(0xf00c, 0xf00d).w(FUNC(firetrap_state::firetrap_bg2_scrollx_w));
@@ -371,17 +334,13 @@ void firetrap_state::firetrap_base_map(address_map &map)
map(0xf012, 0xf012).portr("IN2");
map(0xf013, 0xf013).portr("DSW0");
map(0xf014, 0xf014).portr("DSW1");
-}
-
-void firetrap_state::firetrap_map(address_map &map)
-{
- firetrap_base_map(map);
- map(0xf016, 0xf016).r(FUNC(firetrap_state::firetrap_8751_r));
+ map(0xf016, 0xf016).r(FUNC(firetrap_state::mcu_r));
}
void firetrap_state::firetrap_bootleg_map(address_map &map)
{
- firetrap_base_map(map);
+ firetrap_map(map);
+ map(0xf005, 0xf005).nopw();
map(0xf016, 0xf016).r(FUNC(firetrap_state::firetrap_8751_bootleg_r));
map(0xf800, 0xf8ff).rom(); /* extra ROM in the bootleg with unprotection code */
}
@@ -398,24 +357,6 @@ void firetrap_state::sound_map(address_map &map)
map(0x8000, 0xffff).rom();
}
-INPUT_CHANGED_MEMBER(firetrap_state::coin_inserted)
-{
- /* coin insertion causes an IRQ */
- if(newval)
- {
- m_coin_command_pending = uint8_t(param);
-
- /* Make sure coin IRQ's aren't generated when another command is pending, the main cpu
- definitely doesn't expect them as it locks out the coin routine */
- if (m_coin_command_pending && !m_i8751_current_command)
- {
- m_i8751_return = m_coin_command_pending;
- m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
- m_coin_command_pending = 0;
- }
- }
-}
-
/* verified from Z80 code */
static INPUT_PORTS_START( firetrap )
PORT_START("IN0") /* IN0 */
@@ -491,10 +432,11 @@ static INPUT_PORTS_START( firetrap )
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" )
- PORT_START("COIN") /* Connected to i8751 directly */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, firetrap_state,coin_inserted, 1)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, firetrap_state,coin_inserted, 2)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, firetrap_state,coin_inserted, 3)
+ PORT_START("COINS")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) // any coin input active
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_SERVICE1)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN1)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN2)
INPUT_PORTS_END
/* verified from Z80 code */
@@ -518,11 +460,10 @@ static INPUT_PORTS_START( firetrapbl )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_MODIFY("COIN")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_MODIFY("COINS")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
-
static const gfx_layout charlayout =
{
8,8,
@@ -533,6 +474,7 @@ static const gfx_layout charlayout =
{ 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
8*8
};
+
static const gfx_layout tilelayout =
{
16,16,
@@ -545,6 +487,7 @@ static const gfx_layout tilelayout =
7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
32*8
};
+
static const gfx_layout spritelayout =
{
16,16,
@@ -565,13 +508,17 @@ static GFXDECODE_START( gfx_firetrap )
GFXDECODE_ENTRY( "gfx4", 0, spritelayout, 0x40, 4 ) /* colors 0x40-0x7f */
GFXDECODE_END
-
-INTERRUPT_GEN_MEMBER(firetrap_state::firetrap_irq)
+TIMER_DEVICE_CALLBACK_MEMBER(firetrap_state::interrupt)
{
- if (m_nmi_enable)
- device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero);
-}
+ if (param == 0 && m_nmi_enable)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+
+ if (param == 0 && m_mcu != nullptr)
+ m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE);
+ if (param == 1 && m_mcu != nullptr)
+ m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
+}
void firetrap_state::machine_start()
{
@@ -581,17 +528,17 @@ void firetrap_state::machine_start()
membank("bank1")->configure_entries(0, 4, &MAIN[0x10000], 0x4000);
membank("bank2")->configure_entries(0, 2, &SOUND[0x10000], 0x4000);
- save_item(NAME(m_i8751_current_command));
save_item(NAME(m_sound_irq_enable));
save_item(NAME(m_nmi_enable));
- save_item(NAME(m_i8751_return));
- save_item(NAME(m_i8751_init_ptr));
save_item(NAME(m_adpcm_toggle));
save_item(NAME(m_coin_command_pending));
save_item(NAME(m_scroll1_x));
save_item(NAME(m_scroll1_y));
save_item(NAME(m_scroll2_x));
save_item(NAME(m_scroll2_y));
+ save_item(NAME(m_mcu_p3));
+ save_item(NAME(m_maincpu_to_mcu));
+ save_item(NAME(m_mcu_to_maincpu));
}
void firetrap_state::machine_reset()
@@ -606,11 +553,8 @@ void firetrap_state::machine_reset()
m_scroll2_y[i] = 0;
}
- m_i8751_current_command = 0;
m_sound_irq_enable = 0;
m_nmi_enable = 0;
- m_i8751_return = 0;
- m_i8751_init_ptr = 0;
m_adpcm_toggle = 0;
m_coin_command_pending = 0;
}
@@ -620,14 +564,22 @@ void firetrap_state::firetrap(machine_config &config)
/* basic machine hardware */
Z80(config, m_maincpu, FIRETRAP_XTAL/2); // 6 MHz
m_maincpu->set_addrmap(AS_PROGRAM, &firetrap_state::firetrap_map);
- m_maincpu->set_vblank_int("screen", FUNC(firetrap_state::firetrap_irq));
M6502(config, m_audiocpu, FIRETRAP_XTAL/8); // 1.5 MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &firetrap_state::sound_map);
/* IRQs are caused by the ADPCM chip */
/* NMIs are caused by the main CPU */
- I8751(config, "mcu", XTAL(8'000'000)).set_disable();
+ I8751(config, m_mcu, 8_MHz_XTAL);
+ m_mcu->port_in_cb<0>().set(FUNC(firetrap_state::mcu_p0_r));
+ m_mcu->port_out_cb<1>().set([this](u8 data){ m_mcu_to_maincpu = data; });
+ m_mcu->port_in_cb<2>().set([this](){ return m_maincpu_to_mcu; });
+ m_mcu->port_out_cb<3>().set(FUNC(firetrap_state::mcu_p3_w));
+
+ // needs a tight sync with the mcu
+ config.m_perfect_cpu_quantum = subtag("maincpu");
+
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(firetrap_state::interrupt), "screen", 0, 1);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -666,13 +618,14 @@ void firetrap_state::firetrapbl(machine_config &config)
/* basic machine hardware */
Z80(config, m_maincpu, FIRETRAP_XTAL/2); // 6 MHz
m_maincpu->set_addrmap(AS_PROGRAM, &firetrap_state::firetrap_bootleg_map);
- m_maincpu->set_vblank_int("screen", FUNC(firetrap_state::firetrap_irq));
M6502(config, m_audiocpu, FIRETRAP_XTAL/8); // 1.5 MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &firetrap_state::sound_map);
/* IRQs are caused by the ADPCM chip */
/* NMIs are caused by the main CPU */
+ TIMER(config, "scantimer", 0).configure_scanline(FUNC(firetrap_state::interrupt), "screen", 0, 1);
+
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
// screen.set_refresh_hz(57.4034);
@@ -723,8 +676,8 @@ ROM_START( firetrap )
ROM_LOAD( "di-17.10j", 0x08000, 0x8000, CRC(8605f6b9) SHA1(4fba88f34afd91d2cbc578b3b70f5399b8844390) )
ROM_LOAD( "di-18.12j", 0x10000, 0x8000, CRC(49508c93) SHA1(3812b0b1a33a1506d2896d2b676ed6aabb29dac0) )
- ROM_REGION( 0x1000, "mcu", 0 ) /* 8751 protection MCU */
- ROM_LOAD( "di-12.16h", 0x00000, 0x1000, NO_DUMP )
+ ROM_REGION( 0x1000, "mcu", 0 ) // created from japanese version, patched init byte
+ ROM_LOAD( "di-12.16h", 0x00000, 0x1000, BAD_DUMP CRC(49eba102) SHA1(3c27117245b1f0b2bc995ddfae2cfb80be5f188b) )
ROM_REGION( 0x02000, "gfx1", 0 ) /* characters */
ROM_LOAD( "di-03.17c", 0x00000, 0x2000, CRC(46721930) SHA1(a605fe993166e95c1602a35b548649ceae77bff2) )
@@ -787,8 +740,8 @@ ROM_START( firetrapa )
ROM_LOAD( "di-17.10j", 0x08000, 0x8000, CRC(8605f6b9) SHA1(4fba88f34afd91d2cbc578b3b70f5399b8844390) )
ROM_LOAD( "di-18.12j", 0x10000, 0x8000, CRC(49508c93) SHA1(3812b0b1a33a1506d2896d2b676ed6aabb29dac0) )
- ROM_REGION( 0x1000, "mcu", 0 ) /* 8751 protection MCU */
- ROM_LOAD( "di-12.16h", 0x00000, 0x1000, NO_DUMP )
+ ROM_REGION( 0x1000, "mcu", 0 ) // created from japanese version, patched init byte
+ ROM_LOAD( "di-12.16h", 0x00000, 0x1000, BAD_DUMP CRC(49eba102) SHA1(3c27117245b1f0b2bc995ddfae2cfb80be5f188b) )
ROM_REGION( 0x02000, "gfx1", 0 ) /* characters */
ROM_LOAD( "di-03.17c", 0x00000, 0x2000, CRC(46721930) SHA1(a605fe993166e95c1602a35b548649ceae77bff2) )
@@ -852,7 +805,7 @@ ROM_START( firetrapj )
ROM_LOAD( "fi-19.12j", 0x10000, 0x8000, CRC(49508c93) SHA1(3812b0b1a33a1506d2896d2b676ed6aabb29dac0) )
ROM_REGION( 0x1000, "mcu", 0 ) /* 8751 protection MCU */
- ROM_LOAD( "fi-13.16h", 0x00000, 0x1000, NO_DUMP )
+ ROM_LOAD( "fi-13.16h", 0x00000, 0x1000, CRC(e531a633) SHA1(f21349f4e1147643204ae9735c304129f49911e7) )
ROM_REGION( 0x02000, "gfx1", 0 ) /* characters */
ROM_LOAD( "fi-04.17c", 0x00000, 0x2000, CRC(a584fc16) SHA1(6ac3692a14cb7c70799c23f8f6726fa5be1ac0d8) )
diff --git a/src/mame/drivers/flyball.cpp b/src/mame/drivers/flyball.cpp
index b7f4f04bb05..f9f24738a17 100644
--- a/src/mame/drivers/flyball.cpp
+++ b/src/mame/drivers/flyball.cpp
@@ -186,7 +186,7 @@ void flyball_state::device_timer(emu_timer &timer, device_timer_id id, int param
break;
default:
- assert_always(false, "Unknown id in flyball_state::device_timer");
+ throw emu_fatalerror("Unknown id in flyball_state::device_timer");
}
}
diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp
index ca6703e6b8a..dc6b256e815 100644
--- a/src/mame/drivers/fm7.cpp
+++ b/src/mame/drivers/fm7.cpp
@@ -210,7 +210,7 @@ void fm7_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
fm77av_vsync(ptr, param);
break;
default:
- assert_always(false, "Unknown id in fm7_state::device_timer");
+ throw emu_fatalerror("Unknown id in fm7_state::device_timer");
}
}
diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp
index d57f965ceec..45ab3b8efd5 100644
--- a/src/mame/drivers/fuukifg2.cpp
+++ b/src/mame/drivers/fuukifg2.cpp
@@ -434,7 +434,7 @@ void fuuki16_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_raster_interrupt_timer->adjust(m_screen->frame_period());
break;
default:
- assert_always(false, "Unknown id in fuuki16_state::device_timer");
+ throw emu_fatalerror("Unknown id in fuuki16_state::device_timer");
}
}
diff --git a/src/mame/drivers/fuukifg3.cpp b/src/mame/drivers/fuukifg3.cpp
index 789f009a704..e81b0077e8e 100644
--- a/src/mame/drivers/fuukifg3.cpp
+++ b/src/mame/drivers/fuukifg3.cpp
@@ -492,7 +492,7 @@ void fuuki32_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_raster_interrupt_timer->adjust(m_screen->frame_period());
break;
default:
- assert_always(false, "Unknown id in fuuki32_state::device_timer");
+ throw emu_fatalerror("Unknown id in fuuki32_state::device_timer");
}
}
diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp
index b40f5b20252..38aa479c683 100644
--- a/src/mame/drivers/gaplus.cpp
+++ b/src/mame/drivers/gaplus.cpp
@@ -221,7 +221,7 @@ void gaplus_base_state::device_timer(emu_timer &timer, device_timer_id id, int p
namcoio1_run(ptr, param);
break;
default:
- assert_always(false, "Unknown id in gaplus_base_state::device_timer");
+ throw emu_fatalerror("Unknown id in gaplus_base_state::device_timer");
}
}
diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp
index ddd8aacc807..c0f40b8769a 100644
--- a/src/mame/drivers/geneve.cpp
+++ b/src/mame/drivers/geneve.cpp
@@ -190,23 +190,38 @@
#include "sound/sn76496.h"
#include "bus/ti99/internal/genboard.h"
+#include "bus/ti99/internal/genkbd.h"
#include "bus/ti99/colorbus/colorbus.h"
#include "bus/ti99/joyport/joyport.h"
#include "bus/ti99/peb/peribox.h"
+#include "bus/pc_kbd/keyboards.h"
+#include "bus/pc_kbd/pc_kbdc.h"
+#include "bus/pc_kbd/pcxt83.h"
+#include "bus/pc_kbd/keytro.h"
+
#include "speaker.h"
#define LOG_WARN (1U<<1)
#define LOG_READY (1U<<2)
#define LOG_LINES (1U<<3)
#define LOG_CRU (1U<<4)
+#define LOG_CRUKEY (1U<<5)
// Minimum log should be settings and warnings
#define VERBOSE ( LOG_GENERAL | LOG_WARN )
#include "logmacro.h"
+
+void geneve_xt_keyboards(device_slot_interface &device)
+{
+ device.option_add(STR_KBD_KEYTRONIC_PC3270, PC_KBD_KEYTRONIC_PC3270);
+ device.option_add(STR_KBD_IBM_PC_XT_83, PC_KBD_IBM_PC_XT_83);
+ device.option_add(STR_KBD_GENEVE_XT_101_HLE, KBD_GENEVE_XT_101_HLE);
+}
+
class geneve_state : public driver_device
{
public:
@@ -214,11 +229,11 @@ public:
: driver_device(mconfig, type, tag),
m_cpu(*this, "maincpu"),
m_tms9901(*this, TI_TMS9901_TAG),
- m_keyboard(*this, GENEVE_KEYBOARD_TAG),
- m_mapper(*this, GENEVE_MAPPER_TAG),
+ m_gatearray(*this, GENEVE_GATE_ARRAY_TAG),
m_peribox(*this, TI_PERIBOX_TAG),
m_joyport(*this, TI_JOYPORT_TAG),
m_colorbus(*this, COLORBUS_TAG),
+ m_kbdconn(*this, GENEVE_KEYBOARD_CONN_TAG),
m_left_button(0)
{
}
@@ -240,9 +255,13 @@ private:
DECLARE_WRITE_LINE_MEMBER(VDP_reset);
DECLARE_WRITE_LINE_MEMBER(joystick_select);
DECLARE_WRITE_LINE_MEMBER(extbus_wait_states);
+ DECLARE_WRITE_LINE_MEMBER(keyboard_reset);
DECLARE_WRITE_LINE_MEMBER(video_wait_states);
DECLARE_WRITE_LINE_MEMBER(left_mouse_button);
+ DECLARE_WRITE_LINE_MEMBER(keyboard_clock_line);
+ DECLARE_WRITE_LINE_MEMBER(keyboard_data_line);
+
DECLARE_WRITE_LINE_MEMBER(clock_out);
void external_operation(offs_t offset, uint8_t data);
@@ -253,16 +272,17 @@ private:
required_device<tms9995_device> m_cpu;
required_device<tms9901_device> m_tms9901;
- required_device<bus::ti99::internal::geneve_keyboard_device> m_keyboard;
- required_device<bus::ti99::internal::geneve_mapper_device> m_mapper;
- required_device<bus::ti99::peb::peribox_device> m_peribox;
- required_device<bus::ti99::joyport::joyport_device> m_joyport;
+ required_device<bus::ti99::internal::geneve_gate_array_device> m_gatearray;
+ required_device<bus::ti99::peb::peribox_device> m_peribox;
+ required_device<bus::ti99::joyport::joyport_device> m_joyport;
required_device<bus::ti99::colorbus::v9938_colorbus_device> m_colorbus;
+ required_device<pc_kbdc_device> m_kbdconn;
DECLARE_WRITE_LINE_MEMBER( inta );
DECLARE_WRITE_LINE_MEMBER( intb );
DECLARE_WRITE_LINE_MEMBER( ext_ready );
DECLARE_WRITE_LINE_MEMBER( mapper_ready );
+ DECLARE_WRITE_LINE_MEMBER( keyboard_int );
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -291,12 +311,12 @@ private:
void geneve_state::memmap(address_map &map)
{
- map(0x0000, 0xffff).rw(GENEVE_MAPPER_TAG, FUNC(bus::ti99::internal::geneve_mapper_device::readm), FUNC(bus::ti99::internal::geneve_mapper_device::writem));
+ map(0x0000, 0xffff).rw(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::readm), FUNC(bus::ti99::internal::geneve_gate_array_device::writem));
}
void geneve_state::memmap_setaddress(address_map &map)
{
- map(0x0000, 0xffff).w(GENEVE_MAPPER_TAG, FUNC(bus::ti99::internal::geneve_mapper_device::setaddress));
+ map(0x0000, 0xffff).w(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::setaddress));
}
/*
@@ -316,7 +336,7 @@ void geneve_state::crumap(address_map &map)
static INPUT_PORTS_START(geneve_common)
PORT_START( "BOOTROM" )
- PORT_CONFNAME( 0x03, GENEVE_EPROM, "Boot from" ) PORT_CHANGED_MEMBER(GENEVE_MAPPER_TAG, bus::ti99::internal::geneve_mapper_device, settings_changed, 3)
+ PORT_CONFNAME( 0x03, GENEVE_EPROM, "Boot from" ) PORT_CHANGED_MEMBER(GENEVE_GATE_ARRAY_TAG, bus::ti99::internal::geneve_gate_array_device, settings_changed, 3)
PORT_CONFSETTING( GENEVE_EPROM, "EPROM" )
PORT_CONFSETTING( GENEVE_PFM512, "PFM 512" )
PORT_CONFSETTING( GENEVE_PFM512A, "PFM 512A" )
@@ -343,10 +363,10 @@ static INPUT_PORTS_START(genmod)
PORT_INCLUDE(geneve_common)
PORT_START( "GENMODDIPS" )
- PORT_DIPNAME( GENEVE_GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CHANGED_MEMBER(GENEVE_MAPPER_TAG, bus::ti99::internal::genmod_mapper_device, setgm_changed, 1)
+ PORT_DIPNAME( GENEVE_GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CHANGED_MEMBER(GENEVE_GATE_ARRAY_TAG, bus::ti99::internal::genmod_gate_array_device, setgm_changed, 1)
PORT_CONFSETTING( 0x00, DEF_STR( Off ))
PORT_CONFSETTING( GENEVE_GM_TURBO, DEF_STR( On ))
- PORT_DIPNAME( GENEVE_GM_TIM, GENEVE_GM_TIM, "Genmod TI mode") PORT_CHANGED_MEMBER(GENEVE_MAPPER_TAG, bus::ti99::internal::genmod_mapper_device, setgm_changed, 2)
+ PORT_DIPNAME( GENEVE_GM_TIM, GENEVE_GM_TIM, "Genmod TI mode") PORT_CHANGED_MEMBER(GENEVE_GATE_ARRAY_TAG, bus::ti99::internal::genmod_gate_array_device, setgm_changed, 2)
PORT_CONFSETTING( 0x00, DEF_STR( Off ))
PORT_CONFSETTING( GENEVE_GM_TIM, DEF_STR( On ))
@@ -389,36 +409,36 @@ void geneve_state::cruwrite(offs_t offset, uint8_t data)
LOGMASKED(LOG_CRU, "Set capslock flag = %02x\n", data);
break;
case 8:
- LOGMASKED(LOG_CRU, "Set keyboard clock flag = %02x\n", data);
- m_keyboard->clock_control((data!=0)? ASSERT_LINE : CLEAR_LINE);
+ LOGMASKED(LOG_CRUKEY, "Set keyboard clock = %02x\n", data);
+ m_gatearray->set_keyboard_clock(data);
break;
case 9:
- LOGMASKED(LOG_CRU, "Set keyboard scan flag = %02x\n", data);
- m_keyboard->send_scancodes((data!=0)? ASSERT_LINE : CLEAR_LINE);
+ LOGMASKED(LOG_CRUKEY, "Enable keyboard shift reg = %02x\n", data);
+ m_gatearray->enable_shift_register(data);
break;
case 10:
LOGMASKED(LOG_CRU, "Geneve mode = %02x\n", data);
- m_mapper->set_geneve_mode(data!=0);
+ m_gatearray->set_geneve_mode(data!=0);
break;
case 11:
LOGMASKED(LOG_CRU, "Direct mode = %02x\n", data);
- m_mapper->set_direct_mode(data!=0);
+ m_gatearray->set_direct_mode(data!=0);
break;
case 12:
LOGMASKED(LOG_CRU, "Cartridge size 8K = %02x\n", data);
- m_mapper->set_cartridge_size((data!=0)? 0x2000 : 0x4000);
+ m_gatearray->set_cartridge_size((data!=0)? 0x2000 : 0x4000);
break;
case 13:
LOGMASKED(LOG_CRU, "Cartridge writable 6000 = %02x\n", data);
- m_mapper->set_cartridge_writable(0x6000, (data!=0));
+ m_gatearray->set_cartridge_writable(0x6000, (data!=0));
break;
case 14:
LOGMASKED(LOG_CRU, "Cartridge writable 7000 = %02x\n", data);
- m_mapper->set_cartridge_writable(0x7000, (data!=0));
+ m_gatearray->set_cartridge_writable(0x7000, (data!=0));
break;
case 15:
LOGMASKED(LOG_CRU, "Extra wait states = %02x\n", data==0);
- m_mapper->set_extra_waitstates(data==0); // let's use the inverse semantics
+ m_gatearray->set_extra_waitstates(data==0); // let's use the inverse semantics
break;
default:
LOGMASKED(LOG_WARN, "set CRU address %04x=%02x ignored\n", addroff, data);
@@ -531,6 +551,7 @@ WRITE_LINE_MEMBER( geneve_state::joystick_select )
m_joyport->write_port((state==ASSERT_LINE)? 1:2);
}
+
/*
Write external mem cycles (0=long, 1=short)
*/
@@ -546,11 +567,19 @@ WRITE_LINE_MEMBER( geneve_state::extbus_wait_states )
WRITE_LINE_MEMBER( geneve_state::video_wait_states )
{
LOGMASKED(LOG_LINES, "Video wait states set to %d\n", state);
- m_mapper->set_video_waitstates(state==ASSERT_LINE);
+ m_gatearray->set_video_waitstates(state==ASSERT_LINE);
m_video_wait = (state!=0)? ASSERT_LINE : CLEAR_LINE;
}
/*
+ Keyboard reset (active low).
+*/
+WRITE_LINE_MEMBER( geneve_state::keyboard_reset )
+{
+ LOGMASKED(LOG_CRUKEY, "Keyboard reset %d\n", state);
+}
+
+/*
Called by the 9901 core whenever the state of INTREQ and IC0-3 changes.
As with the TI-99/4A, the interrupt level is delivered as the offset,
but again it is ignored. Anyway, the TMS9995 has only two external inputs
@@ -635,7 +664,7 @@ void geneve_state::external_operation(offs_t offset, uint8_t data)
WRITE_LINE_MEMBER( geneve_state::clock_out )
{
m_tms9901->phi_line(state);
- m_mapper->clock_in(state);
+ m_gatearray->clock_in(state);
}
void geneve_state::init_geneve()
@@ -679,9 +708,10 @@ void geneve_state::geneve(machine_config &config)
{
geneve_common(config);
- // Mapper
- GENEVE_MAPPER(config, m_mapper, 0);
- m_mapper->ready_cb().set(FUNC(geneve_state::mapper_ready));
+ // Gate array
+ GENEVE_GATE_ARRAY(config, m_gatearray, 0);
+ m_gatearray->ready_cb().set(FUNC(geneve_state::mapper_ready));
+ m_gatearray->kbdint_cb().set(FUNC(geneve_state::keyboard_interrupt));
// Peripheral expansion box (Geneve composition)
TI99_PERIBOX_GEN(config, m_peribox, 0);
@@ -695,8 +725,9 @@ void geneve_state::genmod(machine_config &config)
geneve_common(config);
// Mapper
- GENMOD_MAPPER(config, m_mapper, 0);
- m_mapper->ready_cb().set(FUNC(geneve_state::mapper_ready));
+ GENMOD_GATE_ARRAY(config, m_gatearray, 0);
+ m_gatearray->ready_cb().set(FUNC(geneve_state::mapper_ready));
+ m_gatearray->kbdint_cb().set(FUNC(geneve_state::keyboard_interrupt));
// Peripheral expansion box (Geneve composition with Genmod and plugged-in Memex)
TI99_PERIBOX_GENMOD(config, m_peribox, 0);
@@ -737,12 +768,12 @@ void geneve_state::geneve_common(machine_config &config)
m_tms9901->p_out_cb(0).set(FUNC(geneve_state::peripheral_bus_reset));
m_tms9901->p_out_cb(1).set(FUNC(geneve_state::VDP_reset));
m_tms9901->p_out_cb(2).set(FUNC(geneve_state::joystick_select));
- m_tms9901->p_out_cb(4).set(GENEVE_MAPPER_TAG, FUNC(bus::ti99::internal::geneve_mapper_device::pfm_select_lsb));
- m_tms9901->p_out_cb(5).set(GENEVE_MAPPER_TAG, FUNC(bus::ti99::internal::geneve_mapper_device::pfm_output_enable));
- m_tms9901->p_out_cb(6).set(GENEVE_KEYBOARD_TAG, FUNC(bus::ti99::internal::geneve_keyboard_device::reset_line));
+ m_tms9901->p_out_cb(4).set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::pfm_select_lsb));
+ m_tms9901->p_out_cb(5).set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::pfm_output_enable));
+ m_tms9901->p_out_cb(6).set(FUNC(geneve_state::keyboard_reset));
m_tms9901->p_out_cb(7).set(FUNC(geneve_state::extbus_wait_states));
m_tms9901->p_out_cb(9).set(FUNC(geneve_state::video_wait_states));
- m_tms9901->p_out_cb(13).set(GENEVE_MAPPER_TAG, FUNC(bus::ti99::internal::geneve_mapper_device::pfm_select_msb));
+ m_tms9901->p_out_cb(13).set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::pfm_select_msb));
m_tms9901->intreq_cb().set(FUNC(geneve_state::tms9901_interrupt));
// Clock
@@ -754,8 +785,12 @@ void geneve_state::geneve_common(machine_config &config)
soundgen.ready_cb().set(FUNC(geneve_state::ext_ready));
soundgen.add_route(ALL_OUTPUTS, "sound_out", 0.75);
- // User interface devices
- GENEVE_KEYBOARD(config, m_keyboard, 0).int_cb().set(FUNC(geneve_state::keyboard_interrupt));
+ // User interface devices: PC-style keyboard, joystick port, mouse connector
+ PC_KBDC(config, m_kbdconn, 0);
+ PC_KBDC_SLOT(config, "kbd", geneve_xt_keyboards, STR_KBD_GENEVE_XT_101_HLE).set_pc_kbdc_slot(m_kbdconn);
+ m_kbdconn->out_clock_cb().set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::kbdclk));
+ m_kbdconn->out_data_cb().set(GENEVE_GATE_ARRAY_TAG, FUNC(bus::ti99::internal::geneve_gate_array_device::kbddata));
+
TI99_JOYPORT(config, m_joyport, 0, ti99_joyport_options_plain, "twinjoy");
V9938_COLORBUS(config, m_colorbus, 0, ti99_colorbus_options, nullptr);
m_colorbus->extra_button_cb().set(FUNC(geneve_state::left_mouse_button));
diff --git a/src/mame/drivers/geniusjr.cpp b/src/mame/drivers/geniusjr.cpp
index 125b518890d..cc6cfaf96a1 100644
--- a/src/mame/drivers/geniusjr.cpp
+++ b/src/mame/drivers/geniusjr.cpp
@@ -274,13 +274,6 @@ void geniusjr_state::gln(machine_config &config)
subdevice<software_list_device>("cart_list")->set_original("gln");
}
-void geniusjr_state::gls(machine_config &config)
-{
- gj4000(config);
-
- subdevice<software_list_device>("cart_list")->set_original("gls");
-}
-
void geniusjr_state::gj5000(machine_config &config)
{
M68HC05L9(config, m_maincpu, 8'000'000); // unknown clock (type also uncertain)
@@ -308,6 +301,13 @@ void geniusjr_state::gjmovie(machine_config &config)
subdevice<software_list_device>("cart_list")->set_original("gjmovie");
}
+void geniusjr_state::gls(machine_config &config)
+{
+ gjrstar(config);
+
+ subdevice<software_list_device>("cart_list")->set_original("gls");
+}
+
ROM_START( gj4000 )
ROM_REGION( 0x2000, "maincpu", 0 )
@@ -377,8 +377,8 @@ ROM_START( gls )
ROM_REGION( 0x2000, "maincpu", 0 )
ROM_LOAD( "hc05_internal.bin", 0x0000, 0x2000, NO_DUMP )
- ROM_REGION( 0x80000, "extrom", 0 )
- ROM_LOAD( "gls.bin", 0x000000, 0x080000, NO_DUMP )
+ ROM_REGION( 0x40000, "extrom", 0 )
+ ROM_LOAD( "27-5635-00.u2", 0x000000, 0x40000, CRC(bc3c0587) SHA1(fe98f162bd80d96ce3264087b5869f4505955464))
ROM_END
@@ -391,4 +391,4 @@ COMP( 1996, gjrstar2, gjrstar, 0, gjrstar, geniusjr, geniusjr_state, empty
COMP( 1998, gjrstar3, 0, 0, gjrstar, geniusjr, geniusjr_state, empty_init, "VTech", "Genius Junior Redstar 3 (Germany)", MACHINE_IS_SKELETON )
COMP( 1998, gj5000, 0, 0, gj5000, geniusjr, geniusjr_state, empty_init, "VTech", "Genius Junior 5000 (Germany)", MACHINE_IS_SKELETON )
COMP( 1993, gln, 0, 0, gln, geniusjr, geniusjr_state, empty_init, "VTech", "Genius Leader Notebook", MACHINE_IS_SKELETON )
-COMP( 199?, gls, 0, 0, gls, geniusjr, geniusjr_state, empty_init, "VTech", "Genius Leader Select", MACHINE_IS_SKELETON ) // placeholder driver to attach cartridge dumps to
+COMP( 1995, gls, 0, 0, gls, geniusjr, geniusjr_state, empty_init, "VTech", "Genius Leader Select", MACHINE_IS_SKELETON )
diff --git a/src/mame/drivers/genpc.cpp b/src/mame/drivers/genpc.cpp
index ce6389d99b4..364db2abd2c 100644
--- a/src/mame/drivers/genpc.cpp
+++ b/src/mame/drivers/genpc.cpp
@@ -210,7 +210,9 @@ ROM_START(pc)
ROM_SYSTEM_BIOS(46, "b190b", "B-190-B") // B-190-B' P1.830 810.02, Chipset: Faraday FE2010A ICs: UM8272A, INS8250N-BT, MM58167AN-T
ROMX_LOAD( "b190bios.bin", 0xc000, 0x4000, CRC(4178d321) SHA1(a6b30c0805beabe3566b7d22984aa683fc62d7dc), ROM_BIOS(46)) // continuous beep but works
ROM_SYSTEM_BIOS(47, "kt10mb", "KT 10 M/B") // Award XT BIOS 2.05
- ROMX_LOAD( "kt10bios.bin", 0xe000, 0x2000, CRC(94e9836e) SHA1(793a9359ffd6f0964aa25edce31a3f37aa0dadc8), ROM_BIOS(47))
+ ROMX_LOAD( "kt10bios.bin", 0xe000, 0x2000, CRC(94e9836e) SHA1(793a9359ffd6f0964aa25edce31a3f37aa0dadc8), ROM_BIOS(47))
+ ROM_SYSTEM_BIOS(48, "diag", "Ruud Baltissen's Diagnostics") // http://www.vcfed.org/forum/showthread.php?68214-Ruud-s-diagnostic-ROM-for-IBM-PC-XT-and-compatibles / use pcherc
+ ROMX_LOAD( "diagrom.bin", 0xe000, 0x2000, CRC(747b1853) SHA1(204a484bc83b3607d5e1404a2dbe629f5f3044b1), ROM_BIOS(48))
ROM_END
#define rom_pcmda rom_pc
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index 3ae77dcb246..87f168784c1 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -707,7 +707,7 @@ void gottlieb_state::device_timer(emu_timer &timer, device_timer_id id, int para
nmi_clear(ptr, param);
break;
default:
- assert_always(false, "Unknown id in gottlieb_state::device_timer");
+ throw emu_fatalerror("Unknown id in gottlieb_state::device_timer");
}
}
diff --git a/src/mame/drivers/gpworld.cpp b/src/mame/drivers/gpworld.cpp
index df0edef9ad1..5bafebbd9d9 100644
--- a/src/mame/drivers/gpworld.cpp
+++ b/src/mame/drivers/gpworld.cpp
@@ -462,7 +462,7 @@ void gpworld_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line(0, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in gpworld_state::device_timer");
+ throw emu_fatalerror("Unknown id in gpworld_state::device_timer");
}
}
diff --git a/src/mame/drivers/gunbustr.cpp b/src/mame/drivers/gunbustr.cpp
index 6c52edd33f3..4b425dda742 100644
--- a/src/mame/drivers/gunbustr.cpp
+++ b/src/mame/drivers/gunbustr.cpp
@@ -66,7 +66,7 @@ void gunbustr_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(5, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in gunbustr_state::device_timer");
+ throw emu_fatalerror("Unknown id in gunbustr_state::device_timer");
}
}
diff --git a/src/mame/drivers/h01x.cpp b/src/mame/drivers/h01x.cpp
index 33d68b72313..c1902d57304 100644
--- a/src/mame/drivers/h01x.cpp
+++ b/src/mame/drivers/h01x.cpp
@@ -229,7 +229,7 @@ void h01x_state::machine_start()
void h01x_state::machine_reset()
{
- m_bank = 0x00;
+ m_bank = 0x00;
m_rom_ptr = m_rom->base();
m_hzrom_ptr = m_hzrom->base();
@@ -251,7 +251,7 @@ void h01x_state::init_h01x()
/*
uint32_t h01x_state::screen_update_h01x(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- return 0;
+ return 0;
}
*/
@@ -268,7 +268,7 @@ WRITE8_MEMBER( h01x_state::port_64_w )
WRITE8_MEMBER( h01x_state::port_70_w )
{
- m_bank = data&0xC0;
+ m_bank = data&0xC0;
// bit5, speaker
m_speaker->level_w(BIT(data,5));
@@ -400,23 +400,23 @@ ROM_END
// H-01B中文教育电脑
// 普乐电器公司
-// cpu Z-80A 2MHz
+// cpu Z-80A 2MHz
// NF500A教学电脑
// 国营八三〇厂制造
-// cpu Z-80A 4MHz
-// video MC6845P
-// sysrom 16KB EPROM
-// hzrom 32KB EPROM
-// ram 32KB SRAM
-// vram 16Kx4bit DRAM
+// cpu Z-80A 4MHz
+// video MC6845P
+// sysrom 16KB EPROM
+// hzrom 32KB EPROM
+// ram 32KB SRAM
+// vram 16Kx4bit DRAM
// JCE
// 广东江门计算机应用设备厂
-// video HD6845SP
-// sysrom 16KB EPROM
-// hzrom 32KB EPROM
-// extrom 16KB EPROM
+// video HD6845SP
+// sysrom 16KB EPROM
+// hzrom 32KB EPROM
+// extrom 16KB EPROM
// 开机画面
// H-01B : H-01型中文教育电脑 普乐电器公司制造
diff --git a/src/mame/drivers/h19.cpp b/src/mame/drivers/h19.cpp
index d445b869756..bd431361b89 100644
--- a/src/mame/drivers/h19.cpp
+++ b/src/mame/drivers/h19.cpp
@@ -148,13 +148,11 @@ void h19_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_bellactive = false;
break;
default:
- assert_always(false, "Unknown id in h19_state::device_timer");
+ throw emu_fatalerror("Unknown id in h19_state::device_timer");
}
if (!m_keyclickactive && !m_bellactive)
- {
m_beep->set_state(0);
- }
}
diff --git a/src/mame/drivers/hawk.cpp b/src/mame/drivers/hawk.cpp
index 3c2d318196e..444231c6015 100644
--- a/src/mame/drivers/hawk.cpp
+++ b/src/mame/drivers/hawk.cpp
@@ -142,6 +142,10 @@ ROM_START(hawk)
ROMX_LOAD("v1.10_1.rom", 0x08000, 0x08000, CRC(121b5ce0) SHA1(baf06bc0d16501b50cbf97b686612b00098c73ab), ROM_BIOS(2))
ROMX_LOAD("v1.10_2.rom", 0x10000, 0x08000, CRC(cd5d94c7) SHA1(44c996b4bf00185ccb303cf9ef9bbd705018390c), ROM_BIOS(2))
ROMX_LOAD("56189.rom", 0x18000, 0x08000, CRC(1b2db82b) SHA1(2185d27816bde263c62db1a2441d8a6d2cb6d193), ROM_BIOS(2))
+ ROM_SYSTEM_BIOS(3, "101", "DEMOS 2.21 V1.01")
+ ROMX_LOAD("hawk-v1.01-0.rom", 0x00000, 0x08000, CRC(96404435) SHA1(3b108d6906ecc7d7a36c36b993e79ec7480668fa), ROM_BIOS(3))
+ ROMX_LOAD("hawk-v1.01-1.rom", 0x08000, 0x08000, CRC(4f99c76c) SHA1(45ff638277cff7b1fb2e21c4c348dad2b2e779b7), ROM_BIOS(3))
+ ROMX_LOAD("hawk-v1.01-2.rom", 0x10000, 0x08000, CRC(982ed053) SHA1(ab0a860f1204f36f490fdfadfefe2ee4a82ed3be), ROM_BIOS(3))
ROM_END
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp
index 86c7afb3985..57ea4a3e63d 100644
--- a/src/mame/drivers/hh_sm510.cpp
+++ b/src/mame/drivers/hh_sm510.cpp
@@ -20,13 +20,14 @@ TODO:
- improve/redo SVGs of: gnw_mmouse, gnw_egg, exospace
- confirm gnw_mmouse/gnw_egg rom (dumped from Soviet clone, but pretty
confident that it's same)
-- confirm gnw_climbcs rom (assumed to be the same as gnw_climber)
+- confirm gnw_bfight rom (assumed to be the same as gnw_bfightn)
+- confirm gnw_climber rom (assumed to be the same as gnw_climbern)
- dump/add purple version of gnw_judge
- dump/add CN-07 version of gnw_helmet
- Currently there is no accurate way to dump the SM511/SM512 melody ROM
electronically. For the ones that weren't decapped, they were read by
playing back all melody data and reconstructing it to ROM. Visual(decap)
- verification is wanted for: gnw_bfight, gnw_bjack, gnw_bsweep, gnw_climber,
+ verification is wanted for: gnw_bfightn, gnw_bjack, gnw_bsweep, gnw_climbern,
gnw_dkjrp, gnw_gcliff, gnw_mbaway, gnw_sbuster, gnw_zelda
****************************************************************************
@@ -103,7 +104,7 @@ AK-302* mvs SM511? Donkey Kong 3
HK-303* mvs SM511? Donkey Kong Hockey
YM-801* cs SM511 Super Mario Bros. (assume same ROM as nws version)
DR-802 cs SM511 Climber "
-BF-803* cs SM511 Balloon Fight "
+BF-803 cs SM511 Balloon Fight "
YM-901-S* x SM511 Super Mario Bros. "
RGW-001 (2010 Ball remake) is on different hardware, ATmega169PV MCU.
@@ -697,7 +698,7 @@ public:
// config
static INPUT_PORTS_START( gnw_judge )
- PORT_START("IN.0") // R2
+ PORT_START("IN.0") // R2
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN.1") // R3
@@ -2241,7 +2242,7 @@ ROM_END
/***************************************************************************
Nintendo Game & Watch: Mario Bros. (model MW-56)
- * PCB label MW-56-M
+ * PCB label MW-56-M-I (left), MW-56-S (right)
* Sharp SM510 label MW-56 533C (no decap)
* horizontal dual lcd screens with custom segments, 1-bit sound
@@ -3740,19 +3741,19 @@ ROM_END
/***************************************************************************
- Nintendo Game & Watch: Climber New Wide Screen (model DR-106),
- Nintendo Game & Watch: Climber Crystal Screen (model DR-802)
- * PCB label DR-106 (New Wide Screen), DR-802 (Crystal Screen)
+ Nintendo Game & Watch: Climber Crystal Screen (model DR-802),
+ Nintendo Game & Watch: Climber New Wide Screen (model DR-106)
+ * PCB label DR-802 (Crystal Screen), DR-106 (New Wide Screen)
* Sharp SM511
- - label DR-106 9038B (new wide screen version) (no decap)
- label DR-802 8626A (crystal screen) (not dumped yet)
+ - label DR-106 9038B (new wide screen version) (no decap)
* lcd screen with custom segments, 1-bit sound
First released in 1986 on Crystal Screen (model DR-802), rereleased on
New Wide Screen in 1988 (model DR-106). The graphic LCD elements look the same
in both versions but the display aspect ratio and the graphical background is
- slightly different.
- Until further proof, it's assumed that the ROM is the same for both models.
+ slightly different. Until further proof, it's assumed that the ROM is the same
+ for both models.
***************************************************************************/
@@ -3764,7 +3765,7 @@ public:
{ }
void gnw_climber(machine_config &config);
- void gnw_climbcs(machine_config &config);
+ void gnw_climbern(machine_config &config);
};
// config
@@ -3808,7 +3809,7 @@ void gnw_climber_state::gnw_climber(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
- screen.set_size(1677, 1080);
+ screen.set_size(1756, 1080);
screen.set_visarea_full();
/* sound hardware */
@@ -3817,13 +3818,13 @@ void gnw_climber_state::gnw_climber(machine_config &config)
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
-void gnw_climber_state::gnw_climbcs(machine_config &config)
+void gnw_climber_state::gnw_climbern(machine_config &config)
{
gnw_climber(config);
/* video hardware */
screen_device *screen = subdevice<screen_device>("screen");
- screen->set_size(1756, 1080);
+ screen->set_size(1677, 1080);
screen->set_visarea_full();
}
@@ -3831,24 +3832,24 @@ void gnw_climber_state::gnw_climbcs(machine_config &config)
ROM_START( gnw_climber )
ROM_REGION( 0x1000, "maincpu", 0 )
- ROM_LOAD( "dr-106.program", 0x0000, 0x1000, CRC(2adcbd6d) SHA1(110dc08c65120ab2c76ee647e89aa2726e24ac1a) )
+ ROM_LOAD( "dr-802.program", 0x0000, 0x1000, BAD_DUMP CRC(2adcbd6d) SHA1(110dc08c65120ab2c76ee647e89aa2726e24ac1a) ) // dumped from NWS version
ROM_REGION( 0x100, "maincpu:melody", 0 )
- ROM_LOAD( "dr-106.melody", 0x000, 0x100, BAD_DUMP CRC(7c49a3a3) SHA1(fad00d650b4864135c7d50f6fae735b7fffe720f) ) // decap needed for verification
+ ROM_LOAD( "dr-802.melody", 0x000, 0x100, BAD_DUMP CRC(7c49a3a3) SHA1(fad00d650b4864135c7d50f6fae735b7fffe720f) ) // dumped from NWS version
- ROM_REGION( 542332, "screen", 0)
- ROM_LOAD( "gnw_climber.svg", 0, 542332, CRC(d7e84c21) SHA1(a5b5b68c8cdb3a09966bfb91b281791bef311248) )
+ ROM_REGION( 564704, "screen", 0)
+ ROM_LOAD( "gnw_climber.svg", 0, 564704, CRC(60b25cc5) SHA1(1c101539a861257c5b0334ffdf9491c877759fa1) )
ROM_END
-ROM_START( gnw_climbcs )
+ROM_START( gnw_climbern )
ROM_REGION( 0x1000, "maincpu", 0 )
- ROM_LOAD( "dr-106.program", 0x0000, 0x1000, BAD_DUMP CRC(2adcbd6d) SHA1(110dc08c65120ab2c76ee647e89aa2726e24ac1a) ) // dumped from NWS version
+ ROM_LOAD( "dr-106.program", 0x0000, 0x1000, CRC(2adcbd6d) SHA1(110dc08c65120ab2c76ee647e89aa2726e24ac1a) )
ROM_REGION( 0x100, "maincpu:melody", 0 )
- ROM_LOAD( "dr-106.melody", 0x000, 0x100, BAD_DUMP CRC(7c49a3a3) SHA1(fad00d650b4864135c7d50f6fae735b7fffe720f) ) // dumped from NWS version
+ ROM_LOAD( "dr-106.melody", 0x000, 0x100, BAD_DUMP CRC(7c49a3a3) SHA1(fad00d650b4864135c7d50f6fae735b7fffe720f) ) // decap needed for verification
- ROM_REGION( 564704, "screen", 0)
- ROM_LOAD( "gnw_climbcs.svg", 0, 564704, CRC(60b25cc5) SHA1(1c101539a861257c5b0334ffdf9491c877759fa1) )
+ ROM_REGION( 542332, "screen", 0)
+ ROM_LOAD( "gnw_climbern.svg", 0, 542332, CRC(d7e84c21) SHA1(a5b5b68c8cdb3a09966bfb91b281791bef311248) )
ROM_END
@@ -3857,9 +3858,14 @@ ROM_END
/***************************************************************************
- Nintendo Game & Watch: Balloon Fight (model: see below)
- * PCB label DR-106 (same PCB as in Climber (new wide screen version))
- * Sharp SM511 label BF-107 9031B (new wide screen version) (no decap)
+ Nintendo Game & Watch: Balloon Fight Crystal Screen (model BF-803),
+ Nintendo Game & Watch: Balloon Fight New Wide Screen (model BF-107)
+ * PCB labels
+ - DR-802-2 (Crystal Screen)
+ - DR-106 (new wide screen version)
+ * Sharp SM511
+ - label BF-803 8646A (crystal screen) (not dumped yet)
+ - label BF-107 9031B (new wide screen version) (no decap)
* lcd screen with custom segments, 1-bit sound
First released in 1986 on Crystal Screen (model BF-803), rereleased on
@@ -3867,6 +3873,9 @@ ROM_END
in both versions but the graphical background is slightly different.
Until further proof, it's assumed that the ROM is the same for both models.
+ The PCB design for the different editions seems to be shared with the
+ corresponding editions of Climber.
+
***************************************************************************/
class gnw_bfight_state : public hh_sm510_state
@@ -3877,6 +3886,7 @@ public:
{ }
void gnw_bfight(machine_config &config);
+ void gnw_bfightn(machine_config &config);
};
// config
@@ -3920,7 +3930,7 @@ void gnw_bfight_state::gnw_bfight(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
- screen.set_size(1549, 1080);
+ screen.set_size(1771, 1080);
screen.set_visarea_full();
/* sound hardware */
@@ -3929,17 +3939,38 @@ void gnw_bfight_state::gnw_bfight(machine_config &config)
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
+void gnw_bfight_state::gnw_bfightn(machine_config &config)
+{
+ gnw_bfight(config);
+
+ /* video hardware */
+ screen_device *screen = subdevice<screen_device>("screen");
+ screen->set_size(1549, 1080);
+ screen->set_visarea_full();
+}
+
// roms
ROM_START( gnw_bfight )
ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "bf-803.program", 0x0000, 0x1000, BAD_DUMP CRC(4c8d07ed) SHA1(a8974dff85d5f3bacaadb71b86e9b30994b6d129) ) // dumped from NWS version
+
+ ROM_REGION( 0x100, "maincpu:melody", 0 )
+ ROM_LOAD( "bf-803.melody", 0x000, 0x100, BAD_DUMP CRC(ffddf9ed) SHA1(e9cb3a340924363eeef5ab453c452b9cc69207b9) ) // dumped from NWS version
+
+ ROM_REGION( 586284, "screen", 0)
+ ROM_LOAD( "gnw_bfight.svg", 0, 586284, CRC(e4ca7a48) SHA1(5f425183ee8d347d93d11a611f3726230e83859c) )
+ROM_END
+
+ROM_START( gnw_bfightn )
+ ROM_REGION( 0x1000, "maincpu", 0 )
ROM_LOAD( "bf-107.program", 0x0000, 0x1000, CRC(4c8d07ed) SHA1(a8974dff85d5f3bacaadb71b86e9b30994b6d129) )
ROM_REGION( 0x100, "maincpu:melody", 0 )
ROM_LOAD( "bf-107.melody", 0x000, 0x100, BAD_DUMP CRC(ffddf9ed) SHA1(e9cb3a340924363eeef5ab453c452b9cc69207b9) ) // decap needed for verification
- ROM_REGION( 558341, "screen", 0)
- ROM_LOAD( "gnw_bfight.svg", 0, 558341, CRC(f0d61fe8) SHA1(b0b56224a967e4b26836c0f7e3015d13b42ae5cc) )
+ ROM_REGION( 558342, "screen", 0)
+ ROM_LOAD( "gnw_bfightn.svg", 0, 558342, CRC(361e03c3) SHA1(2883bc3de07f71fff8ea95dbc4f6955fd13abacd) )
ROM_END
@@ -10162,8 +10193,8 @@ CONS( 1980, gnw_ball, 0, 0, gnw_ball, gnw_ball, gnw_ball_state
CONS( 1980, gnw_flagman, 0, 0, gnw_flagman, gnw_flagman, gnw_flagman_state, empty_init, "Nintendo", "Game & Watch: Flagman", MACHINE_SUPPORTS_SAVE )
CONS( 1980, gnw_vermin, 0, 0, gnw_vermin, gnw_vermin, gnw_vermin_state, empty_init, "Nintendo", "Game & Watch: Vermin", MACHINE_SUPPORTS_SAVE )
CONS( 1980, gnw_fires, 0, 0, gnw_fires, gnw_fires, gnw_fires_state, empty_init, "Nintendo", "Game & Watch: Fire (silver)", MACHINE_SUPPORTS_SAVE )
-CONS( 1980, gnw_judge, 0, 0, gnw_judge, gnw_judge, gnw_judge_state, empty_init, "Nintendo", "Game & Watch: Judge", MACHINE_SUPPORTS_SAVE )
-CONS( 1981, gnw_helmet, 0, 0, gnw_helmet, gnw_helmet, gnw_helmet_state, empty_init, "Nintendo", "Game & Watch: Helmet", MACHINE_SUPPORTS_SAVE )
+CONS( 1980, gnw_judge, 0, 0, gnw_judge, gnw_judge, gnw_judge_state, empty_init, "Nintendo", "Game & Watch: Judge (green)", MACHINE_SUPPORTS_SAVE )
+CONS( 1981, gnw_helmet, 0, 0, gnw_helmet, gnw_helmet, gnw_helmet_state, empty_init, "Nintendo", "Game & Watch: Helmet (Rev. 2)", MACHINE_SUPPORTS_SAVE )
// Nintendo G&W: wide screen
CONS( 1981, gnw_pchute, 0, 0, gnw_pchute, gnw_pchute, gnw_pchute_state, empty_init, "Nintendo", "Game & Watch: Parachute", MACHINE_SUPPORTS_SAVE )
@@ -10203,9 +10234,10 @@ CONS( 1983, gnw_mariocm, 0, 0, gnw_mariocm, gnw_mariocm, gnw_mariocm_st
CONS( 1983, gnw_manhole, 0, 0, gnw_manhole, gnw_manhole, gnw_manhole_state, empty_init, "Nintendo", "Game & Watch: Manhole (new wide screen)", MACHINE_SUPPORTS_SAVE )
CONS( 1985, gnw_tfish, 0, 0, gnw_tfish, gnw_tfish, gnw_tfish_state, empty_init, "Nintendo", "Game & Watch: Tropical Fish", MACHINE_SUPPORTS_SAVE )
CONS( 1988, gnw_smb, 0, 0, gnw_smb, gnw_smb, gnw_smb_state, empty_init, "Nintendo", "Game & Watch: Super Mario Bros. (new wide screen)", MACHINE_SUPPORTS_SAVE )
-CONS( 1988, gnw_climber, 0, 0, gnw_climber, gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (new wide screen)", MACHINE_SUPPORTS_SAVE )
-CONS( 1986, gnw_climbcs, gnw_climber,0, gnw_climbcs, gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (crystal screen)", MACHINE_SUPPORTS_SAVE )
-CONS( 1988, gnw_bfight, 0, 0, gnw_bfight, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (new wide screen)", MACHINE_SUPPORTS_SAVE )
+CONS( 1986, gnw_climber, 0, 0, gnw_climber, gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (crystal screen)", MACHINE_SUPPORTS_SAVE )
+CONS( 1988, gnw_climbern,gnw_climber,0, gnw_climbern,gnw_climber, gnw_climber_state, empty_init, "Nintendo", "Game & Watch: Climber (new wide screen)", MACHINE_SUPPORTS_SAVE )
+CONS( 1986, gnw_bfight, 0, 0, gnw_bfight, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (crystal screen)", MACHINE_SUPPORTS_SAVE )
+CONS( 1988, gnw_bfightn, gnw_bfight, 0, gnw_bfightn, gnw_bfight, gnw_bfight_state, empty_init, "Nintendo", "Game & Watch: Balloon Fight (new wide screen)", MACHINE_SUPPORTS_SAVE )
// Nintendo G&W: table top / panorama screen
CONS( 1983, gnw_dkjrp, 0, 0, gnw_dkjrp, gnw_dkjrp, gnw_dkjrp_state, empty_init, "Nintendo", "Game & Watch: Donkey Kong Jr. (panorama screen)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp
index 877554f4bb9..c1cc2515239 100644
--- a/src/mame/drivers/hvyunit.cpp
+++ b/src/mame/drivers/hvyunit.cpp
@@ -670,6 +670,8 @@ void hvyunit_state::hvyunit(machine_config &config)
*
*************************************/
+/* There is likely a World version using the newer (B73_25 - B73_28) graphics ROMs with a program ROM labeled B73_29 */
+
ROM_START( hvyunit )
ROM_REGION( 0x20000, "master", 0 )
ROM_LOAD( "b73_10.5c", 0x00000, 0x20000, CRC(ca52210f) SHA1(346951962aa5bbad641117dbd66f035dddc7c0bf) )
@@ -712,20 +714,24 @@ ROM_START( hvyunitj )
ROM_REGION( 0x1000, "mermaid", 0 )
ROM_LOAD( "mermaid.bin", 0x0000, 0x0e00, CRC(88c5dd27) SHA1(5043fed7fd192891be7e4096f2c5daaae1538bc4) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* note, the rom ordering on this is different to the other Japan set */
+ ROM_REGION( 0x200000, "gfx1", 0 )
ROM_LOAD( "b73_08.2f", 0x000000, 0x080000, CRC(f83dd808) SHA1(09d5f1e86fad3a0d2d3ac1845103d3f2833c6793) )
- ROM_LOAD( "b73_07.2c", 0x100000, 0x010000, CRC(5cffa42c) SHA1(687e047345039479b35d5099e56dbc1d57284ed9) )
- ROM_LOAD( "b73_06.2b", 0x110000, 0x010000, CRC(a98e4aea) SHA1(560fef03ad818894c9c7578c6282d55b646e8129) )
- ROM_LOAD( "b73_01.1b", 0x120000, 0x010000, CRC(3a8a4489) SHA1(a01d7300015f90ce6dd571ad93e7a58270a99e47) )
- ROM_LOAD( "b73_02.1c", 0x130000, 0x010000, CRC(025c536c) SHA1(075e95cc39e792049ae656404e7f7440df064391) )
- ROM_LOAD( "b73_03.1d", 0x140000, 0x010000, CRC(ec6020cf) SHA1(2973aa2dc3deb2f27c9f1bad07a7664bad95b3f2) )
- ROM_LOAD( "b73_04.1f", 0x150000, 0x010000, CRC(f7badbb2) SHA1(d824ab4aba94d7ca02401f4f6f34213143c282ec) )
- ROM_LOAD( "b73_05.1h", 0x160000, 0x010000, CRC(b8e829d2) SHA1(31102358500d7b58173d4f18647decf5db744416) )
+ ROM_LOAD( "b73_28.2c", 0x100000, 0x020000, CRC(a02e08d6) SHA1(72764d4e8474aaac0674fd1c20278a706da7ade2) )
+ ROM_LOAD( "b73_27.2b", 0x120000, 0x020000, CRC(8708f97c) SHA1(ccddc7f2fa53c5e35345c2db0520f515c512b723) )
+ ROM_LOAD( "b73_25.0b", 0x140000, 0x020000, CRC(2f13f81e) SHA1(9d9c1869bf582a0bc0581cdf5b65237124b9e456) ) /* the data in first half of this actually differs slightly to the other sets, a 0x22 fill is replaced by 0xff on empty tiles */
+ ROM_LOAD( "b73_26.0c", 0x160000, 0x010000, CRC(b8e829d2) SHA1(31102358500d7b58173d4f18647decf5db744416) ) /* == b73_05.1h, despite the different label */
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "b73_09.2p", 0x000000, 0x080000, CRC(537c647f) SHA1(941c0f4e251bc68e53d62e70b033a3a6c145bb7e) )
ROM_END
+/*
+
+There is known to exist a currently undumped Japanese version with graphic ROMs numbered B73_15 through B73_23, while
+using B73_12 sound CPU code & B73_14 slave CPU code. The label for the program was missing, presumed to B73_24
+
+*/
+
ROM_START( hvyunitjo )
ROM_REGION( 0x20000, "master", 0 )
ROM_LOAD( "b73_13.5c", 0x00000, 0x20000, CRC(e2874601) SHA1(7f7f3287113b8622eb365d04135d2d9c35d70554) )
diff --git a/src/mame/drivers/ibmpc.cpp b/src/mame/drivers/ibmpc.cpp
index e9e5e3c330c..91a04c69439 100644
--- a/src/mame/drivers/ibmpc.cpp
+++ b/src/mame/drivers/ibmpc.cpp
@@ -401,6 +401,14 @@ ROM_START( ibm5150 )
ROMX_LOAD("5700043.u32", 0xc000, 0x2000, CRC(ea2794e6) SHA1(22fe58bc853ffd393d5e2f98defda7456924b04f), ROM_BIOS(2)) /* ROM Basic 1.0 FC000-FDFFF */
ROMX_LOAD("5700671.u33", 0xe000, 0x2000, CRC(b7d4ec46) SHA1(bdb06f846c4768f39eeff7e16b6dbff8cd2117d2), ROM_BIOS(2))
+ /* Landmark/Supersoft Diagnostics ROM */
+ ROM_SYSTEM_BIOS( 3, "pclandmark", "Landmark/Supersoft Diagnostics" )
+ ROMX_LOAD("5000019.u29", 0x6000, 0x2000, CRC(80d3cf5d) SHA1(64769b7a8b60ffeefa04e4afbec778069a2840c9), ROM_BIOS(3)) /* ROM Basic 1.1 F6000-F7FFF; IBM P/N: 5000019, FRU: 6359109 */
+ ROMX_LOAD("5000021.u30", 0x8000, 0x2000, CRC(673a4acc) SHA1(082ae803994048e225150f771794ca305f73d731), ROM_BIOS(3)) /* ROM Basic 1.1 F8000-F9FFF; IBM P/N: 5000021, FRU: 6359111 */
+ ROMX_LOAD("5000022.u31", 0xa000, 0x2000, CRC(aac3fc37) SHA1(c9e0529470edf04da093bb8c8ae2536c688c1a74), ROM_BIOS(3)) /* ROM Basic 1.1 FA000-FBFFF; IBM P/N: 5000022, FRU: 6359112 */
+ ROMX_LOAD("5000023.u32", 0xc000, 0x2000, CRC(3062b3fc) SHA1(5134dd64721cbf093d059ee5d3fd09c7f86604c7), ROM_BIOS(3)) /* ROM Basic 1.1 FC000-FDFFF; IBM P/N: 5000023, FRU: 6359113 */
+ ROMX_LOAD("5150_or_5160_2764_8kb.bin", 0xe000, 0x2000, CRC(4e89a4d8) SHA1(39a28fb2fe9f1aeea24ed2c0255cebca76e37ed7), ROM_BIOS(3))
+
/* Z80 on the Xebec 1210 and 1220 Hard Disk Controllers */
// ROM_REGION(0x10000, "cpu1", 0)
// ROM_LOAD("104839re.12a", 0x0000, 0x1000, CRC(3ad32fcc) SHA1(0127fa520aaee91285cb46a640ed835b4554e4b3)) /* Xebec 1210 IBM OEM Hard Disk Controller, silkscreened "104839RE // COPYRIGHT // XEBEC 1986" - Common for both XEBEC 1210 IBM OEM revisions. Some cards have the rom marked 104839E instead (John Eliott's card is like this), but contents are the same. */
@@ -487,12 +495,10 @@ ROM_START( ibm5160 )
ROMX_LOAD("68x4370.u19", 0x0000, 0x8000, CRC(758ff036) SHA1(045e27a70407d89b7956ecae4d275bd2f6b0f8e2), ROM_BIOS(3))
ROMX_LOAD("62x0890.u18", 0x8000, 0x8000, CRC(4f417635) SHA1(daa61762d3afdd7262e34edf1a3d2df9a05bcebb), ROM_BIOS(3))
-// ROM_SYSTEM_BIOS( 4, "xtdiag", "IBM XT 5160 w/Supersoft Diagnostics" ) /* ROMs marked as BAD_DUMP for now. We expect the data to be in a different ROM chip layout */
-// ROMX_LOAD("basicc11.f6", 0xf6000, 0x2000, BAD_DUMP CRC(80d3cf5d) SHA1(64769b7a8b60ffeefa04e4afbec778069a2840c9), ROM_BIOS(4) )
-// ROMX_LOAD("basicc11.f8", 0xf8000, 0x2000, BAD_DUMP CRC(673a4acc) SHA1(082ae803994048e225150f771794ca305f73d731), ROM_BIOS(4) )
-// ROMX_LOAD("basicc11.fa", 0xfa000, 0x2000, BAD_DUMP CRC(aac3fc37) SHA1(c9e0529470edf04da093bb8c8ae2536c688c1a74), ROM_BIOS(4) )
-// ROMX_LOAD("basicc11.fc", 0xfc000, 0x2000, BAD_DUMP CRC(3062b3fc) SHA1(5134dd64721cbf093d059ee5d3fd09c7f86604c7), ROM_BIOS(4) )
-// ROMX_LOAD("xtdiag.bin", 0xfe000, 0x2000, CRC(4e89a4d8) SHA1(39a28fb2fe9f1aeea24ed2c0255cebca76e37ed7), ROM_BIOS(4) )
+ ROM_SYSTEM_BIOS( 4, "xtlandmark", "Landmark/Supersoft Diagnostics" )
+ ROMX_LOAD("62x0854.u19", 0x0000, 0x8000, CRC(b5fb0e83) SHA1(937b43759ffd472da4fb0fe775b3842f5fb4c3b3), ROM_BIOS(4) ) /* instructions say to leave this ROM in place */
+ ROMX_LOAD("5150_or_5160_27256_32kb.bin", 0x8000, 0x8000, CRC(d3603216) SHA1(6691d33f43eddd3b0a6269ef985f5be8705ba55f), ROM_BIOS(4) )
+
/* IBM 1501981(CGA) and 1501985(MDA) Character rom */
ROM_REGION(0x2000,"gfx1", 0)
diff --git a/src/mame/drivers/icebox.cpp b/src/mame/drivers/icebox.cpp
index 75332c06e94..3a1c7599cd7 100644
--- a/src/mame/drivers/icebox.cpp
+++ b/src/mame/drivers/icebox.cpp
@@ -108,6 +108,9 @@ on the boards to say which of the four selects it responds to.
The three byte fifo and a register jams a zero onto the data bus (when?), and we have the source for the CP/M version
of the debugger/boot prom to see how interrupt handling occurs.
+When the floppy controller generates a DRQ or INTRQ it also generates a Z80 INT, which uses IM 0
+and forces a NOP (00) onto the bus. This allows firmware and/or disk routines to resume after a HALT.
+
I can sort of piece together what Terse implements and what it evolved from. I think it started as the Caltech FORTH
implemented for the PDP-10 and 11 with a lot of words stripped out, and others added. This was submitted to DECUS as
submission 11-232 but much of the early DECUS stuff has been lost, so I've not been able to find a copy to see how the
@@ -176,6 +179,7 @@ public:
private:
DECLARE_WRITE_LINE_MEMBER(drq_w);
+ DECLARE_WRITE_LINE_MEMBER(intrq_w);
void mem_map(address_map &map);
void io_map(address_map &map);
void machine_reset() override;
@@ -286,13 +290,20 @@ void icebox_state::port_f1_w(u8 data)
m_fdc->dden_w(1); // single density?
}
-// The next byte from floppy is available. Enable CPU so it can get the byte, via IM0.
+// The next byte from floppy is available. Enable CPU so it can get the NOP byte, via IM0.
WRITE_LINE_MEMBER(icebox_state::drq_w)
{
if (BIT(m_f1, 2))
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE, 0x00); // Z80
}
+// The next byte from floppy is available. Enable CPU so it can get the NOP byte, via IM0.
+WRITE_LINE_MEMBER(icebox_state::intrq_w)
+{
+ if (BIT(m_f1, 2))
+ m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE, 0x00); // Z80
+}
+
static void floppies(device_slot_interface &device)
{
device.option_add("flop", FLOPPY_8_SSDD); // Pertec "iCOM FD5200"
@@ -343,6 +354,7 @@ void icebox_state::icebox(machine_config &config)
FD1771(config, m_fdc, 4_MHz_XTAL / 2);
m_fdc->drq_wr_callback().set(FUNC(icebox_state::drq_w));
+ m_fdc->intrq_wr_callback().set(FUNC(icebox_state::intrq_w));
FLOPPY_CONNECTOR(config, m_floppy0, floppies, "flop", floppy_image_device::default_floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, m_floppy1, floppies, "flop", floppy_image_device::default_floppy_formats).enable_sound(true);
}
diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp
index 92a9f1fe0bd..375103f79d0 100644
--- a/src/mame/drivers/igspoker.cpp
+++ b/src/mame/drivers/igspoker.cpp
@@ -65,7 +65,8 @@ FIX: PK Tetris have an input named AMUSE which I couldn't map. Maybe it is
TODO:
- Sets cpoker & cpokert spit 660K of whatever they have in the hopper when keyout...
-- Check if the cpoker sets lock randomly due to protection.
+- Check if the cpoker sets still lock at some point due to protection.
+- Fix lamps to cpoker101.
*****************************************************************************/
@@ -559,11 +560,11 @@ static INPUT_PORTS_START( cpoker )
PORT_START("BUTTONS2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1 / High / Low")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1 / Low / Black")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Hold 5 / Bet")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Hold 4 / Take")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / W-Up")
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2 / Red / Black")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2 / High / Red")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -2141,7 +2142,7 @@ void igspoker_state::init_cpoker300us()
}
}
-void igspoker_state::init_cpokert() // same decryption as cpokert
+void igspoker_state::init_cpokert()
{
uint8_t *rom = memregion("maincpu")->base();
/* decrypt the program ROM */
@@ -2211,6 +2212,27 @@ void igspoker_state::init_cpoker101() // same decryption as cpokert
rom[i] ^= 0x02;
}
}
+
+/* Patch to avoid traps at $0ec5 (cpoker101),
+ $0ef0 (cpoker201f), $0f20 (cpoker210ks) and
+ $206e (cpoker101, cpoker201f & cpoker210ks),
+ that run subs in RAM, operate registers,
+ and finally lock the game at $732e (cpoker101),
+ $72c2 (cpoker201f) & $72c6 (cpoker210ks).
+
+ All these are triggered if RAM contents of $ff18
+ matches the $ff19 (normally 0x20 due to an AND
+ against the $ff1b contents)
+*/
+// this NOP the $0ec5 call...
+ rom[0x214a] = 0x00;
+ rom[0x214b] = 0x00;
+ rom[0x214c] = 0x00;
+
+// this NOP the conditional jump to $206e
+ rom[0x214d] = 0x00;
+ rom[0x214e] = 0x00;
+ rom[0x214f] = 0x00;
}
void igspoker_state::init_cska()
@@ -3003,10 +3025,10 @@ void igspoker_state::init_kungfu()
GAMEL( 1993?,cpoker, 0, igspoker, cpoker, igspoker_state, init_cpoker, ROT0, "IGS", "Champion Poker (v220I)", 0, layout_igspoker )
GAMEL( 1993?,cpokert, cpoker, igspoker, cpoker, igspoker_state, init_cpokert, ROT0, "IGS (Tuning license)", "Champion Poker (v200G)", 0, layout_igspoker )
GAMEL( 1993, cpokerx, cpoker, igspoker, cpokerx, igspoker_state, init_cpokert, ROT0, "IGS", "Champion Poker (v100)", 0, layout_igspoker )
-GAMEL( 1993, cpoker101, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v101)", MACHINE_NOT_WORKING, layout_igspoker ) // need to verify protection handling and inputs/outputs
-GAMEL( 1993, cpoker201f, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v201F)", MACHINE_NOT_WORKING, layout_igspoker ) // "
-GAMEL( 1993, cpoker210ks, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v210KS)", MACHINE_NOT_WORKING, layout_igspoker ) // "
-GAMEL( 1993, cpoker300us, cpoker, igspoker, cpoker, igspoker_state, init_cpoker300us, ROT0, "IGS", "Champion Poker (v300US)", MACHINE_NOT_WORKING, layout_igspoker ) // "
+GAMEL( 1993, cpoker101, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v101)", 0, layout_igspoker ) // need to fix lamps/layout
+GAMEL( 1993, cpoker201f, cpoker, igspoker, cpoker, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v201F)", 0, layout_igspoker )
+GAMEL( 1993, cpoker210ks, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v210KS)", MACHINE_NOT_WORKING, layout_igspoker ) // need to verify protection handling and inputs/outputs
+GAMEL( 1993, cpoker300us, cpoker, igspoker, cpoker, igspoker_state, init_cpoker300us, ROT0, "IGS", "Champion Poker (v300US)", MACHINE_NOT_WORKING, layout_igspoker ) // need to verify protection handling and inputs/outputs
GAMEL( 2000, chleague, 0, igspoker, chleague, igspoker_state, init_chleague, ROT0, "IGS", "Champion League (v220I, Poker)", 0, layout_igspoker )
GAMEL( 2000, chleagul, chleague, igspoker, chleague, igspoker_state, init_chleague, ROT0, "IGS", "Champion League (v220I, Lattine)", 0, layout_igspoker )
diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp
index 79f691084ea..2ac93db8a1f 100644
--- a/src/mame/drivers/indy_indigo2.cpp
+++ b/src/mame/drivers/indy_indigo2.cpp
@@ -400,9 +400,11 @@ void ip24_state::ip24(machine_config &config)
SAA7191(config, m_dmsd);
VINO(config, m_vino);
+ m_vino->set_gio64_space(m_maincpu, AS_PROGRAM);
m_vino->i2c_data_out().set(m_dmsd, FUNC(saa7191_device::i2c_data_w));
m_vino->i2c_data_in().set(m_dmsd, FUNC(saa7191_device::i2c_data_r));
m_vino->i2c_stop().set(m_dmsd, FUNC(saa7191_device::i2c_stop_w));
+ m_vino->interrupt_cb().set(m_ioc2, FUNC(ioc2_device::video_int_w));
DS1386_8K(config, m_rtc, 32768);
}
diff --git a/src/mame/drivers/intv.cpp b/src/mame/drivers/intv.cpp
index 34fdf36526d..90a3ac14a61 100644
--- a/src/mame/drivers/intv.cpp
+++ b/src/mame/drivers/intv.cpp
@@ -438,7 +438,7 @@ void intv_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
intv_btb_fill(ptr, param);
break;
default:
- assert_always(false, "Unknown id in intv_state::device_timer");
+ throw emu_fatalerror("Unknown id in intv_state::device_timer");
}
}
diff --git a/src/mame/drivers/island.cpp b/src/mame/drivers/island.cpp
new file mode 100644
index 00000000000..4724ff44f7d
--- /dev/null
+++ b/src/mame/drivers/island.cpp
@@ -0,0 +1,81 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/***************************************************************************
+
+ Skeleton driver for mechanical games by Island Design Inc.:
+
+ * Spider Stompin' Deluxe (undumped)
+ * Tortoise and the Hare (undumped)
+ * Vortex
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+#include "sound/okim6295.h"
+#include "speaker.h"
+
+
+class island_state : public driver_device
+{
+public:
+ island_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_oki(*this, "oki")
+ {
+ }
+
+ void vortex(machine_config &config);
+
+private:
+ void prog_map(address_map &map);
+ void ext_map(address_map &map);
+
+ required_device<mcs51_cpu_device> m_maincpu;
+ required_device<okim6295_device> m_oki;
+};
+
+void island_state::prog_map(address_map &map)
+{
+ map(0x0000, 0xffff).rom().region("program", 0); // TODO: banking
+}
+
+void island_state::ext_map(address_map &map)
+{
+ map(0x2008, 0x200d).noprw();
+ map(0x4000, 0x7fff).ram();
+}
+
+
+static INPUT_PORTS_START(vortex)
+INPUT_PORTS_END
+
+
+void island_state::vortex(machine_config &config)
+{
+ I80C32(config, m_maincpu, 20_MHz_XTAL); // FIXME: actually DS80C320 (more registers, faster machine cycles)
+ m_maincpu->set_addrmap(AS_PROGRAM, &island_state::prog_map);
+ m_maincpu->set_addrmap(AS_IO, &island_state::ext_map);
+
+ SPEAKER(config, "mono").front_center();
+
+ OKIM6295(config, m_oki, 20_MHz_XTAL / 4, okim6295_device::PIN7_HIGH); // clock & pin 7 not verified
+ m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
+
+
+ROM_START(isld_vortex)
+ // vortex program w test version 1.4 u17 = 27c040
+ ROM_REGION(0x80000, "program", 0)
+ ROM_LOAD("vortex.u17", 0x00000, 0x80000, CRC(4a47626c) SHA1(c11c59ad382f4dffc3062cd434a7efeb9dbe7b18))
+ ROM_FILL(0x000d8, 1, 0x00) // workaround for unemulated DS80C320 watchdog timer
+ ROM_FILL(0x000d9, 1, 0x00)
+
+ // vortex sound u29 = 27c040 vers. 1.0
+ ROM_REGION(0x80000, "oki", 0)
+ ROM_LOAD("vortex.u29", 0x00000, 0x80000, CRC(2b0cc5c7) SHA1(ca9426351cec304b29a47ca66da12080269eb6e3))
+ROM_END
+
+
+GAME(1995, isld_vortex, 0, vortex, vortex, island_state, empty_init, ROT0, "Island Design", "Vortex (Island Design)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_MECHANICAL)
diff --git a/src/mame/drivers/itech8.cpp b/src/mame/drivers/itech8.cpp
index f3ec9da347d..dd1bfe80380 100644
--- a/src/mame/drivers/itech8.cpp
+++ b/src/mame/drivers/itech8.cpp
@@ -692,7 +692,7 @@ void itech8_state::device_timer(emu_timer &timer, device_timer_id id, int param,
delayed_z80_control_w(ptr, param);
break;
default:
- assert_always(false, "Unknown id in itech8_state::device_timer");
+ throw emu_fatalerror("Unknown id in itech8_state::device_timer");
}
}
diff --git a/src/mame/drivers/jclub2.cpp b/src/mame/drivers/jclub2.cpp
index 75a13ac9a58..fbbfde0d7a2 100644
--- a/src/mame/drivers/jclub2.cpp
+++ b/src/mame/drivers/jclub2.cpp
@@ -114,6 +114,8 @@
#include "jclub2o.lh"
#include "jclub2.lh"
+namespace {
+
// Common between all hardware (jclub2o, jclub2 and darkhors)
class common_state : public driver_device
{
@@ -235,6 +237,14 @@ public:
m_gfxdecode(*this, "gfxdecode")
{ }
+ void init_darkhors();
+
+ void darkhors(machine_config &config);
+
+protected:
+ virtual void video_start() override;
+
+private:
DECLARE_WRITE32_MEMBER(input_sel_w);
DECLARE_READ32_MEMBER(input_r);
DECLARE_WRITE32_MEMBER(out1_w);
@@ -248,12 +258,8 @@ public:
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- void init_darkhors();
- DECLARE_VIDEO_START(darkhors);
-
- void darkhors(machine_config &config);
void darkhors_map(address_map &map);
-private:
+
required_shared_ptr<uint32_t> m_tmapram;
required_shared_ptr<uint32_t> m_tmapscroll;
required_shared_ptr<uint32_t> m_tmapram2;
@@ -391,8 +397,10 @@ void darkhors_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
}
}
-VIDEO_START_MEMBER(darkhors_state,darkhors)
+void darkhors_state::video_start()
{
+ common_state::video_start();
+
m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(darkhors_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS,16,16, 0x40,0x40);
m_tmap2= &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(darkhors_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS,16,16, 0x40,0x40);
m_tmap->set_transparent_pen(0);
@@ -1232,7 +1240,6 @@ void darkhors_state::darkhors(machine_config &config)
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x10000);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_darkhors);
- MCFG_VIDEO_START_OVERRIDE(darkhors_state, darkhors)
// layout
config.set_default_layout(layout_jclub2);
@@ -1531,6 +1538,8 @@ void darkhors_state::init_darkhors()
}
}
+} // anonymous namespace
+
// Older hardware (ST-0020 + ST-0016)
GAME( 1994, jclub2v100, jclub2v112, jclub2o, jclub2v100, jclub2o_state, init_jclub2o, ROT0, "Seta", "Jockey Club II (v1.00, older hardware)", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp
index 31b9a48dd19..236a8a881e8 100644
--- a/src/mame/drivers/karnov.cpp
+++ b/src/mame/drivers/karnov.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Bryan McPhail
+// copyright-holders:Bryan McPhail, Dirk Best
/***************************************************************************
Karnov (USA version) (c) 1987 Data East USA
@@ -85,6 +85,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
+#include "machine/input_merger.h"
#include "sound/2203intf.h"
#include "sound/3526intf.h"
#include "sound/3812intf.h"
@@ -98,36 +99,79 @@ Stephh's notes (based on the games M68000 code and some tests) :
*
*************************************/
-// i8031 bootleg emulation
-
-void karnov_state::chelnovjbl_mcu_map(address_map &map)
+void karnov_state::mcu_coin_irq(int state)
{
- map(0x0000, 0x1fff).rom();
-}
+ if (state && !m_coin_state)
+ m_mcu->set_input_line(MCS51_INT0_LINE, ASSERT_LINE);
-void karnov_state::chelnovjbl_mcu_io_map(address_map &map)
-{
- map.global_mask(0xff);
- map(0x00, 0x00).rw(FUNC(karnov_state::mcu_data_l_r), FUNC(karnov_state::mcu_data_l_w));
- map(0x01, 0x01).rw(FUNC(karnov_state::mcu_data_h_r), FUNC(karnov_state::mcu_data_h_w));
+ m_coin_state = bool(state);
}
-void karnov_state::chelnovjbl_mcu_ack_w(uint16_t data)
+void karnov_state::mcu_ack_w(uint16_t data)
{
m_maincpu->set_input_line(6, CLEAR_LINE);
}
-uint16_t karnov_state::chelnovjbl_mcu_r()
+uint16_t karnov_state::mcu_r()
{
return m_mcu_to_maincpu;
}
-void karnov_state::chelnovjbl_mcu_w(uint16_t data)
+void karnov_state::mcu_w(uint16_t data)
{
m_maincpu_to_mcu = data;
m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE);
}
+void karnov_state::mcu_p2_w(uint8_t data)
+{
+ // 7------- output latch 9k (d8-d15)
+ // -6------ output latch 11k (d0-d7)
+ // --5----- input latch 10k (d8-d15)
+ // ---4---- input latch 12k (d0-d7)
+ // ----3--- unused
+ // -----2-- secirq to maincpu
+ // ------1- secreq ack
+ // -------0 cinclr
+
+ if (BIT(m_mcu_p2, 0) == 1 && BIT(data, 0) == 0)
+ m_mcu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE);
+
+ if (BIT(m_mcu_p2, 1) == 1 && BIT(data, 1) == 0)
+ m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
+
+ if (BIT(m_mcu_p2, 2) == 1 && BIT(data, 2) == 0)
+ m_maincpu->set_input_line(6, ASSERT_LINE);
+
+ if (BIT(m_mcu_p2, 4) == 1 && BIT(data, 4) == 0)
+ m_mcu_p0 = m_maincpu_to_mcu >> 0;
+
+ if (BIT(m_mcu_p2, 5) == 1 && BIT(data, 5) == 0)
+ m_mcu_p1 = m_maincpu_to_mcu >> 8;
+
+ if (BIT(m_mcu_p2, 6) == 1 && BIT(data, 6) == 0)
+ m_mcu_to_maincpu = (m_mcu_to_maincpu & 0xff00) | (m_mcu_p0 << 0);
+
+ if (BIT(m_mcu_p2, 7) == 1 && BIT(data, 7) == 0)
+ m_mcu_to_maincpu = (m_mcu_to_maincpu & 0x00ff) | (m_mcu_p1 << 8);
+
+ m_mcu_p2 = data;
+}
+
+// i8031 for bootleg emulation
+
+void karnov_state::chelnovjbl_mcu_map(address_map &map)
+{
+ map(0x0000, 0x1fff).rom();
+}
+
+void karnov_state::chelnovjbl_mcu_io_map(address_map &map)
+{
+ map.global_mask(0xff);
+ map(0x00, 0x00).rw(FUNC(karnov_state::mcu_data_l_r), FUNC(karnov_state::mcu_data_l_w));
+ map(0x01, 0x01).rw(FUNC(karnov_state::mcu_data_h_r), FUNC(karnov_state::mcu_data_h_w));
+}
+
uint8_t karnov_state::mcu_data_l_r()
{
return m_maincpu_to_mcu >> 0;
@@ -148,7 +192,7 @@ void karnov_state::mcu_data_h_w(uint8_t data)
m_mcu_to_maincpu = (m_mcu_to_maincpu & 0x00ff) | (data << 8);
}
-void karnov_state::mcu_p1_w(uint8_t data)
+void karnov_state::mcubl_p1_w(uint8_t data)
{
if (BIT(m_mcu_p1, 0) == 1 && BIT(data, 0) == 0)
m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
@@ -159,7 +203,7 @@ void karnov_state::mcu_p1_w(uint8_t data)
m_mcu_p1 = data;
}
-// end of i8031 emulation
+// mcu simulation below
/* Emulation of the protected microcontroller - for coins & general protection */
void karnov_state::karnov_i8751_w( int data )
@@ -257,140 +301,6 @@ void karnov_state::wndrplnt_i8751_w( int data )
m_i8751_needs_ack = 1;
}
-void karnov_state::chelnov_i8751_w( int data )
-{
- /* Pending coin operations may cause protection commands to be queued */
- if (m_i8751_needs_ack)
- {
- m_i8751_command_queue = data;
- return;
- }
-
- m_i8751_return = 0;
-
- if (data == 0x200 && m_microcontroller_id == CHELNOV) /* World version */
- m_i8751_return = 0x7736;
-
- if (data == 0x200 && m_microcontroller_id == CHELNOVU) /* USA version */
- m_i8751_return = 0x783e;
-
- if (data == 0x200 && m_microcontroller_id == CHELNOVJ) /* Japan version */
- m_i8751_return = 0x7734;
-
- if (data == 0x100 && m_microcontroller_id == CHELNOV) /* World version */
- m_i8751_return = 0x71c;
-
- if (data == 0x100 && m_microcontroller_id == CHELNOVU) /* USA version */
- m_i8751_return = 0x71b;
-
- if (data == 0x100 && m_microcontroller_id == CHELNOVJ) /* Japan version */
- m_i8751_return = 0x71a;
-
- if ((data & 0xe000) == 0x6000) {
- if (data & 0x1000) {
- m_i8751_return = ((data & 0x0f) + ((data >> 4) & 0x0f)) * ((data >> 8) & 0x0f);
- } else {
- m_i8751_return = (data & 0x0f) * (((data >> 8) & 0x0f) + ((data >> 4) & 0x0f));
- }
- }
-
- if ((data & 0xf000) == 0x1000) m_i8751_level = 1; /* Level 1 */
- if ((data & 0xf000) == 0x2000) m_i8751_level++; /* Level Increment */
-
- if ((data & 0xf000) == 0x3000)
- {
- /* Sprite table mapping */
- int b = data & 0xff;
- switch (m_i8751_level)
- {
- case 1: /* Level 1, Sprite mapping tables */
- if (m_microcontroller_id == CHELNOVU) /* USA */
- {
- if (b < 2) m_i8751_return = 0;
- else if (b < 6) m_i8751_return = 1;
- else if (b < 0xb) m_i8751_return = 2;
- else if (b < 0xf) m_i8751_return = 3;
- else if (b < 0x13) m_i8751_return = 4;
- else m_i8751_return = 5;
- }
- else /* Japan, World */
- {
- if (b < 3) m_i8751_return = 0;
- else if (b < 8) m_i8751_return = 1;
- else if (b < 0xc) m_i8751_return = 2;
- else if (b < 0x10) m_i8751_return = 3;
- else if (b < 0x19) m_i8751_return = 4;
- else if (b < 0x1b) m_i8751_return = 5;
- else if (b < 0x22) m_i8751_return = 6;
- else if (b < 0x28) m_i8751_return = 7;
- else m_i8751_return = 8;
- }
- break;
- case 2: /* Level 2, Sprite mapping tables, all sets are the same */
- if (b < 3) m_i8751_return = 0;
- else if (b < 9) m_i8751_return = 1;
- else if (b < 0x11) m_i8751_return = 2;
- else if (b < 0x1b) m_i8751_return = 3;
- else if (b < 0x21) m_i8751_return = 4;
- else if (b < 0x28) m_i8751_return = 5;
- else m_i8751_return = 6;
- break;
- case 3: /* Level 3, Sprite mapping tables, all sets are the same */
- if (b < 5) m_i8751_return = 0;
- else if (b < 9) m_i8751_return = 1;
- else if (b < 0xd) m_i8751_return = 2;
- else if (b < 0x11) m_i8751_return = 3;
- else if (b < 0x1b) m_i8751_return = 4;
- else if (b < 0x1c) m_i8751_return = 5;
- else if (b < 0x22) m_i8751_return = 6;
- else if (b < 0x27) m_i8751_return = 7;
- else m_i8751_return = 8;
- break;
- case 4: /* Level 4, Sprite mapping tables, all sets are the same */
- if (b < 4) m_i8751_return = 0;
- else if (b < 0xc) m_i8751_return = 1;
- else if (b < 0xf) m_i8751_return = 2;
- else if (b < 0x19) m_i8751_return = 3;
- else if (b < 0x1c) m_i8751_return = 4;
- else if (b < 0x22) m_i8751_return = 5;
- else if (b < 0x29) m_i8751_return = 6;
- else m_i8751_return = 7;
- break;
- case 5: /* Level 5, Sprite mapping tables, all sets are the same */
- if (b < 7) m_i8751_return = 0;
- else if (b < 0xe) m_i8751_return = 1;
- else if (b < 0x14) m_i8751_return = 2;
- else if (b < 0x1a) m_i8751_return = 3;
- else if (b < 0x23) m_i8751_return = 4;
- else if (b < 0x27) m_i8751_return = 5;
- else m_i8751_return = 6;
- break;
- case 6: /* Level 6, Sprite mapping tables, all sets are the same */
- if (b < 3) m_i8751_return = 0;
- else if (b < 0xb) m_i8751_return = 1;
- else if (b < 0x11) m_i8751_return = 2;
- else if (b < 0x17) m_i8751_return = 3;
- else if (b < 0x1d) m_i8751_return = 4;
- else if (b < 0x24) m_i8751_return = 5;
- else m_i8751_return = 6;
- break;
- case 7: /* Level 7, Sprite mapping tables, all sets are the same */
- if (b < 5) m_i8751_return = 0;
- else if (b < 0xb) m_i8751_return = 1;
- else if (b < 0x11) m_i8751_return = 2;
- else if (b < 0x1a) m_i8751_return = 3;
- else if (b < 0x21) m_i8751_return = 4;
- else if (b < 0x27) m_i8751_return = 5;
- else m_i8751_return = 6;
- break;
- }
- }
-
- // logerror("%s - Unknown Write %02x intel\n", machine().describe_context(), data);
-
- m_maincpu->set_input_line(6, HOLD_LINE); /* Signal main cpu task is complete */
- m_i8751_needs_ack = 1;
-}
/*************************************
*
@@ -398,7 +308,7 @@ void karnov_state::chelnov_i8751_w( int data )
*
*************************************/
-WRITE16_MEMBER(karnov_state::mcu_ack_w)
+WRITE16_MEMBER(karnov_state::mcusim_ack_w)
{
m_maincpu->set_input_line(6, CLEAR_LINE);
@@ -415,7 +325,7 @@ WRITE16_MEMBER(karnov_state::mcu_ack_w)
{
/* Pending control command - just write it back as SECREQ */
m_i8751_needs_ack = 0;
- mcu_w(m_i8751_command_queue);
+ mcusim_w(m_i8751_command_queue);
m_i8751_command_queue = 0;
}
else
@@ -425,22 +335,20 @@ WRITE16_MEMBER(karnov_state::mcu_ack_w)
}
}
-u16 karnov_state::mcu_r()
+u16 karnov_state::mcusim_r()
{
return m_i8751_return;
}
-void karnov_state::mcu_w(u16 data)
+void karnov_state::mcusim_w(u16 data)
{
if (m_microcontroller_id == KARNOV || m_microcontroller_id == KARNOVJ)
karnov_i8751_w(data);
- if (m_microcontroller_id == CHELNOV || m_microcontroller_id == CHELNOVU || m_microcontroller_id == CHELNOVJ)
- chelnov_i8751_w(data);
if (m_microcontroller_id == WNDRPLNT)
wndrplnt_i8751_w(data);
}
-WRITE16_MEMBER(karnov_state::mcu_reset_w)
+WRITE16_MEMBER(karnov_state::mcusim_reset_w)
{
logerror("Reset i8751\n");
m_i8751_needs_ack = 0;
@@ -454,6 +362,7 @@ WRITE16_MEMBER(karnov_state::vint_ack_w)
m_maincpu->set_input_line(7, CLEAR_LINE);
}
+
/*************************************
*
* Address maps
@@ -470,21 +379,21 @@ void karnov_state::karnov_map(address_map &map)
map(0x0a1000, 0x0a17ff).w(FUNC(karnov_state::playfield_w)).share("pf_data");
map(0x0a1800, 0x0a1fff).lw16("pf_col_w", [this](offs_t offset, u16 data, u16 mem_mask)
{ playfield_w(((offset & 0x1f) << 5) | ((offset & 0x3e0) >> 5), data, mem_mask); });
- map(0x0c0000, 0x0c0001).portr("P1_P2").w(FUNC(karnov_state::mcu_ack_w));
+ map(0x0c0000, 0x0c0001).portr("P1_P2").w(FUNC(karnov_state::mcusim_ack_w));
map(0x0c0002, 0x0c0003).portr("SYSTEM");
map(0x0c0003, 0x0c0003).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x0c0004, 0x0c0005).portr("DSW").w(m_spriteram, FUNC(buffered_spriteram16_device::write));
- map(0x0c0006, 0x0c0007).rw(FUNC(karnov_state::mcu_r), FUNC(karnov_state::mcu_w));
+ map(0x0c0006, 0x0c0007).rw(FUNC(karnov_state::mcusim_r), FUNC(karnov_state::mcusim_w));
map(0x0c0008, 0x0c000b).writeonly().share("scroll");
- map(0x0c000c, 0x0c000d).w(FUNC(karnov_state::mcu_reset_w));
+ map(0x0c000c, 0x0c000d).w(FUNC(karnov_state::mcusim_reset_w));
map(0x0c000e, 0x0c000f).w(FUNC(karnov_state::vint_ack_w));
}
-void karnov_state::chelnovjbl_map(address_map &map)
+void karnov_state::chelnov_map(address_map &map)
{
karnov_map(map);
- map(0x0c0000, 0x0c0001).portr("P1_P2").w(FUNC(karnov_state::chelnovjbl_mcu_ack_w));
- map(0x0c0006, 0x0c0007).rw(FUNC(karnov_state::chelnovjbl_mcu_r), FUNC(karnov_state::chelnovjbl_mcu_w));
+ map(0x0c0000, 0x0c0001).portr("P1_P2").w(FUNC(karnov_state::mcu_ack_w));
+ map(0x0c0006, 0x0c0007).rw(FUNC(karnov_state::mcu_r), FUNC(karnov_state::mcu_w));
map(0x0c000c, 0x0c000d).unmaprw();
map(0x0c000e, 0x0c000f).nopr();
}
@@ -547,7 +456,6 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
-
/* verified from M68000 code */
static INPUT_PORTS_START( karnov )
PORT_INCLUDE( common )
@@ -654,15 +562,15 @@ static INPUT_PORTS_START( wndrplnt )
PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) /* see notes */
INPUT_PORTS_END
-
/* verified from M68000 code */
static INPUT_PORTS_START( chelnov )
PORT_INCLUDE( common )
- PORT_START("COIN") /* Dummy input for i8751 */
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
+ PORT_START("COIN")
+ PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_WRITE_LINE_DEVICE_MEMBER("coin", input_merger_device, in_w<0>)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_WRITE_LINE_DEVICE_MEMBER("coin", input_merger_device, in_w<1>)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_WRITE_LINE_DEVICE_MEMBER("coin", input_merger_device, in_w<2>)
PORT_START("DSW")
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
@@ -731,6 +639,17 @@ static INPUT_PORTS_START( chelnovu )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
INPUT_PORTS_END
+static INPUT_PORTS_START( chelnovjbl )
+ PORT_INCLUDE(chelnovj)
+
+ // no interrupt on coin input here
+ PORT_MODIFY("COIN")
+ PORT_BIT(0x1f, IP_ACTIVE_LOW, IPT_UNUSED)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_COIN1)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_COIN2)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE1)
+INPUT_PORTS_END
+
/*************************************
*
@@ -774,7 +693,7 @@ GFXDECODE_END
*
*************************************/
-WRITE_LINE_MEMBER(karnov_state::vbint_w)
+WRITE_LINE_MEMBER(karnov_state::mcusim_vbint_w)
{
if (!state)
return;
@@ -805,7 +724,7 @@ WRITE_LINE_MEMBER(karnov_state::vbint_w)
m_maincpu->set_input_line(7, ASSERT_LINE);
}
-void karnov_state::chelnovjbl_vbint_w(int state)
+void karnov_state::vbint_w(int state)
{
m_maincpu->set_input_line(7, ASSERT_LINE);
}
@@ -823,11 +742,13 @@ void karnov_state::machine_start()
save_item(NAME(m_i8751_needs_ack));
save_item(NAME(m_i8751_coin_pending));
save_item(NAME(m_i8751_command_queue));
- save_item(NAME(m_i8751_level));
save_item(NAME(m_latch));
+ save_item(NAME(m_mcu_p0));
save_item(NAME(m_mcu_p1));
+ save_item(NAME(m_mcu_p2));
save_item(NAME(m_mcu_to_maincpu));
save_item(NAME(m_maincpu_to_mcu));
+ save_item(NAME(m_coin_state));
}
void karnov_state::machine_reset()
@@ -838,7 +759,6 @@ void karnov_state::machine_reset()
m_i8751_needs_ack = 0;
m_i8751_coin_pending = 0;
m_i8751_command_queue = 0;
- m_i8751_level = 0;
// m_latch = 0;
m_scroll[0] = 0;
@@ -865,7 +785,7 @@ void karnov_state::karnov(machine_config &config)
m_screen->set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
m_screen->set_screen_update(FUNC(karnov_state::screen_update));
m_screen->set_palette(m_palette);
- m_screen->screen_vblank().set(FUNC(karnov_state::vbint_w));
+ m_screen->screen_vblank().set(FUNC(karnov_state::mcusim_vbint_w));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_karnov);
DECO_RMC3(config, m_palette, 0, 1024); // xxxxBBBBGGGGRRRR with custom weighting
@@ -904,18 +824,36 @@ void karnov_state::karnovjbl(machine_config &config)
ym2.add_route(ALL_OUTPUTS, "mono", 1.0);
}
+void karnov_state::chelnov(machine_config &config)
+{
+ karnov(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &karnov_state::chelnov_map);
+
+ I8751(config, m_mcu, 8_MHz_XTAL); // unknown clock
+ m_mcu->port_in_cb<0>().set([this](){ return m_mcu_p0; });
+ m_mcu->port_out_cb<0>().set([this](u8 data){ m_mcu_p0 = data; });
+ m_mcu->port_in_cb<1>().set([this](){ return m_mcu_p1; });
+ m_mcu->port_out_cb<1>().set([this](u8 data){ m_mcu_p1 = data; });
+ m_mcu->port_out_cb<2>().set(FUNC(karnov_state::mcu_p2_w));
+ m_mcu->port_in_cb<3>().set_ioport("COIN");
+
+ INPUT_MERGER_ANY_LOW(config, "coin").output_handler().set(FUNC(karnov_state::mcu_coin_irq));
+
+ m_screen->screen_vblank().set(FUNC(karnov_state::vbint_w));
+}
+
void karnov_state::chelnovjbl(machine_config &config)
{
karnov(config);
- m_maincpu->set_addrmap(AS_PROGRAM, &karnov_state::chelnovjbl_map);
+ m_maincpu->set_addrmap(AS_PROGRAM, &karnov_state::chelnov_map);
I8031(config, m_mcu, 8_MHz_XTAL); // unknown clock
m_mcu->set_addrmap(AS_PROGRAM, &karnov_state::chelnovjbl_mcu_map);
m_mcu->set_addrmap(AS_IO, &karnov_state::chelnovjbl_mcu_io_map);
- m_mcu->port_out_cb<1>().set(FUNC(karnov_state::mcu_p1_w));
+ m_mcu->port_out_cb<1>().set(FUNC(karnov_state::mcubl_p1_w));
m_mcu->port_in_cb<3>().set_ioport("COIN");
- m_screen->screen_vblank().set(FUNC(karnov_state::chelnovjbl_vbint_w));
+ m_screen->screen_vblank().set(FUNC(karnov_state::vbint_w));
}
void karnov_state::wndrplnt(machine_config &config)
@@ -1183,7 +1121,7 @@ ROM_START( chelnov )
ROM_LOAD( "ee05-.f3", 0x8000, 0x8000, CRC(6a8936b4) SHA1(2b72cb749e6bddb67c2bd3d27b3a92511f9ef016) )
ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 MCU */
- ROM_LOAD( "ee-e.k13", 0x0000, 0x1000, NO_DUMP )
+ ROM_LOAD( "ee-e.14k", 0x0000, 0x1000, CRC(b7045395) SHA1(a873de0978cbd169b481ee4c4512e47e7745df77) )
ROM_REGION( 0x08000, "gfx1", 0 )
ROM_LOAD( "ee00-e.c5", 0x00000, 0x08000, CRC(e06e5c6b) SHA1(70166257da5be428cb8404d8e1063c59c7722365) ) /* Characters */
@@ -1217,8 +1155,8 @@ ROM_START( chelnovu )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 6502 Sound CPU */
ROM_LOAD( "ee05-.f3", 0x8000, 0x8000, CRC(6a8936b4) SHA1(2b72cb749e6bddb67c2bd3d27b3a92511f9ef016) )
- ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 MCU */
- ROM_LOAD( "ee-a.k13", 0x0000, 0x1000, NO_DUMP )
+ ROM_REGION( 0x1000, "mcu", 0 ) // created from the world version, id byte patched, sprite table adjusted, internal checksum hacked
+ ROM_LOAD( "ee-a.14k", 0x0000, 0x1000, BAD_DUMP CRC(15fc8b96) SHA1(44d60fc915cf10ca08a635c3c5fc17439977f498) )
ROM_REGION( 0x08000, "gfx1", 0 )
ROM_LOAD( "ee00-e.c5", 0x00000, 0x08000, CRC(e06e5c6b) SHA1(70166257da5be428cb8404d8e1063c59c7722365) ) /* Characters */
@@ -1252,8 +1190,8 @@ ROM_START( chelnovj ) /* at least 1 PCB found with all labels as 'EPR-EExx' like
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 6502 Sound CPU */
ROM_LOAD( "ee05.f3", 0x8000, 0x8000, CRC(6a8936b4) SHA1(2b72cb749e6bddb67c2bd3d27b3a92511f9ef016) )
- ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 MCU */
- ROM_LOAD( "ee.k13", 0x0000, 0x1000, NO_DUMP )
+ ROM_REGION( 0x1000, "mcu", 0 ) // created from the world version by patching the id byte, internal checksum matches
+ ROM_LOAD( "ee-j.14k", 0x0000, 0x1000, BAD_DUMP CRC(b3dc380c) SHA1(81cc4ded918da9f232481f4e67cf71de814efc48) )
ROM_REGION( 0x08000, "gfx1", 0 )
ROM_LOAD( "ee00.c5", 0x00000, 0x08000, CRC(1abf2c6d) SHA1(86d625ae94cd9ea69e4e613895410640efb175b3) ) /* Characters */
@@ -1368,6 +1306,7 @@ ROM_START( chelnovjbla )
ROM_LOAD( "ee-16.l6", 0x0400, 0x0400, CRC(41816132) SHA1(89a1194bd8bf39f13419df685e489440bdb05676) )
ROM_END
+
/*************************************
*
* Driver initialization
@@ -1392,33 +1331,6 @@ void karnov_state::init_wndrplnt()
m_coin_mask = 0x00;
}
-void karnov_state::init_chelnov()
-{
- uint16_t *RAM = (uint16_t *)memregion("maincpu")->base();
-
- m_microcontroller_id = CHELNOV;
- m_coin_mask = 0xe0;
- RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */
-}
-
-void karnov_state::init_chelnovu()
-{
- uint16_t *RAM = (uint16_t *)memregion("maincpu")->base();
-
- m_microcontroller_id = CHELNOVU;
- m_coin_mask = 0xe0;
- RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */
-}
-
-void karnov_state::init_chelnovj()
-{
- uint16_t *RAM = (uint16_t *)memregion("maincpu")->base();
-
- m_microcontroller_id = CHELNOVJ;
- m_coin_mask = 0xe0;
- RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */
-}
-
/*************************************
*
@@ -1426,13 +1338,13 @@ void karnov_state::init_chelnovj()
*
*************************************/
-GAME( 1987, karnov, 0, karnov, karnov, karnov_state, init_karnov, ROT0, "Data East USA", "Karnov (US, rev 6)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, karnova, karnov, karnov, karnov, karnov_state, init_karnov, ROT0, "Data East USA", "Karnov (US, rev 5)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, karnovj, karnov, karnov, karnov, karnov_state, init_karnovj, ROT0, "Data East Corporation", "Karnov (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, karnovjbl, karnov, karnovjbl, karnov, karnov_state, init_karnovj, ROT0, "bootleg (K. J. Corporation)", "Karnov (Japan, bootleg with NEC D8748HD)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
-GAME( 1987, wndrplnt, 0, wndrplnt, wndrplnt, karnov_state, init_wndrplnt, ROT270, "Data East Corporation", "Wonder Planet (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, chelnov, 0, karnov, chelnov, karnov_state, init_chelnov, ROT0, "Data East Corporation", "Chelnov - Atomic Runner (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, chelnovu, chelnov, karnov, chelnovu, karnov_state, init_chelnovu, ROT0, "Data East USA", "Chelnov - Atomic Runner (US)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, chelnovj, chelnov, karnov, chelnovj, karnov_state, init_chelnovj, ROT0, "Data East Corporation", "Chelnov - Atomic Runner (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, chelnovjbl, chelnov, chelnovjbl, chelnovj, karnov_state, empty_init, ROT0, "bootleg", "Chelnov - Atomic Runner (Japan, bootleg with I8031, set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, chelnovjbla, chelnov, chelnovjbl, chelnovj, karnov_state, empty_init, ROT0, "bootleg", "Chelnov - Atomic Runner (Japan, bootleg with I8031, set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, karnov, 0, karnov, karnov, karnov_state, init_karnov, ROT0, "Data East USA", "Karnov (US, rev 6)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, karnova, karnov, karnov, karnov, karnov_state, init_karnov, ROT0, "Data East USA", "Karnov (US, rev 5)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, karnovj, karnov, karnov, karnov, karnov_state, init_karnovj, ROT0, "Data East Corporation", "Karnov (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, karnovjbl, karnov, karnovjbl, karnov, karnov_state, init_karnovj, ROT0, "bootleg (K. J. Corporation)", "Karnov (Japan, bootleg with NEC D8748HD)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
+GAME( 1987, wndrplnt, 0, wndrplnt, wndrplnt, karnov_state, init_wndrplnt, ROT270, "Data East Corporation", "Wonder Planet (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, chelnov, 0, chelnov, chelnov, karnov_state, empty_init, ROT0, "Data East Corporation", "Chelnov - Atomic Runner (World)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, chelnovu, chelnov, chelnov, chelnovu, karnov_state, empty_init, ROT0, "Data East USA", "Chelnov - Atomic Runner (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, chelnovj, chelnov, chelnov, chelnovj, karnov_state, empty_init, ROT0, "Data East Corporation", "Chelnov - Atomic Runner (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, chelnovjbl, chelnov, chelnovjbl, chelnovjbl, karnov_state, empty_init, ROT0, "bootleg", "Chelnov - Atomic Runner (Japan, bootleg with I8031, set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, chelnovjbla, chelnov, chelnovjbl, chelnovjbl, karnov_state, empty_init, ROT0, "bootleg", "Chelnov - Atomic Runner (Japan, bootleg with I8031, set 2)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp
index 69b198b2b00..fd03c272bff 100644
--- a/src/mame/drivers/kinst.cpp
+++ b/src/mame/drivers/kinst.cpp
@@ -354,7 +354,7 @@ void kinst_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(0, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in kinst_state::device_timer");
+ throw emu_fatalerror("Unknown id in kinst_state::device_timer");
}
}
diff --git a/src/mame/drivers/konamim2.cpp b/src/mame/drivers/konamim2.cpp
index 983b8c02992..22c7fd35708 100644
--- a/src/mame/drivers/konamim2.cpp
+++ b/src/mame/drivers/konamim2.cpp
@@ -688,12 +688,8 @@ void konamim2_state::machine_start()
m_ppc1->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
m_ppc2->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
- // Breakpoints don't work with fast RAM
- if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
- {
- m_ppc1->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr());
- m_ppc2->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr());
- }
+ m_ppc1->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr());
+ m_ppc2->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr());
m_available_cdroms = cdrom_open(machine().rom_load().get_disk_handle(":cdrom"));
diff --git a/src/mame/drivers/laserbat.cpp b/src/mame/drivers/laserbat.cpp
index e0ae530cfe0..ecf2b427351 100644
--- a/src/mame/drivers/laserbat.cpp
+++ b/src/mame/drivers/laserbat.cpp
@@ -457,7 +457,7 @@ void laserbat_state_base::device_timer(emu_timer &timer, device_timer_id id, int
video_line(ptr, param);
break;
default:
- assert_always(false, "Unknown id in laserbat_state_base::device_timer");
+ throw emu_fatalerror("Unknown id in laserbat_state_base::device_timer");
}
}
diff --git a/src/mame/drivers/laz_aftrshok.cpp b/src/mame/drivers/laz_aftrshok.cpp
index 954f203c6de..3e8bdb68ed9 100644
--- a/src/mame/drivers/laz_aftrshok.cpp
+++ b/src/mame/drivers/laz_aftrshok.cpp
@@ -26,6 +26,7 @@ full instructions available from Lazer-Tron aka Arcade Planet
a video of this in action can be seen at
https://www.youtube.com/watch?v=9DIhuOEVwf4
+Spin to Win runs on the same hardware.
*/
@@ -63,7 +64,7 @@ private:
};
static INPUT_PORTS_START( aftrshok )
- PORT_START("IN0")
+ PORT_START("INPUTS1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
@@ -73,7 +74,7 @@ static INPUT_PORTS_START( aftrshok )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_START("IN1")
+ PORT_START("INPUTS2")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
@@ -83,35 +84,88 @@ static INPUT_PORTS_START( aftrshok )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_START("IN2")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
-
- PORT_START("IN3")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
-
- PORT_START("IN4")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_START("INPUTS3")
+ PORT_DIPNAME(0x01, 0x01, "Coin Insertion Vibration Delay") PORT_DIPLOCATION("S2:1")
+ PORT_DIPSETTING(0x00, "100 msec")
+ PORT_DIPSETTING(0x01, "160 msec")
+ PORT_DIPNAME(0x02, 0x02, DEF_STR(Unused)) PORT_DIPLOCATION("S2:2")
+ PORT_DIPSETTING(0x02, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x04, 0x04, DEF_STR(Demo_Sounds)) PORT_DIPLOCATION("S2:3")
+ PORT_DIPSETTING(0x00, DEF_STR(Off))
+ PORT_DIPSETTING(0x04, DEF_STR(On))
+ PORT_DIPNAME(0x08, 0x08, "Progressive Ticket Payout") PORT_DIPLOCATION("S2:4")
+ PORT_DIPSETTING(0x08, "Manual")
+ PORT_DIPSETTING(0x00, "Automatic")
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unused)) PORT_DIPLOCATION("S2:5")
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, "Ticket Payout Sound") PORT_DIPLOCATION("S2:6")
+ PORT_DIPSETTING(0x00, "Short Bell at Start")
+ PORT_DIPSETTING(0x20, "Continuous")
+ PORT_DIPNAME(0x40, 0x40, "Payout Tickets") PORT_DIPLOCATION("S2:7")
+ PORT_DIPSETTING(0x00, DEF_STR(Off))
+ PORT_DIPSETTING(0x40, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unused)) PORT_DIPLOCATION("S2:8")
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+
+ PORT_START("INPUTS4")
+ PORT_DIPNAME(0x01, 0x01, "Vibrator Motor Test") PORT_DIPLOCATION("S3:1")
+ PORT_DIPSETTING(0x01, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x02, 0x02, "Pyramid Vibration Boost") PORT_DIPLOCATION("S3:2")
+ PORT_DIPSETTING(0x02, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x04, 0x04, DEF_STR(Unused)) PORT_DIPLOCATION("S3:3")
+ PORT_DIPSETTING(0x04, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x08, 0x08, DEF_STR(Unused)) PORT_DIPLOCATION("S3:4")
+ PORT_DIPSETTING(0x08, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:1")
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:2")
+ PORT_DIPSETTING(0x20, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:3")
+ PORT_DIPSETTING(0x40, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:4")
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+
+ PORT_START("INPUTS5")
+ PORT_DIPNAME(0x0f, 0x0f, "Playfield Vibration Level") PORT_DIPLOCATION("S5:1,2,3,4")
+ PORT_DIPSETTING(0x0f, "1")
+ PORT_DIPSETTING(0x0e, "2")
+ PORT_DIPSETTING(0x0d, "3")
+ PORT_DIPSETTING(0x0c, "4")
+ PORT_DIPSETTING(0x0b, "5")
+ PORT_DIPSETTING(0x0a, "6")
+ PORT_DIPSETTING(0x09, "7")
+ PORT_DIPSETTING(0x08, "8")
+ PORT_DIPSETTING(0x07, "9")
+ PORT_DIPSETTING(0x06, "10")
+ PORT_DIPSETTING(0x05, "11")
+ PORT_DIPSETTING(0x04, "12")
+ PORT_DIPSETTING(0x03, "13")
+ PORT_DIPSETTING(0x02, "14")
+ PORT_DIPSETTING(0x01, "15")
+ PORT_DIPSETTING(0x00, "16")
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:1") // "Lazer-Tron Use Only"
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:2") // "Lazer-Tron Use Only"
+ PORT_DIPSETTING(0x20, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:3") // "Lazer-Tron Use Only"
+ PORT_DIPSETTING(0x40, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:4") // "Lazer-Tron Use Only"
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
INPUT_PORTS_END
@@ -150,11 +204,11 @@ void aftrshok_state::ext_map(address_map &map)
map(0x1800, 0x1800).nopw();
map(0x2000, 0x2000).nopw();
map(0x2800, 0x2800).nopw();
- map(0x4000, 0x4000).portr("IN0");
- map(0x4800, 0x4800).portr("IN1");
- map(0x5000, 0x5000).portr("IN2");
- map(0x5800, 0x5800).portr("IN3");
- map(0x6000, 0x6000).portr("IN4");
+ map(0x4000, 0x4000).portr("INPUTS1"); // 74HC541 buffer (U17)
+ map(0x4800, 0x4800).portr("INPUTS2"); // 74HC541 buffer (U18)
+ map(0x5000, 0x5000).portr("INPUTS3"); // 74HC541 buffer (U19)
+ map(0x5800, 0x5800).portr("INPUTS4"); // 74HC541 buffer (U20)
+ map(0x6000, 0x6000).portr("INPUTS5"); // 74HC541 buffer (U21)
map(0x8000, 0x9fff).ram();
}
@@ -197,5 +251,5 @@ ROM_START( aftrshoka )
ROM_END
-GAME( 19??, aftrshok, 0, aftrshok, aftrshok, aftrshok_state, empty_init, ROT0, "Lazer-tron", "After Shock (Lazer-tron, set 1)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )
-GAME( 19??, aftrshoka, aftrshok, aftrshok, aftrshok, aftrshok_state, empty_init, ROT0, "Lazer-tron", "After Shock (Lazer-tron, set 2)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )
+GAME( 19??, aftrshok, 0, aftrshok, aftrshok, aftrshok_state, empty_init, ROT0, "Lazer-Tron", "Aftershock (Lazer-Tron, set 1)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )
+GAME( 19??, aftrshoka, aftrshok, aftrshok, aftrshok, aftrshok_state, empty_init, ROT0, "Lazer-Tron", "Aftershock (Lazer-Tron, set 2)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )
diff --git a/src/mame/drivers/laz_awetoss.cpp b/src/mame/drivers/laz_awetoss.cpp
deleted file mode 100644
index 8f88516353f..00000000000
--- a/src/mame/drivers/laz_awetoss.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:David Haywood
-/*
-
-Awesome tossem u21 = 27c512
- u7 = 27c512 cpu
- u10-u7 and u11-u14 = 27c512 sound board
-
- probably http://www.highwaygames.com/arcade-machines/awesome-toss-em-7115/
-*/
-
-#include "emu.h"
-#include "sound/okim6295.h"
-#include "speaker.h"
-
-
-class awetoss_state : public driver_device
-{
-public:
- awetoss_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag)
- // ,m_maincpu(*this, "maincpu")
- { }
-
- void awetoss(machine_config &config);
-
-private:
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
-// required_device<mcs51_cpu_device> m_maincpu;
-};
-
-static INPUT_PORTS_START( awetoss )
-INPUT_PORTS_END
-
-
-
-void awetoss_state::machine_start()
-{
-}
-
-void awetoss_state::machine_reset()
-{
-}
-
-
-void awetoss_state::awetoss(machine_config &config)
-{
- /* basic machine hardware */
-// ??_device &maincpu(??(config, "maincpu", 8000000)); // unknown
-// maincpu.set_addrmap(AS_PROGRAM, &awetoss_state::awetoss_map);
-// maincpu.set_addrmap(AS_IO, &awetoss_state::awetoss_io);
-// maincpu.set_vblank_int("screen", FUNC(awetoss_state::irq0_line_hold));
-
- /* sound hardware */
- SPEAKER(config, "mono").front_center();
-
- OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // maybe
-}
-
-
-
-ROM_START( awetoss )
- // based on the IC positions differing I don't think this is 2 different sets?
- // both program roms look similar tho
- ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "awsmtoss.u7", 0x00000, 0x10000, CRC(2c48469c) SHA1(5ccca03d6b9cbcaddd73c8a95425f55d9e6af238) )
-
- ROM_REGION( 0xc0000, "oki", 0 )
- ROM_LOAD( "awsmtoss.u10", 0x00000, 0x10000, CRC(84c8a6b9) SHA1(26dc8c0f2098c9b0ef0e06e5dd69c897a9af69a2) )
- ROM_LOAD( "awsmtoss.u9s", 0x10000, 0x10000, CRC(5c7bbbd9) SHA1(89713058d03f982647217e4c6cbe37969f2537a5) )
- ROM_LOAD( "awsmtoss.u8s", 0x20000, 0x10000, CRC(9852e0bd) SHA1(930cca65e3f7774334dd0513a261f874f94886ac) )
- ROM_LOAD( "awsmtoss.u7s", 0x30000, 0x10000, CRC(32fa11f5) SHA1(70914eac64f53bcb07c0eb9fcc1b4fbeab2fc453) )
-
- ROM_REGION( 0x10000, "maincpu2", 0 )
- ROM_LOAD( "awsmtoss.u21", 0x00000, 0x10000, CRC(2b66d952) SHA1(b95f019d007cbd1f0325c33ffd1208f2afa6b996) )
-
- ROM_REGION( 0xc0000, "oki2", 0 )
- ROM_LOAD( "awsmtoss.u14", 0x00000, 0x10000, CRC(6217daaf) SHA1(3036e7f941f787374ef130d3ae6d57813d9e9aac) )
- ROM_LOAD( "awsmtoss.u13", 0x10000, 0x10000, CRC(4ed3c827) SHA1(761d2796d4f40deeb2caa61c4a9c56ced156084b) )
- ROM_LOAD( "awsmtoss.u12", 0x20000, 0x10000, CRC(9ddf6dd9) SHA1(c115828ab261ae6d83cb500057313c3a5570b4b0) )
- ROM_LOAD( "awsmtoss.u11", 0x30000, 0x10000, CRC(8ae9d4f0) SHA1(58d1d8972c8e4c9a7c63e9d63e267ea81515d22a) )
-ROM_END
-
-GAME( 19??, awetoss, 0, awetoss, awetoss, awetoss_state, empty_init, ROT0, "Lazer-tron", "Awesome Toss'em (Lazer-tron)", MACHINE_IS_SKELETON_MECHANICAL )
diff --git a/src/mame/drivers/laz_ribrac.cpp b/src/mame/drivers/laz_ribrac.cpp
index 7ef91dff45f..91012fc96a9 100644
--- a/src/mame/drivers/laz_ribrac.cpp
+++ b/src/mame/drivers/laz_ribrac.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:David Haywood
+// copyright-holders:David Haywood,AJR
/*
ribbit racing -- prog rom 27c512 @ u7
@@ -11,55 +11,307 @@ sound rom dumps weren't present even tho mentioned??
this appears to be the operators manual
http://ohwow-arcade.com/Assets/Game_Manuals/RIBBIT%20RACIN.PDF
+
+Awesome tossem u21 = 27c512
+ u7 = 27c512 cpu
+ u10-u7 and u11-u14 = 27c512 sound board
+
+ probably http://www.highwaygames.com/arcade-machines/awesome-toss-em-7115/
+
*/
#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+#include "machine/nvram.h"
#include "sound/okim6295.h"
#include "speaker.h"
-class laz_ribrac_state : public driver_device
+class ribrac_state : public driver_device
{
public:
- laz_ribrac_state(const machine_config &mconfig, device_type type, const char *tag)
+ ribrac_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
- // ,m_maincpu(*this, "maincpu")
+ , m_maincpu(*this, "maincpu")
+ , m_oki(*this, "oki%u", 1U)
+ , m_sound_data(0)
{ }
- void laz_ribrac(machine_config &config);
+ void ribrac(machine_config &config);
private:
virtual void machine_start() override;
- virtual void machine_reset() override;
-// required_device<mcs51_cpu_device> m_maincpu;
+ void sound_data_w(u8 data);
+ void sound_control_w(u8 data);
+ void motor_w(u8 data);
+ void lights_w(u8 data);
+ void bonus_w(u8 data);
+ void led_w(u8 data);
+ void extra_w(u8 data);
+
+ void prog_map(address_map &map);
+ void ext_map(address_map &map);
+
+ required_device<mcs51_cpu_device> m_maincpu;
+ required_device_array<okim6295_device, 2> m_oki;
+
+ u8 m_sound_data;
};
-static INPUT_PORTS_START( laz_ribrac )
-INPUT_PORTS_END
+void ribrac_state::machine_start()
+{
+ save_item(NAME(m_sound_data));
+}
+
+
+void ribrac_state::sound_data_w(u8 data)
+{
+ m_sound_data = data;
+}
+
+void ribrac_state::sound_control_w(u8 data)
+{
+ if (!BIT(data, 0))
+ m_oki[0]->reset();
+ else if (!BIT(data, 1) && !BIT(data, 2))
+ m_oki[0]->write(m_sound_data);
+
+ if (!BIT(data, 3))
+ m_oki[1]->reset();
+ else if (!BIT(data, 4) && !BIT(data, 5))
+ m_oki[1]->write(m_sound_data);
+}
+
+void ribrac_state::motor_w(u8 data)
+{
+}
+
+void ribrac_state::lights_w(u8 data)
+{
+}
+
+void ribrac_state::bonus_w(u8 data)
+{
+}
+
+void ribrac_state::led_w(u8 data)
+{
+}
+
+void ribrac_state::extra_w(u8 data)
+{
+}
-void laz_ribrac_state::machine_start()
+void ribrac_state::prog_map(address_map &map)
{
+ map(0x0000, 0xffff).rom().region("maincpu", 0);
}
-void laz_ribrac_state::machine_reset()
+void ribrac_state::ext_map(address_map &map)
{
+ map(0x0000, 0x0000).mirror(0x700).w(FUNC(ribrac_state::sound_data_w));
+ map(0x0800, 0x0800).w(FUNC(ribrac_state::sound_control_w));
+ map(0x1000, 0x1000).w(FUNC(ribrac_state::motor_w));
+ map(0x1800, 0x1800).w(FUNC(ribrac_state::lights_w));
+ map(0x2000, 0x2000).w(FUNC(ribrac_state::bonus_w));
+ map(0x2800, 0x2800).w(FUNC(ribrac_state::led_w));
+ map(0x3000, 0x3000).w(FUNC(ribrac_state::extra_w));
+ map(0x4000, 0x4000).portr("INPUTS1");
+ map(0x4800, 0x4800).portr("INPUTS2");
+ map(0x5000, 0x5000).portr("INPUTS3");
+ map(0x5800, 0x5800).portr("INPUTS4");
+ map(0x6000, 0x6000).portr("INPUTS5");
+ map(0x8000, 0x9fff).ram().share("nvram");
}
-void laz_ribrac_state::laz_ribrac(machine_config &config)
+static INPUT_PORTS_START( ribrac )
+ PORT_START("INPUTS1")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("INPUTS2")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("INPUTS3")
+ PORT_DIPNAME(0x01, 0x01, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:1")
+ PORT_DIPSETTING(0x01, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x02, 0x02, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:2")
+ PORT_DIPSETTING(0x02, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x04, 0x04, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:3")
+ PORT_DIPSETTING(0x04, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x08, 0x08, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:4")
+ PORT_DIPSETTING(0x08, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:5")
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:6")
+ PORT_DIPSETTING(0x20, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:7")
+ PORT_DIPSETTING(0x40, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:8")
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+
+ PORT_START("INPUTS4")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("INPUTS5")
+ PORT_DIPNAME(0x01, 0x01, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:1")
+ PORT_DIPSETTING(0x01, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x02, 0x02, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:2")
+ PORT_DIPSETTING(0x02, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x04, 0x04, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:3")
+ PORT_DIPSETTING(0x04, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x08, 0x08, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:4")
+ PORT_DIPSETTING(0x08, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:1")
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:2")
+ PORT_DIPSETTING(0x20, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:3")
+ PORT_DIPSETTING(0x40, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:4")
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( awetoss )
+ PORT_START("INPUTS1")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("INPUTS2")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("INPUTS3")
+ PORT_DIPNAME(0x01, 0x01, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:1")
+ PORT_DIPSETTING(0x01, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x02, 0x02, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:2")
+ PORT_DIPSETTING(0x02, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x04, 0x04, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:3")
+ PORT_DIPSETTING(0x04, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x08, 0x08, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:4")
+ PORT_DIPSETTING(0x08, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:5")
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:6")
+ PORT_DIPSETTING(0x20, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:7")
+ PORT_DIPSETTING(0x40, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("SET1:8")
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+
+ PORT_START("INPUTS4")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("INPUTS5")
+ PORT_DIPNAME(0x01, 0x01, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:1")
+ PORT_DIPSETTING(0x01, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x02, 0x02, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:2")
+ PORT_DIPSETTING(0x02, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x04, 0x04, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:3")
+ PORT_DIPSETTING(0x04, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x08, 0x08, DEF_STR(Unknown)) PORT_DIPLOCATION("SET2:4")
+ PORT_DIPSETTING(0x08, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:1")
+ PORT_DIPSETTING(0x10, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:2")
+ PORT_DIPSETTING(0x20, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:3")
+ PORT_DIPSETTING(0x40, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+ PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("SET3:4")
+ PORT_DIPSETTING(0x80, DEF_STR(Off))
+ PORT_DIPSETTING(0x00, DEF_STR(On))
+INPUT_PORTS_END
+
+
+void ribrac_state::ribrac(machine_config &config)
{
- /* basic machine hardware */
-// ??_device &maincpu(??(config, "maincpu", 8000000)); // unknown
-// maincpu.set_addrmap(AS_PROGRAM, &laz_ribrac_state::laz_ribrac_map);
-// maincpu.set_addrmap(AS_IO, &laz_ribrac_state::laz_ribrac_io);
+ I80C31(config, m_maincpu, 12_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ribrac_state::prog_map);
+ m_maincpu->set_addrmap(AS_IO, &ribrac_state::ext_map);
+
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // 6264 + MAX694 + battery
/* sound hardware */
- SPEAKER(config, "mono").front_center();
+ SPEAKER(config, "lspeaker").front_left();
+ SPEAKER(config, "rspeaker").front_right();
+
+ OKIM6295(config, m_oki[0], 2.097152_MHz_XTAL, okim6295_device::PIN7_HIGH);
+ m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
- OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // maybe
+ OKIM6295(config, m_oki[1], 2.097152_MHz_XTAL, okim6295_device::PIN7_HIGH);
+ m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
}
@@ -68,7 +320,7 @@ ROM_START( ribrac )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "ribbitr.u7", 0x00000, 0x10000, CRC(9eb78ca3) SHA1(4fede7bdd30449602a01489dc72dbbd5452d6b5a) )
- ROM_REGION( 0xc0000, "oki", 0 )
+ ROM_REGION( 0xc0000, "oki1", 0 )
ROM_LOAD( "ribbitr_snd.u10", 0x00000, 0x10000, NO_DUMP )
ROM_LOAD( "ribbitr_snd.u9", 0x10000, 0x10000, NO_DUMP )
ROM_LOAD( "ribbitr_snd.u8", 0x20000, 0x10000, NO_DUMP )
@@ -81,4 +333,27 @@ ROM_START( ribrac )
ROM_LOAD( "ribbitr_snd.u11", 0x30000, 0x10000, NO_DUMP )
ROM_END
-GAME( 1993, ribrac, 0, laz_ribrac, laz_ribrac, laz_ribrac_state, empty_init, ROT0, "Lazer-tron", "Ribbit Racing (Lazer-tron)", MACHINE_IS_SKELETON_MECHANICAL )
+ROM_START( awetoss )
+ // based on the IC positions differing I don't think this is 2 different sets?
+ // both program roms look similar tho
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "awsmtoss.u7", 0x00000, 0x10000, CRC(2c48469c) SHA1(5ccca03d6b9cbcaddd73c8a95425f55d9e6af238) )
+
+ ROM_REGION( 0xc0000, "oki1", 0 )
+ ROM_LOAD( "awsmtoss.u10", 0x00000, 0x10000, CRC(84c8a6b9) SHA1(26dc8c0f2098c9b0ef0e06e5dd69c897a9af69a2) )
+ ROM_LOAD( "awsmtoss.u9s", 0x10000, 0x10000, CRC(5c7bbbd9) SHA1(89713058d03f982647217e4c6cbe37969f2537a5) )
+ ROM_LOAD( "awsmtoss.u8s", 0x20000, 0x10000, CRC(9852e0bd) SHA1(930cca65e3f7774334dd0513a261f874f94886ac) )
+ ROM_LOAD( "awsmtoss.u7s", 0x30000, 0x10000, CRC(32fa11f5) SHA1(70914eac64f53bcb07c0eb9fcc1b4fbeab2fc453) )
+
+ ROM_REGION( 0x10000, "maincpu2", 0 )
+ ROM_LOAD( "awsmtoss.u21", 0x00000, 0x10000, CRC(2b66d952) SHA1(b95f019d007cbd1f0325c33ffd1208f2afa6b996) )
+
+ ROM_REGION( 0xc0000, "oki2", 0 )
+ ROM_LOAD( "awsmtoss.u14", 0x00000, 0x10000, CRC(6217daaf) SHA1(3036e7f941f787374ef130d3ae6d57813d9e9aac) )
+ ROM_LOAD( "awsmtoss.u13", 0x10000, 0x10000, CRC(4ed3c827) SHA1(761d2796d4f40deeb2caa61c4a9c56ced156084b) )
+ ROM_LOAD( "awsmtoss.u12", 0x20000, 0x10000, CRC(9ddf6dd9) SHA1(c115828ab261ae6d83cb500057313c3a5570b4b0) )
+ ROM_LOAD( "awsmtoss.u11", 0x30000, 0x10000, CRC(8ae9d4f0) SHA1(58d1d8972c8e4c9a7c63e9d63e267ea81515d22a) )
+ROM_END
+
+GAME( 1993, ribrac, 0, ribrac, ribrac, ribrac_state, empty_init, ROT0, "Lazer-Tron", "Ribbit Racin (Lazer-Tron)", MACHINE_IS_SKELETON_MECHANICAL )
+GAME( 19??, awetoss, 0, ribrac, awetoss, ribrac_state, empty_init, ROT0, "Lazer-Tron", "Awesome Toss 'Em (Lazer-Tron)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )
diff --git a/src/mame/drivers/leapfrog_leappad.cpp b/src/mame/drivers/leapfrog_leappad.cpp
index 2a7af785163..59acdb72347 100644
--- a/src/mame/drivers/leapfrog_leappad.cpp
+++ b/src/mame/drivers/leapfrog_leappad.cpp
@@ -28,6 +28,8 @@
#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
@@ -40,6 +42,7 @@ class leapfrog_leappad_state : public driver_device
public:
leapfrog_leappad_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
, m_cart(*this, "cartslot")
, m_cart_region(nullptr)
{ }
@@ -51,8 +54,12 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
+ void prog_map(address_map &map);
+ void ext_map(address_map &map);
+
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
+ required_device<mcs51_cpu_device> m_maincpu;
required_device<generic_slot_device> m_cart;
memory_region *m_cart_region;
};
@@ -73,6 +80,15 @@ void leapfrog_leappad_state::machine_reset()
{
}
+void leapfrog_leappad_state::prog_map(address_map &map)
+{
+ map(0x0000, 0xffff).rom().region("maincpu", 0x10000); // TODO: banking
+}
+
+void leapfrog_leappad_state::ext_map(address_map &map)
+{
+}
+
DEVICE_IMAGE_LOAD_MEMBER(leapfrog_leappad_state::cart_load)
{
uint32_t size = m_cart->common_get_size("rom");
@@ -90,8 +106,9 @@ INPUT_PORTS_END
void leapfrog_leappad_state::leapfrog_leappad(machine_config &config)
{
- //ARCA5(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (doesn't appear to be Arcompact, what is it?)
- //m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::map);
+ I8032(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (which exact type is it?)
+ m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map);
+ m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map);
// screenless
@@ -104,8 +121,9 @@ void leapfrog_leappad_state::leapfrog_leappad(machine_config &config)
void leapfrog_leappad_state::leapfrog_mfleappad(machine_config &config)
{
- //ARCA5(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (doesn't appear to be Arcompact, what is it?)
- //m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::map);
+ I8032(config, m_maincpu, 96000000/10); // LeapPad Leapfrog 05-9-01 FS80A363 (which exact type is it?)
+ m_maincpu->set_addrmap(AS_PROGRAM, &leapfrog_leappad_state::prog_map);
+ m_maincpu->set_addrmap(AS_IO, &leapfrog_leappad_state::ext_map);
// screenless
@@ -114,6 +132,7 @@ void leapfrog_leappad_state::leapfrog_mfleappad(machine_config &config)
m_cart->set_device_load(FUNC(leapfrog_leappad_state::cart_load), this);
SOFTWARE_LIST(config, "cart_list").set_original("leapfrog_mfleappad_cart");
+ SOFTWARE_LIST(config, "cart_list2").set_original("leapfrog_ltleappad_cart");
}
// All of these contain the string "Have you copied our ROM?" near the date codes
diff --git a/src/mame/drivers/m10.cpp b/src/mame/drivers/m10.cpp
index 1ad63866911..e7abdf087f7 100644
--- a/src/mame/drivers/m10.cpp
+++ b/src/mame/drivers/m10.cpp
@@ -488,7 +488,7 @@ void m10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in m10_state::device_timer");
+ throw emu_fatalerror("Unknown id in m10_state::device_timer");
}
}
diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp
index b6da93c812d..ca03f0e3605 100644
--- a/src/mame/drivers/mac.cpp
+++ b/src/mame/drivers/mac.cpp
@@ -1756,10 +1756,10 @@ static INPUT_PORTS_START( macadb )
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_UNUSED) /* keyboard Enter : */
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL)
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Command / Open Apple") PORT_CODE(KEYCODE_LALT)
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Command / Open Apple") PORT_CODE(KEYCODE_RALT)
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
- PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Option / Solid Apple") PORT_CODE(KEYCODE_RALT)
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Option / Solid Apple") PORT_CODE(KEYCODE_LALT)
PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Arrow") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Arrow") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Down Arrow") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
diff --git a/src/mame/drivers/mac128.cpp b/src/mame/drivers/mac128.cpp
index 46b5094373e..76d0e6c5ca1 100644
--- a/src/mame/drivers/mac128.cpp
+++ b/src/mame/drivers/mac128.cpp
@@ -1508,7 +1508,7 @@ static INPUT_PORTS_START( macplus )
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_UNUSED) /* keyboard Enter : */
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_UNUSED) /* escape: */
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_UNUSED) /* ??? */
- PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Command") PORT_CODE(KEYCODE_LCONTROL)
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Command") PORT_CODE(KEYCODE_RALT)
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Option") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_SHIFT_2)
diff --git a/src/mame/drivers/marineb.cpp b/src/mame/drivers/marineb.cpp
index fe0328c9441..4ed3ad76276 100644
--- a/src/mame/drivers/marineb.cpp
+++ b/src/mame/drivers/marineb.cpp
@@ -129,12 +129,12 @@ static INPUT_PORTS_START( marineb )
PORT_DIPSETTING( 0x03, "6" )
PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4,5") /* coinage doesn't work?? - always 1C / 1C or Free Play?? */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
-// PORT_DIPSETTING( 0x14, DEF_STR( 2C_1C ) ) /* This is the correct Coinage according to manual */
-// PORT_DIPSETTING( 0x18, DEF_STR( 3C_2C ) )
-// PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
-// PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) )
-// PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
-// PORT_DIPSETTING( 0x10, DEF_STR( 1C_6C ) )
+// PORT_DIPSETTING( 0x14, DEF_STR( 2C_1C ) ) /* This is the correct Coinage according to manual */
+// PORT_DIPSETTING( 0x18, DEF_STR( 3C_2C ) )
+// PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
+// PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) )
+// PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
+// PORT_DIPSETTING( 0x10, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x1c, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x00, "20000 50000" )
@@ -178,9 +178,9 @@ static INPUT_PORTS_START( changes )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPSETTING( 0x03, "6" )
PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4") /* coinage doesn't work?? - always 1C / 1C or Free Play?? */
-// PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) /* This is the correct Coinage according to manual */
+// PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) /* This is the correct Coinage according to manual */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
-// PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
+// PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x10, 0x00, "1st Bonus Life" ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x00, "20000" )
diff --git a/src/mame/drivers/mekd2.cpp b/src/mame/drivers/mekd2.cpp
index 242de177330..7810c6bbbfb 100644
--- a/src/mame/drivers/mekd2.cpp
+++ b/src/mame/drivers/mekd2.cpp
@@ -211,7 +211,7 @@ void mekd2_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in mekd2_state::device_timer");
+ throw emu_fatalerror("Unknown id in mekd2_state::device_timer");
}
}
diff --git a/src/mame/drivers/mekd3.cpp b/src/mame/drivers/mekd3.cpp
new file mode 100644
index 00000000000..b1ce2fdd077
--- /dev/null
+++ b/src/mame/drivers/mekd3.cpp
@@ -0,0 +1,1021 @@
+// license:BSD-3-Clause
+// copyright-holders: 68bit
+/******************************************************************************
+
+Motorola Evaluation Kit 6802 D3 - MEK6802D3
+
+Keypad commands:
+
+RS (Reset) - Reset, wired to the CPU reset line
+EX (Escape) - Typically aborts user program, or exits command.
+M - Memory display/change
+ Digits 5 and 6 show the entered data, and are blank unless it differs.
+ Digits 7 and 8 show the actual data at the address.
+ GO - increase the address.
+ M - decreases the address.
+ FS - Offset calculation. Enter address, then press 'GO'.
+ EX - exits memory display.
+RD - Register display/alter
+ RD - advance to next register.
+ T/B - trace a single instruction
+ GO - continue user code.
+ EX - exits register display.
+GO - Go to user program.
+ If no address is entered then it uses the pseudo PC, it continues.
+ Enter the address and press 'Go' to use that entered address.
+ It firstly checks that there is RAM at the stack pointer. ???
+T/B - Trace one instruction.
+FS T/B - Breakpoint editor
+ GO - advance to next breakpoing, up to 8, then loops.
+ FS - insert a breakpoint
+ FC - deactivate breakpoint
+ EX - exits breakpoing editor.
+P/L - Punch tape
+ The 300/1200 baud switch needs to be set, and the same rate selected.
+ FS - Set 300 baud mode, J-BUG compatible.
+ FC - Set 1200 baud mode, has checksum.
+ At the 'b' prompt enter the beginning address of the data, then 'GO'.
+ At the 'E' prompt enter the last address of the data, the 'GO' to
+ start writing to the tape. There is a 30 second leader of $ff.
+ M - Skip to Verify tape.
+FS P/L - Load from tape
+ FS - Set 300 baud mode, J-BUG compatible.
+ FC - Set 1200 baud mode, has checksum.
+ GO - Start load.
+ M - Skip to Verify tape.
+FS 0 to F
+ One of 16 user defined functions. Press FS then one number key 0 to F.
+ A pointer to a table of 16 function addresses should be set at 0x8102.
+FC - Clears the 'FS' flag.
+
+
+ASCII terminal commands:
+B - Breakpoing display, up to eight.
+C - Continue user program
+D - Delete all breakpoints
+E <addr> - Examine a block of memory, with ASCII chars.
+ Carriage Return - exit examine memory.
+G <addr> - Go to the user program at <addr>.
+ Keypad Escape - breaks execution.
+L - Load from audio tape.
+ The 300/1200 baud switch needs to be set, and the same rate selected.
+ The 300 baud rate is J-BUG compatible. The 1200 includes a checksum.
+M <addr> - Memory display at <addr>
+ Linefeed - Advance to next address.
+ M or ^ - Previous address.
+ Space - Redisplay data.
+ Carriage Return - exit memory display.
+ O <addr> - Offset calculation.
+N - Trace one instruction.
+O - Offset load from tape.
+P - Punch tape.
+R - Register display and edit.
+ Space - Advance to next register.
+ Carriage Return - exit register display.
+ <nn> - Change register value.
+S <addr> - Set a breakpoint at the <addr>.
+T <nn> - Trace <nn> instructions.
+U <addr> - Delete the breakpoint at <addr>
+V - Verify tape.
+Ctrl-E - Clear screen.
+! - Execute user function stored in user register 2, aka $816a
+" - Execute user function stored in user register 3, aka $816c
+# - Execute user function stored in user register 4, aka $816e
+
+$FDFD - Remove breakpoints. Documentation suggests assigning this address
+ to a user function when debugging, to clean up breakpoints.
+
+
+TODO
+
+There are references to a MEK6802EA product, probably an Editor Assembler
+that might have been for this system. Perhaps it was ROMable and that might
+be nice to add here.
+
+There was a color graphics evaluation board, the MEK68VDG, using the
+MC6847. It must have had it's own expansion ROM as the D3DUG2 ROM for the
+MEK68R2 is specific to the R2 and has no support for the 6847. This might be
+a nice addition if documentation and/or a ROM can be found.
+
+The RAM paging might need revising.
+
+The ROM support is still TODO.
+
+******************************************************************************/
+
+#include "emu.h"
+#include "cpu/m6800/m6800.h"
+#include "machine/input_merger.h"
+#include "machine/ram.h"
+#include "machine/6821pia.h"
+#include "machine/6850acia.h"
+#include "machine/mc14411.h"
+#include "machine/mc6846.h"
+#include "machine/clock.h"
+#include "machine/timer.h"
+#include "video/pwm.h"
+#include "bus/rs232/rs232.h"
+#include "imagedev/cassette.h"
+#include "sound/wave.h"
+#include "speaker.h"
+#include "mekd3.lh"
+
+// MEK68R2
+#include "machine/terminal.h"
+#include "video/mc6845.h"
+#include "emupal.h"
+#include "screen.h"
+#include "render.h"
+
+#define XTAL_MEKD3 3.579545_MHz_XTAL
+
+class mekd3_state : public driver_device
+{
+public:
+ mekd3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_ram(*this, RAM_TAG)
+ , m_ram_bank(*this, "ram_bank")
+ , m_mainirq(*this, "mainirq")
+ , m_mainnmi(*this, "mainnmi")
+ , m_mc6846(*this, "mc6846")
+ , m_kpd_pia(*this, "kpd_pia")
+ , m_display(*this, "display")
+ , m_keypad_columns(*this, "COL%u", 0)
+ // MEK68IO
+ , m_pia_io1(*this, "pia_io1")
+ , m_pia_io2(*this, "pia_io2")
+ , m_acia_io1(*this, "acia_io1")
+ , m_acia_cas(*this, "acia_cas")
+ , m_brg(*this, "brg")
+ , m_cass(*this, "cassette")
+ , m_tx_rate(*this, "tx_baud")
+ , m_rx_rate(*this, "rx_baud")
+ , m_cas_rate(*this, "cas_rate")
+ // MEK68R2
+ , m_mc6845(*this, "mc6845")
+ , m_palette(*this, "palette")
+ , m_screen(*this, "screen")
+ , m_p_chargen(*this, "chargen")
+ , m_video_ram(*this, "videoram")
+ , m_r2_pia(*this, "r2_pia")
+ , m_r2_mode(*this, "r2_mode")
+ , m_r2_display_nationality(*this, "r2_display_nationality")
+ , m_r2_display_format(*this, "r2_display_format")
+ { }
+
+ void mekd3(machine_config &config);
+ void init_mekd3();
+
+ DECLARE_WRITE_LINE_MEMBER(reset_key_w);
+ DECLARE_INPUT_CHANGED_MEMBER(keypad_changed);
+
+private:
+ DECLARE_READ_LINE_MEMBER(keypad_cb1_r);
+ DECLARE_READ8_MEMBER(keypad_key_r);
+ DECLARE_WRITE8_MEMBER(led_digit_w);
+ DECLARE_WRITE8_MEMBER(led_segment_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(led_update);
+ DECLARE_WRITE8_MEMBER(page_w);
+ DECLARE_WRITE8_MEMBER(trace_timer_w);
+ DECLARE_READ8_MEMBER(trace_timer_r);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+ required_memory_bank m_ram_bank;
+ required_device<input_merger_device> m_mainirq;
+ required_device<input_merger_device> m_mainnmi;
+ required_device<mc6846_device> m_mc6846;
+ required_device<pia6821_device> m_kpd_pia;
+ required_device<pwm_display_device> m_display;
+ required_ioport_array<4> m_keypad_columns;
+
+ uint8_t m_rom_page;
+ uint8_t m_ram_page;
+ uint8_t m_trace;
+ uint8_t m_segment;
+ uint8_t m_digit;
+
+ bool keypad_key_pressed();
+
+ void mekd3_mem(address_map &map);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ // MEK68IO
+
+ // Clocks
+ DECLARE_WRITE_LINE_MEMBER(write_f1_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f2_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f4_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f5_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f7_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f8_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f9_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_f13_clock);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(kansas_r);
+ DECLARE_WRITE_LINE_MEMBER(acia_cas_clock300_w);
+ DECLARE_WRITE_LINE_MEMBER(acia_cas_clock1200_w);
+ DECLARE_READ8_MEMBER(pia_io2a_r);
+
+ required_device<pia6821_device> m_pia_io1;
+ required_device<pia6821_device> m_pia_io2;
+ required_device<acia6850_device> m_acia_io1;
+ required_device<acia6850_device> m_acia_cas;
+ required_device<mc14411_device> m_brg;
+ required_device<cassette_image_device> m_cass;
+ required_ioport m_tx_rate;
+ required_ioport m_rx_rate;
+ required_ioport m_cas_rate;
+ uint8_t m_cass_rx_period, m_cass_txcount;
+ bool m_cass_in, m_cass_inbit, m_cass_txbit, m_cass_last_txbit;
+
+ // MEK68R2
+ MC6845_UPDATE_ROW(update_row);
+ DECLARE_READ8_MEMBER(r2_pia_pa_r);
+ DECLARE_READ8_MEMBER(r2_pia_pb_r);
+ DECLARE_WRITE_LINE_MEMBER(r2_hsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(r2_vsync_changed);
+ DECLARE_READ_LINE_MEMBER(r2_pia_cb1_r);
+ optional_device<mc6845_device> m_mc6845;
+ optional_device<palette_device> m_palette;
+ optional_device<screen_device> m_screen;
+ optional_region_ptr<uint8_t> m_p_chargen;
+ optional_shared_ptr<uint8_t> m_video_ram;
+ optional_device<pia6821_device> m_r2_pia;
+ optional_ioport m_r2_mode;
+ optional_ioport m_r2_display_nationality;
+ optional_ioport m_r2_display_format;
+ void kbd_put(uint8_t data);
+ uint8_t m_term_data;
+ bool m_r2_vsync;
+};
+
+
+
+/***********************************************************
+
+ Address Map
+
+************************************************************/
+
+void mekd3_state::mekd3_mem(address_map &map)
+{
+ // User RAM banks
+ map(0x0000, 0x7fff).bankrw("ram_bank");
+
+ // MEK68IO User PIA
+ map(0x8000, 0x8003).rw(m_pia_io1, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
+ // MEK68IO D3BUG cassette PIA
+ map(0x8004, 0x8007).rw(m_pia_io2, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
+
+ // MEK68IO RS232 ACIA
+ map(0x8008, 0x8009).rw(m_acia_io1, FUNC(acia6850_device::read), FUNC(acia6850_device::write));
+ // MEK68IO cassette ACIA.
+ map(0x800a, 0x800b).rw(m_acia_cas, FUNC(acia6850_device::read), FUNC(acia6850_device::write));
+
+ // 8040-8041 MEK68VG VDG Scroll register
+
+ // 8042-8043 MEK68R2 CRT register.
+ map(0x8042, 0x8042).w(m_mc6845, FUNC(mc6845_device::address_w));
+ map(0x8043, 0x8043).rw(m_mc6845, FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w));
+
+ // MEK68R2 PIA (Keyboard)
+ map(0x8044, 0x8047).rw(m_r2_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
+ // GPIA IEEE-488 8048-804F
+
+ // 8050-8057 MEK68EP PROM Programmer
+
+ // MEK6802D3 timer and I/O.
+ map(0x8080, 0x8087).rw(m_mc6846, FUNC(mc6846_device::read), FUNC(mc6846_device::write));
+ // MEK6802D3 display/keyboard PIA
+ map(0x8088, 0x808b).rw(m_kpd_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write));
+
+ // MEK6802D3 MCM6810 RAM
+ map(0x8100, 0x81ff).ram(); // system ram
+
+ // 8200 - 87ff User defined RAM
+
+ // 8800 - 8fff MEK68VDG RAM
+
+ // 9000-9fff MEK68R2 and MEK68VDG Video RAM
+ map(0x9000, 0x9fff).ram().share(m_video_ram);
+
+ // a000-efff ROM banks.
+
+ // D3BUG2 ROM
+ map(0xf000, 0xf7ff).rom();
+
+ // MEK6802D3 D3BUG ROM, MC6846 ROM
+ map(0xf800, 0xffff).rom();
+}
+
+/***********************************************************
+
+ Keys
+
+************************************************************/
+
+static INPUT_PORTS_START(mekd3)
+ // RESET is not wired to the key matrix.
+ PORT_START("RESET")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("RS") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, mekd3_state, reset_key_w)
+
+ // PORT_CODEs are not assigned to the keypad to allow it on screen at
+ // the same time as the terminal or CRT console which also receive
+ // keyboard inputs. When a keyboard is available the keypad is of
+ // limited use, but still useful to interrupt code or reset the
+ // machine. If MAME someday allows the keyboard input focus to be
+ // switched then this might be redesigned.
+ PORT_START("COL0")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("M")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("FS")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("7")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("4")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("0")
+
+ PORT_START("COL1")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("EX")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("FC")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("8")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("5")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("F")
+
+ PORT_START("COL2")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("RD")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("P/L")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("9")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("6")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("3")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("E")
+
+ PORT_START("COL3")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("GO")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("T/B")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("A")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("B")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("C")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, keypad_changed, 0) PORT_NAME("D")
+
+
+ // MEK68IO
+
+ PORT_START("console_enable")
+ PORT_DIPNAME(0x01, 0x00, "RS-232 console")
+ PORT_DIPSETTING(0x01, DEF_STR(On))
+ PORT_DIPSETTING(0x00, DEF_STR(Off))
+
+ // RS232 baud rates available for use at socket 1.
+ PORT_START("tx_baud")
+ PORT_CONFNAME(0x3f, 1, "RS232 TX Baud Rate")
+ PORT_CONFSETTING(0x01, "9600")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x04, "3600")
+ PORT_CONFSETTING(0x08, "2400")
+ PORT_CONFSETTING(0x10, "1200")
+ PORT_CONFSETTING(0x20, "600")
+ PORT_CONFSETTING(0x40, "300")
+ PORT_CONFSETTING(0x80, "110")
+
+ PORT_START("rx_baud")
+ PORT_CONFNAME(0x3f, 1, "RS232 RX Baud Rate")
+ PORT_CONFSETTING(0x01, "9600")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x04, "3600")
+ PORT_CONFSETTING(0x08, "2400")
+ PORT_CONFSETTING(0x10, "1200")
+ PORT_CONFSETTING(0x20, "600")
+ PORT_CONFSETTING(0x40, "300")
+ PORT_CONFSETTING(0x80, "110")
+
+ // A mechanical switch at the edge of the board set the cassette baud
+ // rate. The software could not control or read this rate setting and
+ // since D3BUG used a different format for 1200 baud it had to promote
+ // for the rate too.
+ PORT_START("cas_rate")
+ PORT_CONFNAME(0x01, 0, "Cassette Baud Rate")
+ PORT_CONFSETTING(0x1, "1200")
+ PORT_CONFSETTING(0x0, "300")
+
+
+ // MEK68R2
+
+ PORT_START("r2_mode")
+ PORT_DIPNAME(0x1, 0, "R2 Mode")
+ PORT_DIPSETTING(0, "Normal")
+ PORT_DIPSETTING(1, "Dumb terminal")
+
+ PORT_START("r2_display_nationality")
+ PORT_DIPNAME(0x1, 1, "Display nationality")
+ PORT_DIPSETTING(0, "US")
+ PORT_DIPSETTING(1, "Europe")
+
+ PORT_START("r2_display_format")
+ PORT_DIPNAME(0x0003, 2, "Display format")
+ PORT_DIPSETTING(0, "16 lines of 32 characters")
+ PORT_DIPSETTING(1, "16 lines of 64 characters")
+ PORT_DIPSETTING(2, "20 lines of 80 characters")
+ PORT_DIPSETTING(3, "User defined")
+
+INPUT_PORTS_END
+
+
+/***********************************************************
+
+ RAM and ROM paging
+
+************************************************************/
+
+WRITE8_MEMBER(mekd3_state::page_w)
+{
+ m_rom_page = data & 0x07;
+ // TODO switch the ROM bank entry.
+ m_ram_page = (data >> 3) & 0x07;
+ m_ram_bank->set_entry(m_ram_page);
+}
+
+/***********************************************************
+
+ Trace timer
+
+************************************************************/
+
+WRITE8_MEMBER(mekd3_state::trace_timer_w)
+{
+ m_trace = data;
+ m_kpd_pia->ca1_w(data);
+}
+
+READ8_MEMBER(mekd3_state::trace_timer_r)
+{
+ return m_trace;
+}
+
+/***********************************************************
+
+ Keypad
+
+************************************************************/
+
+WRITE_LINE_MEMBER(mekd3_state::reset_key_w)
+{
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE);
+
+ if (!state)
+ {
+ m_mc6846->reset();
+ m_kpd_pia->reset();
+ m_kpd_pia->write(1, 2);
+ // MEK68IO
+ m_pia_io1->reset();
+ m_pia_io2->reset();
+ m_acia_io1->reset();
+ m_acia_cas->reset();
+ m_cass_rx_period = 0;
+ m_cass_txcount = 0;
+ m_cass_in = 0;
+ m_cass_inbit = 0;
+ // MEK68R2
+ m_mc6845->reset();
+ m_r2_pia->reset();
+ }
+}
+
+bool mekd3_state::keypad_key_pressed()
+{
+ return (m_keypad_columns[0]->read() & m_digit) ||
+ (m_keypad_columns[1]->read() & m_digit) ||
+ (m_keypad_columns[2]->read() & m_digit) ||
+ (m_keypad_columns[3]->read() & m_digit);
+}
+
+INPUT_CHANGED_MEMBER(mekd3_state::keypad_changed)
+{
+ m_kpd_pia->cb1_w(mekd3_state::keypad_key_pressed());
+}
+
+READ_LINE_MEMBER(mekd3_state::keypad_cb1_r)
+{
+ return mekd3_state::keypad_key_pressed();
+}
+
+READ8_MEMBER(mekd3_state::keypad_key_r)
+{
+ uint8_t mux = (m_digit & 0xc0) >> 6;
+ uint8_t i = (m_keypad_columns[mux]->read() & m_digit) ? 0 : 0x80;
+
+ return i | m_segment;
+}
+
+/***********************************************************
+
+ Seven segment LED display
+
+************************************************************/
+
+// PA
+WRITE8_MEMBER(mekd3_state::led_segment_w)
+{
+ m_segment = data & 0x7f;
+ m_display->matrix(m_digit, m_segment);
+}
+
+// PB
+WRITE8_MEMBER(mekd3_state::led_digit_w)
+{
+ m_digit = data;
+ m_display->matrix(m_digit, m_segment);
+ // Update the keypad pressed output which depends on m_digit.
+ m_kpd_pia->cb1_w(mekd3_state::keypad_key_pressed());
+}
+
+/***********************************************************
+
+ MEK68IO
+
+************************************************************/
+
+WRITE_LINE_MEMBER(mekd3_state::write_f1_clock)
+{
+ if (BIT(m_tx_rate->read(), 0))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 0))
+ m_acia_io1->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f2_clock)
+{
+ if (BIT(m_tx_rate->read(), 1))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 1))
+ m_acia_io1->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f4_clock)
+{
+ if (BIT(m_tx_rate->read(), 2))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 2))
+ m_acia_io1->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f5_clock)
+{
+ if (BIT(m_tx_rate->read(), 3))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 3))
+ m_acia_io1->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f7_clock)
+{
+ if (BIT(m_tx_rate->read(), 4))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 4))
+ m_acia_io1->write_rxc(state);
+
+ // 1200 baud also drives the cassette ACIA
+ if (m_cas_rate->read() == 1)
+ acia_cas_clock1200_w(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f8_clock)
+{
+ if (BIT(m_tx_rate->read(), 5))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 5))
+ m_acia_io1->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f9_clock)
+{
+ if (BIT(m_tx_rate->read(), 6))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 6))
+ m_acia_io1->write_rxc(state);
+
+ // 300 baud also drives the cassette ACIA
+ if (m_cas_rate->read() == 0)
+ acia_cas_clock300_w(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::write_f13_clock)
+{
+ if (BIT(m_tx_rate->read(), 7))
+ m_acia_io1->write_txc(state);
+ if (BIT(m_rx_rate->read(), 7))
+ m_acia_io1->write_rxc(state);
+}
+
+
+TIMER_DEVICE_CALLBACK_MEMBER(mekd3_state::kansas_r)
+{
+ m_cass_rx_period++;
+
+ // Turn 1200/2400Hz to a bit
+ uint8_t cassin = (m_cass->input() > +0.04) ? 1 : 0;
+ uint8_t inbit = m_cass_inbit;
+
+ if (cassin != m_cass_in)
+ {
+ // Transition, now check the period.
+ inbit = (m_cass_rx_period < 12) ? 1 : 0;
+ m_cass_in = cassin;
+ m_cass_rx_period = 0;
+ }
+ else if (m_cass_rx_period > 32)
+ {
+ // Idle the ACIA if there is no data.
+ m_cass_rx_period = 32;
+ inbit = 1;
+ }
+
+ if (inbit != m_cass_inbit)
+ {
+ m_acia_cas->write_rxd(inbit);
+ m_cass_inbit = inbit;
+ }
+}
+
+WRITE_LINE_MEMBER(mekd3_state::acia_cas_clock300_w)
+{
+ // The Kansas City cassette format encodes a '0' bit by four cycles of
+ // a 1200 Hz sine wave, and a '1' bit as eight cycles of 2400 Hz,
+ // giving a 300 baud rate.
+ //
+ // The clock rate to the ACIA is 16x the baud rate and is divided by 2
+ // to get the 2400 Hz rate, or divided by 4 to get the 1200 Hz rate.
+
+ // Sync the period phase on TX bit transitions.
+ if (m_cass_txbit != m_cass_last_txbit)
+ {
+ m_cass_txcount = 0;
+ m_cass_last_txbit = m_cass_txbit;
+ }
+
+ if (m_cass_txbit)
+ m_cass->output(BIT(m_cass_txcount, 1) ? +1.0 : -1.0); // 2400Hz
+ else
+ m_cass->output(BIT(m_cass_txcount, 2) ? +1.0 : -1.0); // 1200Hz
+
+ m_cass_txcount++;
+ m_acia_cas->write_txc(state);
+ m_acia_cas->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::acia_cas_clock1200_w)
+{
+ // For the 1200 baud rate the number of cycles in reduced to just one
+ // cycle at 1200 Hz and two at 2400 Hz.
+
+ // Sync the period phase on TX bit transitions.
+ if (m_cass_txbit != m_cass_last_txbit)
+ {
+ m_cass_txcount = 0;
+ m_cass_last_txbit = m_cass_txbit;
+ }
+
+ if (m_cass_txbit)
+ m_cass->output(BIT(m_cass_txcount, 3) ? +1.0 : -1.0); // 2400Hz
+ else
+ m_cass->output(BIT(m_cass_txcount, 4) ? +1.0 : -1.0); // 1200Hz
+
+ m_cass_txcount++;
+ m_acia_cas->write_txc(state);
+ m_acia_cas->write_rxc(state);
+}
+
+READ8_MEMBER(mekd3_state::pia_io2a_r)
+{
+ uint32_t console_enable = ioport("console_enable")->read();
+
+ // bit 1 (0x02) is a jumper to set RS232 terminal mode when set.
+
+ return console_enable ? 0x02 : 0x00;
+}
+
+
+/***********************************************************
+
+ MEK68R2
+
+ This might in future be moved to a slot device, on a bus.
+
+************************************************************/
+
+// Delivery of keyboard inputs to the MEK68R2 keyboard is disabled when on
+// views with the RS232 terminal, assuming that this keyboard is not present.
+// Also disable delivery when the 'MEK68R2 present' jumper indicates it is
+// disabled, assuming that this keyboard is not present.
+void mekd3_state::kbd_put(uint8_t data)
+{
+ uint8_t view = machine().render().first_target()->view();
+ if (view == 0)
+ return;
+
+ m_term_data = data;
+ // Triggers on the falling edge.
+ m_r2_pia->ca1_w(ASSERT_LINE);
+ m_r2_pia->ca1_w(CLEAR_LINE);
+ m_r2_pia->ca1_w(ASSERT_LINE);
+}
+
+// PA0 to PA6 - Keyboard data.
+// PA7 - Display nationality, 0 USA, 1 Europe.
+READ8_MEMBER(mekd3_state::r2_pia_pa_r)
+{
+ uint8_t ret = m_term_data;
+ int8_t display_nationality = m_r2_display_nationality->read();
+ m_term_data = 0;
+ return ret | (display_nationality << 7);
+}
+
+// PB0 - Mode: 0 normal, 1 dumb terminal.
+// PB1,2,3 - N/C
+// PB4 - User defined
+// PB5 - Light pen control.
+// PB7, PB6 - Display format.
+// 00 - 16 lines of 32 characters.
+// 01 - 16 lines of 64 characters.
+// 10 - 20 lines of 80 characters.
+// 11 - User defined.
+READ8_MEMBER(mekd3_state::r2_pia_pb_r)
+{
+ int8_t display_format = m_r2_display_format->read();
+ int8_t mode = m_r2_mode->read();
+ return (display_format << 6) | mode;
+}
+
+WRITE_LINE_MEMBER(mekd3_state::r2_hsync_changed)
+{
+ m_r2_pia->cb2_w(state);
+}
+
+WRITE_LINE_MEMBER(mekd3_state::r2_vsync_changed)
+{
+ m_r2_vsync = state;
+ m_r2_pia->cb1_w(state);
+}
+
+READ_LINE_MEMBER(mekd3_state::r2_pia_cb1_r)
+{
+ return m_r2_vsync;
+}
+
+MC6845_UPDATE_ROW(mekd3_state::update_row)
+{
+ const pen_t *pen = m_palette->pens();
+
+ int x = 0;
+
+ for (int column = 0; column < x_count; column++)
+ {
+ uint8_t code = m_video_ram[(ma + column) & 0xfff];
+ int dcursor = (column == cursor_x);
+
+ if (BIT(code, 7)) {
+ /* Lores 6 pixel character.
+ -----------
+ | D1 | D0 |
+ | D3 | D2 |
+ | D5 | D4 |
+ -----------
+ D6 - 1 Grey tone, 0 brightness.
+ */
+ int pixel = ((ra & 0x0c) >> 1) + 1;
+ int dout = BIT(code, pixel);
+ int grey = BIT(code, 6);
+ int color = ((dcursor ^ dout) && de) << !grey;
+ bitmap.pix32(y, x++) = pen[color];
+ bitmap.pix32(y, x++) = pen[color];
+ bitmap.pix32(y, x++) = pen[color];
+ bitmap.pix32(y, x++) = pen[color];
+ pixel--;
+ dout = BIT(code, pixel);
+ color = ((dcursor ^ dout) && de) << !grey;
+ bitmap.pix32(y, x++) = pen[color];
+ bitmap.pix32(y, x++) = pen[color];
+ bitmap.pix32(y, x++) = pen[color];
+ bitmap.pix32(y, x++) = pen[color];
+ } else {
+ offs_t address = ra < 8 ? ((code & 0x7f) << 3) | (ra & 0x07) : 0;
+ uint8_t data = m_p_chargen[address];
+
+ for (int bit = 0; bit < 8; bit++)
+ {
+ int dout = BIT(data, 7);
+ int color = ((dcursor ^ dout) && de) << 1;
+
+ bitmap.pix32(y, x++) = pen[color];
+
+ data <<= 1;
+ }
+ }
+ }
+}
+
+/***********************************************************
+
+************************************************************/
+
+void mekd3_state::init_mekd3()
+{
+ uint8_t* ROM = memregion("maincpu")->base();
+
+ // Hack to the trace timer delay, which is 0x000e by default, but
+ // that did not produce proper timing for tracing.
+ // 15 half works sometimes??
+ // 16 to 19 half works, gets to user code but not to the next instruction!
+ // 20 will step a nop but not a branch.
+ // 21 also steps a branch.
+ // 22 can overstep!
+ ROM[0xf80c] = 21;
+}
+
+void mekd3_state::machine_start()
+{
+ uint8_t* RAM = m_ram->pointer();
+ m_ram_bank->configure_entries(0, 8, RAM, 0x8000);
+}
+
+void mekd3_state::machine_reset()
+{
+ m_rom_page = 0;
+ m_ram_page = 0;
+ m_ram_bank->set_entry(0);
+
+ // Avoid triggering an early interrupt when CA1 lowered. The mc6821
+ // driver resets CA1 high and to trigger on a high to low
+ // transition. The mekd3 programs CA1 to trigger on a low to high
+ // transition and configuring this earlier here is adequate.
+ m_kpd_pia->write(1, 2);
+
+ m_brg->rsa_w(CLEAR_LINE);
+ m_brg->rsb_w(ASSERT_LINE);
+
+ m_cass_rx_period = 0;
+ m_cass_txcount = 0;
+ m_cass_in = 0;
+ m_cass_inbit = 0;
+}
+
+/***********************************************************
+
+ Machine
+
+************************************************************/
+
+static DEVICE_INPUT_DEFAULTS_START(terminal)
+ DEVICE_INPUT_DEFAULTS("RS232_RXBAUD", 0xff, RS232_BAUD_9600)
+ DEVICE_INPUT_DEFAULTS("RS232_TXBAUD", 0xff, RS232_BAUD_9600)
+ DEVICE_INPUT_DEFAULTS("RS232_STARTBITS", 0xff, RS232_STARTBITS_1)
+ DEVICE_INPUT_DEFAULTS("RS232_DATABITS", 0xff, RS232_DATABITS_8)
+ DEVICE_INPUT_DEFAULTS("RS232_PARITY", 0xff, RS232_PARITY_NONE)
+ DEVICE_INPUT_DEFAULTS("RS232_STOPBITS", 0xff, RS232_STOPBITS_1)
+DEVICE_INPUT_DEFAULTS_END
+
+void mekd3_state::mekd3(machine_config &config)
+{
+ M6802(config, m_maincpu, XTAL_MEKD3); // 894.8 kHz clock
+ m_maincpu->set_addrmap(AS_PROGRAM, &mekd3_state::mekd3_mem);
+
+ RAM(config, m_ram).set_default_size("256K").set_default_value(0);
+
+ INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6802_IRQ_LINE);
+ INPUT_MERGER_ANY_HIGH(config, "mainnmi").output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+
+ // LED display
+ PWM_DISPLAY(config, m_display).set_size(8, 7);
+ m_display->set_segmask(0xff, 0x7f);
+
+ config.set_default_layout(layout_mekd3);
+
+ SPEAKER(config, "mono").front_center();
+
+ CASSETTE(config, m_cass);
+ m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
+ m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
+
+ // Keypad and display PIA. CA2 and CB2 are NC.
+ PIA6821(config, m_kpd_pia, 0);
+ m_kpd_pia->readpa_handler().set(FUNC(mekd3_state::keypad_key_r));
+ m_kpd_pia->readcb1_handler().set(FUNC(mekd3_state::keypad_cb1_r));
+ m_kpd_pia->writepa_handler().set(FUNC(mekd3_state::led_segment_w));
+ m_kpd_pia->writepb_handler().set(FUNC(mekd3_state::led_digit_w));
+ m_kpd_pia->readca1_handler().set(FUNC(mekd3_state::trace_timer_r));
+ m_kpd_pia->irqa_handler().set("mainnmi", FUNC(input_merger_device::in_w<0>));
+ m_kpd_pia->irqb_handler().set("mainnmi", FUNC(input_merger_device::in_w<1>));
+
+ // CP1, CP2, /CTG, /CTC are available at SK1, and not used here.
+ MC6846(config, m_mc6846, XTAL_MEKD3 / 4); // Same as the cpu clock
+ m_mc6846->out_port().set(FUNC(mekd3_state::page_w));
+ m_mc6846->cto().set(FUNC(mekd3_state::trace_timer_w));
+ m_mc6846->irq().set("mainirq", FUNC(input_merger_device::in_w<0>));
+
+ // MEK68IO
+
+ // A 'user' PIA, I/O available at SK6.
+ PIA6821(config, m_pia_io1, 0);
+ m_pia_io1->irqa_handler().set("mainnmi", FUNC(input_merger_device::in_w<2>));
+ m_pia_io1->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<1>));
+
+ // Largely a 'user' PIA, I/O available at SK5.
+ // PA0 can optionally be an audio bit input, at TP1.
+ // PA1 is a jumper mode input, and low by default.
+ // PA2 can optionally be an audio bit output, at TP2.
+ PIA6821(config, m_pia_io2, 0);
+ m_pia_io2->readpa_handler().set(FUNC(mekd3_state::pia_io2a_r));
+ m_pia_io2->irqa_handler().set("mainirq", FUNC(input_merger_device::in_w<2>));
+ m_pia_io2->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<3>));
+
+ // RS232 ACIA
+ // /RTS, /CTS and /DCD are available at SK3.
+ ACIA6850(config, m_acia_io1, 0);
+ m_acia_io1->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
+ m_acia_io1->irq_handler().set("mainirq", FUNC(input_merger_device::in_w<4>));
+
+ MC14411(config, m_brg, XTAL(1'843'200));
+ m_brg->out_f<1>().set(FUNC(mekd3_state::write_f1_clock));
+ m_brg->out_f<2>().set(FUNC(mekd3_state::write_f2_clock));
+ m_brg->out_f<4>().set(FUNC(mekd3_state::write_f4_clock));
+ m_brg->out_f<4>().set(FUNC(mekd3_state::write_f5_clock));
+ m_brg->out_f<7>().set(FUNC(mekd3_state::write_f7_clock));
+ m_brg->out_f<8>().set(FUNC(mekd3_state::write_f8_clock));
+ m_brg->out_f<9>().set(FUNC(mekd3_state::write_f9_clock));
+ m_brg->out_f<13>().set(FUNC(mekd3_state::write_f13_clock));
+
+ rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
+ rs232.rxd_handler().set(m_acia_io1, FUNC(acia6850_device::write_rxd));
+ rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
+
+ // /RTS is available at SK2.
+ // /CTS and /DCD are available at SK2, or can be jumpered low.
+ ACIA6850(config, m_acia_cas, 0);
+ m_acia_cas->txd_handler().set([this] (bool state) { m_cass_txbit = state; });
+ m_acia_cas->irq_handler().set("mainirq", FUNC(input_merger_device::in_w<5>));
+
+ TIMER(config, "kansas_r").configure_periodic(FUNC(mekd3_state::kansas_r), attotime::from_hz(40000));
+
+ // MEK68R2
+
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+
+ m_screen->set_refresh_hz(50);
+ m_screen->set_size(80 * 8 + 80 * 10, 20 * 12 + 100);
+ m_screen->set_visarea(0, 80 * 8 + 80 * 10 - 1, 0, 20 * 12 + 100 - 1);
+ m_screen->set_screen_update("mc6845", FUNC(mc6845_device::screen_update));
+
+ PALETTE(config, m_palette, palette_device::MONOCHROME_HIGHLIGHT);
+
+ MC6845(config, m_mc6845, XTAL(14'318'181)/8);
+ m_mc6845->set_screen("screen");
+ m_mc6845->set_show_border_area(false);
+ m_mc6845->set_char_width(8);
+ m_mc6845->set_update_row_callback(FUNC(mekd3_state::update_row), this);
+ m_mc6845->out_hsync_callback().set(FUNC(mekd3_state::r2_hsync_changed));
+ m_mc6845->out_vsync_callback().set(FUNC(mekd3_state::r2_vsync_changed));
+
+ // PA is the keyboard data and a mode flag.
+ // CA1 is keyboard strobe.
+ // CA2 light pen input.
+ // PB0 is mode flags and light pen control.
+ // CB1 is VSYNC, and CB2 is HSYNC.
+ PIA6821(config, m_r2_pia, 0);
+ m_r2_pia->readpa_handler().set(FUNC(mekd3_state::r2_pia_pa_r));
+ m_r2_pia->readpb_handler().set(FUNC(mekd3_state::r2_pia_pb_r));
+ m_r2_pia->readcb1_handler().set(FUNC(mekd3_state::r2_pia_cb1_r));
+ m_r2_pia->irqa_handler().set("mainirq", FUNC(input_merger_device::in_w<6>));
+ m_r2_pia->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<7>));
+
+ generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
+ keyboard.set_keyboard_callback(FUNC(mekd3_state::kbd_put));
+}
+
+/***********************************************************
+
+ ROMS
+
+************************************************************/
+
+ROM_START(mekd3)
+ ROM_REGION(0x10000,"maincpu",0)
+ ROM_LOAD("d3bug.rom", 0xf800, 0x0800, CRC(57863614) SHA1(b31679df86367d1e48e12f01a22cd0f008e74df4))
+ ROM_LOAD("d3bug2.rom", 0xf000, 0x0800, CRC(bf3640b0) SHA1(374362c4464ab3986af2f08395bf254d1ce7a52f))
+ ROM_REGION(0x0400, "chargen",0)
+ ROM_LOAD("mcm6674p.chr", 0x0000, 0x0400, CRC(1c22088a) SHA1(b5f0bd0cfdec0cd5c1cb764506bef3c17d6af0eb))
+ROM_END
+
+/***************************************************************************
+
+ Game driver(s)
+
+***************************************************************************/
+
+// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
+COMP( 1978, mekd3, 0, 0, mekd3, mekd3, mekd3_state, init_mekd3, "Motorola", "MEK6802D3" , MACHINE_NO_SOUND )
diff --git a/src/mame/drivers/mekd5.cpp b/src/mame/drivers/mekd5.cpp
index 56b00f13b7e..3c0eeb521c2 100644
--- a/src/mame/drivers/mekd5.cpp
+++ b/src/mame/drivers/mekd5.cpp
@@ -253,7 +253,7 @@ void mekd5_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_kpd_pia->cb2_w(0);
break;
default:
- assert_always(false, "Unknown id in mekd5_state::device_timer");
+ throw emu_fatalerror("Unknown id in mekd5_state::device_timer");
}
}
diff --git a/src/mame/drivers/menghong.cpp b/src/mame/drivers/menghong.cpp
index 63d0e306d52..b60bede8fa8 100644
--- a/src/mame/drivers/menghong.cpp
+++ b/src/mame/drivers/menghong.cpp
@@ -9,11 +9,11 @@
TODO:
- HY04 protection (controls tile RNG, 8bpp colors, a few program flow bits)
- 8bpp colors are washed, data from flash ROMs is XORed with contents
- of NVRAM area 0x1400070b-80f in menghong, might be shared with
- HY04 as well.
+ of NVRAM area 0x1400070b-80f in menghong, might be shared with
+ HY04 as well.
- EEPROM hookup;
- - extract password code when entering test mode in-game (assuming the
- 0x485 workaround isn't enough);
+ - extract password code when entering test mode in-game (assuming the
+ 0x485 workaround isn't enough);
=============================================================================
@@ -88,7 +88,7 @@ public:
m_mainbank(*this, "mainbank"),
m_maincpu(*this, "maincpu"),
m_vr0soc(*this, "vr0soc"),
-// m_nvram(*this, "nvram"),
+// m_nvram(*this, "nvram"),
m_ds1302(*this, "rtc"),
m_eeprom(*this, "eeprom"),
m_prot_data(*this, "pic_data")
@@ -107,7 +107,7 @@ private:
/* devices */
required_device<se3208_device> m_maincpu;
required_device<vrender0soc_device> m_vr0soc;
-// required_device<nvram_device> m_nvram;
+// required_device<nvram_device> m_nvram;
required_device<ds1302_device> m_ds1302;
optional_device<eeprom_serial_93cxx_device> m_eeprom;
required_region_ptr <uint8_t> m_prot_data;
@@ -135,7 +135,7 @@ private:
DECLARE_WRITE32_MEMBER(crzyddz2_PIOldat_w);
DECLARE_READ32_MEMBER(crzyddz2_PIOedat_r);
uint8_t m_crzyddz2_prot;
-
+
DECLARE_READ8_MEMBER(menghong_shared_r);
DECLARE_WRITE8_MEMBER(menghong_shared_w);
DECLARE_READ8_MEMBER(crzyddz2_shared_r);
@@ -189,23 +189,23 @@ WRITE32_MEMBER(menghong_state::FlashCmd_w)
// To do: HY04 (pic?) protection, 93C46 hookup
READ8_MEMBER(menghong_state::menghong_shared_r)
-{
+{
return m_sharedram[offset];
}
WRITE8_MEMBER(menghong_state::menghong_shared_w)
{
m_sharedram[offset] = data;
-
+
if (offset == 0x2a0)
{
if (data == 0x09)
{
// enables game settings by pressing start on password screen
m_sharedram[0x485] = 0x02;
-
+
// start at 0x140071b, up to 0x806, rolls back at 0x70c
- // we conveniently use an handcrafted ROM here, created by guessing colors from
+ // we conveniently use an handcrafted ROM here, created by guessing colors from
// transparencies and shading.
// This will be useful for comparison when the actual PIC data will be extracted.
for (int i=0;i<0x100;i++)
@@ -230,7 +230,7 @@ READ8_MEMBER(menghong_state::crzyddz2_shared_r)
WRITE8_MEMBER(menghong_state::crzyddz2_shared_w)
{
m_sharedram[offset] = data;
-
+
// State machine is unconfirmed
if (offset == 0x7e3)
{
@@ -242,8 +242,8 @@ WRITE8_MEMBER(menghong_state::crzyddz2_shared_w)
break;
case 0xbb:
// this actually affects color again, game checksums the NVRAM contents
- // at PC=0x2011f9a, expecting a value of 0x7ebe otherwise locks up
- // after Sealy logo. Every single value is added to the routine and left
+ // at PC=0x2011f9a, expecting a value of 0x7ebe otherwise locks up
+ // after Sealy logo. Every single value is added to the routine and left
// shifted by 1 (including the two values above)
for(int i=0;i<0x3f;i++)
m_sharedram[i+0x652] = 0xff;
@@ -316,7 +316,7 @@ void menghong_state::menghong_mem(address_map &map)
map(0x00000000, 0x003fffff).rom().nopw();
map(0x01280000, 0x01280003).w(FUNC(menghong_state::Banksw_w));
-// map(0x01400000, 0x0140ffff).ram().share("nvram");
+// map(0x01400000, 0x0140ffff).ram().share("nvram");
map(0x01400000, 0x0140ffff).rw(FUNC(menghong_state::menghong_shared_r), FUNC(menghong_state::menghong_shared_w));
map(0x01500000, 0x01500003).portr("P1_P2");
map(0x01500004, 0x01500007).r(FUNC(menghong_state::crzyddz2_key_r));
@@ -343,7 +343,7 @@ void menghong_state::crzyddz2_mem(address_map &map)
void menghong_state::machine_start()
{
m_sharedram = auto_alloc_array_clear(machine(), uint8_t, 0x10000);
-
+
if (m_mainbank)
{
m_maxbank = (m_flash) ? m_flash.bytes() / 0x1000000 : 0;
@@ -473,7 +473,7 @@ void menghong_state::menghong(machine_config &config)
// HY04 running at 8 MHz
-// NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0);
+// NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0);
VRENDER0_SOC(config, m_vr0soc, 14318180 * 3);
m_vr0soc->set_host_cpu_tag(m_maincpu);
@@ -499,7 +499,7 @@ ROM_START( menghong )
ROM_REGION( 0x4280, "pic", 0 ) // hy04
ROM_LOAD("menghong_hy04", 0x000000, 0x4280, NO_DUMP )
-
+
ROM_REGION( 0x0100, "pic_data", ROMREGION_ERASEFF )
ROM_LOAD("hy04_fake_data.bin", 0, 0x100, BAD_DUMP CRC(73cc964b) SHA1(39d223c550e38c97135322e43ccabb70f04964b9) )
ROM_END
@@ -513,7 +513,7 @@ ROM_START( crzyddz2 )
ROM_REGION( 0x4280, "pic", 0 ) // hy04
ROM_LOAD("hy04", 0x000000, 0x4280, NO_DUMP )
-
+
ROM_REGION( 0x0100, "pic_data", ROMREGION_ERASEFF )
ROM_END
diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp
index 41600286900..82c18c784ee 100644
--- a/src/mame/drivers/metro.cpp
+++ b/src/mame/drivers/metro.cpp
@@ -207,7 +207,7 @@ void metro_state::device_timer(emu_timer &timer, device_timer_id id, int param,
update_irq_state();
break;
default:
- assert_always(false, "Unknown id in metro_state::device_timer");
+ throw emu_fatalerror("Unknown id in metro_state::device_timer");
}
}
diff --git a/src/mame/drivers/mgolf.cpp b/src/mame/drivers/mgolf.cpp
index a04d2c47e9e..54bf8ac3854 100644
--- a/src/mame/drivers/mgolf.cpp
+++ b/src/mame/drivers/mgolf.cpp
@@ -154,7 +154,7 @@ void mgolf_state::device_timer(emu_timer &timer, device_timer_id id, int param,
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in mgolf_state::device_timer");
+ throw emu_fatalerror("Unknown id in mgolf_state::device_timer");
}
}
diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp
index 319eff9f656..76467a1099b 100644
--- a/src/mame/drivers/midvunit.cpp
+++ b/src/mame/drivers/midvunit.cpp
@@ -1341,7 +1341,7 @@ ROM_START( crusnusa40 ) /* Version 4.0, Wed Feb 08 1995 - 10:45:14 */
ROM_LOAD32_BYTE( "cusa.u27", 0x800001, 0x80000, CRC(2d977a8e) SHA1(8f4d511bfd6c3bee18daa7253be1a27d079aec8f) )
ROM_LOAD32_BYTE( "cusa.u28", 0x800002, 0x80000, CRC(cffa5fb1) SHA1(fb73bc8f65b604c374f88d0ecf06c50ef52f0547) )
ROM_LOAD32_BYTE( "cusa.u29", 0x800003, 0x80000, CRC(cbe52c60) SHA1(3f309ce8ef1784c830f4160cfe76dc3a0b438cac) )
-
+
ROM_REGION( 0x0b33, "pals", 0 ) // all protected
ROM_LOAD("a-19993.u38", 0x0000, 0x02e5, BAD_DUMP CRC(7e8b7b0d) SHA1(f9af19da171f949a11c5548da7b4277aecb6f2a8) ) /* TIBPAL22V10-15BCNT */
ROM_LOAD("a-19670.u43", 0x0000, 0x0144, BAD_DUMP CRC(acafcc97) SHA1(b6f916838d08590a536fe925ec62d66e6ea3dcbc) ) /* TIBPAL20L8-10CNT */
@@ -1384,7 +1384,7 @@ ROM_START( crusnusa21 ) /* Version 2.1, Wed Nov 09 1994 - 16:28:10 */
ROM_LOAD32_BYTE( "cusa.u27", 0x800001, 0x80000, CRC(2d977a8e) SHA1(8f4d511bfd6c3bee18daa7253be1a27d079aec8f) )
ROM_LOAD32_BYTE( "cusa.u28", 0x800002, 0x80000, CRC(cffa5fb1) SHA1(fb73bc8f65b604c374f88d0ecf06c50ef52f0547) )
ROM_LOAD32_BYTE( "cusa.u29", 0x800003, 0x80000, CRC(cbe52c60) SHA1(3f309ce8ef1784c830f4160cfe76dc3a0b438cac) )
-
+
ROM_REGION( 0x0b33, "pals", 0 ) // all protected
ROM_LOAD("a-19669.u38", 0x0000, 0x02dd, NO_DUMP ) /* TIBPAL22V10-15BCNT */
ROM_LOAD("a-19670.u43", 0x0000, 0x0144, BAD_DUMP CRC(acafcc97) SHA1(b6f916838d08590a536fe925ec62d66e6ea3dcbc) ) /* TIBPAL20L8-10CNT */
diff --git a/src/mame/drivers/mjsister.cpp b/src/mame/drivers/mjsister.cpp
index 37a2378a550..8ce399fdefd 100644
--- a/src/mame/drivers/mjsister.cpp
+++ b/src/mame/drivers/mjsister.cpp
@@ -212,7 +212,7 @@ void mjsister_state::device_timer(emu_timer &timer, device_timer_id id, int para
dac_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in mjsister_state::device_timer");
+ throw emu_fatalerror("Unknown id in mjsister_state::device_timer");
}
}
diff --git a/src/mame/drivers/mlanding.cpp b/src/mame/drivers/mlanding.cpp
index 4dfb1572506..b4d53d3f304 100644
--- a/src/mame/drivers/mlanding.cpp
+++ b/src/mame/drivers/mlanding.cpp
@@ -425,12 +425,12 @@ void mlanding_state::device_timer(emu_timer &timer, device_timer_id id, int para
{
switch (id)
{
- case TIMER_DMA_COMPLETE:
- m_dma_busy = 0;
- break;
+ case TIMER_DMA_COMPLETE:
+ m_dma_busy = 0;
+ break;
- default:
- assert_always(false, "Unknown id in mlanding_state::device_timer");
+ default:
+ throw emu_fatalerror("Unknown id in mlanding_state::device_timer");
}
}
diff --git a/src/mame/drivers/mycom.cpp b/src/mame/drivers/mycom.cpp
index 815dbb89685..87097a45524 100644
--- a/src/mame/drivers/mycom.cpp
+++ b/src/mame/drivers/mycom.cpp
@@ -37,8 +37,6 @@
toggles between English and Kana.
TODO/info:
- - Sound not working. The info makes its way to the audio chip but for
- some unknown reason, nothing is heard.
- FDC, little info, guessing (143kb, single sided, 525sd)
- Cassette doesn't load
- Printer
@@ -46,6 +44,19 @@
- Keyboard autorepeat
- Need software
+ Basic:
+ - To enter Basic, type BASIC. To quit, type EXIT.
+
+ Cassette:
+ - Bios 0: you can SAVE and LOAD from the monitor, but not from Basic. (see ToDo)
+ - Bios 1: Doesn't seem to be supported.
+
+ Sound:
+ - Bios 0: Sound is initialised with the volume turned off. In Basic, you
+ can POKE 4382,144 to enable sound.
+ - Bios 1: Doesn't appear to support sound. The included Basic has a SOUND
+ command (e.g SOUND 127,80), but no sound is heard.
+
*******************************************************************************/
#include "emu.h"
@@ -540,8 +551,8 @@ void mycom_state::mycom(machine_config &config)
GFXDECODE(config, "gfxdecode", m_palette, gfx_mycom);
/* Manual states clock is 1.008mhz for 40 cols, and 2.016 mhz for 80 cols.
- The CRTC is a HD46505S - same as a 6845. The start registers need to be readable. */
- MC6845(config, m_crtc, 1008000);
+ The manual states the CRTC is a HD46505S (apparently same as HD6845S). The start registers need to be readable. */
+ HD6845S(config, m_crtc, 1008000);
m_crtc->set_screen("screen");
m_crtc->set_show_border_area(false);
m_crtc->set_char_width(8);
@@ -586,4 +597,4 @@ ROM_END
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-COMP( 1981, mycom, 0, 0, mycom, mycom, mycom_state, init_mycom, "Japan Electronics College", "MYCOMZ-80A", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
+COMP( 1981, mycom, 0, 0, mycom, mycom, mycom_state, init_mycom, "Japan Electronics College", "MYCOMZ-80A", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp
index 47f3dd46577..2ea2c8b5a0b 100644
--- a/src/mame/drivers/namcona1.cpp
+++ b/src/mame/drivers/namcona1.cpp
@@ -1231,10 +1231,10 @@ ROM_END
This bootleg is running on the older type rom board (Cosmo Gang etc). Super World Court normally runs on the newer type 'B' board with extra chip at 6J.
It has a small pcb replacement keycus with a 74hc4060 , LS04 and 2 chips with the ID scratched (possibly PAL chips).
Program ROMs are almost identical. They hacked the keycus routine and the copyright year (from 1992 to 1994):
-sc2-ep0l.4c [2 / 2] 0l.0l [2 / 2] IDENTICAL
-sc2-ep0u.4f [2 / 2] 0u.0u [2 / 2] IDENTICAL
-sc2-ep0u.4f [1 / 2] 0u.0u [1 / 2] 99.997711%
-sc2-ep0l.4c [1 / 2] 0l.0l [1 / 2] 99.997330%
+sc2-ep0l.4c [2/2] 0l.0l [2/2] IDENTICAL
+sc2-ep0u.4f [2/2] 0u.0u [2/2] IDENTICAL
+sc2-ep0u.4f [1/2] 0u.0u [1/2] 99.997711%
+sc2-ep0l.4c [1/2] 0l.0l [1/2] 99.997330%
GFX ROMs are 27c040's double stacked with flying wires to the PAL board. They are the same as the 801 dumps, chopped in half. Pin 22 of OLH and OUH go to C pad on custom board.
Pin 22 of 1LH and 1UH go to B pad on custom board. All Lower pin '22's are tied high.
diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp
index 581cc12421b..adf6dc37661 100644
--- a/src/mame/drivers/namcos2.cpp
+++ b/src/mame/drivers/namcos2.cpp
@@ -3858,9 +3858,8 @@ ROM_START( marvland )
ROM_LOAD16_BYTE( "mv2_spr0", 0x000000, 0x010000, CRC(aa418f29) SHA1(413798d9c1d98cfcadb045a5436aaee61ce6718f) )
ROM_LOAD16_BYTE( "mv2_spr1", 0x000001, 0x010000, CRC(dbd94def) SHA1(56a8d7acd483bc4d12c8bc5b7e90ffdb132be670) )
- // This needs re-dumping, sound is very poor in this version and doesn't match Japanese version or any of the ports. High res photos of PCB required too.
ROM_REGION( 0x020000, "audiocpu", 0 ) /* Sound CPU (Banked) */
- ROM_LOAD( "mv2_snd0", 0x000000, 0x020000, BAD_DUMP CRC(a5b99162) SHA1(cafe8d1dae1e981c7ff9b70076b3e1d52cd806f7) )
+ ROM_LOAD( "mv2_snd0", 0x000000, 0x020000, CRC(a5b99162) SHA1(cafe8d1dae1e981c7ff9b70076b3e1d52cd806f7) )
ROM_REGION( 0x8000, "c65mcu:external", ROMREGION_ERASE00 ) /* I/O MCU */
ROM_LOAD( "sys2c65c.bin", 0x000000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
@@ -3894,7 +3893,7 @@ ROM_START( marvland )
NAMCOS2_DATA_LOAD_O_128K( "mv2_dat3.13n", 0x100000, CRC(6df76955) SHA1(fcfb520399acdd3776f66944121d6980552d3100) )
ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */
- ROM_LOAD( "mv1-voi1.bin", 0x000000, 0x080000, CRC(de5cac09) SHA1(2d73e54c4f159e52db2c403a59d6c137cce6f53e) )
+ ROM_LOAD( "mv1-voi1.bin", 0x000000, 0x080000, BAD_DUMP CRC(de5cac09) SHA1(2d73e54c4f159e52db2c403a59d6c137cce6f53e) ) // either undumped, or PCB was wrongly populated with JP samples ROM?
ROM_END
/* MARVEL LAND (JAPAN) */
@@ -5825,9 +5824,9 @@ GAMEL( 1987, finallapc, finallap, finallap, finallap, namcos2_state, init_final
GAMEL( 1987, finallapjc, finallap, finallap, finallap, namcos2_state, init_finallap, ROT0, "Namco", "Final Lap (Japan, Rev C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN, layout_finallap )
GAMEL( 1987, finallapjb, finallap, finallap, finallap, namcos2_state, init_finallap, ROT0, "Namco", "Final Lap (Japan, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN, layout_finallap )
-GAME( 1988, assault, 0, base2, assault, namcos2_state, init_assault, ROT90, "Namco", "Assault (Rev B)", 0 )
-GAME( 1988, assaultj, assault, base2, assault, namcos2_state, init_assaultj, ROT90, "Namco", "Assault (Japan)", 0 )
-GAME( 1988, assaultp, assault, assaultp, assault, namcos2_state, init_assaultp, ROT90, "Namco", "Assault Plus (Japan)", 0)
+GAME( 1988, assault, 0, base2, assault, namcos2_state, init_assault, ROT90, "Namco", "Assault (Rev B)", 0 )
+GAME( 1988, assaultj, assault, base2, assault, namcos2_state, init_assaultj, ROT90, "Namco", "Assault (Japan)", 0 )
+GAME( 1988, assaultp, assault, assaultp, assault, namcos2_state, init_assaultp, ROT90, "Namco", "Assault Plus (Japan)", 0)
GAME( 1988, metlhawk, 0, metlhawk, metlhawk, namcos2_state, init_metlhawk, ROT90, "Namco", "Metal Hawk (Rev C)", 0 )
GAME( 1988, metlhawkj, metlhawk, metlhawk, metlhawk, namcos2_state, init_metlhawk, ROT90, "Namco", "Metal Hawk (Japan, Rev F)", 0 )
@@ -5854,7 +5853,7 @@ GAME( 1989, finehour, 0, base2, base, namcos2_state, init_fineh
GAME( 1989, burnforc, 0, base3, base, namcos2_state, init_burnforc, ROT0, "Namco", "Burning Force (Japan, new version (Rev C))", 0 )
GAME( 1989, burnforco, burnforc, base3, base, namcos2_state, init_burnforc, ROT0, "Namco", "Burning Force (Japan, old version)", 0 )
-GAME( 1989, marvland, 0, base, base, namcos2_state, init_marvland, ROT0, "Namco", "Marvel Land (US)", MACHINE_IMPERFECT_SOUND )
+GAME( 1989, marvland, 0, base, base, namcos2_state, init_marvland, ROT0, "Namco", "Marvel Land (US, prototype?)", MACHINE_IMPERFECT_SOUND )
GAME( 1989, marvlandj, marvland, base, base, namcos2_state, init_marvlanj, ROT0, "Namco", "Marvel Land (Japan)", 0 )
GAME( 1990, kyukaidk, 0, base, kyukaidk, namcos2_state, init_kyukaidk, ROT0, "Namco", "Kyuukai Douchuuki (Japan, new version (Rev B))", 0 )
diff --git a/src/mame/drivers/nightmare.cpp b/src/mame/drivers/nightmare.cpp
index e3b89a4614d..5ec73035356 100644
--- a/src/mame/drivers/nightmare.cpp
+++ b/src/mame/drivers/nightmare.cpp
@@ -271,7 +271,7 @@ void nightmare_state::device_timer(emu_timer &timer, device_timer_id id, int par
m_reset = 1;
break;
default:
- assert_always(false, "Unknown id in nightmare_state::device_timer");
+ throw emu_fatalerror("Unknown id in nightmare_state::device_timer");
}
}
diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp
index e1936339928..26141e200cc 100644
--- a/src/mame/drivers/notetaker.cpp
+++ b/src/mame/drivers/notetaker.cpp
@@ -251,7 +251,7 @@ void notetaker_state::device_timer(emu_timer &timer, device_timer_id id, int par
timer_fifoclk(ptr, param);
break;
default:
- assert_always(false, "Unknown id in notetaker_state::device_timer");
+ throw emu_fatalerror("Unknown id in notetaker_state::device_timer");
}
}
diff --git a/src/mame/drivers/okean240.cpp b/src/mame/drivers/okean240.cpp
index a12bee1167d..8ea2f8b31d5 100644
--- a/src/mame/drivers/okean240.cpp
+++ b/src/mame/drivers/okean240.cpp
@@ -414,7 +414,7 @@ void okean240_state::device_timer(emu_timer &timer, device_timer_id id, int para
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in okean240_state::device_timer");
+ throw emu_fatalerror("Unknown id in okean240_state::device_timer");
}
}
diff --git a/src/mame/drivers/osi.cpp b/src/mame/drivers/osi.cpp
index 2b89d4f3811..cbef219c645 100644
--- a/src/mame/drivers/osi.cpp
+++ b/src/mame/drivers/osi.cpp
@@ -918,7 +918,7 @@ void c1p_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_beeper->set_clock(300);
break;
default:
- assert_always(false, "Unknown id in sb2m600_state::device_timer");
+ throw emu_fatalerror("Unknown id in c1p_state::device_timer");
}
}
diff --git a/src/mame/drivers/parodius.cpp b/src/mame/drivers/parodius.cpp
index a79d49cda8d..f450fc04769 100644
--- a/src/mame/drivers/parodius.cpp
+++ b/src/mame/drivers/parodius.cpp
@@ -74,7 +74,7 @@ void parodius_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in parodius_state::device_timer");
+ throw emu_fatalerror("Unknown id in parodius_state::device_timer");
}
}
diff --git a/src/mame/drivers/pc.cpp b/src/mame/drivers/pc.cpp
index b9d188eddcc..5402f35320a 100644
--- a/src/mame/drivers/pc.cpp
+++ b/src/mame/drivers/pc.cpp
@@ -70,7 +70,7 @@ public:
void juko16(machine_config &config);
void hyo88t(machine_config &config);
void kyoxt(machine_config &config);
-
+
void init_bondwell();
DECLARE_INPUT_CHANGED_MEMBER(pc_turbo_callback);
@@ -1392,6 +1392,6 @@ COMP( 198?, hyo88t, ibm5150, 0, pccga, pccga, pc_state,
COMP( 198?, kyoxt, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Kyocera", "XT", MACHINE_NOT_WORKING )
COMP( 198?, kaypropc, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Kaypro Corporation", "PC", MACHINE_NOT_WORKING )
COMP( 198?, ledgmodm, ibm5150, 0, siemens, pccga, pc_state, empty_init, "Leading Edge", "Model M", MACHINE_NOT_WORKING )
-COMP( 198?, eaglepc2, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Eagle", "PC-2", MACHINE_NOT_WORKING )
-COMP( 198?, mpx16, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Micromint", "MPX-16", MACHINE_NOT_WORKING )
-COMP( 198?, hstrtpls, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Vendex", "HeadStart Plus", MACHINE_NOT_WORKING )
+COMP( 198?, eaglepc2, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Eagle", "PC-2", MACHINE_NOT_WORKING )
+COMP( 198?, mpx16, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Micromint", "MPX-16", MACHINE_NOT_WORKING )
+COMP( 198?, hstrtpls, ibm5150, 0, pccga, pccga, pc_state, empty_init, "Vendex", "HeadStart Plus", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp
index 7ddec08e2c1..aa590135464 100644
--- a/src/mame/drivers/pc88va.cpp
+++ b/src/mame/drivers/pc88va.cpp
@@ -404,7 +404,7 @@ void pc88va_state::device_timer(emu_timer &timer, device_timer_id id, int param,
pc88va_fdc_motor_start_1(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pc88va_state::device_timer");
+ throw emu_fatalerror("Unknown id in pc88va_state::device_timer");
}
}
diff --git a/src/mame/drivers/pcfx.cpp b/src/mame/drivers/pcfx.cpp
index b478d2c5ebd..1a40a8a32a7 100644
--- a/src/mame/drivers/pcfx.cpp
+++ b/src/mame/drivers/pcfx.cpp
@@ -145,7 +145,7 @@ void pcfx_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
pad_func(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pcfx_state::device_timer");
+ throw emu_fatalerror("Unknown id in pcfx_state::device_timer");
}
}
diff --git a/src/mame/drivers/pentagon.cpp b/src/mame/drivers/pentagon.cpp
index d3ac8ce3d3a..83708376c0e 100644
--- a/src/mame/drivers/pentagon.cpp
+++ b/src/mame/drivers/pentagon.cpp
@@ -137,7 +137,7 @@ void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int para
irq_off(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pentagon_state::device_timer");
+ throw emu_fatalerror("Unknown id in pentagon_state::device_timer");
}
}
diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp
index 08c507743d9..e533baba70a 100644
--- a/src/mame/drivers/pk8020.cpp
+++ b/src/mame/drivers/pk8020.cpp
@@ -11,11 +11,17 @@ Cassette is "best guess", as I was unable to locate any recordings, and
also do not know the commands to save and load. SAVE and LOAD appear when
F2 or shift-F2 pressed (in Korvet), but only produce errors.
-Status as at 2019-07-19:
-Korvet - can boot CP/M, but the keyboard then doesn't work.
-Neiva - keyboard not working
-BK8T - keyboard not working, stuck at a "config" screen.
-Kontur - needs to boot from a floppy and we don't have any that work
+Status as at 2019-09-18:
+Korvet, Neiva - largely working. Error after running something from B drive.
+ - floppy operation is very slow.
+Kontur - needs to boot from a floppy, not working.
+BK8T - Keys to navigate initial config screen are mostly unknown
+ (space - change value; Esc - go to next screen).
+ - Next screen: wants the date and time. You can press enter here.
+ - Wait a while, ignore the big message. You get a menu.
+ - Press 1 for a typewriter thing, or 6 for another menu.
+ - Not sure about the choices; needs someone who can read Russian.
+
****************************************************************************/
diff --git a/src/mame/drivers/plan80.cpp b/src/mame/drivers/plan80.cpp
index b4678cafb24..73cb4580ebe 100644
--- a/src/mame/drivers/plan80.cpp
+++ b/src/mame/drivers/plan80.cpp
@@ -181,7 +181,7 @@ void plan80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in plan80_state::device_timer");
+ throw emu_fatalerror("Unknown id in plan80_state::device_timer");
}
}
diff --git a/src/mame/drivers/pmd85.cpp b/src/mame/drivers/pmd85.cpp
index e5a3a2e8748..d2d9b5a4bf8 100644
--- a/src/mame/drivers/pmd85.cpp
+++ b/src/mame/drivers/pmd85.cpp
@@ -612,9 +612,9 @@ INPUT_PORTS_END
//static const struct CassetteOptions pmd85_cassette_options =
//{
-// 1, /* channels */
-// 16, /* bits per sample */
-// 7200 /* sample frequency */
+// 1, /* channels */
+// 16, /* bits per sample */
+// 7200 /* sample frequency */
//};
/* machine definition */
@@ -670,7 +670,7 @@ void pmd85_state::pmd85(machine_config &config, bool with_uart)
/* cassette */
CASSETTE(config, m_cassette);
m_cassette->set_formats(pmd85_cassette_formats);
-// m_cassette->set_create_opts(&pmd85_cassette_options);
+// m_cassette->set_create_opts(&pmd85_cassette_options);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED);
m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05);
m_cassette->set_interface("pmd85_cass");
diff --git a/src/mame/drivers/ps2.cpp b/src/mame/drivers/ps2.cpp
index af3417d486d..bdc4e186a31 100644
--- a/src/mame/drivers/ps2.cpp
+++ b/src/mame/drivers/ps2.cpp
@@ -40,6 +40,7 @@ void ps2_state::at_softlists(machine_config &config)
SOFTWARE_LIST(config, "pc_disk_list").set_original("ibm5150");
SOFTWARE_LIST(config, "at_disk_list").set_original("ibm5170");
SOFTWARE_LIST(config, "at_cdrom_list").set_original("ibm5170_cdrom");
+ SOFTWARE_LIST(config, "midi_disk_list").set_compatible("midi_flop");
}
void ps2_state::ps2_16_map(address_map &map)
diff --git a/src/mame/drivers/psattack.cpp b/src/mame/drivers/psattack.cpp
index 965592abd9d..98a4e8fe4f3 100644
--- a/src/mame/drivers/psattack.cpp
+++ b/src/mame/drivers/psattack.cpp
@@ -8,10 +8,10 @@
TODO:
- Compact Flash hookup;
- - Requires timed based FIFO renderer, loops until both rear and front
- are equal.
+ - Requires timed based FIFO renderer, loops until both rear and front
+ are equal.
- Enables wavetable IRQ, even if so far no channel enables the submask;
- - Unemulated 93C86 EEPROM device;
+ - Unemulated 93C86 EEPROM device;
=============================================================================
@@ -164,7 +164,7 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
void psattack_mem(address_map &map);
-
+
DECLARE_READ16_MEMBER(cfcard_data_r);
DECLARE_READ8_MEMBER(cfcard_regs_r);
DECLARE_WRITE8_MEMBER(cfcard_regs_w);
@@ -212,7 +212,7 @@ void psattack_state::psattack_mem(address_map &map)
map(0x01500000, 0x01500003).portr("IN0").w(FUNC(psattack_state::output_w));
map(0x01500004, 0x01500007).portr("IN1");
map(0x01500008, 0x0150000b).portr("IN2");
-// 0x0150000c is prolly eeprom
+// 0x0150000c is prolly eeprom
map(0x01800000, 0x01ffffff).m(m_vr0soc, FUNC(vrender0soc_device::regs_map));
// map(0x01802410, 0x01802413) peripheral chip select for cf?
diff --git a/src/mame/drivers/ptcsol.cpp b/src/mame/drivers/ptcsol.cpp
index 3cb2478fb85..17f7a8055ce 100644
--- a/src/mame/drivers/ptcsol.cpp
+++ b/src/mame/drivers/ptcsol.cpp
@@ -250,7 +250,7 @@ void sol20_state::device_timer(emu_timer &timer, device_timer_id id, int param,
sol20_boot(ptr, param);
break;
default:
- assert_always(false, "Unknown id in sol20_state::device_timer");
+ throw emu_fatalerror("Unknown id in sol20_state::device_timer");
}
}
diff --git a/src/mame/drivers/rabbit.cpp b/src/mame/drivers/rabbit.cpp
index e84e0781c59..ab112f18b34 100644
--- a/src/mame/drivers/rabbit.cpp
+++ b/src/mame/drivers/rabbit.cpp
@@ -590,7 +590,7 @@ void rabbit_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in rabbit_state::device_timer");
+ throw emu_fatalerror("Unknown id in rabbit_state::device_timer");
}
}
diff --git a/src/mame/drivers/riscpc.cpp b/src/mame/drivers/riscpc.cpp
index a1b1d7e0c99..cc7e8f8a57c 100644
--- a/src/mame/drivers/riscpc.cpp
+++ b/src/mame/drivers/riscpc.cpp
@@ -1009,7 +1009,7 @@ void riscpc_state::a7000p(machine_config &config)
void riscpc_state::sarpc(machine_config &config)
{
/* Basic machine hardware */
- ARM7(config, m_maincpu, 202000000); // StrongARM
+ SA1110(config, m_maincpu, 202000000); // StrongARM
m_maincpu->set_addrmap(AS_PROGRAM, &riscpc_state::riscpc_map);
base_config(config);
}
@@ -1017,7 +1017,7 @@ void riscpc_state::sarpc(machine_config &config)
void riscpc_state::sarpc_j233(machine_config &config)
{
/* Basic machine hardware */
- ARM7(config, m_maincpu, 233000000); // StrongARM
+ SA1110(config, m_maincpu, 233000000); // StrongARM
m_maincpu->set_addrmap(AS_PROGRAM, &riscpc_state::riscpc_map);
base_config(config);
}
diff --git a/src/mame/drivers/rollerg.cpp b/src/mame/drivers/rollerg.cpp
index 528994e61a0..b6aefa297eb 100644
--- a/src/mame/drivers/rollerg.cpp
+++ b/src/mame/drivers/rollerg.cpp
@@ -62,7 +62,7 @@ void rollerg_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in rollerg_state::device_timer");
+ throw emu_fatalerror("Unknown id in rollerg_state::device_timer");
}
}
diff --git a/src/mame/drivers/saitek_mark5.cpp b/src/mame/drivers/saitek_mark5.cpp
index 6cfb006b121..a232a9545e8 100644
--- a/src/mame/drivers/saitek_mark5.cpp
+++ b/src/mame/drivers/saitek_mark5.cpp
@@ -14,7 +14,7 @@ Mark VI/Philidor was released a year later, it was a plug-in module for the Mark
It's not much stronger than Mark V(retroactively called Mark V/Travemunde).
When using the MAME sensorboard interface with MK VI, reset the board by pressing
-CLEAR before RESET, needed on 1st power-on or when starting a new game.
+CLEAR before RESET, needed on 1st power-on or when starting a new game.
Hardware notes:
- SY6502A @ ~2MHz (19.6608MHz XTAL, bunch of 74113 dividers)
diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp
index 4b7ae972852..9f6d677dccf 100644
--- a/src/mame/drivers/samcoupe.cpp
+++ b/src/mame/drivers/samcoupe.cpp
@@ -65,7 +65,7 @@ void samcoupe_state::device_timer(emu_timer &timer, device_timer_id id, int para
sam_video_update_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in samcoupe_state::device_timer");
+ throw emu_fatalerror("Unknown id in samcoupe_state::device_timer");
}
}
diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp
index aa3c42fb2c1..a194c4d37d0 100644
--- a/src/mame/drivers/segac2.cpp
+++ b/src/mame/drivers/segac2.cpp
@@ -1542,10 +1542,10 @@ WRITE_LINE_MEMBER(segac2_state::vdp_lv4irqline_callback_c2)
}
/*
- sound output balance (tfrceac)
- reference : https://youtu.be/AOmeWp9qe5E
- reference 2 : https://youtu.be/Tq8VkJYmij8
- reference 3: https://youtu.be/VId_HWdNuyA
+ sound output balance (tfrceac)
+ reference : https://youtu.be/AOmeWp9qe5E
+ reference 2 : https://youtu.be/Tq8VkJYmij8
+ reference 3: https://youtu.be/VId_HWdNuyA
*/
void segac2_state::segac(machine_config &config)
{
diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp
index b17c0975289..e108111ee1c 100644
--- a/src/mame/drivers/segaorun.cpp
+++ b/src/mame/drivers/segaorun.cpp
@@ -605,7 +605,7 @@ void segaorun_state::device_timer(emu_timer &timer, device_timer_id id, int para
}
default:
- assert_always(false, "Unknown id in segaorun_state::device_timer");
+ throw emu_fatalerror("Unknown id in segaorun_state::device_timer");
}
}
diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp
index 872152d2a02..e2b99336ef1 100644
--- a/src/mame/drivers/segas32.cpp
+++ b/src/mame/drivers/segas32.cpp
@@ -3645,7 +3645,7 @@ ROM_END
Sega Game ID codes:
GAME BD NO. 833-8389-02 EXHAUST NOTE
- ROM BD. 834-8439-02
+ ROM BD. 834-8439-02 or 834-8439-05 for stand alone version
MAIN BD. 837-7428 (SYSTEM 32 COM)
Link PCB NO. 837-8223-01
A/D BD NO. 837-7536
@@ -3663,20 +3663,20 @@ ROM_START( f1en )
ROM_LOAD_x2( "epr-14446.ic22", 0x300000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
- ROM_LOAD32_BYTE( "mpr-14362", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
- ROM_LOAD32_BYTE( "mpr-14361", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
- ROM_LOAD32_BYTE( "mpr-14360", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
- ROM_LOAD32_BYTE( "mpr-14359", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
+ ROM_LOAD32_BYTE( "mpr-14362.ic38", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
+ ROM_LOAD32_BYTE( "mpr-14361.ic34", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
+ ROM_LOAD32_BYTE( "mpr-14360.ic29", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
+ ROM_LOAD32_BYTE( "mpr-14359.ic25", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
ROM_REGION32_BE( 0x800000, "mainpcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr-14370", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14369", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14368", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14367", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14366", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14365", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14364", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14363", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14370.ic36", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14369.ic32", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14368.ic27", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14367.ic23", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14366.ic37", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14365.ic33", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14364.ic28", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14363.ic24", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14452a.ic6", 0x000000, 0x020000, CRC(b5b4a9d9) SHA1(6699c15dc1155c3cee33a06d320acbff0ab5ad11) )
@@ -3690,20 +3690,20 @@ ROM_START( f1en )
ROM_LOAD_x2( "epr-14446.ic22", 0x300000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
ROM_REGION( 0x100000, "slavepcb:gfx1", 0 ) /* tiles */
- ROM_LOAD32_BYTE( "mpr-14362", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
- ROM_LOAD32_BYTE( "mpr-14361", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
- ROM_LOAD32_BYTE( "mpr-14360", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
- ROM_LOAD32_BYTE( "mpr-14359", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
+ ROM_LOAD32_BYTE( "mpr-14362.ic38", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
+ ROM_LOAD32_BYTE( "mpr-14361.ic34", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
+ ROM_LOAD32_BYTE( "mpr-14360.ic29", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
+ ROM_LOAD32_BYTE( "mpr-14359.ic25", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
ROM_REGION32_BE( 0x800000, "slavepcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr-14370", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14369", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14368", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14367", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14366", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14365", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14364", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14363", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14370.ic36", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14369.ic32", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14368.ic27", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14367.ic23", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14366.ic37", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14365.ic33", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14364.ic28", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14363.ic24", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
ROM_END
@@ -3713,7 +3713,7 @@ ROM_END
Sega Game ID codes:
GAME BD NO. 833-8389-01 EXHAUST NOTE
- ROM BD. 834-8439-01 or 834-8439-04
+ ROM BD. 834-8439-01 or 834-8439-04 for stand alone version
MAIN BD. 837-7428 (SYSTEM 32 COM)
Link PCB NO. 837-8223-01
A/D BD NO. 837-7536
@@ -3731,20 +3731,20 @@ ROM_START( f1enu ) // ROM PCB number is 834-8439-04
ROM_LOAD_x2( "epr-14446.ic22", 0x300000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
- ROM_LOAD32_BYTE( "mpr-14362", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
- ROM_LOAD32_BYTE( "mpr-14361", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
- ROM_LOAD32_BYTE( "mpr-14360", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
- ROM_LOAD32_BYTE( "mpr-14359", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
+ ROM_LOAD32_BYTE( "mpr-14362.ic38", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
+ ROM_LOAD32_BYTE( "mpr-14361.ic34", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
+ ROM_LOAD32_BYTE( "mpr-14360.ic29", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
+ ROM_LOAD32_BYTE( "mpr-14359.ic25", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
ROM_REGION32_BE( 0x800000, "mainpcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr-14370", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14369", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14368", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14367", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14366", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14365", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14364", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14363", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14370.ic36", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14369.ic32", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14368.ic27", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14367.ic23", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14366.ic37", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14365.ic33", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14364.ic28", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14363.ic24", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14451a.ic6", 0x000000, 0x020000, CRC(e17259c9) SHA1(be789b7630b7265e19ea2c80f603caff9cec37f8) )
@@ -3758,20 +3758,20 @@ ROM_START( f1enu ) // ROM PCB number is 834-8439-04
ROM_LOAD_x2( "epr-14446.ic22", 0x300000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
ROM_REGION( 0x100000, "slavepcb:gfx1", 0 ) /* tiles */
- ROM_LOAD32_BYTE( "mpr-14362", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
- ROM_LOAD32_BYTE( "mpr-14361", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
- ROM_LOAD32_BYTE( "mpr-14360", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
- ROM_LOAD32_BYTE( "mpr-14359", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
+ ROM_LOAD32_BYTE( "mpr-14362.ic38", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
+ ROM_LOAD32_BYTE( "mpr-14361.ic34", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
+ ROM_LOAD32_BYTE( "mpr-14360.ic29", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
+ ROM_LOAD32_BYTE( "mpr-14359.ic25", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
ROM_REGION32_BE( 0x800000, "slavepcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr-14370", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14369", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14368", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14367", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14366", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14365", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14364", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14363", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14370.ic36", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14369.ic32", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14368.ic27", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14367.ic23", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14366.ic37", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14365.ic33", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14364.ic28", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14363.ic24", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
ROM_END
/**************************************************************************************************************************
@@ -3798,20 +3798,20 @@ ROM_START( f1enj ) // ROM PCB number is 834-8439-04
ROM_LOAD_x2( "epr-14446.ic22", 0x300000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
- ROM_LOAD32_BYTE( "mpr-14362", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
- ROM_LOAD32_BYTE( "mpr-14361", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
- ROM_LOAD32_BYTE( "mpr-14360", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
- ROM_LOAD32_BYTE( "mpr-14359", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
+ ROM_LOAD32_BYTE( "mpr-14362.ic38", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
+ ROM_LOAD32_BYTE( "mpr-14361.ic34", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
+ ROM_LOAD32_BYTE( "mpr-14360.ic29", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
+ ROM_LOAD32_BYTE( "mpr-14359.ic25", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
ROM_REGION32_BE( 0x800000, "mainpcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr-14370", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14369", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14368", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14367", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14366", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14365", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14364", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14363", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14370.ic36", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14369.ic32", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14368.ic27", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14367.ic23", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14366.ic37", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14365.ic33", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14364.ic28", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14363.ic24", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14450a.ic6", 0x000000, 0x020000, CRC(10f62723) SHA1(68fcd6655798f348678e3cc8857c6d1cb46e0987) )
@@ -3825,20 +3825,20 @@ ROM_START( f1enj ) // ROM PCB number is 834-8439-04
ROM_LOAD_x2( "epr-14446.ic22", 0x300000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
ROM_REGION( 0x100000, "slavepcb:gfx1", 0 ) /* tiles */
- ROM_LOAD32_BYTE( "mpr-14362", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
- ROM_LOAD32_BYTE( "mpr-14361", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
- ROM_LOAD32_BYTE( "mpr-14360", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
- ROM_LOAD32_BYTE( "mpr-14359", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
+ ROM_LOAD32_BYTE( "mpr-14362.ic38", 0x000000, 0x040000, CRC(fb1c4e79) SHA1(38ee23763b9e5bb62bbc54cab95041415404f0c4) )
+ ROM_LOAD32_BYTE( "mpr-14361.ic34", 0x000002, 0x040000, CRC(e3204bda) SHA1(34157e80edd6d685bd5a5e23b1e0130a5f3d138a) )
+ ROM_LOAD32_BYTE( "mpr-14360.ic29", 0x000001, 0x040000, CRC(c5e8da79) SHA1(662a6c146fe3d0b8763d845379c06d0ee6ced1ed) )
+ ROM_LOAD32_BYTE( "mpr-14359.ic25", 0x000003, 0x040000, CRC(70305c68) SHA1(7a6a1bf7381eba8cc1c3897497b32ca63316972a) )
ROM_REGION32_BE( 0x800000, "slavepcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr-14370", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14369", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14368", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14367", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14366", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14365", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14364", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
- ROMX_LOAD( "mpr-14363", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14370.ic36", 0x000000, 0x080000, CRC(fda78289) SHA1(3740affdcc738c50d07ff3e5b592bdf8a8b6be15) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14369.ic32", 0x000001, 0x080000, CRC(7765116d) SHA1(9493148aa84adc90143cf638265d4c55bfb43990) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14368.ic27", 0x000002, 0x080000, CRC(5744a30e) SHA1(98544fb234a8e93716e951d5414a490845e213c5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14367.ic23", 0x000003, 0x080000, CRC(77bb9003) SHA1(6370fdeab4967976840d752577cd860b9ce8efca) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14366.ic37", 0x000004, 0x080000, CRC(21078e83) SHA1(f35f643c28aad3bf18cb9906b114c4f49b7b4cd1) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14365.ic33", 0x000005, 0x080000, CRC(36913790) SHA1(4a447cffb44b023fe1441277db1e411d4cd119eb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14364.ic28", 0x000006, 0x080000, CRC(0fa12ecd) SHA1(6a34c7718edffbeddded8786e11cac181b485ebd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14363.ic24", 0x000007, 0x080000, CRC(f3427a56) SHA1(6a99d7432dfff35470ddcca5cfde36689a77e706) , ROM_SKIP(7) )
ROM_END
@@ -4381,31 +4381,31 @@ ROM_END
*/
ROM_START( orunners )
ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
- ROM_LOAD32_WORD_x4( "epr15620.ic37", 0x000000, 0x020000, CRC(84f5ad92) SHA1(1f9cb04b42b2d450be93400d9979a7910eaf05d1) )
- ROM_LOAD32_WORD_x4( "epr15621.ic40", 0x000002, 0x020000, CRC(d98b765a) SHA1(b58567e976228267a86af53de2135bc0b247a44a) )
- ROM_LOAD32_WORD( "mpr15538.ic36", 0x100000, 0x080000, CRC(93958820) SHA1(e19b6f18a5707dbb64ae009d63c05eac5bac4a81) )
- ROM_LOAD32_WORD( "mpr15539.ic39", 0x100002, 0x080000, CRC(219760fa) SHA1(bd62a83de9c9542f6da454a87dc4947492f65c52) )
+ ROM_LOAD32_WORD_x4( "epr-15620.ic37", 0x000000, 0x020000, CRC(84f5ad92) SHA1(1f9cb04b42b2d450be93400d9979a7910eaf05d1) )
+ ROM_LOAD32_WORD_x4( "epr-15621.ic40", 0x000002, 0x020000, CRC(d98b765a) SHA1(b58567e976228267a86af53de2135bc0b247a44a) )
+ ROM_LOAD32_WORD( "mpr-15538.ic36", 0x100000, 0x080000, CRC(93958820) SHA1(e19b6f18a5707dbb64ae009d63c05eac5bac4a81) )
+ ROM_LOAD32_WORD( "mpr-15539.ic39", 0x100002, 0x080000, CRC(219760fa) SHA1(bd62a83de9c9542f6da454a87dc4947492f65c52) )
ROM_REGION( 0x80000, "mainpcb:soundcpu", 0 ) /* sound CPU */
- ROM_LOAD( "epr15550.ic31", 0x00000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
+ ROM_LOAD( "epr-15550.ic31", 0x00000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
- ROM_LOAD16_BYTE( "mpr15548.ic3", 0x000000, 0x200000, CRC(b6470a66) SHA1(e1544590c02d41f62f82a4d771b893fb0f2734c7) )
- ROM_LOAD16_BYTE( "mpr15549.ic11", 0x000001, 0x200000, CRC(81d12520) SHA1(1555893941e832f00ad3d0b3ad0c34a0d3a1c58a) )
+ ROM_LOAD16_BYTE( "mpr-15548.ic3", 0x000000, 0x200000, CRC(b6470a66) SHA1(e1544590c02d41f62f82a4d771b893fb0f2734c7) )
+ ROM_LOAD16_BYTE( "mpr-15549.ic11", 0x000001, 0x200000, CRC(81d12520) SHA1(1555893941e832f00ad3d0b3ad0c34a0d3a1c58a) )
ROM_REGION32_BE( 0x1000000, "mainpcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr15540.ic14", 0x000000, 0x200000, CRC(a10d72b4) SHA1(6d9d5e20be6721b53ce49df4d5a1bbd91f5b3aed) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15542.ic15", 0x000002, 0x200000, CRC(40952374) SHA1(c669ef52508bc2f49cf812dc86ac98fb535471fa) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15544.ic10", 0x000004, 0x200000, CRC(39e3df45) SHA1(38a7b21617b45613b05509dda388f8f7770b186c) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15546.ic38", 0x000006, 0x200000, CRC(e3fcc12c) SHA1(1cf7e05c7873f68789a27a91cddf471df40d7907) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15541.ic22", 0x800000, 0x200000, CRC(a2003c2d) SHA1(200a2c7d78d3f5f28909267fdcdbddd58c5f5fa2) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15543.ic23", 0x800002, 0x200000, CRC(933e8e7b) SHA1(0d53286f524f47851a483569dc37e9f6d34cc5f4) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15545.ic18", 0x800004, 0x200000, CRC(53dd0235) SHA1(4aee5ae1820ff933b6bd8a54bdbf989c0bc95c1a) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15547.ic41", 0x800006, 0x200000, CRC(edcb2a43) SHA1(f0bcfcc749ca0267f85bf9838164869912944d00) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15540.ic14", 0x000000, 0x200000, CRC(a10d72b4) SHA1(6d9d5e20be6721b53ce49df4d5a1bbd91f5b3aed) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15542.ic15", 0x000002, 0x200000, CRC(40952374) SHA1(c669ef52508bc2f49cf812dc86ac98fb535471fa) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15544.ic10", 0x000004, 0x200000, CRC(39e3df45) SHA1(38a7b21617b45613b05509dda388f8f7770b186c) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15546.ic38", 0x000006, 0x200000, CRC(e3fcc12c) SHA1(1cf7e05c7873f68789a27a91cddf471df40d7907) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15541.ic22", 0x800000, 0x200000, CRC(a2003c2d) SHA1(200a2c7d78d3f5f28909267fdcdbddd58c5f5fa2) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15543.ic23", 0x800002, 0x200000, CRC(933e8e7b) SHA1(0d53286f524f47851a483569dc37e9f6d34cc5f4) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15545.ic18", 0x800004, 0x200000, CRC(53dd0235) SHA1(4aee5ae1820ff933b6bd8a54bdbf989c0bc95c1a) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15547.ic41", 0x800006, 0x200000, CRC(edcb2a43) SHA1(f0bcfcc749ca0267f85bf9838164869912944d00) , ROM_SKIP(6)|ROM_GROUPWORD )
ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
- ROM_LOAD( "mpr15551.ic1", 0x000000, 0x200000, CRC(4894bc73) SHA1(351f5c03fb430fd87df915dfe3a377b5ada622c4) )
- ROM_LOAD( "mpr15552.ic2", 0x200000, 0x200000, CRC(1c4b5e73) SHA1(50a8e9a200575a3522a51bf094aa0e87b90bb0a3) )
+ ROM_LOAD( "mpr-15551.ic1", 0x000000, 0x200000, CRC(4894bc73) SHA1(351f5c03fb430fd87df915dfe3a377b5ada622c4) )
+ ROM_LOAD( "mpr-15552.ic2", 0x200000, 0x200000, CRC(1c4b5e73) SHA1(50a8e9a200575a3522a51bf094aa0e87b90bb0a3) )
ROM_END
/**************************************************************************************************************************
@@ -4419,31 +4419,31 @@ ROM_END
*/
ROM_START( orunnersu )
ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
- ROM_LOAD32_WORD_x4( "epr15618.ic37", 0x000000, 0x020000, CRC(25647f76) SHA1(9f882921ebb2f078350295c322b263f75812c053) )
- ROM_LOAD32_WORD_x4( "epr15619.ic40", 0x000002, 0x020000, CRC(2a558f95) SHA1(616ec0a7b251da61a49b933c58895b1a4d39417a) )
- ROM_LOAD32_WORD( "mpr15538.ic36", 0x100000, 0x080000, CRC(93958820) SHA1(e19b6f18a5707dbb64ae009d63c05eac5bac4a81) )
- ROM_LOAD32_WORD( "mpr15539.ic39", 0x100002, 0x080000, CRC(219760fa) SHA1(bd62a83de9c9542f6da454a87dc4947492f65c52) )
+ ROM_LOAD32_WORD_x4( "epr-15618.ic37", 0x000000, 0x020000, CRC(25647f76) SHA1(9f882921ebb2f078350295c322b263f75812c053) )
+ ROM_LOAD32_WORD_x4( "epr-15619.ic40", 0x000002, 0x020000, CRC(2a558f95) SHA1(616ec0a7b251da61a49b933c58895b1a4d39417a) )
+ ROM_LOAD32_WORD( "mpr-15538.ic36", 0x100000, 0x080000, CRC(93958820) SHA1(e19b6f18a5707dbb64ae009d63c05eac5bac4a81) )
+ ROM_LOAD32_WORD( "mpr-15539.ic39", 0x100002, 0x080000, CRC(219760fa) SHA1(bd62a83de9c9542f6da454a87dc4947492f65c52) )
ROM_REGION( 0x80000, "mainpcb:soundcpu", 0 ) /* sound CPU */
- ROM_LOAD( "epr15550.ic31", 0x00000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
+ ROM_LOAD( "epr-15550.ic31", 0x00000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
- ROM_LOAD16_BYTE( "mpr15548.ic3", 0x000000, 0x200000, CRC(b6470a66) SHA1(e1544590c02d41f62f82a4d771b893fb0f2734c7) )
- ROM_LOAD16_BYTE( "mpr15549.ic11", 0x000001, 0x200000, CRC(81d12520) SHA1(1555893941e832f00ad3d0b3ad0c34a0d3a1c58a) )
+ ROM_LOAD16_BYTE( "mpr-15548.ic3", 0x000000, 0x200000, CRC(b6470a66) SHA1(e1544590c02d41f62f82a4d771b893fb0f2734c7) )
+ ROM_LOAD16_BYTE( "mpr-15549.ic11", 0x000001, 0x200000, CRC(81d12520) SHA1(1555893941e832f00ad3d0b3ad0c34a0d3a1c58a) )
ROM_REGION32_BE( 0x1000000, "mainpcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr15540.ic14", 0x000000, 0x200000, CRC(a10d72b4) SHA1(6d9d5e20be6721b53ce49df4d5a1bbd91f5b3aed) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15542.ic15", 0x000002, 0x200000, CRC(40952374) SHA1(c669ef52508bc2f49cf812dc86ac98fb535471fa) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15544.ic10", 0x000004, 0x200000, CRC(39e3df45) SHA1(38a7b21617b45613b05509dda388f8f7770b186c) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15546.ic38", 0x000006, 0x200000, CRC(e3fcc12c) SHA1(1cf7e05c7873f68789a27a91cddf471df40d7907) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15541.ic22", 0x800000, 0x200000, CRC(a2003c2d) SHA1(200a2c7d78d3f5f28909267fdcdbddd58c5f5fa2) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15543.ic23", 0x800002, 0x200000, CRC(933e8e7b) SHA1(0d53286f524f47851a483569dc37e9f6d34cc5f4) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15545.ic18", 0x800004, 0x200000, CRC(53dd0235) SHA1(4aee5ae1820ff933b6bd8a54bdbf989c0bc95c1a) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15547.ic41", 0x800006, 0x200000, CRC(edcb2a43) SHA1(f0bcfcc749ca0267f85bf9838164869912944d00) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15540.ic14", 0x000000, 0x200000, CRC(a10d72b4) SHA1(6d9d5e20be6721b53ce49df4d5a1bbd91f5b3aed) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15542.ic15", 0x000002, 0x200000, CRC(40952374) SHA1(c669ef52508bc2f49cf812dc86ac98fb535471fa) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15544.ic10", 0x000004, 0x200000, CRC(39e3df45) SHA1(38a7b21617b45613b05509dda388f8f7770b186c) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15546.ic38", 0x000006, 0x200000, CRC(e3fcc12c) SHA1(1cf7e05c7873f68789a27a91cddf471df40d7907) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15541.ic22", 0x800000, 0x200000, CRC(a2003c2d) SHA1(200a2c7d78d3f5f28909267fdcdbddd58c5f5fa2) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15543.ic23", 0x800002, 0x200000, CRC(933e8e7b) SHA1(0d53286f524f47851a483569dc37e9f6d34cc5f4) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15545.ic18", 0x800004, 0x200000, CRC(53dd0235) SHA1(4aee5ae1820ff933b6bd8a54bdbf989c0bc95c1a) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15547.ic41", 0x800006, 0x200000, CRC(edcb2a43) SHA1(f0bcfcc749ca0267f85bf9838164869912944d00) , ROM_SKIP(6)|ROM_GROUPWORD )
ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
- ROM_LOAD( "mpr15551.ic1", 0x000000, 0x200000, CRC(4894bc73) SHA1(351f5c03fb430fd87df915dfe3a377b5ada622c4) )
- ROM_LOAD( "mpr15552.ic2", 0x200000, 0x200000, CRC(1c4b5e73) SHA1(50a8e9a200575a3522a51bf094aa0e87b90bb0a3) )
+ ROM_LOAD( "mpr-15551.ic1", 0x000000, 0x200000, CRC(4894bc73) SHA1(351f5c03fb430fd87df915dfe3a377b5ada622c4) )
+ ROM_LOAD( "mpr-15552.ic2", 0x200000, 0x200000, CRC(1c4b5e73) SHA1(50a8e9a200575a3522a51bf094aa0e87b90bb0a3) )
ROM_END
/**************************************************************************************************************************
@@ -4457,31 +4457,31 @@ ROM_END
*/
ROM_START( orunnersj )
ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
- ROM_LOAD32_WORD_x4( "epr15616.ic37", 0x000000, 0x020000, CRC(fb550545) SHA1(2f2c36843b115f5417e1f2ccd4a34ebf91265190) ) /* Need to verify the EPR numbers */
- ROM_LOAD32_WORD_x4( "epr15617.ic40", 0x000002, 0x020000, CRC(6bb741e0) SHA1(d92087a2c0b6de4287e569eecf9758615a85d1eb) ) /* Need to verify the EPR numbers */
- ROM_LOAD32_WORD( "mpr15538.ic36", 0x100000, 0x080000, CRC(93958820) SHA1(e19b6f18a5707dbb64ae009d63c05eac5bac4a81) )
- ROM_LOAD32_WORD( "mpr15539.ic39", 0x100002, 0x080000, CRC(219760fa) SHA1(bd62a83de9c9542f6da454a87dc4947492f65c52) )
+ ROM_LOAD32_WORD_x4( "epr-15616.ic37", 0x000000, 0x020000, CRC(fb550545) SHA1(2f2c36843b115f5417e1f2ccd4a34ebf91265190) ) /* Need to verify the EPR numbers */
+ ROM_LOAD32_WORD_x4( "epr-15617.ic40", 0x000002, 0x020000, CRC(6bb741e0) SHA1(d92087a2c0b6de4287e569eecf9758615a85d1eb) ) /* Need to verify the EPR numbers */
+ ROM_LOAD32_WORD( "mpr-15538.ic36", 0x100000, 0x080000, CRC(93958820) SHA1(e19b6f18a5707dbb64ae009d63c05eac5bac4a81) )
+ ROM_LOAD32_WORD( "mpr-15539.ic39", 0x100002, 0x080000, CRC(219760fa) SHA1(bd62a83de9c9542f6da454a87dc4947492f65c52) )
ROM_REGION( 0x80000, "mainpcb:soundcpu", 0 ) /* sound CPU */
- ROM_LOAD( "epr15550.ic31", 0x00000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
+ ROM_LOAD( "epr-15550.ic31", 0x00000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
- ROM_LOAD16_BYTE( "mpr15548.ic3", 0x000000, 0x200000, CRC(b6470a66) SHA1(e1544590c02d41f62f82a4d771b893fb0f2734c7) )
- ROM_LOAD16_BYTE( "mpr15549.ic11", 0x000001, 0x200000, CRC(81d12520) SHA1(1555893941e832f00ad3d0b3ad0c34a0d3a1c58a) )
+ ROM_LOAD16_BYTE( "mpr-15548.ic3", 0x000000, 0x200000, CRC(b6470a66) SHA1(e1544590c02d41f62f82a4d771b893fb0f2734c7) )
+ ROM_LOAD16_BYTE( "mpr-15549.ic11", 0x000001, 0x200000, CRC(81d12520) SHA1(1555893941e832f00ad3d0b3ad0c34a0d3a1c58a) )
ROM_REGION32_BE( 0x1000000, "mainpcb:sprites", 0 ) /* sprites */
- ROMX_LOAD( "mpr15540.ic14", 0x000000, 0x200000, CRC(a10d72b4) SHA1(6d9d5e20be6721b53ce49df4d5a1bbd91f5b3aed) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15542.ic15", 0x000002, 0x200000, CRC(40952374) SHA1(c669ef52508bc2f49cf812dc86ac98fb535471fa) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15544.ic10", 0x000004, 0x200000, CRC(39e3df45) SHA1(38a7b21617b45613b05509dda388f8f7770b186c) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15546.ic38", 0x000006, 0x200000, CRC(e3fcc12c) SHA1(1cf7e05c7873f68789a27a91cddf471df40d7907) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15541.ic22", 0x800000, 0x200000, CRC(a2003c2d) SHA1(200a2c7d78d3f5f28909267fdcdbddd58c5f5fa2) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15543.ic23", 0x800002, 0x200000, CRC(933e8e7b) SHA1(0d53286f524f47851a483569dc37e9f6d34cc5f4) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15545.ic18", 0x800004, 0x200000, CRC(53dd0235) SHA1(4aee5ae1820ff933b6bd8a54bdbf989c0bc95c1a) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROMX_LOAD( "mpr15547.ic41", 0x800006, 0x200000, CRC(edcb2a43) SHA1(f0bcfcc749ca0267f85bf9838164869912944d00) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15540.ic14", 0x000000, 0x200000, CRC(a10d72b4) SHA1(6d9d5e20be6721b53ce49df4d5a1bbd91f5b3aed) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15542.ic15", 0x000002, 0x200000, CRC(40952374) SHA1(c669ef52508bc2f49cf812dc86ac98fb535471fa) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15544.ic10", 0x000004, 0x200000, CRC(39e3df45) SHA1(38a7b21617b45613b05509dda388f8f7770b186c) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15546.ic38", 0x000006, 0x200000, CRC(e3fcc12c) SHA1(1cf7e05c7873f68789a27a91cddf471df40d7907) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15541.ic22", 0x800000, 0x200000, CRC(a2003c2d) SHA1(200a2c7d78d3f5f28909267fdcdbddd58c5f5fa2) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15543.ic23", 0x800002, 0x200000, CRC(933e8e7b) SHA1(0d53286f524f47851a483569dc37e9f6d34cc5f4) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15545.ic18", 0x800004, 0x200000, CRC(53dd0235) SHA1(4aee5ae1820ff933b6bd8a54bdbf989c0bc95c1a) , ROM_SKIP(6)|ROM_GROUPWORD )
+ ROMX_LOAD( "mpr-15547.ic41", 0x800006, 0x200000, CRC(edcb2a43) SHA1(f0bcfcc749ca0267f85bf9838164869912944d00) , ROM_SKIP(6)|ROM_GROUPWORD )
ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
- ROM_LOAD( "mpr15551.ic1", 0x000000, 0x200000, CRC(4894bc73) SHA1(351f5c03fb430fd87df915dfe3a377b5ada622c4) )
- ROM_LOAD( "mpr15552.ic2", 0x200000, 0x200000, CRC(1c4b5e73) SHA1(50a8e9a200575a3522a51bf094aa0e87b90bb0a3) )
+ ROM_LOAD( "mpr-15551.ic1", 0x000000, 0x200000, CRC(4894bc73) SHA1(351f5c03fb430fd87df915dfe3a377b5ada622c4) )
+ ROM_LOAD( "mpr-15552.ic2", 0x200000, 0x200000, CRC(1c4b5e73) SHA1(50a8e9a200575a3522a51bf094aa0e87b90bb0a3) )
ROM_END
@@ -4973,8 +4973,8 @@ Input sub board: 837-7968
*/
ROM_START( spidmanj )
ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
- ROM_LOAD_x4( "epr-14287.ic13", 0x000000, 0x020000, CRC(403ccdc9) SHA1(4e240c749e362dfa5c579ccbdff18ae3fab58dff) )
- ROM_LOAD_x4( "epr-14286.ic7", 0x080000, 0x020000, CRC(5c2b4e2c) SHA1(79229594710416510f85e6e53ea578789afd4091) )
+ ROM_LOAD_x4( "epr-14287.ic13", 0x000000, 0x020000, CRC(403ccdc9) SHA1(4e240c749e362dfa5c579ccbdff18ae3fab58dff) )
+ ROM_LOAD_x4( "epr-14286.ic7", 0x080000, 0x020000, CRC(5c2b4e2c) SHA1(79229594710416510f85e6e53ea578789afd4091) )
ROM_LOAD16_BYTE_x4( "epr-14281.ic14", 0x100000, 0x020000, CRC(8a746c42) SHA1(fa3729ec3aa4b3c59322408146ce2cfbf5a11b98) )
ROM_LOAD16_BYTE_x4( "epr-14280.ic6", 0x100001, 0x020000, CRC(3c8148f7) SHA1(072b7982bb95e7a9ab77844b59020146c262488d) )
@@ -5010,8 +5010,8 @@ ROM_START( scross )
ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x2( "epr-15093.ic37", 0x000000, 0x040000, CRC(2adc7a4b) SHA1(dca71f00d94898c0758394704d819e13482bf120) )
ROM_LOAD32_WORD_x2( "epr-15094.ic40", 0x000002, 0x040000, CRC(bbb0ae73) SHA1(0d8837706405f301adf8fa85c8d4813d7600af98) )
- ROM_LOAD32_WORD( "mpr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
- ROM_LOAD32_WORD( "mpr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
+ ROM_LOAD32_WORD( "mpr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
+ ROM_LOAD32_WORD( "mpr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
ROM_REGION( 0x80000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15192.ic31", 0x00000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
@@ -5041,8 +5041,8 @@ ROM_END
ROM_START( scrossa )
ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
// 37/40 were missing labels
- ROM_LOAD32_WORD_x2( "ic37", 0x000000, 0x040000, CRC(240a7655) SHA1(7cfdce002fb4783e8c1debf206922d88647c106e) )
- ROM_LOAD32_WORD_x2( "ic40", 0x000002, 0x040000, CRC(3a073060) SHA1(c92c8d8921d94d85c8484c103cbf9cd6ad651333) )
+ ROM_LOAD32_WORD_x2( "ic37", 0x000000, 0x040000, CRC(240a7655) SHA1(7cfdce002fb4783e8c1debf206922d88647c106e) )
+ ROM_LOAD32_WORD_x2( "ic40", 0x000002, 0x040000, CRC(3a073060) SHA1(c92c8d8921d94d85c8484c103cbf9cd6ad651333) )
ROM_LOAD32_WORD( "mpr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
ROM_LOAD32_WORD( "mpr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
@@ -5937,7 +5937,7 @@ GAME( 1992, arescueu, arescue, sega_system32_dual_direct_upd7725, arescue, seg
GAME( 1992, arescuej, arescue, sega_system32_dual_direct_upd7725, arescue, segas32_new_state, init_arescue, ROT0, "Sega", "Air Rescue (Japan)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, alien3, 0, sega_system32_analog, alien3, segas32_new_state, init_alien3, ROT0, "Sega", "Alien3: The Gun (World)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1993, alien3u, alien3, sega_system32_analog, alien3, segas32_new_state, init_alien3, ROT0, "Sega", "Alien3: The Gun (US)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1993, alien3u, alien3, sega_system32_analog, alien3, segas32_new_state, init_alien3, ROT0, "Sega", "Alien3: The Gun (US, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, alien3j, alien3, sega_system32_analog, alien3, segas32_new_state, init_alien3, ROT0, "Sega", "Alien3: The Gun (Japan)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1991, arabfgt, 0, sega_system32_arf, arabfgt, segas32_new_state, init_arabfgt, ROT0, "Sega", "Arabian Fight (World)", MACHINE_IMPERFECT_GRAPHICS ) /* Released in 03.1992 */
@@ -5950,23 +5950,23 @@ GAME( 1992, brivalj, brival, sega_system32_4p, brival, segas32_ne
GAME( 1992, darkedge, 0, sega_system32_4p, darkedge, segas32_new_state, init_darkedge, ROT0, "Sega", "Dark Edge (World)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1992, darkedgej, darkedge, sega_system32_4p, darkedge, segas32_new_state, init_darkedge, ROT0, "Sega", "Dark Edge (Japan)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, dbzvrvs, 0, sega_system32_analog, dbzvrvs, segas32_new_state, init_dbzvrvs, ROT0, "Sega / Banpresto", "Dragon Ball Z V.R.V.S. (Japan)", MACHINE_IMPERFECT_GRAPHICS)
+GAME( 1994, dbzvrvs, 0, sega_system32_analog, dbzvrvs, segas32_new_state, init_dbzvrvs, ROT0, "Sega / Banpresto", "Dragon Ball Z V.R.V.S. (Japan, Rev A)", MACHINE_IMPERFECT_GRAPHICS)
-GAME( 1991, f1en, 0, sega_system32_dual_direct, f1en, segas32_new_state, init_f1en, ROT0, "Sega", "F1 Exhaust Note (World)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1991, f1enu, f1en, sega_system32_dual_direct, f1en, segas32_new_state, init_f1en, ROT0, "Sega", "F1 Exhaust Note (US)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1991, f1enj, f1en, sega_system32_dual_direct, f1en, segas32_new_state, init_f1en, ROT0, "Sega", "F1 Exhaust Note (Japan)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1991, f1en, 0, sega_system32_dual_direct, f1en, segas32_new_state, init_f1en, ROT0, "Sega", "F1 Exhaust Note (World, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1991, f1enu, f1en, sega_system32_dual_direct, f1en, segas32_new_state, init_f1en, ROT0, "Sega", "F1 Exhaust Note (US, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1991, f1enj, f1en, sega_system32_dual_direct, f1en, segas32_new_state, init_f1en, ROT0, "Sega", "F1 Exhaust Note (Japan, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, f1lap, 0, sega_system32_analog, f1lap, segas32_new_state, init_f1lap, ROT0, "Sega", "F1 Super Lap (World)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, f1lapt, f1lap, sega_system32_analog, f1lap, segas32_new_state, init_f1lapt, ROT0, "Sega", "F1 Super Lap (World, Unprotected)", MACHINE_IMPERFECT_GRAPHICS ) /* Factory unprotected */
GAME( 1993, f1lapj, f1lap, sega_system32_analog, f1lap, segas32_new_state, init_f1lap, ROT0, "Sega", "F1 Super Lap (Japan)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1992, ga2, 0, sega_system32_ga2, ga2, segas32_new_state, init_ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (World)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1992, ga2u, ga2, sega_system32_ga2, ga2u, segas32_new_state, init_ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (US)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1992, ga2, 0, sega_system32_ga2, ga2, segas32_new_state, init_ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (World, Rev B)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1992, ga2u, ga2, sega_system32_ga2, ga2u, segas32_new_state, init_ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (US, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1992, ga2j, ga2, sega_system32_ga2, ga2, segas32_new_state, init_ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (Japan)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1992, holo, 0, sega_system32, holo, segas32_new_state, init_holo, ORIENTATION_FLIP_Y, "Sega", "Holosseum (US)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1992, holo, 0, sega_system32, holo, segas32_new_state, init_holo, ORIENTATION_FLIP_Y, "Sega", "Holosseum (US, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1993, jpark, 0, sega_system32_analog, jpark, segas32_new_state, init_jpark, ROT0, "Sega", "Jurassic Park (World)", MACHINE_IMPERFECT_GRAPHICS ) /* Released in 02.1994 */
+GAME( 1993, jpark, 0, sega_system32_analog, jpark, segas32_new_state, init_jpark, ROT0, "Sega", "Jurassic Park (World, Rev A)", MACHINE_IMPERFECT_GRAPHICS ) /* Released in 02.1994 */
GAME( 1993, jparkj, jpark, sega_system32_analog, jpark, segas32_new_state, init_jpark, ROT0, "Sega", "Jurassic Park (Japan, Rev A, Deluxe)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, jparkja, jpark, sega_system32_analog, jpark, segas32_new_state, init_jpark, ROT0, "Sega", "Jurassic Park (Japan, Deluxe)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, jparkjc, jpark, sega_system32_analog, jpark, segas32_new_state, init_jpark, ROT0, "Sega", "Jurassic Park (Japan, Rev A, Conversion)", MACHINE_IMPERFECT_GRAPHICS )
@@ -5987,12 +5987,12 @@ GAME( 1992, sonic, 0, sega_system32_track, sonic, segas32_ne
GAME( 1992, sonicp, sonic, sega_system32_track, sonic, segas32_new_state, init_sonicp, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, prototype)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1991, spidman, 0, sega_system32_4p, spidman, segas32_new_state, init_spidman, ROT0, "Sega", "Spider-Man: The Videogame (World)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1991, spidmanu, spidman, sega_system32_4p, spidmanu, segas32_new_state, init_spidman, ROT0, "Sega", "Spider-Man: The Videogame (US)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1991, spidmanu, spidman, sega_system32_4p, spidmanu, segas32_new_state, init_spidman, ROT0, "Sega", "Spider-Man: The Videogame (US, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1991, spidmanj, spidman, sega_system32_4p, spidman, segas32_new_state, init_spidman, ROT0, "Sega", "Spider-Man: The Videogame (Japan)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1994, svf, 0, sega_system32, svf, segas32_new_state, init_svf, ROT0, "Sega", "Super Visual Football: European Sega Cup (Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1994, svfo, svf, sega_system32, svf, segas32_new_state, init_svf, ROT0, "Sega", "Super Visual Football: European Sega Cup", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, svs, svf, sega_system32, svf, segas32_new_state, init_svf, ROT0, "Sega", "Super Visual Soccer: Sega Cup (US)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, svs, svf, sega_system32, svf, segas32_new_state, init_svf, ROT0, "Sega", "Super Visual Soccer: Sega Cup (US, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1994, jleague, svf, sega_system32, svf, segas32_new_state, init_jleague, ROT0, "Sega", "The J.League 1994 (Japan, Rev A)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1994, jleagueo, svf, sega_system32, svf, segas32_new_state, init_jleague, ROT0, "Sega", "The J.League 1994 (Japan)", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp
index 33c3b1ae671..172ef67ad3f 100644
--- a/src/mame/drivers/simpsons.cpp
+++ b/src/mame/drivers/simpsons.cpp
@@ -178,7 +178,7 @@ void simpsons_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in simpsons_state::device_timer");
+ throw emu_fatalerror("Unknown id in simpsons_state::device_timer");
}
}
diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp
index 280c547b272..f9c0708d87a 100644
--- a/src/mame/drivers/slapshot.cpp
+++ b/src/mame/drivers/slapshot.cpp
@@ -157,7 +157,7 @@ void slapshot_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(6, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in slapshot_state::device_timer");
+ throw emu_fatalerror("Unknown id in slapshot_state::device_timer");
}
}
diff --git a/src/mame/drivers/sm7238.cpp b/src/mame/drivers/sm7238.cpp
index 97d84ae8f5d..bf48ae3fcb2 100644
--- a/src/mame/drivers/sm7238.cpp
+++ b/src/mame/drivers/sm7238.cpp
@@ -141,7 +141,7 @@ void sm7238_state::videobank_map(address_map &map)
void sm7238_state::sm7238_io(address_map &map)
{
map.unmap_value_high();
-// map(0x40, 0x4f).ram() // LUT
+// map(0x40, 0x4f).ram() // LUT
map(0xa0, 0xa1).rw(m_i8251line, FUNC(i8251_device::read), FUNC(i8251_device::write));
map(0xa4, 0xa5).rw(m_i8251kbd, FUNC(i8251_device::read), FUNC(i8251_device::write));
map(0xa8, 0xab).rw(m_t_color, FUNC(pit8253_device::read), FUNC(pit8253_device::write));
diff --git a/src/mame/drivers/socrates.cpp b/src/mame/drivers/socrates.cpp
index 78a5a1b64df..3ea5d4d7c64 100644
--- a/src/mame/drivers/socrates.cpp
+++ b/src/mame/drivers/socrates.cpp
@@ -399,7 +399,7 @@ void socrates_state::device_timer(emu_timer &timer, device_timer_id id, int para
clear_irq_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in socrates_state::device_timer");
+ throw emu_fatalerror("Unknown id in socrates_state::device_timer");
}
}
diff --git a/src/mame/drivers/spacefb.cpp b/src/mame/drivers/spacefb.cpp
index 6049b8876a3..fb22b3b12a7 100644
--- a/src/mame/drivers/spacefb.cpp
+++ b/src/mame/drivers/spacefb.cpp
@@ -136,7 +136,7 @@ void spacefb_state::device_timer(emu_timer &timer, device_timer_id id, int param
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in spacefb_state::device_timer");
+ throw emu_fatalerror("Unknown id in spacefb_state::device_timer");
}
}
diff --git a/src/mame/drivers/spartanxtec.cpp b/src/mame/drivers/spartanxtec.cpp
index 13b94fb7e3e..e6c19f06841 100644
--- a/src/mame/drivers/spartanxtec.cpp
+++ b/src/mame/drivers/spartanxtec.cpp
@@ -404,30 +404,30 @@ void spartanxtec_state::spartanxtec(machine_config &config)
ROM_START( spartanxtec )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "1.bin", 0x00000, 0x04000, CRC(d5d6cddf) SHA1(baaec83be455bf2267d51ea2a2c1fcda22f27bd5) )
- ROM_LOAD( "2.bin", 0x04000, 0x04000, CRC(2803bb72) SHA1(d0f93c61f3f08fb866e2a4617a7824e72f61c97f) )
+ ROM_LOAD( "1.ic13", 0x00000, 0x04000, CRC(d5d6cddf) SHA1(baaec83be455bf2267d51ea2a2c1fcda22f27bd5) )
+ ROM_LOAD( "2.ic14", 0x04000, 0x04000, CRC(2803bb72) SHA1(d0f93c61f3f08fb866e2a4617a7824e72f61c97f) )
ROM_REGION( 0x10000, "audiocpu", 0 )
- ROM_LOAD( "3.bin", 0x00000, 0x01000, CRC(9a18af94) SHA1(1644295aa0c837dced5934360e41d77e0a93ccd1) )
+ ROM_LOAD( "3.ic8", 0x00000, 0x01000, CRC(9a18af94) SHA1(1644295aa0c837dced5934360e41d77e0a93ccd1) )
ROM_REGION( 0x6000, "gfx1", ROMREGION_INVERT )
- ROM_LOAD( "5.bin", 0x00000, 0x0800, CRC(8a3d2978) SHA1(e50ba8d63e894c6a555d92c3144682be68f111b0))
+ ROM_LOAD( "5.ic26", 0x00000, 0x0800, CRC(8a3d2978) SHA1(e50ba8d63e894c6a555d92c3144682be68f111b0))
ROM_CONTINUE(0x1000, 0x0800)
ROM_CONTINUE(0x0800, 0x0800)
ROM_CONTINUE(0x1800, 0x0800)
- ROM_LOAD( "6.bin", 0x02000, 0x0800, CRC(b1570b6b) SHA1(380a692309690e6ff6b57fda657192fff95167e0) )
+ ROM_LOAD( "6.ic27", 0x02000, 0x0800, CRC(b1570b6b) SHA1(380a692309690e6ff6b57fda657192fff95167e0) )
ROM_CONTINUE(0x3000, 0x0800)
ROM_CONTINUE(0x2800, 0x0800)
ROM_CONTINUE(0x3800, 0x0800)
- ROM_LOAD( "4.bin", 0x04000, 0x0800, CRC(b55672ef) SHA1(7bd556a76e130be1262aa7db09df84c6463ce9ef) )
+ ROM_LOAD( "4.ic25", 0x04000, 0x0800, CRC(b55672ef) SHA1(7bd556a76e130be1262aa7db09df84c6463ce9ef) )
ROM_CONTINUE(0x5000, 0x0800)
ROM_CONTINUE(0x4800, 0x0800)
ROM_CONTINUE(0x5800, 0x0800)
ROM_REGION( 0x18000, "gfx2", ROMREGION_INVERT )
- ROM_LOAD( "7.bin", 0x00000, 0x08000, CRC(aa897e30) SHA1(90b3b316800be106d3baa6783ca894703f369d4e) )
- ROM_LOAD( "8.bin", 0x08000, 0x08000, CRC(98a1803b) SHA1(3edfc45c289f850b07a0231ce0b792cbec6fb245) )
- ROM_LOAD( "9.bin", 0x10000, 0x08000, CRC(e3bf0d73) SHA1(4562422c07399e240081792b96b9018d1e7dd97b) )
+ ROM_LOAD( "7.bin", 0x00000, 0x08000, CRC(aa897e30) SHA1(90b3b316800be106d3baa6783ca894703f369d4e) )
+ ROM_LOAD( "8.bin", 0x08000, 0x08000, CRC(98a1803b) SHA1(3edfc45c289f850b07a0231ce0b792cbec6fb245) )
+ ROM_LOAD( "9.ic43", 0x10000, 0x08000, CRC(e3bf0d73) SHA1(4562422c07399e240081792b96b9018d1e7dd97b) )
ROM_REGION( 0x600, "cprom", 0 )
// first half of all of these is empty
@@ -441,6 +441,11 @@ ROM_START( spartanxtec )
ROM_REGION( 0x18000, "unkprom", 0 ) // just linear increasing value
ROM_LOAD( "1_tbp24s10_82s129.bin", 0x0000, 0x0100, CRC(b6135ee0) SHA1(248a978987cff86c2bbad10ef332f63a6abd5bee) )
ROM_LOAD( "2_tbp24s10_82s129.bin", 0x0000, 0x0100, CRC(b6135ee0) SHA1(248a978987cff86c2bbad10ef332f63a6abd5bee) )
+
+ ROM_REGION( 0x00228, "plds", 0 )
+ ROM_LOAD( "pal16r8acn.ic12", 0x0000, 0x0114, NO_DUMP )
+ ROM_LOAD( "pal16r6acn.ic33", 0x0114, 0x0114, NO_DUMP )
+
ROM_END
diff --git a/src/mame/drivers/spbactn.cpp b/src/mame/drivers/spbactn.cpp
index 23a7d5ed34f..033a5f340e8 100644
--- a/src/mame/drivers/spbactn.cpp
+++ b/src/mame/drivers/spbactn.cpp
@@ -418,16 +418,8 @@ void spbactn_state::spbactn(machine_config &config)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
-#if 0
- // actual blanking frequencies unknown, but should be close to NTSC
+ // TODO: verify actual blanking frequencies (should be close to NTSC)
m_screen->set_raw(XTAL(22'656'000) / 2, 720, 0, 512, 262, 16, 240);
-#else
- // set_raw breaks sprites; keeping this in for now
- m_screen->set_refresh_hz(60);
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
- m_screen->set_size(64*8, 32*8);
- m_screen->set_visarea(0*8, 64*8-1, 2*8, 30*8-1);
-#endif
m_screen->set_screen_update(FUNC(spbactn_state::screen_update_spbactn));
MCFG_VIDEO_START_OVERRIDE(spbactn_state,spbactn)
diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp
index c3c496109dc..a59235f7904 100644
--- a/src/mame/drivers/spectrum.cpp
+++ b/src/mame/drivers/spectrum.cpp
@@ -689,7 +689,7 @@ void spectrum_state::device_timer(emu_timer &timer, device_timer_id id, int para
spectrum_UpdateScreenBitmap();
break;
default:
- assert_always(false, "Unknown id in spectrum_state::device_timer");
+ throw emu_fatalerror("Unknown id in spectrum_state::device_timer");
}
}
diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp
index 21a43489004..04199682982 100644
--- a/src/mame/drivers/sprint4.cpp
+++ b/src/mame/drivers/sprint4.cpp
@@ -51,7 +51,7 @@ void sprint4_state::device_timer(emu_timer &timer, device_timer_id id, int param
nmi_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in sprint4_state::device_timer");
+ throw emu_fatalerror("Unknown id in sprint4_state::device_timer");
}
}
diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp
index 7835e9f449c..bd9e74991df 100644
--- a/src/mame/drivers/super80.cpp
+++ b/src/mame/drivers/super80.cpp
@@ -771,6 +771,10 @@ void super80_state::super80d(machine_config &config)
super80(config);
m_gfxdecode->set_info(gfx_super80d);
m_screen->set_screen_update(FUNC(super80_state::screen_update_super80d));
+
+ // software list
+ config.device_remove("cass_list");
+ SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("D");
}
void super80_state::super80e(machine_config &config)
@@ -779,6 +783,10 @@ void super80_state::super80e(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &super80_state::super80e_io);
m_gfxdecode->set_info(gfx_super80e);
m_screen->set_screen_update(FUNC(super80_state::screen_update_super80e));
+
+ // software list
+ config.device_remove("cass_list");
+ SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("E");
}
void super80_state::super80m(machine_config &config)
@@ -790,6 +798,10 @@ void super80_state::super80m(machine_config &config)
m_screen->set_screen_update(FUNC(super80_state::screen_update_super80m));
m_screen->screen_vblank().set(FUNC(super80_state::screen_vblank_super80m));
+
+ // software list
+ config.device_remove("cass_list");
+ SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("M");
}
void super80_state::super80v(machine_config &config)
@@ -876,6 +888,10 @@ void super80_state::super80r(machine_config &config)
m_fdc->drq_wr_callback().set(m_dma, FUNC(z80dma_device::rdy_w));
FLOPPY_CONNECTOR(config, "fdc:0", super80_floppies, "s80flop", floppy_image_device::default_floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, "fdc:1", super80_floppies, "s80flop", floppy_image_device::default_floppy_formats).enable_sound(true);
+
+ // software list
+ config.device_remove("cass_list");
+ SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("R");
}
/**************************** ROMS *****************************************************************/
diff --git a/src/mame/drivers/swyft.cpp b/src/mame/drivers/swyft.cpp
index af132f2be56..f685584eb22 100644
--- a/src/mame/drivers/swyft.cpp
+++ b/src/mame/drivers/swyft.cpp
@@ -326,6 +326,11 @@ public:
void swyft(machine_config &config);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
private:
required_device<m68008_device> m_maincpu;
optional_device<centronics_device> m_ctx;
@@ -344,10 +349,6 @@ private:
optional_ioport m_y6;
optional_ioport m_y7;*/
- DECLARE_MACHINE_START(swyft);
- DECLARE_MACHINE_RESET(swyft);
- DECLARE_VIDEO_START(swyft);
-
uint32_t screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER(bitlatch_r);
@@ -577,7 +578,7 @@ void swyft_state::swyft_mem(address_map &map)
map(0x0e4000, 0x0e4fff).rw(FUNC(swyft_state::swyft_via1_r), FUNC(swyft_state::swyft_via1_w));
}
-MACHINE_START_MEMBER(swyft_state,swyft)
+void swyft_state::machine_start()
{
for (auto &via : m_via)
{
@@ -588,11 +589,11 @@ MACHINE_START_MEMBER(swyft_state,swyft)
}
}
-MACHINE_RESET_MEMBER(swyft_state,swyft)
+void swyft_state::machine_reset()
{
}
-VIDEO_START_MEMBER(swyft_state,swyft)
+void swyft_state::video_start()
{
}
@@ -757,10 +758,6 @@ void swyft_state::swyft(machine_config &config)
M68008(config, m_maincpu, XTAL(15'897'600)/2); //MC68008P8, Y1=15.8976Mhz, clock GUESSED at Y1 / 2
m_maincpu->set_addrmap(AS_PROGRAM, &swyft_state::swyft_mem);
- MCFG_MACHINE_START_OVERRIDE(swyft_state,swyft)
- MCFG_MACHINE_RESET_OVERRIDE(swyft_state,swyft)
- MCFG_VIDEO_START_OVERRIDE(swyft_state,swyft)
-
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(15.8976_MHz_XTAL / 2, 500, 0, 320, 265, 0, 242); // total guess
diff --git a/src/mame/drivers/symbolics.cpp b/src/mame/drivers/symbolics.cpp
index f5460953f9c..b6dea132f95 100644
--- a/src/mame/drivers/symbolics.cpp
+++ b/src/mame/drivers/symbolics.cpp
@@ -289,7 +289,7 @@ INPUT_PORTS_END
outfifo_read_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in symbolics_state::device_timer");
+ throw emu_fatalerror("Unknown id in symbolics_state::device_timer");
}
}
@@ -355,7 +355,7 @@ ROM_START( s3670 )
ROM_CONTINUE( 0x18000, 0x2000 )
ROMX_LOAD("10l.127.27c128.d10", 0x08001, 0x2000, CRC(b8ddb3c8) SHA1(e6c3b96340c5c767ef18abf48b73fa8e5d7353b9), ROM_SKIP(1) | ROM_BIOS(0)) // Label: "10L.127" @D10
ROM_CONTINUE( 0x18001, 0x2000 )
- // D17, D11 are empty sockets; these would map to 0x0c000-0ffff and 0x1c000-0x1ffff; these are verfied from real hardware to read as 0xFF so there must be pullups on the eprom bus/auto-dtack area
+ // D17, D11 are empty sockets; these would map to 0x0c000-0ffff and 0x1c000-0x1ffff; these are verified from real hardware to read as 0xFF, so there must be pull-up resistors on the EPROM bus/auto-DTACK area
ROM_REGION16_BE( 0x20,"fep_paddle_prom", 0)
ROM_LOAD("fpa-458.bin", 0x0000, 0x0020, CRC(5e034b33) SHA1(fea84183825013b2adc290f71d97e5cffd0cf7fd)) // nFEP Paddle S/N 458
ROM_REGION16_BE( 0x20,"fep_prom", 0)
diff --git a/src/mame/drivers/sys2900.cpp b/src/mame/drivers/sys2900.cpp
index b4d27a20a64..8e5c8fa390d 100644
--- a/src/mame/drivers/sys2900.cpp
+++ b/src/mame/drivers/sys2900.cpp
@@ -116,7 +116,7 @@ void sys2900_state::device_timer(emu_timer &timer, device_timer_id id, int param
membank("boot")->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in sys2900_state::device_timer");
+ throw emu_fatalerror("Unknown id in sys2900_state::device_timer");
}
}
diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp
index 5fdd5257d23..9e5964ede5f 100644
--- a/src/mame/drivers/taito_f2.cpp
+++ b/src/mame/drivers/taito_f2.cpp
@@ -537,7 +537,7 @@ void taitof2_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line(6, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in taitof2_state::device_timer");
+ throw emu_fatalerror("Unknown id in taitof2_state::device_timer");
}
}
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index c867b19e8f8..6af1a3dd60c 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -432,7 +432,7 @@ void taito_f3_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(3, HOLD_LINE); // some signal from video hardware?
break;
default:
- assert_always(false, "Unknown id in taito_f3_state::device_timer");
+ throw emu_fatalerror("Unknown id in taito_f3_state::device_timer");
}
}
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index cc024428558..ea00979d01c 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -1330,7 +1330,7 @@ void taitoz_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(6, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in taitoz_state::device_timer");
+ throw emu_fatalerror("Unknown id in taitoz_state::device_timer");
}
}
diff --git a/src/mame/drivers/tehkanwc.cpp b/src/mame/drivers/tehkanwc.cpp
index f14ac0b5601..d7270c31dd7 100644
--- a/src/mame/drivers/tehkanwc.cpp
+++ b/src/mame/drivers/tehkanwc.cpp
@@ -169,7 +169,7 @@ void tehkanwc_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_audiocpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
break;
default:
- assert_always(false, "Unknown id in tehkanwc_state::device_timer");
+ throw emu_fatalerror("Unknown id in tehkanwc_state::device_timer");
}
}
diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp
index b0c9c7d7f76..fc1e2ea4ece 100644
--- a/src/mame/drivers/thayers.cpp
+++ b/src/mame/drivers/thayers.cpp
@@ -133,7 +133,7 @@ void thayers_state::device_timer(emu_timer &timer, device_timer_id id, int param
check_interrupt();
break;
default:
- assert_always(false, "Unknown id in thayers_state::device_timer");
+ throw emu_fatalerror("Unknown id in thayers_state::device_timer");
}
}
diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp
index 0358d968d0a..9f50f97de8a 100644
--- a/src/mame/drivers/thunderx.cpp
+++ b/src/mame/drivers/thunderx.cpp
@@ -42,6 +42,9 @@
#include "sound/ym2151.h"
#include "speaker.h"
+//#define VERBOSE 1
+#include "logmacro.h"
+
void thunderx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
@@ -51,12 +54,10 @@ void thunderx_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
break;
default:
- assert_always(false, "Unknown id in thunderx_state::device_timer");
+ throw emu_fatalerror("Unknown id in thunderx_state::device_timer");
}
}
-#define VERBOSE 0
-#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define PMC_BK (m_1f98_latch & 0x02)
READ8_MEMBER(thunderx_state::pmc_r)
@@ -68,7 +69,7 @@ READ8_MEMBER(thunderx_state::pmc_r)
}
else
{
- LOG(("%04x read pmc internal ram %04x\n",m_audiocpu->pc(),offset));
+ LOG("%04x read pmc internal ram %04x\n",m_audiocpu->pc(),offset);
return 0;
}
}
@@ -77,12 +78,12 @@ WRITE8_MEMBER(thunderx_state::pmc_w)
{
if (PMC_BK)
{
- LOG(("%04x pmcram %04x = %02x\n",m_audiocpu->pc(),offset,data));
+ LOG("%04x pmcram %04x = %02x\n",m_audiocpu->pc(),offset,data);
m_pmcram[offset] = data;
}
else
{
- LOG(("%04x pmc internal ram %04x = %02x\n",m_audiocpu->pc(),offset,data));
+ LOG("%04x pmc internal ram %04x = %02x\n",m_audiocpu->pc(),offset,data);
}
}
diff --git a/src/mame/drivers/tickee.cpp b/src/mame/drivers/tickee.cpp
index 48698080c09..94a9543181b 100644
--- a/src/mame/drivers/tickee.cpp
+++ b/src/mame/drivers/tickee.cpp
@@ -147,7 +147,7 @@ void tickee_state::device_timer(emu_timer &timer, device_timer_id id, int param,
setup_gun_interrupts(ptr, param);
break;
default:
- assert_always(false, "Unknown id in tickee_state::device_timer");
+ throw emu_fatalerror("Unknown id in tickee_state::device_timer");
}
}
diff --git a/src/mame/drivers/tmc1800.cpp b/src/mame/drivers/tmc1800.cpp
index bea8a3a837c..48ae70db106 100644
--- a/src/mame/drivers/tmc1800.cpp
+++ b/src/mame/drivers/tmc1800.cpp
@@ -932,7 +932,7 @@ void tmc1800_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_beeper->set_clock(0);
break;
default:
- assert_always(false, "Unknown id in tmc1800_state::device_timer");
+ throw emu_fatalerror("Unknown id in tmc1800_state::device_timer");
}
}
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp
index c6491d387da..271ec6a9d97 100644
--- a/src/mame/drivers/tmnt.cpp
+++ b/src/mame/drivers/tmnt.cpp
@@ -268,7 +268,7 @@ void tmnt_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in tmnt_state::device_timer");
+ throw emu_fatalerror("Unknown id in tmnt_state::device_timer");
}
}
diff --git a/src/mame/drivers/trivrus.cpp b/src/mame/drivers/trivrus.cpp
index 0f1c293fecf..485e77b1331 100644
--- a/src/mame/drivers/trivrus.cpp
+++ b/src/mame/drivers/trivrus.cpp
@@ -5,13 +5,13 @@
Trivia R Us (c) 2009 AGT
driver by Angelo Salese, based off original crystal.cpp by ElSemi
- original mods on this driver by Luca Elia
+ original mods on this driver by Luca Elia
TODO:
- - touch panel, according to service mode can be generic, atouch or 3M
- (microtouch?). It interfaces thru UART0 port;
+ - touch panel, according to service mode can be generic, atouch or 3M
+ (microtouch?). It interfaces thru UART0 port;
- RTC (unknown type);
- - Split romset or add a slot option supporting debug terminal mode;
+ - Split romset or add a slot option supporting debug terminal mode;
=============================================================================
@@ -303,7 +303,7 @@ void trivrus_state::trivrus(machine_config &config)
m_vr0soc->set_host_cpu_tag(m_maincpu);
m_vr0soc->set_external_vclk(28636360);
m_vr0soc->tx_callback<0>().set(m_microtouch, FUNC(microtouch_device::rx));
-
+
// TODO: 3M from service mode, most likely wrong?
MICROTOUCH(config, m_microtouch, 9600).stx().set(m_vr0soc, FUNC(vrender0soc_device::rx_w<0>));
}
diff --git a/src/mame/drivers/trucocl.cpp b/src/mame/drivers/trucocl.cpp
index 94735cdf7f5..b41f03821a4 100644
--- a/src/mame/drivers/trucocl.cpp
+++ b/src/mame/drivers/trucocl.cpp
@@ -59,7 +59,7 @@ void trucocl_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
break;
default:
- assert_always(false, "Unknown id in trucocl_state::device_timer");
+ throw emu_fatalerror("Unknown id in trucocl_state::device_timer");
}
}
diff --git a/src/mame/drivers/tubep.cpp b/src/mame/drivers/tubep.cpp
index f0fd25ade8a..0796a90ba95 100644
--- a/src/mame/drivers/tubep.cpp
+++ b/src/mame/drivers/tubep.cpp
@@ -261,7 +261,7 @@ void tubep_state::device_timer(emu_timer &timer, device_timer_id id, int param,
rjammer_scanline_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in tubep_state::device_timer");
+ throw emu_fatalerror("Unknown id in tubep_state::device_timer");
}
}
diff --git a/src/mame/drivers/tugboat.cpp b/src/mame/drivers/tugboat.cpp
index 93e6e1863d6..aca5d649683 100644
--- a/src/mame/drivers/tugboat.cpp
+++ b/src/mame/drivers/tugboat.cpp
@@ -221,7 +221,7 @@ void tugboat_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_interrupt_timer->adjust(m_screen->frame_period());
break;
default:
- assert_always(false, "Unknown id in tugboat_state::device_timer");
+ throw emu_fatalerror("Unknown id in tugboat_state::device_timer");
}
}
diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp
index b4fae269996..d3cf768e5b0 100644
--- a/src/mame/drivers/ultratnk.cpp
+++ b/src/mame/drivers/ultratnk.cpp
@@ -56,7 +56,7 @@ void ultratnk_state::device_timer(emu_timer &timer, device_timer_id id, int para
nmi_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in ultratnk_state::device_timer");
+ throw emu_fatalerror("Unknown id in ultratnk_state::device_timer");
}
}
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index 13e92abd15e..1fa59a8173f 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -37,6 +37,9 @@ public:
void init_vegaeo();
+protected:
+ void video_start() override;
+
private:
required_device<generic_latch_8_device> m_soundlatch;
required_ioport m_system_io;
@@ -52,8 +55,6 @@ private:
DECLARE_WRITE8_MEMBER(qs1000_p2_w);
DECLARE_WRITE8_MEMBER(qs1000_p3_w);
- DECLARE_VIDEO_START(vega);
-
uint32_t screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void vega_map(address_map &map);
};
@@ -153,7 +154,7 @@ static INPUT_PORTS_START( crazywar )
INPUT_PORTS_END
-VIDEO_START_MEMBER(vegaeo_state,vega)
+void vegaeo_state::video_start()
{
m_vram = std::make_unique<uint8_t[]>(0x14000*2);
save_pointer(NAME(m_vram), 0x14000*2);
@@ -192,8 +193,6 @@ void vegaeo_state::vega(machine_config &config)
PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 256);
m_palette->set_membits(16);
- MCFG_VIDEO_START_OVERRIDE(vegaeo_state,vega)
-
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp
index 79dbe54f851..1fbbff36241 100644
--- a/src/mame/drivers/vendetta.cpp
+++ b/src/mame/drivers/vendetta.cpp
@@ -173,7 +173,7 @@ void vendetta_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in vendetta_state::device_timer");
+ throw emu_fatalerror("Unknown id in vendetta_state::device_timer");
}
}
diff --git a/src/mame/drivers/videopin.cpp b/src/mame/drivers/videopin.cpp
index e93c6154ac8..d10b44855bf 100644
--- a/src/mame/drivers/videopin.cpp
+++ b/src/mame/drivers/videopin.cpp
@@ -57,7 +57,7 @@ void videopin_state::device_timer(emu_timer &timer, device_timer_id id, int para
interrupt_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in videopin_state::device_timer");
+ throw emu_fatalerror("Unknown id in videopin_state::device_timer");
}
}
diff --git a/src/mame/drivers/videopkr.cpp b/src/mame/drivers/videopkr.cpp
index 45dfbfe6e99..4e536d2988c 100644
--- a/src/mame/drivers/videopkr.cpp
+++ b/src/mame/drivers/videopkr.cpp
@@ -316,11 +316,11 @@ public:
, m_lamps(*this, "lamp%u", 0U)
{ }
- void babypkr(machine_config &config);
- void videodad(machine_config &config);
void videopkr(machine_config &config);
- void fortune1(machine_config &config);
void blckjack(machine_config &config);
+ void videodad(machine_config &config);
+ void babypkr(machine_config &config);
+ void fortune1(machine_config &config);
void bpoker(machine_config &config);
private:
@@ -1339,6 +1339,7 @@ void videopkr_state::fortune1(machine_config &config)
void videopkr_state::bpoker(machine_config &config)
{
babypkr(config);
+
i8751_device &maincpu(I8751(config.replace(), m_maincpu, XTAL(6'000'000)));
maincpu.set_addrmap(AS_PROGRAM, &videopkr_state::i8751_map);
maincpu.set_addrmap(AS_IO, &videopkr_state::i8751_io_port);
diff --git a/src/mame/drivers/vk100.cpp b/src/mame/drivers/vk100.cpp
index 98daff46239..95ed5aaa601 100644
--- a/src/mame/drivers/vk100.cpp
+++ b/src/mame/drivers/vk100.cpp
@@ -342,7 +342,7 @@ void vk100_state::device_timer(emu_timer &timer, device_timer_id id, int param,
execute_vg(ptr, param);
break;
default:
- assert_always(false, "Unknown id in vk100_state::device_timer");
+ throw emu_fatalerror("Unknown id in vk100_state::device_timer");
}
}
diff --git a/src/mame/drivers/vtech_eu3a12.cpp b/src/mame/drivers/vtech_eu3a12.cpp
index f60f3ffc1bc..c3e75f39378 100644
--- a/src/mame/drivers/vtech_eu3a12.cpp
+++ b/src/mame/drivers/vtech_eu3a12.cpp
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Sandro Ronco
-// CPU die is an Elan EU3A12 (Elan "RISC II Series" quasi-PIC with 16-bit opcodes)
+// CPU die (epoxy blob) is an Elan EU3A12 (Elan "RISC II Series" quasi-PIC with 16-bit opcodes)
#include "emu.h"
#include "cpu/rii/riscii.h"
@@ -22,7 +22,7 @@ private:
void prog_map(address_map &map);
- required_device<cpu_device> m_maincpu;
+ required_device<riscii_series_device> m_maincpu;
};
uint32_t vreadere_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@@ -32,7 +32,7 @@ uint32_t vreadere_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm
void vreadere_state::prog_map(address_map &map)
{
- map(0x00000, 0x3ffff).rom().region("maincpu", 0);
+ map(0x000000, 0x1fffff).rom().region("maincpu", 0);
}
static INPUT_PORTS_START( vreadere )
@@ -40,7 +40,7 @@ INPUT_PORTS_END
void vreadere_state::vreadere(machine_config &config)
{
- RISCII(config, m_maincpu, 10'000'000); // CPU type is unknown, epoxy blob
+ EPG3231(config, m_maincpu, 10'000'000);
m_maincpu->set_addrmap(AS_PROGRAM, &vreadere_state::prog_map);
/* video hardware */
diff --git a/src/mame/drivers/wgp.cpp b/src/mame/drivers/wgp.cpp
index 9bfe2c258c5..6d849bc8f0d 100644
--- a/src/mame/drivers/wgp.cpp
+++ b/src/mame/drivers/wgp.cpp
@@ -402,6 +402,7 @@ Stephh's notes (based on the game M68000 code and some tests) :
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "machine/adc0808.h"
#include "sound/2610intf.h"
#include "screen.h"
#include "speaker.h"
@@ -442,15 +443,12 @@ void wgp_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
case TIMER_INTERRUPT4:
m_maincpu->set_input_line(4, HOLD_LINE);
break;
- case TIMER_INTERRUPT6:
- m_maincpu->set_input_line(6, HOLD_LINE);
- break;
/* 68000 B */
case TIMER_CPUB_INTERRUPT6:
m_subcpu->set_input_line(6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */
break;
default:
- assert_always(false, "Unknown id in wgp_state::device_timer");
+ throw emu_fatalerror("Unknown id in wgp_state::device_timer");
}
}
@@ -513,79 +511,63 @@ void wgp_state::rotate_port_w(offs_t offset, u16 data)
}
}
+u8 wgp_state::accel_r()
+{
+ if (m_fake.read_safe(0) & 0x40) // pressing accel
+ return 0xff;
+ else
+ return 0x00;
+}
-#define STEER_PORT_TAG "STEER"
-#define UNKNOWN_PORT_TAG "UNKNOWN"
-#define FAKE_PORT_TAG "FAKE"
-
-u16 wgp_state::adinput_r(offs_t offset)
+u8 wgp_state::steer_r()
{
int steer = 0x40;
int fake = m_fake.read_safe(0);
- if (!(fake & 0x10)) /* Analogue steer (the real control method) */
+ if (!(fake & 0x10)) // Analogue steer (the real control method)
{
- /* Reduce span to 0x80 */
+ // Reduce span to 0x80
steer = (m_steer.read_safe(0) * 0x80) / 0x100;
}
- else /* Digital steer */
+ else // Digital steer
{
- if (fake & 0x08) /* pressing down */
+ if (fake & 0x08) // pressing down
steer = 0x20;
- if (fake & 0x04) /* pressing up */
+ if (fake & 0x04) // pressing up
steer = 0x60;
- if (fake & 0x02) /* pressing right */
+ if (fake & 0x02) // pressing right
steer = 0x00;
- if (fake & 0x01) /* pressing left */
+ if (fake & 0x01) // pressing left
steer = 0x80;
}
- switch (offset)
- {
- case 0x00:
- {
- if (fake & 0x40) /* pressing accel */
- return 0xff;
- else
- return 0x00;
- }
-
- case 0x01:
- return steer;
-
- case 0x02:
- return 0xc0; /* steer offset, correct acc. to service mode */
-
- case 0x03:
- return 0xbf; /* accel offset, correct acc. to service mode */
-
- case 0x04:
- {
- if (fake & 0x80) /* pressing brake */
- return 0xcf;
- else
- return 0xff;
- }
-
- case 0x05:
- return m_unknown.read_safe(0); /* unknown */
- }
+ return steer;
+}
-logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",m_maincpu->pc(),offset);
+u8 wgp_state::steer_offset_r()
+{
+ return 0xc0; // steer offset, correct acc. to service mode
+}
- return 0xff;
+u8 wgp_state::accel_offset_r()
+{
+ return 0xbf; // accel offset, correct acc. to service mode
}
-void wgp_state::adinput_w(u16 data)
+u8 wgp_state::brake_r()
{
- /* Each write invites a new interrupt as soon as the
- hardware has got the next a/d conversion ready. We set a token
- delay of 10000 cycles although our inputs are always ready. */
+ if (m_fake.read_safe(0) & 0x80) // pressing brake
+ return 0xcf;
+ else
+ return 0xff;
+}
- m_int6_timer->adjust(m_maincpu->cycles_to_attotime(10000));
+u8 wgp_state::unknown_r()
+{
+ return m_unknown.read_safe(0); // unknown
}
void wgp_state::coins_w(u8 data)
@@ -617,7 +599,7 @@ void wgp_state::main_map(address_map &map)
map(0x140000, 0x143fff).ram().share("sharedram");
map(0x180000, 0x18000f).rw(m_tc0220ioc, FUNC(tc0220ioc_device::read), FUNC(tc0220ioc_device::write)).umask16(0xff00);
map(0x1c0000, 0x1c0001).w(FUNC(wgp_state::cpua_ctrl_w));
- map(0x200000, 0x20000f).rw(FUNC(wgp_state::adinput_r), FUNC(wgp_state::adinput_w));
+ map(0x200000, 0x20000f).rw("adc", FUNC(adc0809_device::data_r), FUNC(adc0809_device::address_offset_start_w)).umask16(0x00ff);
map(0x300000, 0x30ffff).rw(m_tc0100scn, FUNC(tc0100scn_device::ram_r), FUNC(tc0100scn_device::ram_w)); /* tilemaps */
map(0x320000, 0x32000f).rw(m_tc0100scn, FUNC(tc0100scn_device::ctrl_r), FUNC(tc0100scn_device::ctrl_w));
map(0x400000, 0x40bfff).ram().share("spritemap"); /* sprite tilemaps */
@@ -757,14 +739,14 @@ static INPUT_PORTS_START( wgp_no_joy_generic )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_START(STEER_PORT_TAG)
+ PORT_START("STEER")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1)
- PORT_START(UNKNOWN_PORT_TAG)
+ PORT_START("UNKNOWN")
PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2)
/* fake inputs, allowing digital steer etc. */
- PORT_START(FAKE_PORT_TAG)
+ PORT_START("FAKE")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
@@ -869,7 +851,6 @@ void wgp_state::machine_start()
{
m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
- m_int6_timer = timer_alloc(TIMER_INTERRUPT6);
m_cpub_int6_timer = timer_alloc(TIMER_CPUB_INTERRUPT6);
save_item(NAME(m_cpua_ctrl));
@@ -900,6 +881,15 @@ void wgp_state::wgp(machine_config &config)
m_tc0220ioc->write_4_callback().set(FUNC(wgp_state::coins_w));
m_tc0220ioc->read_7_callback().set_ioport("IN2");
+ adc0809_device &adc(ADC0809(config, "adc", 16_MHz_XTAL / 32)); // TODO: verify divider
+ adc.eoc_ff_callback().set_inputline(m_maincpu, M68K_IRQ_6);
+ adc.in_callback<0>().set(FUNC(wgp_state::accel_r));
+ adc.in_callback<1>().set(FUNC(wgp_state::steer_r));
+ adc.in_callback<2>().set(FUNC(wgp_state::steer_offset_r));
+ adc.in_callback<3>().set(FUNC(wgp_state::accel_offset_r));
+ adc.in_callback<4>().set(FUNC(wgp_state::brake_r));
+ adc.in_callback<5>().set(FUNC(wgp_state::unknown_r));
+
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
diff --git a/src/mame/drivers/wolfpack.cpp b/src/mame/drivers/wolfpack.cpp
index 21d6d76776d..29364110e13 100644
--- a/src/mame/drivers/wolfpack.cpp
+++ b/src/mame/drivers/wolfpack.cpp
@@ -22,7 +22,7 @@ void wolfpack_state::device_timer(emu_timer &timer, device_timer_id id, int para
periodic_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in wolfpack_state::device_timer");
+ throw emu_fatalerror("Unknown id in wolfpack_state::device_timer");
}
}
diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp
index 999024d83ce..fe379981f14 100644
--- a/src/mame/drivers/x1.cpp
+++ b/src/mame/drivers/x1.cpp
@@ -2153,7 +2153,7 @@ static const gfx_layout x1_pcg_8x8 =
8*8
};
-MACHINE_START_MEMBER(x1_state,x1)
+void x1_state::machine_start()
{
/* set up RTC */
{
@@ -2217,7 +2217,6 @@ void x1_state::x1(machine_config &config)
ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w));
ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w));
- MCFG_MACHINE_START_OVERRIDE(x1_state,x1)
MCFG_MACHINE_RESET_OVERRIDE(x1_state,x1)
/* video hardware */
@@ -2237,8 +2236,6 @@ void x1_state::x1(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_x1);
- MCFG_VIDEO_START_OVERRIDE(x1_state,x1)
-
MB8877(config, m_fdc, MAIN_CLOCK / 16);
// TODO: guesswork, try to implicitly start the motor
m_fdc->hld_wr_callback().set(FUNC(x1_state::hdl_w));
diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp
index 056201271c3..b0a07189520 100644
--- a/src/mame/drivers/x1twin.cpp
+++ b/src/mame/drivers/x1twin.cpp
@@ -436,7 +436,6 @@ void x1twin_state::x1twin(machine_config &config)
ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w));
ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w));
- MCFG_MACHINE_START_OVERRIDE(x1twin_state,x1)
MCFG_MACHINE_RESET_OVERRIDE(x1twin_state,x1)
#if 0
@@ -475,8 +474,6 @@ void x1twin_state::x1twin(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_x1);
- MCFG_VIDEO_START_OVERRIDE(x1twin_state,x1)
-
MB8877(config, m_fdc, MAIN_CLOCK / 16);
// TODO: guesswork, try to implicitly start the motor
m_fdc->hld_wr_callback().set(FUNC(x1_state::hdl_w));
diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp
index 813c15760be..8478428a4c8 100644
--- a/src/mame/drivers/x68k.cpp
+++ b/src/mame/drivers/x68k.cpp
@@ -175,7 +175,7 @@ void x68k_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
m_hd63450->drq3_w(0);
break;
default:
- assert_always(false, "Unknown id in x68k_state::device_timer");
+ throw emu_fatalerror("Unknown id in x68k_state::device_timer");
}
}
diff --git a/src/mame/drivers/zrt80.cpp b/src/mame/drivers/zrt80.cpp
index b8c03b1e6d2..f008e38453f 100644
--- a/src/mame/drivers/zrt80.cpp
+++ b/src/mame/drivers/zrt80.cpp
@@ -86,7 +86,7 @@ void zrt80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_beep->set_state(0);
break;
default:
- assert_always(false, "Unknown id in zrt80_state::device_timer");
+ throw emu_fatalerror("Unknown id in zrt80_state::device_timer");
}
}
diff --git a/src/mame/etc/opwolf_cchip.txt b/src/mame/etc/opwolf_cchip.txt
index 13904edc920..f56ac5242d7 100644
--- a/src/mame/etc/opwolf_cchip.txt
+++ b/src/mame/etc/opwolf_cchip.txt
@@ -496,7 +496,7 @@ void opwolf_state::device_timer(emu_timer &timer, device_timer_id id, int param,
cchip_timer(ptr, param);
break;
default:
- assert_always(false, "Unknown id in opwolf_state::device_timer");
+ throw emu_fatalerror("Unknown id in opwolf_state::device_timer");
}
}
diff --git a/src/mame/includes/alpha68k.h b/src/mame/includes/alpha68k.h
index e7cecdfbb6a..6c291fa686a 100644
--- a/src/mame/includes/alpha68k.h
+++ b/src/mame/includes/alpha68k.h
@@ -46,6 +46,7 @@ public:
void jongbou(machine_config &config);
void alpha68k_V(machine_config &config);
void alpha68k_II_gm(machine_config &config);
+ void alpha68k_III(machine_config &config);
void init_paddlema();
void init_btlfield();
@@ -117,6 +118,7 @@ private:
void alpha68k_I_map(address_map &map);
void alpha68k_I_s_map(address_map &map);
void alpha68k_V_map(address_map &map);
+ void alpha68k_III_map(address_map &map);
void jongbou_sound_map(address_map &map);
void jongbou_sound_portmap(address_map &map);
void kyros_map(address_map &map);
diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h
index 2e13bb33219..e545d01f476 100644
--- a/src/mame/includes/archimds.h
+++ b/src/mame/includes/archimds.h
@@ -14,9 +14,7 @@
#include "machine/aakart.h"
#include "machine/i2cmem.h"
#include "machine/wd_fdc.h"
-#include "sound/dac.h"
-#include "emupal.h"
-#include "screen.h"
+#include "machine/acorn_vidc.h"
// interrupt definitions. these are for the real Archimedes computer - arcade
// and gambling knockoffs likely are a bit different.
@@ -53,15 +51,12 @@ public:
m_kart(*this, "kart"),
m_maincpu(*this, "maincpu"),
m_i2cmem(*this, "i2cmem"),
+ m_vidc(*this, "vidc"),
m_fdc(*this, "fdc"),
m_floppy0(*this, "fdc:0"),
m_floppy1(*this, "fdc:1"),
m_region_maincpu(*this, "maincpu"),
- m_region_vram(*this, "vram"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette"),
- m_joy(*this, "joy_p%u",1),
- m_dac(*this, { "dac0", "dac1", "dac2", "dac3", "dac4", "dac5", "dac6", "dac7" })
+ m_joy(*this, "joy_p%u",1)
{ }
optional_device<aakart_device> m_kart;
@@ -79,24 +74,16 @@ public:
DECLARE_READ32_MEMBER(aristmk5_drame_memc_logical_r);
DECLARE_READ32_MEMBER(archimedes_memc_logical_r);
DECLARE_WRITE32_MEMBER(archimedes_memc_logical_w);
- DECLARE_READ32_MEMBER(archimedes_memc_r);
DECLARE_WRITE32_MEMBER(archimedes_memc_w);
DECLARE_WRITE32_MEMBER(archimedes_memc_page_w);
DECLARE_READ32_MEMBER(archimedes_ioc_r);
DECLARE_WRITE32_MEMBER(archimedes_ioc_w);
- DECLARE_READ32_MEMBER(archimedes_vidc_r);
- DECLARE_WRITE32_MEMBER(archimedes_vidc_w);
DECLARE_WRITE_LINE_MEMBER( a310_kart_rx_w );
DECLARE_WRITE_LINE_MEMBER( a310_kart_tx_w );
uint8_t m_i2c_clk;
int16_t m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k
- uint32_t m_vidc_regs[256];
- uint8_t m_cursor_vram[0x8000]; // size -> max(VCER) - min(VCSR) * 32 = 0x7fe0
uint8_t m_ioc_regs[0x80/4];
- uint8_t m_vidc_bpp_mode;
- uint8_t m_vidc_interlace;
- uint16_t m_vidc_vblank_time;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
@@ -104,29 +91,25 @@ public:
protected:
required_device<arm_cpu_device> m_maincpu;
optional_device<i2cmem_device> m_i2cmem;
+ required_device<acorn_vidc10_device> m_vidc;
optional_device<wd1772_device> m_fdc;
optional_device<floppy_connector> m_floppy0;
optional_device<floppy_connector> m_floppy1;
required_memory_region m_region_maincpu;
- required_memory_region m_region_vram;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
optional_ioport_array<2> m_joy;
- required_device_array<dac_16bit_r2r_twos_complement_device, 8> m_dac;
+
+ DECLARE_WRITE_LINE_MEMBER( vblank_irq );
+ DECLARE_WRITE_LINE_MEMBER( sound_drq );
private:
- static const device_timer_id TIMER_VBLANK = 0;
- static const device_timer_id TIMER_VIDEO = 1;
- static const device_timer_id TIMER_AUDIO = 2;
static const device_timer_id TIMER_IOC = 3;
- void vidc_vblank();
+// void vidc_vblank();
void vidc_video_tick();
void vidc_audio_tick();
void ioc_timer(int param);
- void vidc_dynamic_res_change();
void latch_timer_cnt(int tmr);
void a310_set_timer(int tmr);
DECLARE_READ32_MEMBER(ioc_ctrl_r);
@@ -136,14 +119,11 @@ private:
uint32_t m_memc_pagesize;
int m_memc_latchrom;
uint32_t m_ioc_timercnt[4], m_ioc_timerout[4];
- uint32_t m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur,m_vidc_cinit;
+ uint32_t m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur, m_vidc_cinit;
uint32_t m_vidc_sndstart, m_vidc_sndend, m_vidc_sndcur, m_vidc_sndendcur;
uint8_t m_video_dma_on,m_audio_dma_on;
- uint8_t m_vidc_pixel_clk;
- uint8_t m_vidc_stereo_reg[8];
bool m_cursor_enabled;
- emu_timer *m_timer[4], *m_snd_timer, *m_vid_timer;
- emu_timer *m_vbl_timer;
+ emu_timer *m_timer[4];
uint8_t m_floppy_select;
bool check_floppy_ready();
uint8_t m_joy_serial_data;
@@ -185,22 +165,4 @@ private:
#define T3_GO 0x78/4
#define T3_LATCH 0x7c/4
-#define VIDC_HCR 0x80
-#define VIDC_HSWR 0x84
-#define VIDC_HBSR 0x88
-#define VIDC_HDSR 0x8c
-#define VIDC_HDER 0x90
-#define VIDC_HBER 0x94
-#define VIDC_HCSR 0x98
-#define VIDC_HIR 0x9c
-
-#define VIDC_VCR 0xa0
-#define VIDC_VSWR 0xa4
-#define VIDC_VBSR 0xa8
-#define VIDC_VDSR 0xac
-#define VIDC_VDER 0xb0
-#define VIDC_VBER 0xb4
-#define VIDC_VCSR 0xb8
-#define VIDC_VCER 0xbc
-
#endif // MAME_INCLUDES_ARCHIMEDES_H
diff --git a/src/mame/includes/cps3.h b/src/mame/includes/cps3.h
index b68937159c3..75dcb438616 100644
--- a/src/mame/includes/cps3.h
+++ b/src/mame/includes/cps3.h
@@ -28,6 +28,7 @@ public:
, m_palette(*this, "palette")
, m_cps3sound(*this, "cps3sound")
, m_dma_timer(*this, "dma_timer")
+ , m_spritelist_dma_timer(*this, "spritelist_dma_timer")
, m_simm{{*this, "simm1.%u", 0U},
{*this, "simm2.%u", 0U},
{*this, "simm3.%u", 0U},
@@ -38,10 +39,8 @@ public:
, m_mainram(*this, "mainram")
, m_spriteram(*this, "spriteram")
, m_colourram(*this, "colourram", 0)
- , m_tilemap20_regs_base(*this, "tmap20_regs")
- , m_tilemap30_regs_base(*this, "tmap30_regs")
- , m_tilemap40_regs_base(*this, "tmap40_regs")
- , m_tilemap50_regs_base(*this, "tmap50_regs")
+ , m_ppu_gscroll(*this, "ppu_gscroll_regs")
+ , m_tilemap_regs(*this, "ppu_tmap_regs")
, m_ppu_crtc_zoom(*this, "ppu_crtc_zoom")
, m_sh2cache_ram(*this, "sh2cache_ram")
, m_decrypted_gamerom(*this, "decrypted_gamerom")
@@ -88,15 +87,14 @@ protected:
required_device<palette_device> m_palette;
required_device<cps3_sound_device> m_cps3sound;
required_device<timer_device> m_dma_timer;
+ required_device<timer_device> m_spritelist_dma_timer;
optional_device_array<fujitsu_29f016a_device, 8> m_simm[7];
required_shared_ptr<u32> m_mainram;
required_shared_ptr<u32> m_spriteram;
required_shared_ptr<u16> m_colourram;
- required_shared_ptr<u32> m_tilemap20_regs_base;
- required_shared_ptr<u32> m_tilemap30_regs_base;
- required_shared_ptr<u32> m_tilemap40_regs_base;
- required_shared_ptr<u32> m_tilemap50_regs_base;
+ required_shared_ptr<u32> m_ppu_gscroll;
+ required_shared_ptr<u32> m_tilemap_regs;
required_shared_ptr<u32> m_ppu_crtc_zoom;
required_shared_ptr<u32> m_sh2cache_ram;
required_shared_ptr<u32> m_decrypted_gamerom;
@@ -111,7 +109,7 @@ private:
std::unique_ptr<u32[]> m_eeprom;
std::unique_ptr<u8[]> m_ss_ram;
std::unique_ptr<u32[]> m_spritelist;
- u32 m_ppu_gscroll[0x20/4];
+ u32 m_ppu_gscroll_buff[0x20/4];
s16 m_ss_hscroll;
s16 m_ss_vscroll;
u8 m_ss_pal_base;
@@ -161,7 +159,6 @@ private:
DECLARE_WRITE32_MEMBER(eeprom_w);
DECLARE_WRITE32_MEMBER(palettedma_w);
DECLARE_WRITE32_MEMBER(characterdma_w);
- DECLARE_WRITE32_MEMBER(ppu_gscroll_w);
DECLARE_READ16_MEMBER(colourram_r);
DECLARE_WRITE16_MEMBER(colourram_w);
DECLARE_WRITE16_MEMBER(outport_w);
@@ -171,13 +168,14 @@ private:
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
WRITE_LINE_MEMBER(vbl_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(dma_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(sprite_dma_cb);
u16 rotate_left(u16 value, int n);
u16 rotxor(u16 val, u16 xorval);
u32 cps3_mask(u32 address, u32 key1, u32 key2);
void decrypt_bios();
void init_crypt(u32 key1, u32 key2, int altEncryption);
void set_mame_colours(int colournum, u16 data, u32 fadeval);
- void draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect );
+ void draw_tilemapsprite_line(u32* regs, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect );
u32 flashmain_r(int which, u32 offset, u32 mem_mask);
void flashmain_w(int which, u32 offset, u32 data, u32 mem_mask);
u32 process_byte( u8 real_byte, u32 destination, int max_length );
diff --git a/src/mame/includes/firetrap.h b/src/mame/includes/firetrap.h
index e43f0016fca..04307cfe980 100644
--- a/src/mame/includes/firetrap.h
+++ b/src/mame/includes/firetrap.h
@@ -10,8 +10,10 @@
#pragma once
+#include "cpu/mcs51/mcs51.h"
#include "machine/74157.h"
#include "machine/gen_latch.h"
+#include "machine/timer.h"
#include "sound/msm5205.h"
#include "emupal.h"
#include "tilemap.h"
@@ -27,17 +29,22 @@ public:
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_mcu(*this, "mcu"),
m_msm(*this, "msm"),
m_adpcm_select(*this, "adpcm_select"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch")
+ m_soundlatch(*this, "soundlatch"),
+ m_coins(*this, "COINS")
{ }
void firetrapbl(machine_config &config);
void firetrap(machine_config &config);
- DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
private:
/* memory pointers */
@@ -58,26 +65,33 @@ private:
/* misc */
int m_sound_irq_enable;
int m_nmi_enable;
- int m_i8751_return;
- int m_i8751_current_command;
- int m_i8751_init_ptr;
int m_adpcm_toggle;
int m_coin_command_pending;
+ uint8_t m_mcu_p3;
+ uint8_t m_maincpu_to_mcu;
+ uint8_t m_mcu_to_maincpu;
+
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ optional_device<i8751_device> m_mcu;
required_device<msm5205_device> m_msm;
required_device<ls157_device> m_adpcm_select;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
- DECLARE_WRITE8_MEMBER(firetrap_nmi_disable_w);
+ optional_ioport m_coins;
+
+ DECLARE_WRITE8_MEMBER(nmi_disable_w);
DECLARE_WRITE8_MEMBER(firetrap_bankselect_w);
+ void irqack_w(uint8_t data);
+ uint8_t mcu_r();
+ void mcu_w(uint8_t data);
+ uint8_t mcu_p0_r();
+ void mcu_p3_w(uint8_t data);
DECLARE_READ8_MEMBER(firetrap_8751_bootleg_r);
- DECLARE_READ8_MEMBER(firetrap_8751_r);
- DECLARE_WRITE8_MEMBER(firetrap_8751_w);
DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(sound_flip_flop_w);
DECLARE_WRITE8_MEMBER(sound_bankselect_w);
@@ -95,18 +109,14 @@ private:
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_bg1_tile_info);
TILE_GET_INFO_MEMBER(get_bg2_tile_info);
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
void firetrap_palette(palette_device &palette) const;
uint32_t screen_update_firetrap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(firetrap_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
inline void get_bg_tile_info(tile_data &tileinfo, int tile_index, uint8_t *bgvideoram, int gfx_region);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
DECLARE_WRITE_LINE_MEMBER(firetrap_adpcm_int);
- void firetrap_base_map(address_map &map);
- void firetrap_bootleg_map(address_map &map);
void firetrap_map(address_map &map);
+ void firetrap_bootleg_map(address_map &map);
void sound_map(address_map &map);
};
diff --git a/src/mame/includes/h01x.h b/src/mame/includes/h01x.h
index a51220279a9..5caec560eca 100644
--- a/src/mame/includes/h01x.h
+++ b/src/mame/includes/h01x.h
@@ -9,7 +9,6 @@
#pragma once
-#include "emu.h"
#include "screen.h"
#include "speaker.h"
#include "emupal.h"
diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h
index 84cdbd33186..de097954c3e 100644
--- a/src/mame/includes/karnov.h
+++ b/src/mame/includes/karnov.h
@@ -58,72 +58,74 @@ public:
uint16_t m_i8751_needs_ack;
uint16_t m_i8751_coin_pending;
uint16_t m_i8751_command_queue;
- int m_i8751_level; // needed by chelnov
int m_microcontroller_id;
int m_coin_mask;
int m_latch;
- u16 mcu_r();
- void mcu_w(u16 data);
- DECLARE_WRITE16_MEMBER(mcu_ack_w);
- DECLARE_WRITE16_MEMBER(mcu_reset_w);
+ u16 mcusim_r();
+ void mcusim_w(u16 data);
+ DECLARE_WRITE16_MEMBER(mcusim_ack_w);
+ DECLARE_WRITE16_MEMBER(mcusim_reset_w);
DECLARE_WRITE16_MEMBER(vint_ack_w);
DECLARE_WRITE16_MEMBER(videoram_w);
void playfield_w(offs_t offset, u16 data, u16 mem_mask);
void init_wndrplnt();
void init_karnov();
void init_karnovj();
- void init_chelnovu();
- void init_chelnovj();
- void init_chelnov();
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fix_tile_info);
- virtual void machine_start() override;
- virtual void machine_reset() override;
DECLARE_VIDEO_START(karnov);
DECLARE_VIDEO_START(wndrplnt);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE_LINE_MEMBER(vbint_w);
- void chelnovjbl_vbint_w(int state);
+ DECLARE_WRITE_LINE_MEMBER(mcusim_vbint_w);
+ void vbint_w(int state);
+
void karnov_i8751_w( int data );
void wndrplnt_i8751_w( int data );
- void chelnov_i8751_w( int data );
+
+ void chelnov(machine_config &config);
void chelnovjbl(machine_config &config);
void karnov(machine_config &config);
void wndrplnt(machine_config &config);
void karnovjbl(machine_config &config);
+
void base_sound_map(address_map &map);
void chelnovjbl_mcu_map(address_map &map);
void chelnovjbl_mcu_io_map(address_map &map);
void karnov_map(address_map &map);
- void chelnovjbl_map(address_map &map);
+ void chelnov_map(address_map &map);
void karnov_sound_map(address_map &map);
void karnovjbl_sound_map(address_map &map);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
private:
- // protection mcu (bootleg)
- void chelnovjbl_mcu_ack_w(uint16_t data);
- uint16_t chelnovjbl_mcu_r();
- void chelnovjbl_mcu_w(uint16_t data);
+ // protection mcu
+ void mcu_coin_irq(int state);
+ void mcu_ack_w(uint16_t data);
+ uint16_t mcu_r();
+ void mcu_w(uint16_t data);
+ void mcu_p2_w(uint8_t data);
+ // protection mcu (bootleg specific)
uint8_t mcu_data_l_r();
void mcu_data_l_w(uint8_t data);
uint8_t mcu_data_h_r();
void mcu_data_h_w(uint8_t data);
+ void mcubl_p1_w(uint8_t data);
- void mcu_p1_w(uint8_t data);
-
+ uint8_t m_mcu_p0;
uint8_t m_mcu_p1;
-
+ uint8_t m_mcu_p2;
uint16_t m_mcu_to_maincpu;
uint16_t m_maincpu_to_mcu;
+ bool m_coin_state;
};
enum {
KARNOV = 0,
KARNOVJ,
- CHELNOV,
- CHELNOVU,
- CHELNOVJ,
WNDRPLNT
};
diff --git a/src/mame/includes/ut88.h b/src/mame/includes/ut88.h
index e4dccb4b721..eb29fc92666 100644
--- a/src/mame/includes/ut88.h
+++ b/src/mame/includes/ut88.h
@@ -5,10 +5,11 @@
* includes/ut88.h
*
****************************************************************************/
-
#ifndef MAME_INCLUDES_UT88_H
#define MAME_INCLUDES_UT88_H
+#pragma once
+
#include "cpu/i8085/i8085.h"
#include "sound/dac.h"
#include "machine/i8255.h"
diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h
index a6b16d9ec51..7b6f64f5e1e 100644
--- a/src/mame/includes/wgp.h
+++ b/src/mame/includes/wgp.h
@@ -50,7 +50,6 @@ protected:
enum
{
TIMER_INTERRUPT4,
- TIMER_INTERRUPT6,
TIMER_CPUB_INTERRUPT6
};
@@ -65,8 +64,12 @@ private:
void cpua_ctrl_w(u16 data);
u16 lan_status_r();
void rotate_port_w(offs_t offset, u16 data);
- u16 adinput_r(offs_t offset);
- void adinput_w(u16 data);
+ u8 accel_r();
+ u8 steer_r();
+ u8 steer_offset_r();
+ u8 accel_offset_r();
+ u8 brake_r();
+ u8 unknown_r();
void sound_bankswitch_w(u8 data);
void pivram_word_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void piv_ctrl_word_w(offs_t offset, u16 data, u16 mem_mask = ~0);
@@ -106,7 +109,6 @@ private:
/* misc */
u16 m_cpua_ctrl;
u16 m_port_sel;
- emu_timer *m_int6_timer;
emu_timer *m_cpub_int6_timer;
/* devices */
diff --git a/src/mame/includes/x1.h b/src/mame/includes/x1.h
index 621133ac9b6..f86a47784f5 100644
--- a/src/mame/includes/x1.h
+++ b/src/mame/includes/x1.h
@@ -134,9 +134,9 @@ public:
DECLARE_WRITE8_MEMBER(x1_portb_w);
DECLARE_WRITE8_MEMBER(x1_portc_w);
void init_x1_kanji();
- DECLARE_MACHINE_START(x1);
+ virtual void machine_start() override;
DECLARE_MACHINE_RESET(x1);
- DECLARE_VIDEO_START(x1);
+ virtual void video_start() override;
DECLARE_MACHINE_RESET(x1turbo);
uint32_t screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_INPUT_CHANGED_MEMBER(ipl_reset);
diff --git a/src/mame/layout/mekd3.lay b/src/mame/layout/mekd3.lay
new file mode 100644
index 00000000000..b1ebbc79ec8
--- /dev/null
+++ b/src/mame/layout/mekd3.lay
@@ -0,0 +1,305 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+ <element name="digit" defstate="0">
+ <led7seg>
+ <color red="0.85" green="0.0" blue="0.0" />
+ </led7seg>
+ </element>
+ <element name="background">
+ <rect>
+ <bounds left="0" top="0" right="1" bottom="1" />
+ <color red="0.1" green="0.1" blue="0.1" />
+ </rect>
+ </element>
+
+ <element name="btn_0">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="0"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_1">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="1"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_2">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="2"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_3">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="3"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_4">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="4"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_5">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="5"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_6">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="6"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_7">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="7"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_8">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="8"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_9">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="9"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_a">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="A"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_b">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="B"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_c">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="C"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_d">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="D"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_e">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="E"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_f">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.92" green="0.92" blue="0.92" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.96" green="0.96" blue="0.96" /></rect>
+ <text string="F"><bounds x="0.1" y="0.2" width="0.8" height="0.6" /><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+ <element name="btn_rst">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="RS"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_fs">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="FS"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_fc">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="FC"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_pl">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="P/L"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_tb">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="T/B"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_m">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="M"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_ex">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="EX"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_rd">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="RD"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+ <element name="btn_go">
+ <rect state="0"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect state="1"><bounds x="0.0" y="0.0" width="1.0" height="1.0" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="0"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.14" green="0.36" blue="0.45" /></rect>
+ <rect state="1"><bounds x="0.1" y="0.1" width="0.9" height="0.9" /><color red="0.22" green="0.44" blue="0.53" /></rect>
+ <rect><bounds x="0.1" y="0.1" width="0.8" height="0.8" /><color red="0.18" green="0.40" blue="0.49" /></rect>
+ <text string="GO"><bounds x="0.1" y="0.25" width="0.8" height="0.5" /><color red="0.96" green="0.96" blue="0.96" /></text>
+ </element>
+
+ <group name="displays">
+ <!-- Black background -->
+ <bezel element="background">
+ <bounds left="0" top="0" right="482.0" bottom="70" />
+ </bezel>
+ <bezel name="digit7" element="digit">
+ <bounds left="5.5" top="20" right="30.5" bottom="50" />
+ </bezel>
+ <bezel name="digit6" element="digit">
+ <bounds left="63.5" top="20" right="88.5" bottom="50" />
+ </bezel>
+ <bezel name="digit5" element="digit">
+ <bounds left="121.5" top="20" right="146.5" bottom="50" />
+ </bezel>
+ <bezel name="digit4" element="digit">
+ <bounds left="179.5" top="20" right="204.5" bottom="50" />
+ </bezel>
+ <bezel name="digit3" element="digit">
+ <bounds left="257.5" top="20" right="282.5" bottom="50" />
+ </bezel>
+ <bezel name="digit2" element="digit">
+ <bounds left="315.5" top="20" right="340.5" bottom="50" />
+ </bezel>
+ <bezel name="digit1" element="digit">
+ <bounds left="393.5" top="20" right="418.5" bottom="50" />
+ </bezel>
+ <bezel name="digit0" element="digit">
+ <bounds left="451.5" top="20" right="476.5" bottom="50" />
+ </bezel>
+ </group>
+
+ <group name="keypad">
+ <bezel element="background">
+ <bounds x="0" y="0" width="7.1" height="6.70" />
+ </bezel>
+
+ <cpanel element="btn_rst" inputtag="RESET" inputmask="0x01"><bounds x="0.35" y="0.15" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_fs" inputtag="COL0" inputmask="0x10"><bounds x="1.70" y="0.15" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_fc" inputtag="COL1" inputmask="0x10"><bounds x="3.05" y="0.15" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_pl" inputtag="COL2" inputmask="0x10"><bounds x="4.40" y="0.15" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_tb" inputtag="COL3" inputmask="0x10"><bounds x="5.75" y="0.15" width="1.0" height="1.0" /></cpanel>
+
+ <cpanel element="btn_7" inputtag="COL0" inputmask="0x08"><bounds x="0.35" y="1.50" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_8" inputtag="COL1" inputmask="0x08"><bounds x="1.70" y="1.50" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_9" inputtag="COL2" inputmask="0x08"><bounds x="3.05" y="1.50" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_a" inputtag="COL3" inputmask="0x08"><bounds x="4.40" y="1.50" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_m" inputtag="COL0" inputmask="0x20"><bounds x="5.75" y="1.50" width="1.0" height="1.0" /></cpanel>
+
+ <cpanel element="btn_4" inputtag="COL0" inputmask="0x04"><bounds x="0.35" y="2.85" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_5" inputtag="COL1" inputmask="0x04"><bounds x="1.70" y="2.85" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_6" inputtag="COL2" inputmask="0x04"><bounds x="3.05" y="2.85" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_b" inputtag="COL3" inputmask="0x04"><bounds x="4.40" y="2.85" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_ex" inputtag="COL1" inputmask="0x20"><bounds x="5.75" y="2.85" width="1.0" height="1.0" /></cpanel>
+
+ <cpanel element="btn_1" inputtag="COL0" inputmask="0x02"><bounds x="0.35" y="4.20" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_2" inputtag="COL1" inputmask="0x02"><bounds x="1.70" y="4.20" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_3" inputtag="COL2" inputmask="0x02"><bounds x="3.05" y="4.20" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_c" inputtag="COL3" inputmask="0x02"><bounds x="4.40" y="4.20" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_rd" inputtag="COL2" inputmask="0x20"><bounds x="5.75" y="4.20" width="1.0" height="1.0" /></cpanel>
+
+ <cpanel element="btn_0" inputtag="COL0" inputmask="0x01"><bounds x="0.35" y="5.55" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_f" inputtag="COL1" inputmask="0x01"><bounds x="1.70" y="5.55" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_e" inputtag="COL2" inputmask="0x01"><bounds x="3.05" y="5.55" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_d" inputtag="COL3" inputmask="0x01"><bounds x="4.40" y="5.55" width="1.0" height="1.0" /></cpanel>
+ <cpanel element="btn_go" inputtag="COL3" inputmask="0x20"><bounds x="5.75" y="5.55" width="1.0" height="1.0" /></cpanel>
+ </group>
+
+
+ <view name="LED Displays, Terminal and Keypad" index="0">
+ <group ref="displays"><bounds x="0" y="0" width="320" height="47" /></group>
+ <group ref="keypad"><bounds x="406" y="0" width="148" height="140" /></group>
+ <screen index="0"><bounds x="0" y="160" width="640" height="480" /></screen>
+ </view>
+
+ <view name="LED Displays, CRT and Keypad" index="1">
+ <group ref="displays"><bounds x="0" y="0" width="320" height="47" /></group>
+ <group ref="keypad"><bounds x="406" y="0" width="148" height="140" /></group>
+ <screen index="1"><bounds x="0" y="160" width="640" height="480" /></screen>
+ </view>
+
+ <view name="LED Displays and Keypad" index="2">
+ <group ref="displays"><bounds x="0" y="0" width="320" height="47" /></group>
+ <group ref="keypad"><bounds x="112" y="57" width="171" height="161" /></group>
+ </view>
+
+ <view name="LED Displays" index="3">
+ <group ref="displays"><bounds x="0" y="0" width="320" height="47" /></group>
+ </view>
+
+</mamelayout>
diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp
index 245117ce0d5..fc3004c0f5e 100644
--- a/src/mame/machine/3dom2.cpp
+++ b/src/mame/machine/3dom2.cpp
@@ -196,7 +196,7 @@ static void write_m2_reg(uint32_t &reg, uint32_t data, m2_reg_wmode mode)
case REG_SET: reg |= data; break;
case REG_CLEAR: reg &= ~data; break;
default:
- assert_always(false, "Bad register write mode");
+ throw emu_fatalerror("write_m2_reg: Bad register write mode");
}
}
@@ -1605,7 +1605,7 @@ void m2_cde_device::device_timer(emu_timer &timer, device_timer_id id, int param
break;
default:
- assert_always(false, "Unknown CDE timer ID");
+ throw emu_fatalerror("m2_cde_device::device_timer: Unknown CDE timer ID");
}
}
@@ -1947,7 +1947,7 @@ void m2_cde_device::start_dma(uint32_t ch)
if (dma_ch.m_cntl & CDE_DMA_DIRECTION)
{
// PowerBus to BioBus
- assert_always(false, "CDE PowerBus to BioBus DMA currently unsupported");
+ throw emu_fatalerror("m2_cde_device::start_dma: CDE PowerBus to BioBus DMA currently unsupported");
}
else
{
@@ -1964,8 +1964,10 @@ void m2_cde_device::start_dma(uint32_t ch)
if (setup & CDE_DATAWIDTH_16)
{
// 16-bit case
- assert_always((dma_ch.m_ccnt & 1) == 0, "16-bit DMA: Byte count must be even?");
- assert_always((dma_ch.m_cpad & 1) == 0, "16-bit DMA: DMA destination must be word aligned?");
+ if (dma_ch.m_ccnt & 1)
+ throw emu_fatalerror("m2_cde_device::start_dma: 16-bit DMA: Byte count must be even?");
+ if (dma_ch.m_cpad & 1)
+ throw emu_fatalerror("m2_cde_device::start_dma: 16-bit DMA: DMA destination must be word aligned?");
const uint32_t srcinc = setup & CDE_READ_SETUP_IO ? 0 : 2;
@@ -2012,7 +2014,8 @@ void m2_cde_device::next_dma(uint32_t ch)
m_cpu1->set_cache_dirty();
#endif
- assert_always(dma_ch.m_ccnt == 0, "DMA count non-zero during next DMA");
+ if (dma_ch.m_ccnt != 0)
+ throw emu_fatalerror("m2_cde_device::next_dma: DMA count non-zero during next DMA");
if (dma_ch.m_cntl & CDE_DMA_NEXT_VALID)
{
diff --git a/src/mame/machine/3dom2.h b/src/mame/machine/3dom2.h
index 8942b515064..ed6eabd425b 100644
--- a/src/mame/machine/3dom2.h
+++ b/src/mame/machine/3dom2.h
@@ -691,9 +691,10 @@ private:
void start_dma(uint32_t ch);
void next_dma(uint32_t ch);
- uint32_t address_to_biobus_slot(uint32_t addr) const
+ static uint32_t address_to_biobus_slot(uint32_t addr)
{
- assert_always(addr >= 0x20000000 && addr <= 0x3fffffff, "Address not within BioBus address range");
+ if ((addr < 0x20000000) || (addr > 0x3fffffff))
+ throw emu_fatalerror("m2_cde_device::address_to_biobus_slot: Address not within BioBus address range");
return ((addr >> 24) >> 2) & 7;
}
diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp
index 0449b71d391..690183b1583 100644
--- a/src/mame/machine/amstrad.cpp
+++ b/src/mame/machine/amstrad.cpp
@@ -235,7 +235,7 @@ void amstrad_state::device_timer(emu_timer &timer, device_timer_id id, int param
cb_set_resolution(ptr, param);
break;
default:
- assert_always(false, "Unknown id in amstrad_state::device_timer");
+ throw emu_fatalerror("Unknown id in amstrad_state::device_timer");
}
}
diff --git a/src/mame/machine/archimds.cpp b/src/mame/machine/archimds.cpp
index 319c963afa5..031f27fb196 100644
--- a/src/mame/machine/archimds.cpp
+++ b/src/mame/machine/archimds.cpp
@@ -34,7 +34,6 @@
#include "debugger.h"
static const int page_sizes[4] = { 4096, 8192, 16384, 32768 };
-static const uint32_t pixel_rate[4] = { 8000000, 12000000, 16000000, 24000000};
#define IOC_LOG 0
#define CRTC_LOG 0
@@ -97,30 +96,35 @@ void archimedes_state::device_timer(emu_timer &timer, device_timer_id id, int pa
{
switch (id)
{
- case TIMER_VBLANK: vidc_vblank();break;
- case TIMER_VIDEO: vidc_video_tick(); break;
- case TIMER_AUDIO: vidc_audio_tick(); break;
case TIMER_IOC: ioc_timer(param); break;
}
}
-void archimedes_state::vidc_vblank()
+WRITE_LINE_MEMBER( archimedes_state::vblank_irq )
{
- archimedes_request_irq_a(ARCHIMEDES_IRQA_VBL);
+ if (state)
+ {
+ archimedes_request_irq_a(ARCHIMEDES_IRQA_VBL);
+ if (m_video_dma_on)
+ vidc_video_tick();
+ }
+}
- // set up for next vbl
- m_vbl_timer->adjust(m_screen->time_until_pos(m_vidc_vblank_time));
+WRITE_LINE_MEMBER( archimedes_state::sound_drq )
+{
+ if (state)
+ vidc_audio_tick();
}
+
/* video DMA */
-/* TODO: what type of DMA this is, burst or cycle steal? Docs doesn't explain it (4 usec is the DRAM refresh). */
-/* TODO: change m_region_vram into proper alloc array */
-/* TODO: Erotictac and Poizone sets up vidinit register AFTER vidend, for double buffering? (fixes Poizone "Eterna" logo display on attract) */
+// TODO: what type of DMA this is, burst or cycle steal? Docs doesn't explain it (4 usec is the DRAM refresh). */
+// TODO: Erotictac and Poizone sets up vidinit register AFTER vidend, for double buffering? (fixes Poizone "Eterna" logo display on attract)
+// TODO: understand how to make quazer to work (sets video DMA param in-flight)
void archimedes_state::vidc_video_tick()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- static uint8_t *vram = m_region_vram->base();
uint32_t size;
uint32_t offset_ptr;
@@ -134,7 +138,7 @@ void archimedes_state::vidc_video_tick()
for(m_vidc_vidcur = 0;m_vidc_vidcur < size;m_vidc_vidcur++)
{
- vram[m_vidc_vidcur] = (space.read_byte(offset_ptr));
+ m_vidc->write_vram(m_vidc_vidcur, space.read_byte(offset_ptr));
offset_ptr++;
if(offset_ptr >= m_vidc_vidend+0x10) // TODO: correct?
offset_ptr = m_vidc_vidstart;
@@ -142,73 +146,21 @@ void archimedes_state::vidc_video_tick()
if(m_cursor_enabled == true)
{
- uint32_t ccur_size = (m_vidc_regs[VIDC_VCER] - m_vidc_regs[VIDC_VCSR]) * 32;
-
- for(uint32_t ccur = 0; ccur < ccur_size; ccur++)
- m_cursor_vram[ccur] = (space.read_byte(m_vidc_cinit+ccur));
- }
+ uint32_t ccur_size = m_vidc->get_cursor_size();
- if(m_video_dma_on)
- {
- m_vid_timer->adjust(m_screen->time_until_pos(m_vidc_vblank_time+1));
+ for(uint32_t ccur = 0; ccur < ccur_size; ccur++)
+ m_vidc->write_cram(ccur, space.read_byte(m_vidc_cinit+ccur));
}
- else
- m_vid_timer->adjust(attotime::never);
}
/* audio DMA */
void archimedes_state::vidc_audio_tick()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- uint8_t ulaw_comp;
- int16_t res;
uint8_t ch;
- static const int16_t mulawTable[256] =
- {
- -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,
- -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,
- -15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412,
- -11900,-11388,-10876,-10364, -9852, -9340, -8828, -8316,
- -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140,
- -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092,
- -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004,
- -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980,
- -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436,
- -1372, -1308, -1244, -1180, -1116, -1052, -988, -924,
- -876, -844, -812, -780, -748, -716, -684, -652,
- -620, -588, -556, -524, -492, -460, -428, -396,
- -372, -356, -340, -324, -308, -292, -276, -260,
- -244, -228, -212, -196, -180, -164, -148, -132,
- -120, -112, -104, -96, -88, -80, -72, -64,
- -56, -48, -40, -32, -24, -16, -8, -1,
- 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956,
- 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764,
- 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412,
- 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316,
- 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140,
- 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092,
- 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004,
- 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980,
- 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436,
- 1372, 1308, 1244, 1180, 1116, 1052, 988, 924,
- 876, 844, 812, 780, 748, 716, 684, 652,
- 620, 588, 556, 524, 492, 460, 428, 396,
- 372, 356, 340, 324, 308, 292, 276, 260,
- 244, 228, 212, 196, 180, 164, 148, 132,
- 120, 112, 104, 96, 88, 80, 72, 64,
- 56, 48, 40, 32, 24, 16, 8, 0
- };
for(ch=0; ch<8; ch++)
- {
- uint8_t ulaw_temp = (space.read_byte(m_vidc_sndcur + ch)) ^ 0xff;
-
- ulaw_comp = (ulaw_temp>>1) | ((ulaw_temp&1)<<7);
-
- res = mulawTable[ulaw_comp];
-
- m_dac[ch & 7]->write(res);
- }
+ m_vidc->write_dac(ch, (space.read_byte(m_vidc_sndcur + ch)));
m_vidc_sndcur+=8;
@@ -216,13 +168,12 @@ void archimedes_state::vidc_audio_tick()
{
archimedes_request_irq_b(ARCHIMEDES_IRQB_SOUND_EMPTY);
+ // TODO: nuke this implementation detail, repeated below
+ m_vidc->update_sound_mode(m_audio_dma_on);
if(!m_audio_dma_on)
{
- m_snd_timer->adjust(attotime::never);
for(ch=0; ch<8; ch++)
- {
- m_dac[ch & 7]->write(0);
- }
+ m_vidc->clear_dac(ch);
}
else
{
@@ -293,21 +244,12 @@ void archimedes_state::archimedes_reset()
m_ioc_regs[IRQ_STATUS_B] = 0x00; //set up IL[1] On
m_ioc_regs[FIQ_STATUS] = 0x80; //set up Force FIQ
m_ioc_regs[CONTROL] = 0xff;
-
- m_vidc_vblank_time = 10000; // set a stupidly high time so it doesn't fire off
- m_vbl_timer->adjust(attotime::never);
-
- m_cursor_enabled = false;
- memset(m_cursor_vram, 0, sizeof(m_cursor_vram));
}
void archimedes_state::archimedes_init()
{
m_memc_pagesize = 0;
- m_vbl_timer = timer_alloc(TIMER_VBLANK);
- m_vbl_timer->adjust(attotime::never);
-
m_timer[0] = timer_alloc(TIMER_IOC);
m_timer[1] = timer_alloc(TIMER_IOC);
m_timer[2] = timer_alloc(TIMER_IOC);
@@ -316,10 +258,6 @@ void archimedes_state::archimedes_init()
m_timer[1]->adjust(attotime::never);
m_timer[2]->adjust(attotime::never);
m_timer[3]->adjust(attotime::never);
-
- m_vid_timer = timer_alloc(TIMER_VIDEO);
- m_snd_timer = timer_alloc(TIMER_AUDIO);
- m_snd_timer->adjust(attotime::never);
}
READ32_MEMBER(archimedes_state::archimedes_memc_logical_r)
@@ -520,13 +458,8 @@ READ32_MEMBER( archimedes_state::ioc_ctrl_r )
case CONTROL:
{
uint8_t i2c_data = 1;
- uint8_t flyback; //internal name for vblank here
- int vert_pos;
bool floppy_ready_state;
- vert_pos = m_screen->vpos();
- flyback = (vert_pos <= m_vidc_regs[VIDC_VDSR] || vert_pos >= m_vidc_regs[VIDC_VDER]) ? 0x80 : 0x00;
-
if ( m_i2cmem )
{
i2c_data = (m_i2cmem->read_sda() & 1);
@@ -534,7 +467,7 @@ READ32_MEMBER( archimedes_state::ioc_ctrl_r )
floppy_ready_state = check_floppy_ready();
- return (flyback) | (m_ioc_regs[CONTROL] & 0x78) | (floppy_ready_state<<2) | (m_i2c_clk<<1) | i2c_data;
+ return (m_vidc->flyback_r()<<7) | (m_ioc_regs[CONTROL] & 0x78) | (floppy_ready_state<<2) | (m_i2c_clk<<1) | i2c_data;
}
case KART: // keyboard read
@@ -612,7 +545,7 @@ WRITE32_MEMBER( archimedes_state::ioc_ctrl_w )
---- --x- I2C clock
---- ---x I2C data
*/
-
+
//m_ioc_regs[CONTROL] = data & 0x38;
//if(data & 0x40)
// popmessage("Muting sound, contact MAME/MESSdev");
@@ -628,8 +561,8 @@ WRITE32_MEMBER( archimedes_state::ioc_ctrl_w )
/* bit 7 forces an IRQ trap */
archimedes_request_irq_a((data & 0x80) ? ARCHIMEDES_IRQA_FORCE : 0);
- if(data & 0x08) //set up the VBLANK timer
- m_vbl_timer->adjust(m_screen->time_until_pos(m_vidc_vblank_time));
+ //if(data & 0x08) //set up the VBLANK timer
+ // m_vbl_timer->adjust(m_screen->time_until_pos(m_vidc_vblank_time));
break;
@@ -747,18 +680,19 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r)
}
case 2:
// RTFM joystick interface routes here
+ // TODO: slot interface for econet (reads registers 0 and 1 during boot)
switch(ioc_addr)
{
case 0x3a0000:
- return 0xed; // ID? Status?
+ return 0xed; // ID for econet
case 0x3a0004:
return m_joy[0].read_safe(0xff);
- case 0x3a0008:
+ case 0x3a0008:
// Top Banana reads there and do various checks,
// disallowing player 1 joy use if they fails (?)
return m_joy[1].read_safe(0xff);
}
-
+
logerror("IOC: Econet Read %08x at PC=%08x\n",ioc_addr, m_maincpu->pc());
return 0xffff;
case 3:
@@ -770,18 +704,19 @@ READ32_MEMBER(archimedes_state::archimedes_ioc_r)
case 5:
if (m_fdc)
{
+ // TODO: IOEB slot interface
switch(ioc_addr & 0xfffc)
{
case 0x18: return 0xff; // FDC latch B
case 0x40: return 0xff; // FDC latch A
- case 0x50: return 0; //fdc type, new model returns 5 here
- case 0x70: return 0x0f;
+ case 0x50: return 0; //fdc type, an 82c711 returns 5 here
+ case 0x70: return 0x0f; // monitor type, TBD
case 0x74: return 0xff; // unknown
case 0x78: // serial joystick?
case 0x7c:
logerror("FDC: reading Joystick port %04x at PC=%08x\n",ioc_addr, m_maincpu->pc());
return 0xff;
-
+
}
}
@@ -849,16 +784,16 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
// TODO: understand how player 2 inputs routes, related somehow to CONTROL bit 6 (cfr. blitz in SW list)
// TODO: paradr2k polls here with bit 7 and fails detection (Vertical Twist)
uint8_t cur_joy_in = bitswap<8>(m_joy[0].read_safe(0xff),7,6,5,4,0,1,2,3);
-
+
m_joy_serial_data = (data & 0xff) ^ 0xff;
bool serial_on = false;
-
+
if (m_joy_serial_data == 0x20)
serial_on = true;
else if (m_joy_serial_data & cur_joy_in)
serial_on = true;
-
-
+
+
// wants printer irq for some reason (connected on parallel?)
if (serial_on == true)
{
@@ -870,7 +805,7 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
archimedes_clear_irq_a(ARCHIMEDES_IRQA_PRINTER_BUSY);
//m_ioc_regs[CONTROL] &= ~0x40;
}
-
+
return;
}
case 0x18: // latch B
@@ -917,178 +852,6 @@ WRITE32_MEMBER(archimedes_state::archimedes_ioc_w)
logerror("(PC=%08x) I/O: W %x @ %x (mask %08x)\n", m_maincpu->pc(), data, (offset*4)+0x3000000, mem_mask);
}
-READ32_MEMBER(archimedes_state::archimedes_vidc_r)
-{
- return 0;
-}
-
-void archimedes_state::vidc_dynamic_res_change()
-{
- /* sanity checks - first pass */
- /*
- total cycles + border end
- */
- if(m_vidc_regs[VIDC_HCR] && m_vidc_regs[VIDC_HBER] &&
- m_vidc_regs[VIDC_VCR] && m_vidc_regs[VIDC_VBER])
- {
- /* sanity checks - second pass */
- /*
- total cycles >= border end >= border start
- */
- if((m_vidc_regs[VIDC_HCR] >= m_vidc_regs[VIDC_HBER]) &&
- (m_vidc_regs[VIDC_HBER] >= m_vidc_regs[VIDC_HBSR]) &&
- (m_vidc_regs[VIDC_VBER] >= m_vidc_regs[VIDC_VBSR]))
- {
- rectangle const visarea(
- 0, m_vidc_regs[VIDC_HBER] - m_vidc_regs[VIDC_HBSR] - 1,
- 0, (m_vidc_regs[VIDC_VBER] - m_vidc_regs[VIDC_VBSR]) * (m_vidc_interlace + 1));
-
- m_vidc_vblank_time = m_vidc_regs[VIDC_VBER] * (m_vidc_interlace+1);
- //logerror("Configuring: htotal %d vtotal %d border %d x %d display origin %d x %d vblank = %d\n",
- // m_vidc_regs[VIDC_HCR], m_vidc_regs[VIDC_VCR],
- // visarea.right(), visarea.bottom(),
- // m_vidc_regs[VIDC_HDER]-m_vidc_regs[VIDC_HDSR],m_vidc_regs[VIDC_VDER]-m_vidc_regs[VIDC_VDSR]+1,
- // m_vidc_vblank_time);
-
- attoseconds_t const refresh = HZ_TO_ATTOSECONDS(pixel_rate[m_vidc_pixel_clk]) * m_vidc_regs[VIDC_HCR] * m_vidc_regs[VIDC_VCR];
-
- m_screen->configure(m_vidc_regs[VIDC_HCR], m_vidc_regs[VIDC_VCR] * (m_vidc_interlace+1), visarea, refresh);
- }
- }
-}
-
-WRITE32_MEMBER(archimedes_state::archimedes_vidc_w)
-{
- uint32_t reg = data>>24;
- uint32_t val = data & 0xffffff;
- #if CRTC_LOG
- static const char *const vrnames[] =
- {
- "horizontal total",
- "horizontal sync width",
- "horizontal border start",
- "horizontal display start",
- "horizontal display end",
- "horizontal border end",
- "horizontal cursor start",
- "horizontal interlace",
- "vertical total",
- "vertical sync width",
- "vertical border start",
- "vertical display start",
- "vertical display end",
- "vertical border end",
- "vertical cursor start",
- "vertical cursor end",
- };
- #endif
-
-
- // 0x00 - 0x3c Video Palette Logical Colors (16 colors)
- // 0x40 Border Color
- // 0x44 - 0x4c Cursor Palette Logical Colors
- if (reg <= 0x4c)
- {
- int r,g,b;
-
- //i = (val & 0x1000) >> 12; //supremacy bit
- b = (val & 0x0f00) >> 8;
- g = (val & 0x00f0) >> 4;
- r = (val & 0x000f) >> 0;
-
- //if(reg == 0x40 && val & 0xfff)
- // logerror("WARNING: border color write here (PC=%08x)!\n",m_maincpu->pc());
-
- m_palette->set_pen_color(reg >> 2, pal4bit(r), pal4bit(g), pal4bit(b) );
-
- /* handle 8bpp colors here */
- if(reg <= 0x3c)
- {
- int i;
-
- for(i=0;i<0x100;i+=0x10)
- {
- b = ((val & 0x700) >> 8) | ((i & 0x80) >> 4);
- g = ((val & 0x030) >> 4) | ((i & 0x60) >> 3);
- r = ((val & 0x007) >> 0) | ((i & 0x10) >> 1);
-
- m_palette->set_pen_color((reg >> 2) + 0x100 + i, pal4bit(r), pal4bit(g), pal4bit(b) );
- }
- }
-
- // update partials
- m_screen->update_partial(m_screen->vpos());
- }
- else if (reg >= 0x60 && reg <= 0x7c)
- {
- m_vidc_stereo_reg[(reg >> 2) & 7] = val & 0x07;
-
-// popmessage("%02x %02x %02x %02x %02x %02x %02x %02x",vidc_stereo_reg[0],vidc_stereo_reg[1],vidc_stereo_reg[2],vidc_stereo_reg[3]
-// ,vidc_stereo_reg[4],vidc_stereo_reg[5],vidc_stereo_reg[6],vidc_stereo_reg[7]);
- }
- else if (reg >= 0x80 && reg <= 0xbc)
- {
- switch(reg)
- {
- case VIDC_HCR: m_vidc_regs[VIDC_HCR] = ((val >> 14)<<1)+1; break;
-// case VIDC_HSWR: m_vidc_regs[VIDC_HSWR] = (val >> 14)+1; break;
- case VIDC_HBSR: m_vidc_regs[VIDC_HBSR] = ((val >> 14)<<1)+1; break;
- case VIDC_HDSR: m_vidc_regs[VIDC_HDSR] = (val >> 14); break;
- case VIDC_HDER: m_vidc_regs[VIDC_HDER] = (val >> 14); break;
- case VIDC_HBER: m_vidc_regs[VIDC_HBER] = ((val >> 14)<<1)+1; break;
- case VIDC_HCSR: m_vidc_regs[VIDC_HCSR] = ((val >> 13) & 0x7ff) + 6; break;
-// #define VIDC_HIR 0x9c
-
- case VIDC_VCR: m_vidc_regs[VIDC_VCR] = ((val >> 14))+1; break;
-// #define VIDC_VSWR 0xa4
- case VIDC_VBSR: m_vidc_regs[VIDC_VBSR] = (val >> 14)+1; break;
- case VIDC_VDSR: m_vidc_regs[VIDC_VDSR] = (val >> 14)+1; break;
- case VIDC_VDER: m_vidc_regs[VIDC_VDER] = (val >> 14)+1; break;
- case VIDC_VBER: m_vidc_regs[VIDC_VBER] = (val >> 14)+1; break;
- case VIDC_VCSR: m_vidc_regs[VIDC_VCSR] = ((val >> 14) & 0x3ff) + 1; break;
- case VIDC_VCER: m_vidc_regs[VIDC_VCER] = ((val >> 14) & 0x3ff) + 1; break;
- }
-
-
- #if CRTC_LOG
- if(reg != VIDC_VCSR && reg != VIDC_VCER && reg != VIDC_HCSR)
- logerror("VIDC: %s = %d\n", vrnames[(reg-0x80)/4], m_vidc_regs[reg]);
- #endif
-
- vidc_dynamic_res_change();
- }
- else if (reg == 0xc0)
- {
- m_vidc_regs[reg] = val & 0xffff;
-
- if (m_audio_dma_on)
- {
- double sndhz = 1e6 / ((m_vidc_regs[0xc0] & 0xff) + 2);
- sndhz /= 8.0;
- m_snd_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz));
- //printf("VIDC: sound freq to %d, sndhz = %f\n", (val & 0xff)-2, sndhz);
- }
- }
- else if (reg == 0xe0)
- {
- m_vidc_bpp_mode = ((val & 0x0c) >> 2);
- m_vidc_interlace = ((val & 0x40) >> 6);
- m_vidc_pixel_clk = (val & 0x03);
- //todo: vga/svga modes sets 0x1000
- vidc_dynamic_res_change();
- }
- else
- {
- logerror("VIDC: %x to register %x\n", val, reg);
- m_vidc_regs[reg] = val&0xffff;
- }
-}
-
-READ32_MEMBER(archimedes_state::archimedes_memc_r)
-{
- return 0;
-}
-
WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
{
// is it a register?
@@ -1113,23 +876,28 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
case 3: /* cursor init */
m_cursor_enabled = true;
+ m_vidc->set_cursor_enable(m_cursor_enabled);
m_vidc_cinit = 0x2000000 | (((data>>2)&0x7fff)*16);
//printf("MEMC: CURSOR INIT %08x\n",((data>>2)&0x7fff)*16);
break;
case 4: /* sound start */
- //logerror("MEMC: SNDSTART %08x\n",data);
archimedes_clear_irq_b(ARCHIMEDES_IRQB_SOUND_EMPTY);
m_vidc_sndstart = 0x2000000 | ((data>>2)&0x7fff)*16;
+ //printf("MEMC: SNDSTART %08x\n",m_vidc_sndstart);
break;
case 5: /* sound end */
- //logerror("MEMC: SNDEND %08x\n",data);
- m_vidc_sndend = 0x2000000 | ((data>>2)&0x7fff)*16;
+ // end buffer is actually +16 bytes wrt sound start
+ // TODO: it actually don't apply for ertictac and poizone?
+ m_vidc_sndend = 0x2000000 | (((data>>2)+1)&0x7fff)*16;
+ //printf("MEMC: SNDEND %08x\n",m_vidc_sndend);
break;
case 6:
- m_vidc_sndcur = 0;
+ //printf("MEMC: SNDPTR\n");
+ m_vidc_sndcur = m_vidc_sndstart;
+ m_vidc_sndendcur = m_vidc_sndend;
archimedes_request_irq_b(ARCHIMEDES_IRQB_SOUND_EMPTY);
break;
@@ -1138,24 +906,25 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
logerror("(PC = %08x) MEMC: %x to Control (page size %d, %s, %s)\n", m_maincpu->pc(), data & 0x1ffc, page_sizes[m_memc_pagesize], ((data>>10)&1) ? "Video DMA on" : "Video DMA off", ((data>>11)&1) ? "Sound DMA on" : "Sound DMA off");
- m_video_dma_on = ((data>>10)&1);
- m_audio_dma_on = ((data>>11)&1);
+ m_video_dma_on = BIT(data, 10);
+ m_audio_dma_on = BIT(data, 11);
- if ((data>>10)&1)
+ if (m_video_dma_on)
{
m_vidc_vidcur = 0;
- m_vid_timer->adjust(m_screen->time_until_pos(m_vidc_vblank_time+1));
+ // TODO: update internally
}
else
+ {
m_cursor_enabled = false;
+ m_vidc->set_cursor_enable(m_cursor_enabled);
+ }
- if ((data>>11) & 1)
+ m_vidc->update_sound_mode(m_audio_dma_on);
+ if (m_audio_dma_on)
{
//printf("MEMC: Starting audio DMA at %d uSec, buffer from %x to %x\n", ((m_vidc_regs[0xc0]&0xff)-2)*8, m_vidc_sndstart, m_vidc_sndend);
- double sndhz = 1e6 / ((m_vidc_regs[0xc0] & 0xff) + 2);
- sndhz /= 8.0;
- m_snd_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz));
//printf("MEMC: audio DMA start, sound freq %d, sndhz = %f\n", (m_vidc_regs[0xc0] & 0xff)-2, sndhz);
m_vidc_sndcur = m_vidc_sndstart;
diff --git a/src/mame/machine/arkanoid.cpp b/src/mame/machine/arkanoid.cpp
index b89d77eb4a0..a6762df998a 100644
--- a/src/mame/machine/arkanoid.cpp
+++ b/src/mame/machine/arkanoid.cpp
@@ -486,7 +486,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_d008_r)
{
uint8_t arkanoid_bootleg_d008_bit[8];
uint8_t arkanoid_bootleg_d008_val;
- uint8_t arkanoid_paddle_value = ioport("MUX")->read();
+ uint8_t arkanoid_paddle_value = input_mux_r();
int b;
arkanoid_bootleg_d008_bit[4] = arkanoid_bootleg_d008_bit[6] = arkanoid_bootleg_d008_bit[7] = 0; /* untested bits */
diff --git a/src/mame/machine/asic65.cpp b/src/mame/machine/asic65.cpp
index 5a41d76763c..6f9a021edd6 100644
--- a/src/mame/machine/asic65.cpp
+++ b/src/mame/machine/asic65.cpp
@@ -181,7 +181,7 @@ void asic65_device::device_timer(emu_timer &timer, device_timer_id id, int param
m_ourcpu->set_input_line(0, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in asic65_device::device_timer");
+ throw emu_fatalerror("Unknown id in asic65_device::device_timer");
}
}
diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp
index 9edac77f473..3c224b77370 100644
--- a/src/mame/machine/at.cpp
+++ b/src/mame/machine/at.cpp
@@ -52,6 +52,7 @@ void at_mb_device::at_softlists(machine_config &config)
SOFTWARE_LIST(config, "pc_disk_list").set_original("ibm5150");
SOFTWARE_LIST(config, "at_disk_list").set_original("ibm5170");
SOFTWARE_LIST(config, "at_cdrom_list").set_original("ibm5170_cdrom");
+ SOFTWARE_LIST(config, "midi_disk_list").set_compatible("midi_flop");
}
void at_mb_device::device_add_mconfig(machine_config &config)
diff --git a/src/mame/machine/bebox.cpp b/src/mame/machine/bebox.cpp
index f75af07d232..6c0cec83571 100644
--- a/src/mame/machine/bebox.cpp
+++ b/src/mame/machine/bebox.cpp
@@ -306,11 +306,12 @@ void bebox_state::bebox_set_irq_bit(unsigned int interrupt_bit, int val)
if (LOG_INTERRUPTS)
{
/* make sure that we don't shoot ourself in the foot */
- assert_always((interrupt_bit < ARRAY_LENGTH(interrupt_names)) && (interrupt_names[interrupt_bit] != nullptr), "Raising invalid interrupt");
+ if ((interrupt_bit >= ARRAY_LENGTH(interrupt_names)) || !interrupt_names[interrupt_bit])
+ throw emu_fatalerror("bebox_state::bebox_set_irq_bit: Raising invalid interrupt");
logerror("bebox_set_irq_bit(): pc[0]=0x%08x pc[1]=0x%08x %s interrupt #%u (%s)\n",
- (unsigned) m_ppc[0]->pc(),
- (unsigned) m_ppc[1]->pc(),
+ unsigned(m_ppc[0]->pc()),
+ unsigned(m_ppc[1]->pc()),
val ? "Asserting" : "Clearing",
interrupt_bit, interrupt_names[interrupt_bit]);
}
@@ -750,7 +751,7 @@ void bebox_state::device_timer(emu_timer &timer, device_timer_id id, int param,
case TIMER_GET_DEVICES:
break;
default:
- assert_always(false, "Unknown id in bebox_state::device_timer");
+ throw emu_fatalerror("Unknown id in bebox_state::device_timer");
}
}
diff --git a/src/mame/machine/bublbobl.cpp b/src/mame/machine/bublbobl.cpp
index f726f7d3fa9..c9d9f2c9ce2 100644
--- a/src/mame/machine/bublbobl.cpp
+++ b/src/mame/machine/bublbobl.cpp
@@ -135,7 +135,7 @@ void bublbobl_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_mcu->set_input_line(0, CLEAR_LINE);
break;
default:
- assert_always(false, "Unknown id in bublbobl_state::device_timer");
+ throw emu_fatalerror("Unknown id in bublbobl_state::device_timer");
}
}
diff --git a/src/mame/machine/dai.cpp b/src/mame/machine/dai.cpp
index a7864d4c398..a809984d668 100644
--- a/src/mame/machine/dai.cpp
+++ b/src/mame/machine/dai.cpp
@@ -31,7 +31,7 @@ void dai_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
timer_set(attotime::from_hz(100), TIMER_TMS5501);
break;
default:
- assert_always(false, "Unknown id in dai_state::device_timer");
+ throw emu_fatalerror("Unknown id in dai_state::device_timer");
}
}
diff --git a/src/mame/machine/electron.cpp b/src/mame/machine/electron.cpp
index 87d1056fdb4..19862d17e72 100644
--- a/src/mame/machine/electron.cpp
+++ b/src/mame/machine/electron.cpp
@@ -42,7 +42,7 @@ void electron_state::device_timer(emu_timer &timer, device_timer_id id, int para
electron_scanline_interrupt(ptr, param);
break;
default:
- assert_always(false, "Unknown id in electron_state::device_timer");
+ throw emu_fatalerror("Unknown id in electron_state::device_timer");
}
}
diff --git a/src/mame/machine/hpc3.cpp b/src/mame/machine/hpc3.cpp
index d5f0962848f..ca25c0d544b 100644
--- a/src/mame/machine/hpc3.cpp
+++ b/src/mame/machine/hpc3.cpp
@@ -248,7 +248,7 @@ void hpc3_device::device_timer(emu_timer &timer, device_timer_id id, int param,
LOGMASKED(LOG_UNKNOWN, "HPC3: Ignoring active PBUS DMA on channel %d\n", id - TIMER_PBUS_DMA);
break;
default:
- assert_always(false, "Unknown id in hpc3_device::device_timer");
+ throw emu_fatalerror("Unknown id in hpc3_device::device_timer");
}
}
diff --git a/src/mame/machine/ioc2.cpp b/src/mame/machine/ioc2.cpp
index dfa6ac0c45a..eeff60b99d1 100644
--- a/src/mame/machine/ioc2.cpp
+++ b/src/mame/machine/ioc2.cpp
@@ -759,3 +759,10 @@ WRITE_LINE_MEMBER(ioc2_device::enet_int_w)
lower_local_irq(0, ioc2_device::INT3_LOCAL0_ETHERNET);
}
+WRITE_LINE_MEMBER(ioc2_device::video_int_w)
+{
+ if (state)
+ raise_local_irq(1, ioc2_device::INT3_LOCAL1_VIDEO);
+ else
+ lower_local_irq(1, ioc2_device::INT3_LOCAL1_VIDEO);
+}
diff --git a/src/mame/machine/ioc2.h b/src/mame/machine/ioc2.h
index 808655ae71d..63113d08077 100644
--- a/src/mame/machine/ioc2.h
+++ b/src/mame/machine/ioc2.h
@@ -36,6 +36,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(scsi0_int_w);
DECLARE_WRITE_LINE_MEMBER(scsi1_int_w);
DECLARE_WRITE_LINE_MEMBER(enet_int_w);
+ DECLARE_WRITE_LINE_MEMBER(video_int_w);
void raise_local_irq(int channel, uint8_t mask);
void lower_local_irq(int channel, uint8_t mask);
@@ -60,7 +61,7 @@ public:
INT3_LOCAL1_MAPPABLE1 = 0x08,
INT3_LOCAL1_HPC_DMA = 0x10,
INT3_LOCAL1_AC_FAIL = 0x20,
- INT3_LOCAL1_VSYNC = 0x40,
+ INT3_LOCAL1_VIDEO = 0x40,
INT3_LOCAL1_RETRACE = 0x80,
};
diff --git a/src/mame/machine/kaneko_calc3.cpp b/src/mame/machine/kaneko_calc3.cpp
index 572fa89fdba..54078f5d297 100644
--- a/src/mame/machine/kaneko_calc3.cpp
+++ b/src/mame/machine/kaneko_calc3.cpp
@@ -104,7 +104,7 @@ void kaneko_calc3_device::device_timer(emu_timer &timer, device_timer_id id, int
reset_run_timer();
break;
default:
- assert_always(false, "Unknown id in kaneko_calc3_device::device_timer");
+ throw emu_fatalerror("Unknown id in kaneko_calc3_device::device_timer");
}
}
diff --git a/src/mame/machine/kaypro.cpp b/src/mame/machine/kaypro.cpp
index a2159d3212a..1bef83edaf0 100644
--- a/src/mame/machine/kaypro.cpp
+++ b/src/mame/machine/kaypro.cpp
@@ -201,7 +201,7 @@ void kaypro_state::device_timer(emu_timer &timer, device_timer_id id, int param,
break;
default:
- assert_always(false, "Unknown id in kaypro_state::device_timer");
+ throw emu_fatalerror("Unknown id in kaypro_state::device_timer");
}
}
diff --git a/src/mame/machine/lynx.cpp b/src/mame/machine/lynx.cpp
index 2ed5da8b021..d6fa79da37c 100644
--- a/src/mame/machine/lynx.cpp
+++ b/src/mame/machine/lynx.cpp
@@ -598,7 +598,7 @@ void lynx_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
lynx_uart_timer(ptr, param);
break;
default:
- assert_always(false, "Unknown id in lynx_state::device_timer");
+ throw emu_fatalerror("Unknown id in lynx_state::device_timer");
}
}
diff --git a/src/mame/machine/mbee.cpp b/src/mame/machine/mbee.cpp
index 35f338a8e2f..6a6d4fe49cd 100644
--- a/src/mame/machine/mbee.cpp
+++ b/src/mame/machine/mbee.cpp
@@ -24,7 +24,7 @@ void mbee_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
timer_newkb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in mbee_state::device_timer");
+ throw emu_fatalerror("Unknown id in mbee_state::device_timer");
}
}
diff --git a/src/mame/machine/micro3d.cpp b/src/mame/machine/micro3d.cpp
index 1eb182ea07f..e30e9361b5d 100644
--- a/src/mame/machine/micro3d.cpp
+++ b/src/mame/machine/micro3d.cpp
@@ -133,7 +133,7 @@ void micro3d_state::device_timer(emu_timer &timer, device_timer_id id, int param
mac_done_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in micro3d_state::device_timer");
+ throw emu_fatalerror("Unknown id in micro3d_state::device_timer");
}
}
diff --git a/src/mame/machine/mikro80.cpp b/src/mame/machine/mikro80.cpp
index 633c47481da..ad2d9299f0c 100644
--- a/src/mame/machine/mikro80.cpp
+++ b/src/mame/machine/mikro80.cpp
@@ -66,7 +66,7 @@ void mikro80_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_bank1->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in mikro80_state::device_timer");
+ throw emu_fatalerror("Unknown id in mikro80_state::device_timer");
}
}
diff --git a/src/mame/machine/nb1412m2.cpp b/src/mame/machine/nb1412m2.cpp
index f0216b886ff..ee9e49bc2c0 100644
--- a/src/mame/machine/nb1412m2.cpp
+++ b/src/mame/machine/nb1412m2.cpp
@@ -204,7 +204,7 @@ void nb1412m2_device::device_timer(emu_timer &timer, device_timer_id id, int par
break;
default:
- assert_always(false, "Unknown id in nb1412m2_device::device_timer");
+ throw emu_fatalerror("Unknown id in nb1412m2_device::device_timer");
}
}
diff --git a/src/mame/machine/nb1413m3.cpp b/src/mame/machine/nb1413m3.cpp
index aee884a0d3f..ad6083b0ba3 100644
--- a/src/mame/machine/nb1413m3.cpp
+++ b/src/mame/machine/nb1413m3.cpp
@@ -111,7 +111,7 @@ void nb1413m3_device::device_timer(emu_timer &timer, device_timer_id id, int par
timer_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in nb1413m3_device::device_timer");
+ throw emu_fatalerror("Unknown id in nb1413m3_device::device_timer");
}
}
diff --git a/src/mame/machine/pk8020.cpp b/src/mame/machine/pk8020.cpp
index 57bcb5d9f08..8a8b1661482 100644
--- a/src/mame/machine/pk8020.cpp
+++ b/src/mame/machine/pk8020.cpp
@@ -233,5 +233,5 @@ void pk8020_state::machine_reset()
INTERRUPT_GEN_MEMBER(pk8020_state::pk8020_interrupt)
{
m_takt ^= 1;
- m_inr->ir4_w(1);
+ m_inr->ir4_w(m_takt);
}
diff --git a/src/mame/machine/pmd85.cpp b/src/mame/machine/pmd85.cpp
index 37cad7aef89..f3206e7be7e 100644
--- a/src/mame/machine/pmd85.cpp
+++ b/src/mame/machine/pmd85.cpp
@@ -639,7 +639,7 @@ void pmd85_state::device_timer(emu_timer &timer, device_timer_id id, int param,
pmd85_cassette_timer_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in pmd85_state::device_timer");
+ throw emu_fatalerror("Unknown id in pmd85_state::device_timer");
}
}
diff --git a/src/mame/machine/pocketc.cpp b/src/mame/machine/pocketc.cpp
index 6afa6a5c84e..528084a5dbb 100644
--- a/src/mame/machine/pocketc.cpp
+++ b/src/mame/machine/pocketc.cpp
@@ -22,7 +22,7 @@ void pocketc_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_power = 0;
break;
default:
- assert_always(false, "Unknown id in pocketc_state::device_timer");
+ throw emu_fatalerror("Unknown id in pocketc_state::device_timer");
}
}
diff --git a/src/mame/machine/radio86.cpp b/src/mame/machine/radio86.cpp
index f15da84afdc..fb203b68101 100644
--- a/src/mame/machine/radio86.cpp
+++ b/src/mame/machine/radio86.cpp
@@ -137,7 +137,7 @@ void radio86_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_bank1->set_entry(0);
break;
default:
- assert_always(false, "Unknown id in radio86_state::device_timer");
+ throw emu_fatalerror("Unknown id in radio86_state::device_timer");
}
}
diff --git a/src/mame/machine/saa7191.cpp b/src/mame/machine/saa7191.cpp
index 58adc913ebf..865b3a5da25 100644
--- a/src/mame/machine/saa7191.cpp
+++ b/src/mame/machine/saa7191.cpp
@@ -6,8 +6,8 @@
Philips SAA7191B Digital Multistandard Colour Decoder (DMSD)
- TODO:
- - Actual functionality
+ TODO:
+ - Actual functionality
*********************************************************************/
@@ -17,8 +17,8 @@
#define LOG_UNKNOWN (1 << 0)
#define LOG_READS (1 << 1)
#define LOG_WRITES (1 << 2)
-#define LOG_ERRORS (1 << 3)
-#define LOG_I2C_IGNORES (1 << 4)
+#define LOG_ERRORS (1 << 3)
+#define LOG_I2C_IGNORES (1 << 4)
#define LOG_DEFAULT (LOG_READS | LOG_WRITES | LOG_ERRORS | LOG_I2C_IGNORES | LOG_UNKNOWN)
#define VERBOSE (LOG_DEFAULT)
diff --git a/src/mame/machine/saa7191.h b/src/mame/machine/saa7191.h
index b641aa46190..42a5170b162 100644
--- a/src/mame/machine/saa7191.h
+++ b/src/mame/machine/saa7191.h
@@ -6,8 +6,8 @@
Philips SAA7191B Digital Multistandard Colour Decoder (DMSD)
- TODO:
- - Actual functionality
+ TODO:
+ - Actual functionality
*********************************************************************/
@@ -174,4 +174,4 @@ private:
DECLARE_DEVICE_TYPE(SAA7191, saa7191_device)
-#endif // MAME_MACHINE_SAA7191_H \ No newline at end of file
+#endif // MAME_MACHINE_SAA7191_H
diff --git a/src/mame/machine/segabill.cpp b/src/mame/machine/segabill.cpp
index 38dfbf4f560..554c35965e3 100644
--- a/src/mame/machine/segabill.cpp
+++ b/src/mame/machine/segabill.cpp
@@ -1,14 +1,63 @@
// license: BSD-3-Clause
// copyright-holders: Dirk Best
+// thanks-to: Rob Krum
/***************************************************************************
Sega Billboard
- TODO: Timing, vs298 needs a higher interrupt frequency, but then
- the animations seem to fast?
+ TODO: Timing, vs298 needs a higher interrupt frequency, but then
+ the animations seem to fast?
+ Document and add support for Blast City Billboard with EPR-19158.IC3
+ ( https://www.arcade-projects.com/forums/index.php?attachment/1477-blast-city-billboard-pcb-jpg/ )
***************************************************************************/
+/*
+Sega VERSUS CITY BILLBOARD CONTROL BD 837-11854 (C) 1991
+( https://www.arcade-projects.com/forums/index.php?attachment/7044-vs-pcb-top-jpg/ )
+|-----------------------------------------------------------------------------|
+| |---------------| |---------------| |---------------------------| |
+|-- |---------------| |---------------| |---------------------------| |
+|||S CN5 CN4 CN3 |
+|||W PS2501 PS2501 M54583P M54583P M54583P |
+|||1 M54583P M54583P |
+|-- 74F74N M74LS393P HD74HC4040P 315-5338A |
+| |
+| z -- |
+| 8 M27C512 32.000MHz C|| |
+| 0 LH5268AD N|| |
+| 2|| |
+| GAL16V8B SN74LS32N SN74LS04N MB3771 -- |
+| LED |
+|-----------------------------------------------------------------------------|
+ Setup:
+ Z80 ZILOG Z0840008PSC Z80 CPU (DIP40)
+ LH5268A SHARP LH5268AD-10LL 8k x8 SRAM (DIP28, labeled as MB8464A-15LL on PCB silkscreen)
+ PS2501 NEC PS2501-4 ISOLATOR (DIP16)
+ M54583P MITSUBISHI M54583P DARLINGTON TRANSISTOR ARRAY (DIP18)
+ 74F74N PHILLIPS 74F74N DUAL D-TYPE FLIP-FLIP (DIP14)
+ M74LS393P MITSUBISHI M74LS393P DUAL BINARY COUNTER (DIP14)
+ HD74HC4040P RENESAS HD74HC4040P 12-STAGE BINARY COUNTER (DIP16)
+ 315-5338A SEGA CUSTOM (QFP100)
+ M27C512 ST MICROELECTRONICS M27C512-15F1 (DIP28, labeled 'EPR-18022', socketed)
+ GAL16V8B LATTICE GAL16V8B-25LP HIGH PERFORMANCE E2CMOS PLD GENERIC ARRAY LOGIC (DIP28, socketed)
+ SN74LS32N MOTOROLA SN74LS32N QUAD 2-INPUT OR GATE (DIP14)
+ SN74LS04N MOTOROLA SN74LS04N HEX INVERTER (DIP14)
+ MB3771 FUJITSU MB3771 POWER SUPPLY VOLTAGE MONITOR (SOP8)
+ Board:
+ 837-11854 Sega VERSUS CITY BILLBOARD CONTROL BD
+ EEPROM:
+ EPR-18022.IC2 Sega VERSUS CITY BILLBOARD
+ Notes:
+ SW1 8-DIP switch
+ CN2 10 pin connector for power input (5v)
+ CN3 J50 pin connector for two 7-SEG UNITs (VSC-0220, connects at VSC-0221 7SEG BASE)
+ CN4 J20 pin connector to BLUE(U-P) PANEL
+ (600-6770-005 WIRE HARN BILLBOARD FLT BD, CN7(?) and CN11 for Model3, CN6 and CN12 for Model2)
+ CN5 has no connector soldered and as such is unused and has two silkscreened PS2501-4 ICs below,
+ similar to the ICs under CN4
+ 171-6218B is printed to right of (C) SEGA 1991 on bottom of board
+*/
#include "emu.h"
#include "segabill.h"
#include "cpu/z80/z80.h"
@@ -99,7 +148,7 @@ const tiny_rom_entry *sega_billboard_device::device_rom_region() const
void sega_billboard_device::device_add_mconfig(machine_config &config)
{
- Z80(config, m_billcpu, 32_MHz_XTAL / 8); // divisor guessed
+ Z80(config, m_billcpu, 32_MHz_XTAL / 4); // Z0840008PSC 8MHz rated part - not verified
m_billcpu->set_addrmap(AS_PROGRAM, &sega_billboard_device::mem_map);
m_billcpu->set_addrmap(AS_IO, &sega_billboard_device::io_map);
m_billcpu->set_periodic_int(FUNC(sega_billboard_device::irq0_line_hold), attotime::from_hz(32_MHz_XTAL/65536)); // timing?
diff --git a/src/mame/machine/segacrp2_device.cpp b/src/mame/machine/segacrp2_device.cpp
index 09573756add..8fd7b4f5729 100644
--- a/src/mame/machine/segacrp2_device.cpp
+++ b/src/mame/machine/segacrp2_device.cpp
@@ -142,7 +142,7 @@ void nec_315_5136_device::decrypt()
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
0x03,0x03,0x03,0x03,0x03,0x03,0x04,0x04
};
-
+
decode(memregion(tag())->base(), m_decrypted, xor_table, swap_table);
}
diff --git a/src/mame/machine/snes.cpp b/src/mame/machine/snes.cpp
index 0e232318516..419cb007816 100644
--- a/src/mame/machine/snes.cpp
+++ b/src/mame/machine/snes.cpp
@@ -69,7 +69,7 @@ void snes_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
snes_hblank_tick(ptr, param);
break;
default:
- assert_always(false, "Unknown id in snes_state::device_timer");
+ throw emu_fatalerror("Unknown id in snes_state::device_timer");
}
}
@@ -230,14 +230,12 @@ TIMER_CALLBACK_MEMBER(snes_state::snes_hblank_tick)
/* draw a scanline */
if (m_ppu->current_vert() <= m_ppu->last_visible_line())
{
- if (m_screen->vpos() > 0)
- {
- /* Do HDMA */
- if (SNES_CPU_REG(HDMAEN))
- hdma(cpu0space);
+ /* Do HDMA */
+ if (SNES_CPU_REG(HDMAEN))
+ hdma(cpu0space);
- m_screen->update_partial((m_ppu->interlace() == 2) ? (m_ppu->current_vert() * m_ppu->interlace()) : m_ppu->current_vert() - 1);
- }
+ if (m_screen->vpos() > 0)
+ m_screen->update_partial((m_ppu->interlace() == 2) ? (m_ppu->current_vert() * m_ppu->interlace()) : m_ppu->current_vert());
}
// signal hblank
diff --git a/src/mame/machine/sorcerer.cpp b/src/mame/machine/sorcerer.cpp
index 7752f4eba09..65cbdf6e1d7 100644
--- a/src/mame/machine/sorcerer.cpp
+++ b/src/mame/machine/sorcerer.cpp
@@ -42,7 +42,7 @@ void sorcerer_state::device_timer(emu_timer &timer, device_timer_id id, int para
sorcerer_reset(ptr, param);
break;
default:
- assert_always(false, "Unknown id in sorcerer_state::device_timer");
+ throw emu_fatalerror("Unknown id in sorcerer_state::device_timer");
}
}
diff --git a/src/mame/machine/special.cpp b/src/mame/machine/special.cpp
index 92511b9d6a2..bd971917260 100644
--- a/src/mame/machine/special.cpp
+++ b/src/mame/machine/special.cpp
@@ -119,14 +119,12 @@ void special_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_bank1->set_entry(0);
break;
case TIMER_PIT8253_GATES:
- {
m_pit->write_gate0(0);
m_pit->write_gate1(0);
m_pit->write_gate2(0);
break;
- }
default:
- assert_always(false, "Unknown id in special_state::device_timer");
+ throw emu_fatalerror("Unknown id in special_state::device_timer");
}
}
diff --git a/src/mame/machine/stfight.cpp b/src/mame/machine/stfight.cpp
index 18968dcd63e..2b6afd21814 100644
--- a/src/mame/machine/stfight.cpp
+++ b/src/mame/machine/stfight.cpp
@@ -125,7 +125,7 @@ void stfight_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80
break;
default:
- assert_always(false, "Unknown id in stfight_state::device_timer");
+ throw emu_fatalerror("Unknown id in stfight_state::device_timer");
}
}
diff --git a/src/mame/machine/ut88.cpp b/src/mame/machine/ut88.cpp
index 712a2683e57..0f7b2c09d14 100644
--- a/src/mame/machine/ut88.cpp
+++ b/src/mame/machine/ut88.cpp
@@ -48,7 +48,7 @@ void ut88_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
timer_set(attotime::from_hz(60), TIMER_UPDATE_DISPLAY);
break;
default:
- assert_always(false, "Unknown id in ut88_state::device_timer");
+ throw emu_fatalerror("Unknown id in ut88_state::device_timer");
}
}
diff --git a/src/mame/machine/vino.cpp b/src/mame/machine/vino.cpp
index 5f1044b2d39..5e7280bb881 100644
--- a/src/mame/machine/vino.cpp
+++ b/src/mame/machine/vino.cpp
@@ -14,9 +14,18 @@
#define LOG_UNKNOWN (1 << 0)
#define LOG_READS (1 << 1)
#define LOG_WRITES (1 << 2)
-#define LOG_DEFAULT (LOG_READS | LOG_WRITES | LOG_UNKNOWN)
+#define LOG_DESCS (1 << 3)
+#define LOG_DMA (1 << 4)
+#define LOG_DMA_DATA (1 << 5)
+#define LOG_FIFO (1 << 6)
+#define LOG_FIELDS (1 << 7)
+#define LOG_COORDS (1 << 8)
+#define LOG_INPUTS (1 << 9)
+#define LOG_INTERRUPTS (1 << 10)
+#define LOG_INDICES (1 << 11)
+#define LOG_DEFAULT (LOG_WRITES | LOG_FIELDS | LOG_DMA | LOG_DESCS | LOG_READS | LOG_INTERRUPTS | LOG_INDICES | LOG_COORDS)
-#define VERBOSE (LOG_DEFAULT)
+#define VERBOSE (0)
#include "logmacro.h"
DEFINE_DEVICE_TYPE(VINO, vino_device, "vino", "SGI VINO Controller")
@@ -26,6 +35,11 @@ vino_device::vino_device(const machine_config &mconfig, const char *tag, device_
, m_i2c_data_out(*this)
, m_i2c_data_in(*this)
, m_i2c_stop(*this)
+ , m_interrupt_cb(*this)
+ , m_picture(*this, "srcimg")
+ , m_avivideo(*this, "srcavi")
+ , m_space(*this, finder_base::DUMMY_TAG, -1)
+ , m_input_bitmap(nullptr)
{
}
@@ -35,6 +49,9 @@ vino_device::vino_device(const machine_config &mconfig, const char *tag, device_
void vino_device::device_start()
{
+ m_channels[0].m_fetch_timer = timer_alloc(TIMER_FETCH_CHA);
+ m_channels[1].m_fetch_timer = timer_alloc(TIMER_FETCH_CHB);
+
save_item(NAME(m_rev_id));
save_item(NAME(m_control));
save_item(NAME(m_int_status));
@@ -60,11 +77,27 @@ void vino_device::device_start()
save_item(NAME(m_channels[i].m_fifo_threshold), i);
save_item(NAME(m_channels[i].m_fifo_gio_ptr), i);
save_item(NAME(m_channels[i].m_fifo_video_ptr), i);
+ save_item(NAME(m_channels[i].m_fifo), i);
+ save_item(NAME(m_channels[i].m_active_alpha), i);
+ save_item(NAME(m_channels[i].m_curr_line), i);
+ save_item(NAME(m_channels[i].m_frame_mask_shift), i);
+ save_item(NAME(m_channels[i].m_frame_mask_shifter), i);
+ save_item(NAME(m_channels[i].m_pixel_size), i);
+ save_item(NAME(m_channels[i].m_next_fifo_word), i);
+ save_item(NAME(m_channels[i].m_word_pixel_counter), i);
+ save_item(NAME(m_channels[i].m_pixels_per_even_field), i);
+ save_item(NAME(m_channels[i].m_pixels_per_odd_field), i);
+ save_item(NAME(m_channels[i].m_field_pixels_remaining[0]), i);
+ save_item(NAME(m_channels[i].m_field_pixels_remaining[1]), i);
+ save_item(NAME(m_channels[i].m_end_of_field), i);
+
+ m_channels[i].m_fetch_timer->adjust(attotime::never);
}
m_i2c_data_out.resolve_safe();
m_i2c_data_in.resolve_safe(0x00);
m_i2c_stop.resolve_safe();
+ m_interrupt_cb.resolve_safe();
}
void vino_device::device_reset()
@@ -72,22 +105,53 @@ void vino_device::device_reset()
m_rev_id = 0xb0;
m_control = 0;
m_int_status = 0;
+ m_i2c_ctrl = 0;
+ m_i2c_data = 0;
for (uint32_t i = CHAN_A; i < CHAN_COUNT; i++)
{
+ m_channels[i].m_alpha = 0;
+ m_channels[i].m_clip_start = 0;
+ m_channels[i].m_clip_end = 0;
+ m_channels[i].m_frame_rate = 0;
m_channels[i].m_field_counter = 0;
m_channels[i].m_line_size = 0;
m_channels[i].m_line_counter = 0;
m_channels[i].m_page_index = 0;
m_channels[i].m_next_desc_ptr = 0;
m_channels[i].m_start_desc_ptr = 0;
+ m_channels[i].m_fifo_threshold = 0;
+ m_channels[i].m_fifo_gio_ptr = 0;
+ m_channels[i].m_fifo_video_ptr = 0;
+ m_channels[i].m_active_alpha = 0;
+ m_channels[i].m_curr_line = 0;
+ m_channels[i].m_frame_mask_shift = 0;
+ m_channels[i].m_frame_mask_shifter = 0;
+ m_channels[i].m_pixel_size = 0;
+ m_channels[i].m_next_fifo_word = 0;
+ m_channels[i].m_word_pixel_counter = 0;
+
for (uint32_t j = 0; j < 4; j++)
{
- m_channels[i].m_descriptors[j] = DESC_VALID_BIT;
+ m_channels[i].m_descriptors[j] = 0ULL;
}
+
+ m_channels[i].m_fetch_timer->adjust(attotime::never);
}
}
+void vino_device::device_add_mconfig(machine_config &config)
+{
+ IMAGE_PICTURE(config, m_picture);
+ IMAGE_AVIVIDEO(config, m_avivideo);
+}
+
+void vino_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (id == TIMER_FETCH_CHA || id == TIMER_FETCH_CHB)
+ fetch_pixel((int)id);
+}
+
READ32_MEMBER(vino_device::read)
{
switch (offset & ~1)
@@ -242,18 +306,18 @@ WRITE32_MEMBER(vino_device::write)
break;
case 0x0008/4: // Control
LOGMASKED(LOG_WRITES, "%s: Control write: %08x & %08x\n", machine().describe_context(), data, mem_mask);
- m_control = data & CTRL_MASK;
+ control_w(data & CTRL_MASK);
break;
case 0x0010/4: // Interrupt Status
LOGMASKED(LOG_WRITES, "%s: Interrupt Status write: %08x & %08x\n", machine().describe_context(), data, mem_mask);
- for (uint32_t i = 0; i < 6; i++)
+ for (uint32_t bit = 0; bit < 6; bit++)
{
- if (!BIT(data, i))
+ if (!BIT(data, bit))
{
- m_int_status &= ~(1 << i);
+ m_int_status &= ~(1 << bit);
}
}
- // TODO: Handle interrupt all-clear
+ interrupts_w(m_int_status);
break;
case 0x0018/4: // I2C Control
LOGMASKED(LOG_WRITES, "%s: I2C Control write: %08x & %08x\n", machine().describe_context(), data, mem_mask);
@@ -292,7 +356,7 @@ WRITE32_MEMBER(vino_device::write)
{
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Frame Rate write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
- m_channels[channel].m_frame_rate = data & FRAME_RATE_REG_MASK;
+ frame_rate_w(channel, data);
break;
}
case 0x0048/4: // ChA Field Counter
@@ -323,7 +387,7 @@ WRITE32_MEMBER(vino_device::write)
{
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Page Index write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
- m_channels[channel].m_page_index = data & PAGE_INDEX_MASK;
+ page_index_w(channel, data & PAGE_INDEX_MASK);
break;
}
case 0x0068/4: // ChA Pointer to Next Four Descriptors
@@ -331,7 +395,7 @@ WRITE32_MEMBER(vino_device::write)
{
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Pointer to Next Four Descriptors write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
- m_channels[channel].m_next_desc_ptr = data & DESC_PTR_MASK;
+ next_desc_w(channel, data & DESC_PTR_MASK);
break;
}
case 0x0070/4: // ChA Pointer to Start of Descriptor Table
@@ -348,7 +412,7 @@ WRITE32_MEMBER(vino_device::write)
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Descriptor 0 Data write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
m_channels[channel].m_descriptors[0] = (data & DESC_PTR_MASK);
- m_channels[channel].m_descriptors[0] |= DESC_VALID_BIT; // TODO: Unsure if this is right
+ m_channels[channel].m_descriptors[0] |= DESC_VALID_BIT;
break;
}
case 0x0080/4: // ChA Descriptor 1
@@ -357,7 +421,7 @@ WRITE32_MEMBER(vino_device::write)
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Descriptor 1 Data write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
m_channels[channel].m_descriptors[1] = (data & DESC_PTR_MASK);
- m_channels[channel].m_descriptors[1] |= DESC_VALID_BIT; // TODO: Unsure if this is right
+ m_channels[channel].m_descriptors[1] |= DESC_VALID_BIT;
break;
}
case 0x0088/4: // ChA Descriptor 2
@@ -366,7 +430,7 @@ WRITE32_MEMBER(vino_device::write)
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Descriptor 2 Data write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
m_channels[channel].m_descriptors[2] = (data & DESC_PTR_MASK);
- m_channels[channel].m_descriptors[2] |= DESC_VALID_BIT; // TODO: Unsure if this is right
+ m_channels[channel].m_descriptors[2] |= DESC_VALID_BIT;
break;
}
case 0x0090/4: // ChA Descriptor 3
@@ -375,7 +439,7 @@ WRITE32_MEMBER(vino_device::write)
const uint32_t channel = (offset < 0x00b0/4) ? 0 : 1;
LOGMASKED(LOG_WRITES, "%s: Ch%c Descriptor 3 Data write: %08x & %08x\n", machine().describe_context(), channel ? 'B' : 'A', data, mem_mask);
m_channels[channel].m_descriptors[3] = (data & DESC_PTR_MASK);
- m_channels[channel].m_descriptors[3] |= DESC_VALID_BIT; // TODO: Unsure if this is right
+ m_channels[channel].m_descriptors[3] |= DESC_VALID_BIT;
break;
}
case 0x0098/4: // ChA FIFO Threshold
@@ -405,3 +469,576 @@ WRITE32_MEMBER(vino_device::write)
break;
}
}
+
+bool vino_device::is_even_field(int channel)
+{
+ return BIT(m_channels[channel].m_field_counter, 0);
+}
+
+bool vino_device::is_interleaved(int channel)
+{
+ static const uint32_t s_masks[2] = { CTRL_CHA_INTERLEAVE_EN, CTRL_CHB_INTERLEAVE_EN };
+ return (m_control & s_masks[channel]) != 0;
+}
+
+void vino_device::end_of_field(int channel)
+{
+ LOGMASKED(LOG_FIELDS, "End of field for channel %c\n", channel ? 'B' : 'A');
+
+ channel_t &chan = m_channels[channel];
+ if (BIT(chan.m_frame_mask_shifter, 0))
+ {
+ do_dma_transfer(channel);
+
+ if (!is_interleaved(channel))
+ {
+ page_index_w(channel, 0);
+ }
+ else if (is_even_field(channel))
+ {
+ LOGMASKED(LOG_FIELDS, "Even field ended, setting page index to %08x\n", chan.m_line_size + 8);
+ line_count_w(channel, 0);
+ page_index_w(channel, chan.m_line_size + 8);
+ next_desc_w(channel, chan.m_start_desc_ptr);
+ }
+ else // odd field
+ {
+ LOGMASKED(LOG_FIELDS, "Odd field ended, setting page index to %08x\n", 0);
+ line_count_w(channel, 0);
+ page_index_w(channel, 0);
+ chan.m_start_desc_ptr = chan.m_next_desc_ptr;
+ }
+
+ static const uint32_t s_eof_masks[2] = { ISR_CHA_EOF, ISR_CHB_EOF };
+ interrupts_w(m_int_status | s_eof_masks[channel]);
+ }
+
+ chan.m_field_pixels_remaining[0] = chan.m_pixels_per_odd_field;
+ chan.m_field_pixels_remaining[1] = chan.m_pixels_per_even_field;
+ chan.m_field_x = 0;
+ chan.m_field_y = 0;
+
+ chan.m_field_counter++;
+
+ chan.m_frame_mask_shifter >>= 1;
+ chan.m_frame_mask_shift--;
+ if (chan.m_frame_mask_shift == 0)
+ load_frame_mask_shifter(channel);
+
+ chan.m_active_alpha = chan.m_alpha;
+}
+
+void vino_device::do_dma_transfer(int channel)
+{
+ channel_t &chan = m_channels[channel];
+ LOGMASKED(LOG_DMA, "Transferring %08x words via DMA\n", chan.m_fifo_video_ptr - chan.m_fifo_gio_ptr);
+ while (chan.m_fifo_gio_ptr != chan.m_fifo_video_ptr && !(chan.m_descriptors[0] & DESC_STOP_BIT))
+ {
+ const uint32_t address = (chan.m_descriptors[0] & 0x3ffff000) | (chan.m_page_index & 0x00000ff8);
+ const uint64_t word = chan.m_fifo[chan.m_fifo_gio_ptr >> 3];
+ LOGMASKED(LOG_DMA_DATA, "Writing %08x%08x to %08x\n", (uint32_t)(word >> 32), (uint32_t)word, address);
+ m_space->write_qword(address, word);
+ page_index_w(channel, chan.m_page_index + 8);
+ if (is_interleaved(channel))
+ {
+ line_count_w(channel, chan.m_line_counter + 8);
+ }
+ chan.m_fifo_gio_ptr += 8;
+ }
+ chan.m_fifo_gio_ptr = 0;
+ chan.m_fifo_video_ptr = 0;
+}
+
+void vino_device::push_fifo(int channel)
+{
+ channel_t &chan = m_channels[channel];
+ LOGMASKED(LOG_FIFO, "Pushing %08x%08x onto FIFO, new ptr %08x, remaining (%d/%d)\n",
+ (uint32_t)(chan.m_next_fifo_word >> 32),
+ (uint32_t)chan.m_next_fifo_word,
+ chan.m_fifo_video_ptr + 8,
+ chan.m_field_pixels_remaining[0],
+ chan.m_field_pixels_remaining[1]);
+ if (chan.m_fifo_video_ptr < 0x400)
+ {
+ chan.m_fifo[chan.m_fifo_video_ptr >> 3] = chan.m_next_fifo_word;
+ chan.m_fifo_video_ptr += 8;
+ if (chan.m_fifo_video_ptr >= chan.m_fifo_threshold)
+ {
+ do_dma_transfer(channel);
+ }
+ }
+ chan.m_next_fifo_word = 0;
+ chan.m_word_pixel_counter = 0;
+}
+
+void vino_device::argb_to_yuv(uint32_t argb, int32_t &y, int32_t &u, int32_t &v)
+{
+ const int32_t r = (argb >> 16) & 0xff;
+ const int32_t g = (argb >> 8) & 0xff;
+ const int32_t b = (argb >> 0) & 0xff;
+ y = (int32_t)(0.299f * r + 0.587f * g + 0.114f * b);
+ u = (int32_t)(0.492f * (b - y));
+ v = (int32_t)(0.877f * (r - y));
+}
+
+uint32_t vino_device::yuv_to_abgr(int channel, int32_t y, int32_t u, int32_t v)
+{
+ int32_t r = y + 1.14f * v;
+ int32_t g = y - 0.395f * u - 0.581f * v;
+ int32_t b = y + 2.032f * u;
+ r = (r > 255) ? 255 : (r < 0 ? 0 : r);
+ g = (g > 255) ? 255 : (g < 0 ? 0 : g);
+ b = (b > 255) ? 255 : (b < 0 ? 0 : b);
+ LOGMASKED(LOG_INPUTS, "%d,%d,%d in yuv is %08x in rgb\n", y, u, v, (b << 16) | (g << 8) | r);
+ return (m_channels[channel].m_alpha << 24) | (b << 16) | (g << 8) | r;
+}
+
+bool vino_device::merge_pixel(int channel, int32_t y, int32_t u, int32_t v, pixel_format_t format)
+{
+ channel_t &chan = m_channels[channel];
+ switch (format)
+ {
+ case FORMAT_RGBA32:
+ {
+ const uint32_t shift = 32 - (chan.m_word_pixel_counter << 5);
+ chan.m_next_fifo_word &= ~(0xffffffffULL << shift);
+ chan.m_next_fifo_word |= (uint64_t)yuv_to_abgr(channel, y, u, v) << shift;
+ chan.m_word_pixel_counter++;
+ count_pixel(channel);
+ return (chan.m_word_pixel_counter == 2);
+ }
+ case FORMAT_YUV422:
+ {
+ const uint8_t uy = (uint8_t)y;
+ const uint8_t uu = (uint8_t)u;
+ const uint8_t uv = (uint8_t)v;
+ const uint32_t y_shift = (3 - chan.m_word_pixel_counter) * 16;
+ const uint64_t y_mask = 0xffULL << y_shift;
+ chan.m_next_fifo_word &= ~y_mask;
+ chan.m_next_fifo_word |= (uy << y_shift);
+ if (!(chan.m_word_pixel_counter & 1))
+ {
+ chan.m_next_fifo_word &= 0xffffff << (y_shift - 8);
+ chan.m_next_fifo_word |= (uu << (y_shift + 8));
+ chan.m_next_fifo_word |= (uv << (y_shift - 8));
+ }
+ chan.m_word_pixel_counter++;
+ count_pixel(channel);
+ return (chan.m_word_pixel_counter == 4);
+ }
+ case FORMAT_RGBA8:
+ {
+ const uint32_t abgr = yuv_to_abgr(channel, y, u, v);
+ const uint8_t b = (abgr >> 16) & 0xc0;
+ const uint8_t g = ((abgr >> 8) & 0xe0) >> 2;
+ const uint8_t r = ((abgr >> 0) & 0xe0) >> 5;
+ const uint8_t bgr = b | g | r;
+ const uint32_t shift = 56 - (chan.m_word_pixel_counter << 3);
+ chan.m_next_fifo_word &= ~(0xffULL << shift);
+ chan.m_next_fifo_word |= (uint64_t)bgr << shift;
+ chan.m_word_pixel_counter++;
+ count_pixel(channel);
+ return (chan.m_word_pixel_counter == 8);
+ }
+ case FORMAT_Y8:
+ {
+ const uint8_t y8 = (uint8_t)y;
+ const uint32_t shift = 56 - (chan.m_word_pixel_counter << 3);
+ chan.m_next_fifo_word &= ~(0xffULL << shift);
+ chan.m_next_fifo_word |= (uint64_t)y8 << shift;
+ chan.m_word_pixel_counter++;
+ count_pixel(channel);
+ return (chan.m_word_pixel_counter == 8);
+ }
+ }
+ return false;
+}
+
+void vino_device::count_pixel(int channel)
+{
+ channel_t &chan = m_channels[channel];
+
+ const uint32_t even_or_odd = BIT(chan.m_field_counter, 0);
+
+ int32_t pixels_consumed = chan.m_decimation;
+ chan.m_field_x += chan.m_decimation;
+ if (chan.m_field_x >= chan.m_field_width)
+ {
+ chan.m_field_x = 0;
+ chan.m_field_y++;
+ if (is_interleaved(channel))
+ {
+ //pixels_consumed += chan.m_field_width * chan.m_decimation;
+ }
+ }
+
+ chan.m_field_pixels_remaining[even_or_odd] -= pixels_consumed;
+ if (chan.m_field_pixels_remaining[even_or_odd] == 0)
+ {
+ chan.m_field_x = 0;
+ chan.m_field_y = 0;
+ chan.m_end_of_field = true;
+ }
+}
+
+vino_device::pixel_format_t vino_device::get_current_format(int channel)
+{
+ static const uint32_t rgb_masks[2] = { CTRL_CHA_COLOR_SPACE_RGB, CTRL_CHB_COLOR_SPACE_RGB };
+ static const uint32_t luma_masks[2] = { CTRL_CHA_LUMA_ONLY, CTRL_CHB_LUMA_ONLY };
+ static const uint32_t dither_masks[2] = { CTRL_CHA_DITHER_EN, CTRL_CHB_DITHER_EN };
+
+ const bool rgb_mode = (m_control & rgb_masks[channel]) != 0;
+ const bool luma_mode = (m_control & luma_masks[channel]) != 0;
+ const bool dither_mode = (m_control & dither_masks[channel]) != 0;
+
+ if (rgb_mode)
+ return dither_mode ? FORMAT_RGBA8 : FORMAT_RGBA32;
+ else
+ return luma_mode ? FORMAT_Y8 : FORMAT_YUV422;
+}
+
+void vino_device::process_pixel(int channel, int32_t y, int32_t u, int32_t v)
+{
+ if (merge_pixel(channel, y, u, v, get_current_format(channel)))
+ {
+ push_fifo(channel);
+ }
+ if (m_channels[channel].m_end_of_field)
+ {
+ end_of_field(channel);
+ m_channels[channel].m_end_of_field = false;
+ }
+}
+
+uint32_t vino_device::linear_rgb(uint32_t a, uint32_t b, float f)
+{
+ const int32_t ra = (a >> 16) & 0xff;
+ const int32_t ga = (a >> 8) & 0xff;
+ const int32_t ba = (a >> 0) & 0xff;
+ const int32_t rb = (b >> 16) & 0xff;
+ const int32_t gb = (b >> 8) & 0xff;
+ const int32_t bb = (b >> 0) & 0xff;
+ const float inv_f = 1.0f - f;
+ int32_t rc = (int32_t)(ra * inv_f + rb * f);
+ int32_t gc = (int32_t)(ga * inv_f + gb * f);
+ int32_t bc = (int32_t)(ba * inv_f + bb * f);
+ rc = (rc > 255 ? 255 : (rc < 0 ? 0 : rc));
+ gc = (gc > 255 ? 255 : (gc < 0 ? 0 : gc));
+ bc = (bc > 255 ? 255 : (bc < 0 ? 0 : bc));
+ return (rc << 16) | (gc << 8) | bc;
+}
+
+uint32_t vino_device::bilinear_pixel(float s, float t)
+{
+ if (m_input_bitmap == nullptr)
+ return 0xff000000;
+
+ uint32_t width = m_input_bitmap->width();
+ uint32_t height = m_input_bitmap->height();
+
+ if (width == 0 || height == 0)
+ return 0xff000000;
+
+ width--;
+ height--;
+
+ int32_t s0 = (int32_t)floorf(s * width);
+ int32_t s1 = (int32_t)floorf(s * width + 1);
+ int32_t t0 = (int32_t)floorf(t * height);
+ int32_t t1 = (int32_t)floorf(t * height + 1);
+
+ s0 = (s0 < 0 ? 0 : (s0 > width ? width : s0));
+ s1 = (s1 < 0 ? 0 : (s1 > width ? width : s1));
+ t0 = (t0 < 0 ? 0 : (t0 > height ? height : t0));
+ t1 = (t1 < 0 ? 0 : (t1 > height ? height : t1));
+
+ LOGMASKED(LOG_COORDS, "lerping from %d,%d to %d,%d\n", s0, t0, s1, t1);
+ const uint32_t p00 = m_input_bitmap->pix(t0, s0);
+ const uint32_t p01 = m_input_bitmap->pix(t0, s1);
+ const uint32_t p10 = m_input_bitmap->pix(t1, s0);
+ const uint32_t p11 = m_input_bitmap->pix(t1, s1);
+
+ LOGMASKED(LOG_INPUTS, "%08x, %08x, %08x, %08x\n", p00, p01, p10, p11);
+
+ float ip = 0.0f;
+ const float sf = modff(s, &ip);
+ const float tf = modff(t, &ip);
+ const uint32_t top = linear_rgb(p00, p01, sf);
+ const uint32_t bot = linear_rgb(p10, p11, sf);
+ LOGMASKED(LOG_INPUTS, "%08x, %08x\n", top, bot);
+ const uint32_t mixed = linear_rgb(top, bot, tf);
+ LOGMASKED(LOG_INPUTS, "%08x\n", mixed);
+ return 0xff000000 | mixed;
+}
+
+void vino_device::input_pixel(int channel, int32_t &y, int32_t &u, int32_t &v)
+{
+ m_input_bitmap = &m_avivideo->get_frame();
+ if (m_input_bitmap)
+ {
+ channel_t &chan = m_channels[channel];
+ if (is_interleaved(channel))
+ {
+ const uint32_t even_or_odd = BIT(chan.m_field_counter, 0);
+ const uint32_t even_or_odd_offset = (even_or_odd ? 0 : 1);
+ float s = (float)chan.m_field_x / chan.m_field_width;
+ float t = (float)chan.m_field_y / chan.m_field_height[even_or_odd];
+ LOGMASKED(LOG_COORDS, "%d, %d coords: %f, %f\n", chan.m_field_x, chan.m_field_y * 2 + even_or_odd_offset, s, t);
+ const uint32_t argb = bilinear_pixel(s, t);
+ argb_to_yuv(argb, y, u, v);
+ LOGMASKED(LOG_INPUTS, "%08x in yuv is %d,%d,%d\n", argb, y, u, v);
+ }
+ else
+ {
+ float s = (float)chan.m_field_x / chan.m_field_width;
+ float t = (float)chan.m_field_y / chan.m_field_height[0];
+ LOGMASKED(LOG_COORDS, "%d, %d coords: %f, %f\n", chan.m_field_x, chan.m_field_y, s, t);
+ const uint32_t argb = bilinear_pixel(s, t);
+ argb_to_yuv(argb, y, u, v);
+ LOGMASKED(LOG_INPUTS, "%08x in yuv is %d,%d,%d\n", argb, y, u, v);
+ }
+ }
+}
+
+void vino_device::fetch_pixel(int channel)
+{
+ channel_t &chan = m_channels[channel];
+ if (chan.m_decimation > 1 && (chan.m_field_x % chan.m_decimation) != 0)
+ {
+ count_pixel(channel);
+ return;
+ }
+ if (BIT(chan.m_frame_mask_shifter, 0))
+ {
+ int32_t y = 0, u = 0, v = 0;
+ input_pixel(channel, y, u, v);
+ process_pixel(channel, y, u, v);
+ }
+ else
+ {
+ count_pixel(channel);
+ if (chan.m_end_of_field)
+ {
+ end_of_field(channel);
+ chan.m_end_of_field = false;
+ }
+ }
+}
+
+attotime vino_device::calculate_field_rate(int channel)
+{
+ channel_t &chan = m_channels[channel];
+ const uint32_t fields_per_second = (BIT(chan.m_frame_rate, 0) == FRAME_RATE_PAL) ? 50 : 60;
+ return attotime::from_hz(fields_per_second);
+}
+
+attotime vino_device::calculate_fetch_rate(int channel)
+{
+ channel_t &chan = m_channels[channel];
+ const uint32_t frames_per_second = (BIT(chan.m_frame_rate, 0) == FRAME_RATE_PAL) ? 25 : 30;
+
+ const uint32_t x_end = chan.m_clip_end & CLIP_X_MASK;
+ const uint32_t y_end_even = (chan.m_clip_end >> CLIP_YEVEN_SHIFT) & CLIP_YEVEN_MASK;
+ const uint32_t y_end_odd = (chan.m_clip_end >> CLIP_YODD_SHIFT) & CLIP_YODD_MASK;
+
+ const uint32_t x_start = chan.m_clip_start & CLIP_X_MASK;
+ const uint32_t y_start_even = (chan.m_clip_start >> CLIP_YEVEN_SHIFT) & CLIP_YEVEN_MASK;
+ const uint32_t y_start_odd = (chan.m_clip_start >> CLIP_YODD_SHIFT) & CLIP_YODD_MASK;
+
+ const uint32_t width = (x_end - x_start) + 1;
+ const uint32_t height_even = (y_end_even - y_start_even) + 1;
+ const uint32_t height_odd = (y_end_odd - y_start_odd) + 1;
+
+ const uint32_t field_size_even = (height_even * width) / chan.m_decimation;
+ const uint32_t field_size_odd = (height_odd * width) / chan.m_decimation;
+
+ const uint32_t frame_size = field_size_even + field_size_odd;
+
+ LOGMASKED(LOG_DMA, "Frames per second: %d\n", frames_per_second);
+ LOGMASKED(LOG_DMA, "Frame width: %d - %d = %d\n", x_end, x_start, width);
+ LOGMASKED(LOG_DMA, "Even field height: %d - %d = %d\n", y_end_even, y_start_even, height_even);
+ LOGMASKED(LOG_DMA, "Odd field height: %d - %d = %d\n", y_end_odd, y_start_odd, height_odd);
+ LOGMASKED(LOG_DMA, "Even field pixels: %d\n", field_size_even);
+ LOGMASKED(LOG_DMA, "Odd field pixels: %d\n", field_size_odd);
+ chan.m_pixels_per_even_field = (int32_t)field_size_even;
+ chan.m_pixels_per_odd_field = (int32_t)field_size_odd;
+ chan.m_field_height[1] = height_even / chan.m_decimation;
+ chan.m_field_height[0] = height_odd / chan.m_decimation;
+ chan.m_field_width = width;
+ chan.m_field_x = 0;
+ chan.m_field_y = 0;
+ return attotime::from_hz(frames_per_second * frame_size);
+}
+
+bool vino_device::page_index_w(int channel, uint32_t data)
+{
+ channel_t &chan = m_channels[channel];
+ const uint32_t old = chan.m_page_index;
+ chan.m_page_index = data;
+ LOGMASKED(LOG_INDICES, "Page Index write: %08x\n", data);
+ while (chan.m_page_index >= 0x1000)
+ {
+ chan.m_page_index -= 0x1000;
+ }
+ if (chan.m_page_index < old)
+ {
+ shift_dma_descriptors(channel);
+ return true;
+ }
+ return false;
+}
+
+void vino_device::interrupts_w(uint32_t new_int)
+{
+ const uint32_t old = m_int_status;
+ m_int_status = (new_int & (m_control >> 1)) & ISR_MASK;
+ const uint32_t raised_ints = (~old & m_int_status);
+ if (raised_ints != 0)
+ {
+ LOGMASKED(LOG_INTERRUPTS, "Interrupt status %08x, raising interrupt\n", m_int_status);
+ m_interrupt_cb(1);
+ }
+ else if (m_int_status == 0)
+ {
+ LOGMASKED(LOG_INTERRUPTS, "All interrupts clear, lowering interrupt\n");
+ m_interrupt_cb(0);
+ }
+}
+
+void vino_device::shift_dma_descriptors(int channel)
+{
+ const uint32_t even_or_odd = BIT(m_channels[channel].m_field_counter, 0);
+ LOGMASKED(LOG_DESCS, "Shifting descriptors, remaining pixels %d\n", m_channels[channel].m_field_pixels_remaining[even_or_odd]);
+ channel_t &chan = m_channels[channel];
+ for (int i = 0; i < 3; i++)
+ {
+ chan.m_descriptors[i] = chan.m_descriptors[i + 1];
+ }
+ if (!(chan.m_descriptors[0] & DESC_VALID_BIT))
+ {
+ LOGMASKED(LOG_DESCS, "Shifted in a descriptor without a valid bit; loading a new set\n");
+ load_dma_descriptors(channel, chan.m_next_desc_ptr);
+ chan.m_next_desc_ptr += 16;
+ }
+ else if (chan.m_descriptors[0] & DESC_JUMP_BIT)
+ {
+ LOGMASKED(LOG_DESCS, "Shifted in a descriptor with a jump bit; loading a new set from %08x\n", chan.m_descriptors[0] & 0x3fffffff);
+ load_dma_descriptors(channel, chan.m_descriptors[0] & 0x3fffffff);
+ }
+}
+
+void vino_device::load_dma_descriptors(int channel, uint32_t addr)
+{
+ channel_t &chan = m_channels[channel];
+ for (int i = 0; i < 4; i++)
+ {
+ chan.m_descriptors[i] = (uint64_t)m_space->read_dword(addr + (i << 2)) | DESC_VALID_BIT;
+ LOGMASKED(LOG_DESCS, "Descriptor %d: %08x\n", i, (uint32_t)chan.m_descriptors[i]);
+ }
+
+ if (chan.m_descriptors[0] & DESC_STOP_BIT)
+ {
+ LOGMASKED(LOG_DESCS, "Shifted in a descriptor with a stop bit; stopping DMA and flagging an interrupt\n");
+ static const uint32_t s_stop_masks[2] = { ISR_CHA_DESC, ISR_CHB_DESC };
+ interrupts_w(m_int_status | s_stop_masks[channel]);
+
+ static const uint32_t s_dma_mask[2] = { CTRL_CHA_DMA_EN, CTRL_CHB_DMA_EN };
+ m_control &= ~s_dma_mask[channel];
+ chan.m_fetch_timer->adjust(attotime::never);
+ }
+}
+
+void vino_device::invalidate_dma_descriptors(int channel)
+{
+ LOGMASKED(LOG_DESCS, "Invalidating descriptors\n");
+ for (int i = 0; i < 4; i++)
+ m_channels[channel].m_descriptors[i] &= ~DESC_VALID_BIT;
+}
+
+void vino_device::next_desc_w(int channel, uint32_t data)
+{
+ m_channels[channel].m_next_desc_ptr = data;
+ invalidate_dma_descriptors(channel);
+ load_dma_descriptors(channel, m_channels[channel].m_next_desc_ptr);
+}
+
+bool vino_device::line_count_w(int channel, uint32_t data)
+{
+ channel_t &chan = m_channels[channel];
+ chan.m_line_counter = data & LINE_COUNTER_MASK;
+ LOGMASKED(LOG_INDICES, "Line Counter write: %08x\n", data);
+ if (chan.m_line_counter == chan.m_line_size)
+ {
+ chan.m_line_counter = 0xff8;
+ return page_index_w(channel, chan.m_page_index + (chan.m_line_size + 8));
+ }
+ return false;
+}
+
+void vino_device::frame_rate_w(int channel, uint32_t data)
+{
+ m_channels[channel].m_frame_rate = data & FRAME_RATE_REG_MASK;
+ load_frame_mask_shifter(channel);
+}
+
+void vino_device::load_frame_mask_shifter(int channel)
+{
+ channel_t &chan = m_channels[channel];
+ chan.m_frame_mask_shift = (BIT(chan.m_frame_rate, 0) == FRAME_RATE_PAL) ? 10 : 12;
+ chan.m_frame_mask_shifter = chan.m_frame_rate >> 1;
+}
+
+void vino_device::control_w(uint32_t data)
+{
+ const uint32_t old = m_control;
+ m_control = data;
+
+ if (m_control & CTRL_CHA_DECIMATE_EN)
+ {
+ m_channels[0].m_decimation = ((m_control >> CTRL_CHA_DECIMATION_SHIFT) & CTRL_CHA_DECIMATION_MASK) + 1;
+ }
+ else
+ {
+ m_channels[0].m_decimation = 1;
+ }
+
+ if (m_control & CTRL_CHB_DECIMATE_EN)
+ {
+ m_channels[1].m_decimation = ((m_control >> CTRL_CHB_DECIMATION_SHIFT) & CTRL_CHB_DECIMATION_MASK) + 1;
+ }
+ else
+ {
+ m_channels[1].m_decimation = 1;
+ }
+
+ const uint32_t changed = old ^ m_control;
+ if (changed == 0)
+ return;
+
+ interrupts_w(m_int_status);
+
+ static const uint32_t s_dma_mask[2] = { CTRL_CHA_DMA_EN, CTRL_CHB_DMA_EN };
+ for (int channel = 0; channel < 2; channel++)
+ {
+ if (changed & s_dma_mask[channel])
+ {
+ if (data & s_dma_mask[channel])
+ {
+ channel_t &chan = m_channels[channel];
+ LOGMASKED(LOG_DMA, "Enabling DMA on channel %c\n", channel ? 'B' : 'A');
+ chan.m_field_counter = 0;
+ attotime fetch_rate = calculate_fetch_rate(channel);
+ chan.m_fetch_timer->adjust(fetch_rate, 0, fetch_rate);
+ chan.m_field_pixels_remaining[0] = chan.m_pixels_per_odd_field;
+ chan.m_field_pixels_remaining[1] = chan.m_pixels_per_even_field;
+ chan.m_field_x = 0;
+ chan.m_field_y = 0;
+ }
+ else
+ {
+ LOGMASKED(LOG_DMA, "Disabling DMA on channel %c\n", channel ? 'B' : 'A');
+ m_channels[channel].m_fetch_timer->adjust(attotime::never);
+ }
+ }
+ }
+}
diff --git a/src/mame/machine/vino.h b/src/mame/machine/vino.h
index 0c11247c2ab..2de5da5996c 100644
--- a/src/mame/machine/vino.h
+++ b/src/mame/machine/vino.h
@@ -13,6 +13,10 @@
#pragma once
+#include "bitmap.h"
+#include "imagedev/picture.h"
+#include "imagedev/avivideo.h"
+
class vino_device : public device_t
{
public:
@@ -24,13 +28,21 @@ public:
auto i2c_data_out() { return m_i2c_data_out.bind(); }
auto i2c_data_in() { return m_i2c_data_in.bind(); }
auto i2c_stop() { return m_i2c_stop.bind(); }
+ auto interrupt_cb() { return m_interrupt_cb.bind(); }
+
+ template <typename T> void set_gio64_space(T &&tag, int space) { m_space.set_tag(std::forward<T>(tag), space); }
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
+ static constexpr device_timer_id TIMER_FETCH_CHA = 0;
+ static constexpr device_timer_id TIMER_FETCH_CHB = 1;
+
enum channel_num_t : uint32_t
{
CHAN_A,
@@ -87,6 +99,7 @@ private:
ISR_CHB_EOF = (1 << 3),
ISR_CHB_FIFO = (1 << 4),
ISR_CHB_DESC = (1 << 5),
+ ISR_MASK = 0x3f,
ALPHA_MASK = 0xff,
@@ -132,11 +145,20 @@ private:
I2C_BUS_ERROR = (1 << 7),
I2C_CTRL_MASK = 0xb7,
- I2C_DATA_MASK = 0xff
+ I2C_DATA_MASK = 0xff,
+ };
+
+ enum pixel_format_t : uint8_t
+ {
+ FORMAT_RGBA32,
+ FORMAT_YUV422,
+ FORMAT_RGBA8,
+ FORMAT_Y8
};
struct channel_t
{
+ // Externally-visible state
uint32_t m_alpha;
uint32_t m_clip_start;
uint32_t m_clip_end;
@@ -151,8 +173,68 @@ private:
uint32_t m_fifo_threshold;
uint32_t m_fifo_gio_ptr;
uint32_t m_fifo_video_ptr;
+
+ // Internal state
+ uint64_t m_fifo[128];
+ uint32_t m_active_alpha;
+ uint32_t m_curr_line;
+ uint16_t m_frame_mask_shift;
+ uint16_t m_frame_mask_shifter;
+ uint32_t m_pixel_size;
+ uint64_t m_next_fifo_word;
+ uint32_t m_word_pixel_counter;
+ uint32_t m_decimation;
+
+ // Kludges for picture input
+ uint32_t m_field_width;
+ uint32_t m_field_height[2];
+ uint32_t m_field_x;
+ uint32_t m_field_y;
+
+ // Kludges in order to trigger end-of-field
+ int32_t m_pixels_per_even_field;
+ int32_t m_pixels_per_odd_field;
+ int32_t m_field_pixels_remaining[2];
+ bool m_end_of_field;
+
+ emu_timer *m_fetch_timer;
};
+ void do_dma_transfer(int channel);
+
+ //bool decimate(int channel);
+ bool is_interleaved(int channel);
+ bool is_even_field(int channel);
+ void end_of_field(int channel);
+
+ void push_fifo(int channel);
+
+ void count_pixel(int channel);
+ void argb_to_yuv(uint32_t argb, int32_t &y, int32_t &u, int32_t &v);
+ uint32_t yuv_to_abgr(int channel, int32_t y, int32_t u, int32_t v);
+ bool merge_pixel(int channel, int32_t y, int32_t u, int32_t v, pixel_format_t format);
+ pixel_format_t get_current_format(int channel);
+ void process_pixel(int channel, int32_t y, int32_t u, int32_t v);
+ uint32_t linear_rgb(uint32_t a, uint32_t b, float f);
+ uint32_t bilinear_pixel(float s, float t);
+ void input_pixel(int channel, int32_t &y, int32_t &u, int32_t &v);
+ void fetch_pixel(int channel);
+ attotime calculate_field_rate(int channel);
+ attotime calculate_fetch_rate(int channel);
+
+ void shift_dma_descriptors(int channel);
+ void load_dma_descriptors(int channel, uint32_t addr);
+ void invalidate_dma_descriptors(int channel);
+
+ void load_frame_mask_shifter(int channel);
+
+ bool line_count_w(int channel, uint32_t data);
+ void frame_rate_w(int channel, uint32_t data);
+ bool page_index_w(int channel, uint32_t data);
+ void next_desc_w(int channel, uint32_t data);
+ void control_w(uint32_t data);
+ void interrupts_w(uint32_t new_int);
+
uint32_t m_rev_id;
uint32_t m_control;
uint32_t m_int_status;
@@ -163,6 +245,13 @@ private:
devcb_write8 m_i2c_data_out;
devcb_read8 m_i2c_data_in;
devcb_write_line m_i2c_stop;
+ devcb_write_line m_interrupt_cb;
+
+ required_device<picture_image_device> m_picture;
+ required_device<avivideo_image_device> m_avivideo;
+ required_address_space m_space;
+
+ bitmap_argb32 *m_input_bitmap;
};
DECLARE_DEVICE_TYPE(VINO, vino_device)
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 762c0ee233e..215d45f533e 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -2453,48 +2453,62 @@ pcd4x // Siemens-Nixdorf PCD-4H and other 486 desktops
pcd4nl // 1995 Siemens-Nixdorf PCD-4NL 486 subnotebook
pcd4nd // 1993 Siemens-Nixdorf 486 notebook
ct386sx //
-wy220001 // WYSEpc
+wy220001 // WYSEpc
cxsxd //
ec1842 //
ec1849 //
ev1806 // Everex EV-1806
-ev1815 // Everex EV-1815
+ev1815 // Everex EV-1815
ews286 // 1986 Ericsson WS286
ficpio2 // 1995 FIC 486-PIO-2
ficvipio // FIC 486-VIP-IO
ficvipio2 // FIC 486-VIP-IO2
ftsserv // 1991 Apricot FTs (Scorpion)
-aubam12s2 // AUVA COMPUTER, INC. BAM/12-S2 motherboard (286)
-bi025c // BI-025C HT 12 286 motherboard (286)
-kma202f // KMA-202F-12R motherboard (286)
-cdtekg2 // CDTEK motherboard with Headland G2 chipset (286)
-octekg2 // Octek motherboard with Headland G2 chipset (286)
-olim203 // Olivetti 286 motherboard
-headg2 // 286 motherboards with Headland G2 chipset
-mb1212c // Biostar MB-1212C motherboard (286)
-bam16a0 // VIP-M21502A BAM16-A0 motherboard (286)
-cmpa286 // CMP enterprise CO.LTD. motherboard (286)
-suntac5 // 286 motherboards using the 5-chip SUNTAC chipset
+aubam12s2 // AUVA COMPUTER, INC. BAM/12-S2 motherboard (286)
+bi025c // BI-025C HT 12 286 motherboard (286)
+kma202f // KMA-202F-12R motherboard (286)
+cdtekg2 // CDTEK motherboard with Headland G2 chipset (286)
+octekg2 // Octek motherboard with Headland G2 chipset (286)
+olim203 // Olivetti 286 motherboard
+headg2 // 286 motherboards with Headland G2 chipset
+mb1212c // Biostar MB-1212C motherboard (286)
+bam16a0 // VIP-M21502A BAM16-A0 motherboard (286)
+cmpa286 // CMP enterprise CO.LTD. motherboard (286)
+suntac5 // 286 motherboards using the 5-chip SUNTAC chipset
ht12a // 286 motherboards using the Headland HT12/A chipset
-vlsi5 // 286 motherboards using the 5-chip VLSI chipset
-u3911v3 // Uniron U3911-V3 motherboard (286)
-mkp286 // Morse KP-286 motherboard (286)
-mba009 // HLB-286 MBA-009 motherboard (286)
-pccm205 // PC-Chips M205 motherboard (286)
-pccm321 // PC-Chips M321 motherboard (386)
-pccm326 // PC-Chips M326 motherboard (386)
-pccm919 // PC-Chips M919 motherboard (486)
-snomi286 // Snobol Mini 286 motherboard (286)
-sy019hi // Soyo SY-019H and SY-019I motherboards (386)
-sm38640f // SM 386-40F motherboard (386)
-4nd04a // 386-4N-D04A motherboard (386)
+vlsi5 // 286 motherboards using the 5-chip VLSI chipset
+sy012 // SY-012 16/25 386MB VER: 5.2 motherboard (386)
+frxc402 // 386 motherboards using FOREX FRX46C402/FRX36C300/SIS85C206 chips
+gs611606a // Goldstar P/N 611-606A Rev 1.0A motherboard (386)
+dfi386 // DFI 386-20.REV0 motherboard (386)
+386sc // 386 SC Rev A2 motherboard
+386sc2c //
+opti495xlc // Motherboards using the OPTi 82C495XLC chipset (386)
+isa386u30 // Asus ISA-386U30 REV.2.2 motherboard (386)
+isa386c // Asus ISA-386C motherboard (386)
+pt581392 // Motherboard using the Forex FRX46C402 + FRX46C411 + SiS 85C206 chipset (386)
+pem2530 // DTK PEM 2530 motherboard (386)
+tam3340ma0 // TAM/33/40-MA0 (CM318R00,M31-R00)
+alim1429 // Motherboards using the ALi M1429 A1 and M1431 A2 chipset (386)
+u3911v3 // Uniron U3911-V3 motherboard (286)
+mkp286 // Morse KP-286 motherboard (286)
+mba009 // HLB-286 MBA-009 motherboard (286)
+pccm205 // PC-Chips M205 motherboard (286)
+pccm321 // PC-Chips M321 motherboard (386)
+pccm326 // PC-Chips M326 motherboard (386)
+pccm919 // PC-Chips M919 motherboard (486)
+snomi286 // Snobol Mini 286 motherboard (286)
+sy019hi // Soyo SY-019H and SY-019I motherboards (386)
+sm38640f // SM 386-40F motherboard (386)
+4nd04a // 386-4N-D04A motherboard (386)
+hot304 // Shuttle HOT-304
hot409 // Shuttle HOT-409
ibm5162 // 1986 IBM XT 5162 (XT w/80286)
ibm5170 // 1984 IBM PC/AT 5170, original 6 MHz model
ibm5170a // 1985 IBM PC/AT 5170, enhanced 8 MHz model
ibmps1es // IBM PS/1 (Spanish)
k286i // 1985 Kaypro 286i
-elanht286 // Leanord Elan High Tech 286
+elanht286 // Leanord Elan High Tech 286
kt216wb5 // KT216WB5-HI Rev.2
lm103s //
m290 // Olivetti M290
@@ -2526,7 +2540,8 @@ xb42663 // 1988 Apricot Qi 300 (Rev D,E & F Motherboard)
xb42664 // 1989 Apricot XEN-S (Venus I Motherboard 386) (Bios:3.10.17i)
xb42664a // 1990 Apricot XEN-S (Venus II Motherboard 386) (Bios:1.02.17)
lion3500 // 1993 Lion 3500C/T notebook
-o286foxii // Octek Fox II 286 motherboard
+o286foxii // Octek Fox II motherboard (286)
+ocjagv // Octek Jaguar V motherboard (386)
@source:atari_s1.cpp
aavenger //
@@ -9689,6 +9704,9 @@ cbm730 //
p500 // Commodore P500 (proto, a.k.a. C128-40, PET-II)
p500p //
+@source:cbnt2039.cpp
+cbnt2039 //
+
@source:cbuster.cpp
cbuster // MAB (c) 1990 Data East Corporation (World)
cbusterj // MAB (c) 1990 Data East Corporation (Japan)
@@ -11469,6 +11487,7 @@ debutm
automat // bootleg
baddudes // EI (c) 1988 Data East USA (US)
birdtry // EK (c) 1988 Data East Corporation (Japan)
+birdtrya // EK (c) 1988 Data East Corporation (Japan)
bouldash // (c) 1990 Data East Corporation (World)
bouldashj // (c) 1990 Data East Corporation (Japan)
drgninja // EG (c) 1988 Data East Corporation (Japan)
@@ -15334,12 +15353,13 @@ uspbball // US Games
exospace // Elektronika
gnw_ball // Nintendo
gnw_bfight // Nintendo
+gnw_bfightn // Nintendo
gnw_bjack // Nintendo
gnw_boxing // Nintendo
gnw_bsweep // Nintendo
gnw_chef // Nintendo
gnw_climber // Nintendo
-gnw_climbcs // Nintendo
+gnw_climbern // Nintendo
gnw_dkjr // Nintendo
gnw_dkjrp // Nintendo
gnw_dkong // Nintendo
@@ -16156,6 +16176,9 @@ isbc8030 //
iskr1030m //
iskr1031 //
+@source:island.cpp
+isld_vortex //
+
@source:istellar.cpp
istellar // (c) 1983 Funai / Gakken
@@ -18495,14 +18518,12 @@ madgearj // 2/1989 (c) 1989 (Japan)
lastfght // (c) 2000 Subsino
@source:laz_aftrshok.cpp
-aftrshok // Lazer-tron After Shock
+aftrshok // Lazer-Tron Aftershock
aftrshoka //
-@source:laz_awetoss.cpp
-awetoss // Lazer-tron Awesome Toss'em
-
@source:laz_ribrac.cpp
-ribrac // Lazer-tron Ribbit Racing
+awetoss // Lazer-Tron Awesome Toss 'Em
+ribrac // Lazer-Tron Ribbit Racin
@source:lazercmd.cpp
bbonk // [1976?]
@@ -21493,6 +21514,9 @@ meijinsn // (c) 1986 SNK
@source:mekd2.cpp
mekd2 // 1977 Motorola Evaluation Kit
+@source:mekd3.cpp
+mekd3 // 1978 Motorola Evaluation Kit
+
@source:mekd4.cpp
mekd4 // 1980 Motorola Evaluation Kit
@@ -31661,10 +31685,10 @@ sicpc1605 // Siemens Sicomp PC16-05
ssam88s //
sx16 // Sanyo SX-16
zdsupers //
-ledgmodm // Leading Edge Model M
-eaglepc2 // Eagle PC-2
-mpx16 // Ciarcia's Circuit Cellar Micromint MPX-16
-hstrtpls // Vendex HeadStart Plus
+ledgmodm // Leading Edge Model M
+eaglepc2 // Eagle PC-2
+mpx16 // Ciarcia's Circuit Cellar Micromint MPX-16
+hstrtpls // Vendex HeadStart Plus
@source:pc100.cpp
pc100 //
diff --git a/src/mame/mess.flt b/src/mame/mess.flt
index f992b3dd452..91f9f9f0af8 100644
--- a/src/mame/mess.flt
+++ b/src/mame/mess.flt
@@ -132,6 +132,7 @@ cardinal.cpp
casloopy.cpp
cat.cpp
cbm2.cpp
+cbnt2039.cpp
cc40.cpp
ccs2810.cpp
ccs300.cpp
@@ -463,6 +464,7 @@ mdisk.cpp
megadriv.cpp
megadriv_rad.cpp
mekd2.cpp
+mekd3.cpp
mekd4.cpp
mekd5.cpp
mephisto_brikett.cpp
diff --git a/src/mame/video/3dom2_te.cpp b/src/mame/video/3dom2_te.cpp
index a8a0f33ec56..a75062e144d 100644
--- a/src/mame/video/3dom2_te.cpp
+++ b/src/mame/video/3dom2_te.cpp
@@ -555,22 +555,16 @@ static void write_te_reg(uint32_t &reg, uint32_t data, m2_te_device::te_reg_wmod
switch (mode)
{
case m2_te_device::REG_WRITE:
- {
reg = data;
break;
- }
case m2_te_device::REG_SET:
- {
reg |= data;
break;
- }
case m2_te_device::REG_CLEAR:
- {
reg &= ~data;
break;
- }
default:
- assert_always(false, "Bad register write mode");
+ throw emu_fatalerror("write_te_reg: Bad register write mode");
}
}
@@ -1569,7 +1563,7 @@ void m2_te_device::walk_edges(uint32_t wrange)
if (scan_lr ^ (m_es.x1 < m_es.x2))
{
// TODO: Is this possible?
- assert_always(false, "SPECIAL CASE: WHAT DO?");
+ throw emu_fatalerror("m2_te_device::walk_edges: SPECIAL CASE: WHAT DO?");
r = m_es.r1; // Where do the colors come from?
g = m_es.g1;
b = m_es.b1;
diff --git a/src/mame/video/alpha68k.cpp b/src/mame/video/alpha68k.cpp
index d9172e5f73b..6c655e909e7 100644
--- a/src/mame/video/alpha68k.cpp
+++ b/src/mame/video/alpha68k.cpp
@@ -28,10 +28,12 @@ void alpha68k_state::video_bank_w(u8 data)
TILE_GET_INFO_MEMBER(alpha68k_state::get_tile_info)
{
- const u32 tile = m_videoram[2 * tile_index] & 0xff;
- const u32 color = m_videoram[2 * tile_index + 1] & 0x0f;
+ const u8 tile = m_videoram[2 * tile_index] & 0xff;
+ const u8 attr = m_videoram[2 * tile_index + 1] & 0xff;
+ const u8 color = attr & 0x0f;
+ const bool opaque = BIT(attr, 4);
- SET_TILE_INFO_MEMBER(0, tile | (m_bank_base << 8), color, 0);
+ SET_TILE_INFO_MEMBER(0, tile | (m_bank_base << 8), color, opaque ? TILE_FORCE_LAYER0 : 0);
}
void alpha68k_state::videoram_w(offs_t offset, u16 data)
@@ -71,7 +73,7 @@ void alpha68k_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
for (int i = 0; i < 0x40; i += 2)
{
u16 tile = m_spriteram[offs + 1 + i + (0x800 * j) + 0x800];
- const u16 color = m_spriteram[offs + i + (0x800 * j) + 0x800] & 0x7f;
+ const u8 color = m_spriteram[offs + i + (0x800 * j) + 0x800] & 0x7f;
int fy = tile & 0x8000;
int fx = tile & 0x4000;
@@ -83,12 +85,11 @@ void alpha68k_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
if (fy) fy = 0; else fy = 1;
}
- if (color)
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
- tile,
- color,
- fx,fy,
- mx,my,0);
+ m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ tile,
+ color,
+ fx,fy,
+ mx,my,0);
if (m_flipscreen)
my = (my - 16) & 0x1ff;
@@ -148,18 +149,58 @@ WRITE_LINE_MEMBER(alpha68k_state::video_control3_w)
/******************************************************************************/
+/*
+ * Alpha 68k V sprite system
+ * tile-based, with 8-bit accesses.
+ * Two banks, first at 0x0000-0x1000, second at 0x1000 until end of VRAM.
+ * First bank is processed by 64 bytes stepping starting from address $4,
+ * then once it reaches end it restarts at $8, finally at $c.
+ *
+ * 0x0000-0x1000
+ * [0]
+ * ???? ???? untested in POST, actually written to by Gang Wars (likely NOP)
+ * [1]
+ * XXXX XXXX lower X offset
+ * [2]
+ * X--- ---- upper X offset
+ * -*** ---- unknown, more fractional X?
+ * ---- ---Y upper Y offset
+ * [3]
+ * YYYY YYYY lower Y offset
+ *
+ * Second bank has the actual tile info, and is arranged in vertical strips.
+ * [0]
+ * ???? ???? untested in POST, actually written to by Sky Adventure (likely NOP)
+ * [1]
+ * cccc cccc color entry
+ * [2]
+ * uuu- ---- user selectable, either flipx/flipy or tile bank
+ * ---t tttt high tile offset
+ * [3]
+ * tttt tttt low tile offset
+ *
+ * TODO:
+ * - Currently lags compared to itself, examples:
+ * - player death animation has first frame with inverted horizontal halves;
+ * - stage 1 priest desyncs with background;
+ * - glitchy first frame on title screen;
+ * Given how this and the actual HW works it is pretty likely this having a consistent delay,
+ * however it isn't known how exactly DMA triggers, and one frame of bufferd spriteram isn't enough.
+ * - Why entry 0x7c0 requires a one line and a priority hack?
+ *
+ */
void alpha68k_state::draw_sprites_V(bitmap_ind16 &bitmap, const rectangle &cliprect, int j, int s, int e, u16 fx_mask, u16 fy_mask, u16 sprite_mask)
{
for (int offs = s; offs < e; offs += 0x40)
{
-//AT
int my = m_spriteram[offs + 3 + (j << 1)];
int mx = m_spriteram[offs + 2 + (j << 1)] << 1 | my >> 15;
my = -my & 0x1ff;
mx = ((mx + 0x100) & 0x1ff) - 0x100;
+ // TODO: remove this hack
if (j == 0 && s == 0x7c0)
my++;
-//ZT
+
if (m_flipscreen)
{
mx = 240 - mx;
@@ -169,13 +210,11 @@ void alpha68k_state::draw_sprites_V(bitmap_ind16 &bitmap, const rectangle &clipr
for (int i = 0; i < 0x40; i += 2)
{
u16 tile = m_spriteram[offs + 1 + i + (0x800 * j) + 0x800];
- const u16 color = m_spriteram[offs + i + (0x800 * j) + 0x800] & 0xff;
+ const u8 color = m_spriteram[offs + 0 + i + (0x800 * j) + 0x800] & 0xff;
int fx = tile & fx_mask;
int fy = tile & fy_mask;
tile = tile & sprite_mask;
- if (tile > 0x4fff)
- continue;
if (m_flipscreen)
{
@@ -183,12 +222,13 @@ void alpha68k_state::draw_sprites_V(bitmap_ind16 &bitmap, const rectangle &clipr
if (fy) fy = 0; else fy = 1;
}
- if (color)
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
- tile,
- color,
- fx,fy,
- mx,my,0);
+ // color 0 is actually selectable, cfr. Sky Adventure service mode or Gold Medalist player 1 status bar on long jump
+ // TODO: are there any actual sprite disable conditions?
+ m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ tile,
+ color,
+ fx,fy,
+ mx,my,0);
if (m_flipscreen)
my = (my - 16) & 0x1ff;
@@ -198,35 +238,32 @@ void alpha68k_state::draw_sprites_V(bitmap_ind16 &bitmap, const rectangle &clipr
}
}
+#ifdef UNUSED_FUNCTION
+// AT: *KLUDGE* fixes priest priority in level 1(could be a game bug)
+// Update: it is a btanb according to PCB reference, priest effectively goes above big ship (!)
+// left here for reference
+if (m_spriteram[0x1bde] == 0x24 && (m_spriteram[0x1bdf] >> 8) == 0x3b)
+{
+ draw_sprites_V(bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff);
+ draw_sprites_V(bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff);
+}
+else
+#endif
+
u32 alpha68k_state::screen_update_alpha68k_V(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+ // TODO: should be an user selectable feature instead of using the MCU ID, it's also repeated below.
+ bool is_skyadventure = (m_microcontroller_id == 0x8814);
+ const u16 flipxmask = is_skyadventure ? 0 : 0x8000;
+ const u16 flipymask = is_skyadventure ? 0x8000 : 0;
machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
-
+
bitmap.fill(4095, cliprect);
- /* This appears to be correct priority */
- if (m_microcontroller_id == 0x8814) /* Sky Adventure */
- {
- draw_sprites_V(bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff);
- draw_sprites_V(bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
- //AT: *KLUDGE* fixes priest priority in level 1(could be a game bug)
- if (m_spriteram[0x1bde] == 0x24 && (m_spriteram[0x1bdf] >> 8) == 0x3b)
- {
- draw_sprites_V(bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff);
- draw_sprites_V(bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff);
- }
- else
- draw_sprites_V(bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
-
- draw_sprites_V(bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff);
- }
- else /* gangwars */
- {
- draw_sprites_V(bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff);
- draw_sprites_V(bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
- draw_sprites_V(bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
- draw_sprites_V(bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff);
- }
+ draw_sprites_V(bitmap, cliprect, 0, 0x07c0, 0x0800, flipxmask, flipymask, 0x7fff);
+ draw_sprites_V(bitmap, cliprect, 1, 0x0000, 0x0800, flipxmask, flipymask, 0x7fff);
+ draw_sprites_V(bitmap, cliprect, 2, 0x0000, 0x0800, flipxmask, flipymask, 0x7fff);
+ draw_sprites_V(bitmap, cliprect, 0, 0x0000, 0x07c0, flipxmask, flipymask, 0x7fff);
m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
@@ -238,7 +275,6 @@ u32 alpha68k_state::screen_update_alpha68k_V_sb(screen_device &screen, bitmap_in
bitmap.fill(4095, cliprect);
- /* This appears to be correct priority */
draw_sprites_V(bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff);
draw_sprites_V(bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
draw_sprites_V(bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
@@ -267,7 +303,7 @@ void alpha68k_state::draw_sprites_I(bitmap_ind16 &bitmap, const rectangle &clipr
const bool fy = data & 0x4000;
const u8 color = m_color_proms[tile << 1 | data >> 15];
- gfx->transpen(bitmap,cliprect, tile, color, 0, fy, mx, my, 0);
+ gfx->transpen(bitmap,cliprect, tile, color, 0, fy, mx, my, 0);
my = (my + 8) & 0xff;
}
diff --git a/src/mame/video/archimds.cpp b/src/mame/video/archimds.cpp
deleted file mode 100644
index 7b18dc83f30..00000000000
--- a/src/mame/video/archimds.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-// license:LGPL-2.1+
-// copyright-holders:Angelo Salese, R. Belmont, Juergen Buchmueller
-/***************************************************************************
-
- Acorn Archimedes VIDC (VIDeo Controller) emulation
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/archimds.h"
-
-uint32_t archimedes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- int xstart,ystart,xend,yend;
- int res_x,res_y;
- int xsize,ysize;
- int calc_dxs = 0,calc_dxe = 0;
- const uint8_t x_step[4] = { 19, 11, 7, 5 };
-
- /* border color */
- bitmap.fill(m_palette->pen(0x10), cliprect);
-
- /* define X display area through BPP mode register */
- calc_dxs = (m_vidc_regs[VIDC_HDSR]*2)+x_step[m_vidc_bpp_mode & 3];
- calc_dxe = (m_vidc_regs[VIDC_HDER]*2)+x_step[m_vidc_bpp_mode & 3];
-
- /* now calculate display clip rectangle start/end areas */
- xstart = (calc_dxs)-m_vidc_regs[VIDC_HBSR];
- ystart = (m_vidc_regs[VIDC_VDSR]-m_vidc_regs[VIDC_VBSR]);
- xend = (calc_dxe)+xstart;
- yend = (m_vidc_regs[VIDC_VDER] * (m_vidc_interlace+1))+ystart;
-
- /* disable the screen if display params are invalid */
- if(xstart > xend || ystart > yend)
- return 0;
-
- xsize = calc_dxe-calc_dxs;
- ysize = m_vidc_regs[VIDC_VDER]-m_vidc_regs[VIDC_VDSR];
-
- {
- int count;
- int x,y,xi;
- uint8_t pen;
- static uint8_t *vram = memregion("vram")->base();
-
- count = (0);
-
- switch(m_vidc_bpp_mode)
- {
- case 0: //1 bpp
- {
- for(y=0;y<ysize;y++)
- {
- for(x=0;x<xsize;x+=8)
- {
- pen = vram[count];
-
- for(xi=0;xi<8;xi++)
- {
- res_x = x+xi+xstart;
- res_y = (y+ystart)*(m_vidc_interlace+1);
-
- if(m_vidc_interlace)
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi))&0x1);
- if (cliprect.contains(res_x, res_y+1) && (res_x) <= xend && (res_y+1) <= yend)
- bitmap.pix32(res_y+1, res_x) = m_palette->pen((pen>>(xi))&0x1);
- }
- else
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi))&0x1);
- }
- }
-
- count++;
- }
- }
- }
- break;
- case 1: //2 bpp
- {
- for(y=0;y<ysize;y++)
- {
- for(x=0;x<xsize;x+=4)
- {
- pen = vram[count];
-
- for(xi=0;xi<4;xi++)
- {
- res_x = x+xi+xstart;
- res_y = (y+ystart)*(m_vidc_interlace+1);
-
- if(m_vidc_interlace)
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi*2))&0x3);
- if (cliprect.contains(res_x, res_y+1) && (res_x) <= xend && (res_y+1) <= yend)
- bitmap.pix32(res_y+1, res_x) = m_palette->pen((pen>>(xi*2))&0x3);
- }
- else
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi*2))&0x3);
- }
- }
-
- count++;
- }
- }
- }
- break;
- case 2: //4 bpp
- {
- for(y=0;y<ysize;y++)
- {
- for(x=0;x<xsize;x+=2)
- {
- pen = vram[count];
-
- for(xi=0;xi<2;xi++)
- {
- res_x = x+xi+xstart;
- res_y = (y+ystart)*(m_vidc_interlace+1);
-
- if(m_vidc_interlace)
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi*4))&0xf);
- if (cliprect.contains(res_x, res_y+1) && (res_x) <= xend && (res_y+1) <= yend)
- bitmap.pix32(res_y+1, res_x) = m_palette->pen((pen>>(xi*4))&0xf);
- }
- else
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi*4))&0xf);
- }
- }
-
- count++;
- }
- }
- }
- break;
- case 3: //8 bpp
- {
- for(y=0;y<ysize;y++)
- {
- for(x=0;x<xsize;x++)
- {
- pen = vram[count];
-
- res_x = x+xstart;
- res_y = (y+ystart)*(m_vidc_interlace+1);
-
- if(m_vidc_interlace)
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen&0xff)+0x100);
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y+1) <= yend)
- bitmap.pix32(res_y+1, res_x) = m_palette->pen((pen&0xff)+0x100);
- }
- else
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen((pen&0xff)+0x100);
- }
-
- count++;
- }
- }
- }
- break;
- default:
- popmessage("Unemulated bpp mode %02x, contact MAME/MESSdev",m_vidc_bpp_mode);
- break;
- }
-
-
- if(m_cursor_enabled == true)
- {
- count = 0;
- int cursor_h = m_vidc_regs[VIDC_VCER] - m_vidc_regs[VIDC_VCSR];
-
- if (cursor_h <= 0)
- return 0;
-
- for(y=0; y<cursor_h; y++)
- {
- for(x=0;x<32;x+=4)
- {
- for(xi=0;xi<4;xi++)
- {
- uint8_t cursor_dot;
- pen = m_cursor_vram[count];
-
- res_x = m_vidc_regs[VIDC_HCSR] - m_vidc_regs[VIDC_HBSR] + x + xi;
- res_y = (m_vidc_regs[VIDC_VCSR] - m_vidc_regs[VIDC_VBSR] + y) * (m_vidc_interlace + 1);
-
- cursor_dot = ((pen>>(xi*2))&0x3);
-
- if(cursor_dot)
- {
- if(m_vidc_interlace)
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen(cursor_dot+0x10);
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y+1) <= yend)
- bitmap.pix32(res_y+1, res_x) = m_palette->pen(cursor_dot+0x10);
- }
- else
- {
- if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
- bitmap.pix32(res_y, res_x) = m_palette->pen(cursor_dot+0x10);
- }
- }
- }
-
- count++;
- }
- }
- }
- }
-
-
-
- return 0;
-}
diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp
index f1dd0621e99..74a48a24821 100644
--- a/src/mame/video/astrocde.cpp
+++ b/src/mame/video/astrocde.cpp
@@ -391,7 +391,7 @@ void astrocde_state::device_timer(emu_timer &timer, device_timer_id id, int para
scanline_callback(ptr, param);
break;
default:
- assert_always(false, "Unknown id in astrocde_state::device_timer");
+ throw emu_fatalerror("Unknown id in astrocde_state::device_timer");
}
}
diff --git a/src/mame/video/cchasm.cpp b/src/mame/video/cchasm.cpp
index 9aa48af8bca..e515db965c8 100644
--- a/src/mame/video/cchasm.cpp
+++ b/src/mame/video/cchasm.cpp
@@ -27,7 +27,7 @@ void cchasm_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_maincpu->set_input_line(2, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in cchasm_state::device_timer");
+ throw emu_fatalerror("Unknown id in cchasm_state::device_timer");
}
}
diff --git a/src/mame/video/cps1.cpp b/src/mame/video/cps1.cpp
index e489a7f925d..e3a033618f2 100644
--- a/src/mame/video/cps1.cpp
+++ b/src/mame/video/cps1.cpp
@@ -2293,7 +2293,8 @@ void cps_state::video_start()
m_cps_a_regs[CPS1_OTHER_BASE] = 0x9100;
/* This should never be hit, since game_config is set in machine_reset */
- assert_always(m_game_config, "state_game_config hasn't been set up yet");
+ if (!m_game_config)
+ throw emu_fatalerror("cps_state::video_start: m_game_config hasn't been set up yet");
/* Set up old base */
diff --git a/src/mame/video/dcheese.cpp b/src/mame/video/dcheese.cpp
index f7a82d589aa..17fc90b3993 100644
--- a/src/mame/video/dcheese.cpp
+++ b/src/mame/video/dcheese.cpp
@@ -75,7 +75,7 @@ void dcheese_state::device_timer(emu_timer &timer, device_timer_id id, int param
signal_irq(param);
break;
default:
- assert_always(false, "Unknown id in dcheese_state::device_timer");
+ throw emu_fatalerror("Unknown id in dcheese_state::device_timer");
}
}
diff --git a/src/mame/video/deco_mlc.cpp b/src/mame/video/deco_mlc.cpp
index 4f9b764c5d1..d97042779cf 100644
--- a/src/mame/video/deco_mlc.cpp
+++ b/src/mame/video/deco_mlc.cpp
@@ -100,7 +100,7 @@ void deco_mlc_state::drawgfxzoomline(u32* dest, u8* pri,const rectangle &clip,gf
const u8 *source2 = code_base2 + (srcline) * gfx->rowbytes();
// alphaMode & 0xc0 = 0xc0 : Shadow, 0 : Alpha or Pre-shadowed, Other bits unknown
if (shadowMode && (alphaMode & 0xc0))
- { /* TODO : 8bpp and shadow can use simultaneously? */
+ { /* TODO : 8bpp and shadow can use simultaneously? */
int x, x_index = x_index_base;
for (x = sx; x < ex; x++)
{
@@ -146,10 +146,9 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
u32 *index_ptr = nullptr;
int sprite,h,w,fx1,fy1;
int xoffs,yoffs;
- const u8 *rom = m_gfx2 + 0x20000, *index_ptr8;
- const u8 *rawrom = m_gfx2;
+ const u8 *index_ptr8;
int blockIsTilemapIndex = 0;
- int sprite2 = 0,indx2 = 0,use8bppMode = 0;
+ int sprite2 = 0,use8bppMode = 0;
int useIndicesInRom = 0;
int hibits = 0;
int tileFormat = 0;
@@ -235,7 +234,7 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
int clipper = (spriteram[offs + 1] >> 8) & 0x3;
- int indx = spriteram[offs + 0] & 0x3fff;
+ int indx = spriteram[offs + 0] & 0x7fff;
int yscale = spriteram[offs + 4] & 0x3ff;
int xscale = spriteram[offs + 5] & 0x3ff;
int colorOffset = 0;
@@ -268,13 +267,12 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
if (use8bppMode)
{
color = (spriteram[offs + 1 - 8] & 0x7f);
- indx2 = spriteram[offs + 0 - 8] & 0x3fff;
}
/* Lookup tiles / size in sprite index ram OR in the lookup rom */
- if (spriteram[offs + 0] & 0x4000)
+ if (indx & 0x4000)
{
- index_ptr8 = rom + indx * 8; /* Byte ptr */
+ index_ptr8 = m_gfx2 + indx * 8; /* Byte ptr */
h = (index_ptr8[1] >> 0) & 0xf;
w = (index_ptr8[3] >> 0) & 0xf;
@@ -284,11 +282,6 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
sprite = (index_ptr8[7] << 8) | index_ptr8[6];
sprite |= (index_ptr8[4] & 3) << 16;
- if (use8bppMode)
- {
- const u8* index_ptr28 = rom + indx2 * 8;
- sprite2 = (index_ptr28[7] << 8) | index_ptr28[6];
- }
//unused byte 5
yoffs = index_ptr8[0] & 0xff;
xoffs = index_ptr8[2] & 0xff;
@@ -315,12 +308,6 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
if (!h) h = 16;
if (!w) w = 16;
- if (use8bppMode)
- {
- u32* index_ptr2 = m_vram + ((indx2 * 4) & 0x7fff);
- sprite2 = ((index_ptr2[2] & 0x3) << 16) | (index_ptr2[3] & 0xffff);
- }
-
sprite = ((index_ptr[2] & 0x3) << 16) | (index_ptr[3] & 0xffff);
if (index_ptr[2] & 0xc0)
blockIsTilemapIndex = 1;
@@ -339,6 +326,22 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
fx1 = (index_ptr[1] & 0x1000) >> 12;
}
+ if (use8bppMode)
+ {
+ indx = spriteram[offs + 0 - 8] & 0x7fff;
+ if (indx & 0x4000)
+ {
+ index_ptr8 = m_gfx2 + indx * 8;
+ sprite2 = (index_ptr8[7] << 8) | index_ptr8[6];
+ }
+ else
+ {
+ indx &= 0x1fff;
+ index_ptr = m_vram + indx * 4;
+ sprite2 = ((index_ptr[2] & 0x3) << 16) | (index_ptr[3] & 0xffff);
+ }
+ }
+
if (fx1) fx ^= 0x8000;
if (fy1) fy ^= 0x4000;
@@ -464,12 +467,12 @@ void deco_mlc_state::draw_sprites(const rectangle &cliprect, int scanline, u32*
{
if (useIndicesInRom)
{
- const u8* ptr = rawrom + (tile * 2);
+ const u8* ptr = m_gfx2 + (tile * 2);
tile = (*ptr) + ((*(ptr + 1)) << 8);
if (use8bppMode)
{
- const u8* ptr2 = rawrom + (tile2 * 2);
+ const u8* ptr2 = m_gfx2 + (tile2 * 2);
tile2 = (*ptr2) + ((*(ptr2 + 1)) << 8);
}
else
diff --git a/src/mame/video/exidy.cpp b/src/mame/video/exidy.cpp
index 01a7ee98540..1b68ef99838 100644
--- a/src/mame/video/exidy.cpp
+++ b/src/mame/video/exidy.cpp
@@ -270,7 +270,7 @@ void exidy_state::device_timer(emu_timer &timer, device_timer_id id, int param,
break;
default:
- assert_always(false, "Unknown id in exidy_state::device_timer");
+ throw emu_fatalerror("Unknown id in exidy_state::device_timer");
}
}
diff --git a/src/mame/video/gameplan.cpp b/src/mame/video/gameplan.cpp
index b7214ac02e2..aecd079a48c 100644
--- a/src/mame/video/gameplan.cpp
+++ b/src/mame/video/gameplan.cpp
@@ -48,7 +48,7 @@ void gameplan_state::device_timer(emu_timer &timer, device_timer_id id, int para
via_irq_delayed(ptr, param);
break;
default:
- assert_always(false, "Unknown id in gameplan_state::device_timer");
+ throw emu_fatalerror("Unknown id in gameplan_state::device_timer");
}
}
diff --git a/src/mame/video/gp9001.cpp b/src/mame/video/gp9001.cpp
index 8ff056fd14c..78bd3202e8e 100644
--- a/src/mame/video/gp9001.cpp
+++ b/src/mame/video/gp9001.cpp
@@ -883,6 +883,6 @@ void gp9001vdp_device::device_timer(emu_timer &timer, device_timer_id id, int pa
m_vint_out_cb(1);
break;
default:
- assert_always(false, "Unknown id in gp9001vdp_device::device_timer");
+ throw emu_fatalerror("Unknown id in gp9001vdp_device::device_timer");
}
}
diff --git a/src/mame/video/hyhoo.cpp b/src/mame/video/hyhoo.cpp
index 2651ee5f620..9c225f3bbd2 100644
--- a/src/mame/video/hyhoo.cpp
+++ b/src/mame/video/hyhoo.cpp
@@ -61,7 +61,7 @@ void hyhoo_state::device_timer(emu_timer &timer, device_timer_id id, int param,
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in hyhoo_state::device_timer");
+ throw emu_fatalerror("Unknown id in hyhoo_state::device_timer");
}
}
diff --git a/src/mame/video/lethalj.cpp b/src/mame/video/lethalj.cpp
index f3b836b7b3e..73e9dad414c 100644
--- a/src/mame/video/lethalj.cpp
+++ b/src/mame/video/lethalj.cpp
@@ -110,7 +110,7 @@ void lethalj_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_maincpu->set_input_line(0, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in lethalj_state::device_timer");
+ throw emu_fatalerror("Unknown id in lethalj_state::device_timer");
}
}
diff --git a/src/mame/video/m92.cpp b/src/mame/video/m92.cpp
index 3e4c6475ef8..4b3ca83cb40 100644
--- a/src/mame/video/m92.cpp
+++ b/src/mame/video/m92.cpp
@@ -55,7 +55,7 @@ void m92_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
m_upd71059c->ir1_w(1);
break;
default:
- assert_always(false, "Unknown id in m92_state::device_timer");
+ throw emu_fatalerror("Unknown id in m92_state::device_timer");
}
}
diff --git a/src/mame/video/mcr.cpp b/src/mame/video/mcr.cpp
index 46dddafaca5..87c72395cd3 100644
--- a/src/mame/video/mcr.cpp
+++ b/src/mame/video/mcr.cpp
@@ -111,7 +111,7 @@ void mcr_state::video_start()
break;
default:
- assert_always(0, "Unknown mcr board");
+ throw emu_fatalerror("mcr_state::video_start: Unknown mcr board");
break;
}
}
diff --git a/src/mame/video/midtunit.cpp b/src/mame/video/midtunit.cpp
index b307f3f722b..8bf3e3510b7 100644
--- a/src/mame/video/midtunit.cpp
+++ b/src/mame/video/midtunit.cpp
@@ -625,7 +625,7 @@ void midtunit_video_device::device_timer(emu_timer &timer, device_timer_id id, i
m_maincpu->set_input_line(0, ASSERT_LINE);
break;
default:
- assert_always(false, "Unknown id in midtunit_video_device::device_timer");
+ throw emu_fatalerror("Unknown id in midtunit_video_device::device_timer");
}
}
diff --git a/src/mame/video/midvunit.cpp b/src/mame/video/midvunit.cpp
index 03db5f9dc9d..2cc60de8c5e 100644
--- a/src/mame/video/midvunit.cpp
+++ b/src/mame/video/midvunit.cpp
@@ -44,7 +44,7 @@ void midvunit_state::device_timer(emu_timer &timer, device_timer_id id, int para
scanline_timer_cb(ptr, param);
break;
default:
- assert_always(false, "Unknown id in midvunit_state::device_timer");
+ throw emu_fatalerror("Unknown id in midvunit_state::device_timer");
}
}
diff --git a/src/mame/video/midyunit.cpp b/src/mame/video/midyunit.cpp
index 9a6edb55e19..123fef5ca2b 100644
--- a/src/mame/video/midyunit.cpp
+++ b/src/mame/video/midyunit.cpp
@@ -372,7 +372,7 @@ void midyunit_state::device_timer(emu_timer &timer, device_timer_id id, int para
autoerase_line(ptr, param);
break;
default:
- assert_always(false, "Unknown id in midyunit_state::device_timer");
+ throw emu_fatalerror("Unknown id in midyunit_state::device_timer");
}
}
diff --git a/src/mame/video/namcona1.cpp b/src/mame/video/namcona1.cpp
index 228bf817fd9..34f3d89e0a2 100644
--- a/src/mame/video/namcona1.cpp
+++ b/src/mame/video/namcona1.cpp
@@ -1,6 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
-/* Namco System NA1 / 2 Video Hardware */
+/* Namco System NA1/2 Video Hardware */
/*
Notes:
diff --git a/src/mame/video/nbmj8688.cpp b/src/mame/video/nbmj8688.cpp
index 551ca396cbc..95da1eb067d 100644
--- a/src/mame/video/nbmj8688.cpp
+++ b/src/mame/video/nbmj8688.cpp
@@ -269,7 +269,7 @@ void nbmj8688_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8688_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8688_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8891.cpp b/src/mame/video/nbmj8891.cpp
index ad1311f0171..c1bddc325cb 100644
--- a/src/mame/video/nbmj8891.cpp
+++ b/src/mame/video/nbmj8891.cpp
@@ -313,7 +313,7 @@ void nbmj8891_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8891_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8891_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8900.cpp b/src/mame/video/nbmj8900.cpp
index 2323c301ce6..ad9c1e021fc 100644
--- a/src/mame/video/nbmj8900.cpp
+++ b/src/mame/video/nbmj8900.cpp
@@ -205,7 +205,7 @@ void nbmj8900_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8900_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8900_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj8991.cpp b/src/mame/video/nbmj8991.cpp
index b0b818eba05..01bf4149d1c 100644
--- a/src/mame/video/nbmj8991.cpp
+++ b/src/mame/video/nbmj8991.cpp
@@ -173,7 +173,7 @@ void nbmj8991_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in nbmj8991_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj8991_state::device_timer");
}
}
diff --git a/src/mame/video/nbmj9195.cpp b/src/mame/video/nbmj9195.cpp
index 06d5cb5c6c8..2478f0eb781 100644
--- a/src/mame/video/nbmj9195.cpp
+++ b/src/mame/video/nbmj9195.cpp
@@ -187,7 +187,7 @@ void nbmj9195_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb19010_busyflag = 1;
break;
default:
- assert_always(false, "Unknown id in nbmj9195_state::device_timer");
+ throw emu_fatalerror("Unknown id in nbmj9195_state::device_timer");
}
}
diff --git a/src/mame/video/niyanpai.cpp b/src/mame/video/niyanpai.cpp
index a590d466292..5408856dbc1 100644
--- a/src/mame/video/niyanpai.cpp
+++ b/src/mame/video/niyanpai.cpp
@@ -170,7 +170,7 @@ void niyanpai_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_nb19010_busyflag = 1;
break;
default:
- assert_always(false, "Unknown id in niyanpai_state::device_timer");
+ throw emu_fatalerror("Unknown id in niyanpai_state::device_timer");
}
}
diff --git a/src/mame/video/pastelg.cpp b/src/mame/video/pastelg.cpp
index d7cd8bf77df..c04df9fc244 100644
--- a/src/mame/video/pastelg.cpp
+++ b/src/mame/video/pastelg.cpp
@@ -147,7 +147,7 @@ void pastelg_state::device_timer(emu_timer &timer, device_timer_id id, int param
m_nb1413m3->busyflag_w(1);
break;
default:
- assert_always(false, "Unknown id in pastelg_state::device_timer");
+ throw emu_fatalerror("Unknown id in pastelg_state::device_timer");
}
}
diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp
index 890490c5c64..86a9f038bfc 100644
--- a/src/mame/video/powervr2.cpp
+++ b/src/mame/video/powervr2.cpp
@@ -1486,7 +1486,7 @@ WRITE32_MEMBER( powervr2_device::ta_list_init_w )
}
if (grabsel < 0)
- assert_always(0, "TA grabber error B!\n");
+ throw emu_fatalerror("powervr2_device::ta_list_init_w: TA grabber error B!");
grabsellast=grabsel;
grab[grabsel].ispbase=ta_isp_base;
grab[grabsel].busy=0;
diff --git a/src/mame/video/segag80r.cpp b/src/mame/video/segag80r.cpp
index af00f8240f1..f1af8355cdf 100644
--- a/src/mame/video/segag80r.cpp
+++ b/src/mame/video/segag80r.cpp
@@ -29,7 +29,7 @@ void segag80r_state::device_timer(emu_timer &timer, device_timer_id id, int para
m_vblank_latch = 0;
break;
default:
- assert_always(false, "Unknown id in segag80r_state::device_timer");
+ throw emu_fatalerror("Unknown id in segag80r_state::device_timer");
}
}
diff --git a/src/mame/video/segag80v.cpp b/src/mame/video/segag80v.cpp
index d3731bb37e5..110930e5973 100644
--- a/src/mame/video/segag80v.cpp
+++ b/src/mame/video/segag80v.cpp
@@ -325,7 +325,8 @@ void segag80v_state::sega_generate_vector_list()
void segag80v_state::video_start()
{
- assert_always(m_vectorram.bytes() != 0, "vectorram==0");
+ if (!m_vectorram.bytes())
+ throw emu_fatalerror("segag80v_state::video_start: !vectorram.bytes()");
m_min_x =m_screen->visible_area().min_x;
m_min_y =m_screen->visible_area().min_y;
diff --git a/src/mame/video/segaic24.cpp b/src/mame/video/segaic24.cpp
index b006dee836e..5a5f1d76a14 100644
--- a/src/mame/video/segaic24.cpp
+++ b/src/mame/video/segaic24.cpp
@@ -665,7 +665,7 @@ void segas24_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect
cclip = clip[countspr];
if(cclip) {
- // Crackdown uses this on pre-title screen intro
+ // Crackdown uses this on pre-title screen intro
// for masking both avatars and the Sega logo itself.
clip_reverse_y = (cclip[1] & 0x2000) >> 13;
min_y = (cclip[2] & 511);
diff --git a/src/mame/video/sgi_ge5.cpp b/src/mame/video/sgi_ge5.cpp
index 915b279bc69..ce2b1412af3 100644
--- a/src/mame/video/sgi_ge5.cpp
+++ b/src/mame/video/sgi_ge5.cpp
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Patrick Mackinlay
+// thanks-to:Happy
/*
* Silicon Graphics GE5 and HQ1 devices.
@@ -10,11 +11,15 @@
* communication.
*
* The undocumented HQ1 microcode instruction format is relatively well decoded
- * now, but the exact timing and function of many operations remains incomplete.
+ * now, but the exact timing and function of some operations remains unknown.
*
* TODO:
- * - skeleton only
- *
+ * - implement host dma
+ * - verify some operations
+ * - tidy up latch/timing logic
+ * - implement single stepping
+ * - redo disassembly
+ * - save state
*/
#include "emu.h"
@@ -22,10 +27,106 @@
#include "sgi_ge5.h"
#define LOG_GENERAL (1U << 0)
+#define LOG_TOKEN (1U << 1)
+#define LOG_MEMORY (1U << 2)
//#define VERBOSE (LOG_GENERAL)
#include "logmacro.h"
+static char const *const token_diag[] =
+{
+ "DIAG_DATA", "DIAG_INIT", "DIAG_DRAMTEST", "DIAG_DMA_IG",
+ "DIAG_DMA_IB", "DIAG_DMA_GB", "DIAG_CHARPOS", "DIAG_WRITEFULLPIX",
+ "DIAG_DRAWLINE", "DIAG_DK3_FIFO", "DIAG_DK3_FINFLGS", "DIAG_DRAW4SPANS",
+ "DIAG_DRAWFLATSPAN", "DIAG_DRAWSPAN", "DIAG_LIFECHECK", "DIAG_LOADRE",
+ "DIAG_READPIXDMA", "DIAG_READPIXELS", "DIAG_SCREENCLEAR", "DIAG_WRITEPIXDMA",
+ "DIAG_FASTCLEAR20", "DIAG_DRAWCHAR", "DIAG_STRINGINIT", "DIAG_STRINGEND",
+ "DIAG_FASTCHAR", "DIAG_DRAWLONGSPANS", nullptr, nullptr,
+
+ // turbo option
+ nullptr, nullptr, "DIAG_DSPLOAD", "DIAG_DSPRAMDATA",
+ "DIAG_DSPRAMADDR", "DIAG_DSPFIFO", "DIAG_DSPSPAN", "DIAG_DSPRD",
+ "DIAG_DSPWR", "DIAG_DSPINTRAM", "DIAG_DSPSCOPE", "DIAG_RESCOPE",
+};
+
+static char const *const token_puc[] =
+{
+ "PUC_DATA", "PUC_INIT", nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, "PUC_COLOR", "PUC_FINISH",
+ "PUC_PNT2I", "PUC_RECTI2D", "PUC_CMOV2I", "PUC_DRAWCHAR",
+ "PUC_HAND", "PUC_FBOPT", "PUC_ZBOPT", "PUC_TOPSCAN",
+ "DIAG_READPIXELS", "DIAG_WRITEFULLPIX", "DIAG_LOADRE", "DIAG_CHARPOS",
+};
+
+static char const *const token_gl[] =
+{
+ "GE_DATA", "GE_INIT", nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, "GE_COLOR", "GE_FINISH0",
+ "GE_PNT2I", "GE_SBOXI", "GE_CMOV2I", "GE_DRAWCHAR",
+ "GE_HAND", "GE_FBOPT", "GE_ZBOPT", "GE_TOPSCAN",
+ "GE_READPIXELS", "GE_WRITEPIXELS", "GE_LOADRE", "GE_GETCPOS",
+ "GE_PICKMODE", "GE_PIXTYPE", "GE_PIXWRITEMASK", "GE_POPNAME",
+ "GE_PUSHNAME", "GE_READBLOCK", "GE_RECTREAD", "GE_READBUF",
+ "GE_READPIXDMA", "GE_AUXWRITEMASK", "GE_READRGB", "GE_RECTCOPY",
+ "GE_RGBCOLOR", "GE_RGBSHADERANGE", "GE_RWMODE", "GE_SCREENCLEAR",
+ "GE_SHADEMODEL", "GE_SHADERANGE", "GE_WRITEBLOCK", "GE_RECTWRITE",
+ "GE_WRITEPIXDMA", "GE_BEGINBBOX", "GE_ZBUFFER", "GE_ZCLEAR",
+ "GE_ZOOMFACTOR", "GE_READSOURCE", "GE_DRAWMODE", "GE_CZCLEAR",
+ "GE_HQMSAV", "GE_ZFUNCTION", "GE_SETPIECES", "GE_FLATMODE",
+ "GE_LMCOLOR", "GE_LOADAMBIENT", "GE_DEPTHFN", "GE_LOADDIFFUSE",
+ "GE_LOADMATRIX", "GE_MULTMATRIX", "GE_PUSHMATRIX", "GE_POPMATRIX",
+ "GE_LOADSPECULAR", "GE_LOADEMISSION", "GE_LOADASUM", "GE_LOADLCOLOR",
+ nullptr, nullptr, "GE_CURVEIT", "GE_LOADVIEWP",
+ "GE_POLYGON", "GE_ENDPOLYGON", "GE_TRANSLATEI", "GE_TRANSLATE",
+ "GE_LINESTYLE", "GE_LINEWIDTH", "GE_VERTEX2I", "GE_VERTEX2",
+ "GE_VERTEX3I", "GE_VERTEX3", "GE_VERTEX4I", "GE_VERTEX4",
+ "GE_RVERTEX2I", "GE_RVERTEX2", "GE_RVERTEX3I", "GE_RVERTEX3",
+ "GE_CLOSEDLINE", "GE_ENDCLOSEDLINE", "GE_LSREPEAT", "GE_ANTIALIAS",
+ "GE_COLORF", "GE_PNT2", "GE_PNT3I", "GE_PNT3",
+ "GE_PNT4I", "GE_PNT4", nullptr, nullptr,
+ "GE_MOVE2I", "GE_MOVE2", "GE_MOVE3I", "GE_MOVE3",
+ "GE_MOVE4I", "GE_MOVE4", "GE_RMOVE2I", "GE_RMOVE2",
+ "GE_RMOVE3I", "GE_RMOVE3", "GE_DRAW2I", "GE_DRAW2",
+ "GE_DRAW3I", "GE_DRAW3", "GE_DRAW4I", "GE_DRAW4",
+ "GE_RDRAW2I", "GE_RDRAW2", "GE_RDRAW3I", "GE_RDRAW3",
+ "GE_ENABLWID", "GE_LOADGE", nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, "GE_FRONTFACE", "GE_BACKFACE", "GE_CONCAVE",
+ "GE_PATTERN", "GE_SETPATTERN", "GE_LOADNORMAL", "GE_MULTNORMAL",
+ "GE_INITSTACK", "GE_MMODE", "GE_NORMAL", "GE_ABNORMAL",
+ "GE_LIGHTATTR1", "GE_LIGHTATTR2", "GE_LIGHTATTR3", "GE_BINDLIGHT",
+ "GE_LIGHTDATA4", "GE_LIGHTMEMPTR", "GE_LIGHTDIRECTION", "GE_LIGHTPOSITION",
+ "GE_LIGHTMOVEDATA", "GE_BEGINMESH", "GE_ENDMESH", "GE_SWAPMESH",
+ "GE_SBOXF", "GE_SBOXFI", "GE_FATPOLY", "GE_ENDOLDPOLYGON",
+ "GE_SBOX", "GE_CURRENTWID", nullptr, nullptr,
+ "GE_DEPTHCUE", "GE_CMOV2", "GE_CMOV3I", "GE_CMOV3",
+ "GE_CMOV4I", "GE_CMOV4", "GE_ENABDITH", "GE_ENABWID",
+ nullptr, nullptr, "GE_SETMATRIX", "GE_COMPOSEMATRIX",
+ "GE_LOADTOPMATRIX", "GE_COPYMATRIX", "GE_FEEDBACK", "GE_ENDFEEDBACK",
+ "GE_PASSTHROUGH", "GE_FMOVE", "GE_FDRAW", "GE_FLINE",
+ "GE_SCRMASK", "GE_ZSOURCE", "GE_SUBPIXEL", "GE_SMOOTHPOINT",
+ "GE_RASTEROP", "GE_RESETLS", nullptr, nullptr,
+ nullptr, nullptr, "GE_SETSURFSCALE", "GE_SETV",
+ "GE_PUSHV", "GE_SURFP1", "GE_SURFNTURF", "GE_SETVHI",
+ "GE_STRIP", "GE_1LOAD1", "GE_1LOAD3", "GE_1LOAD4",
+ "GE_SURFMODE", "GE_DSPRD", "GE_DSPWR", "GE_DSPNEXT",
+ "GE_DSPDUMMY", "GE_PICKTYPE", "GE_VERSION", "GE_ENDBBOX",
+ "GE_ENDPICKMODE", "GE_INITNAMES", "GE_LOADNAME", nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ "GE_CTX0", nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, "GE_CTX1",
+};
+
DEFINE_DEVICE_TYPE(SGI_GE5, sgi_ge5_device, "ge5", "SGI Geometry Engine 5")
sgi_ge5_device::sgi_ge5_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
@@ -40,15 +141,13 @@ sgi_ge5_device::sgi_ge5_device(machine_config const &mconfig, char const *tag, d
, m_re_w(*this)
, m_icount(0)
{
- (void)m_dma_count;
}
void sgi_ge5_device::device_add_mconfig(machine_config &config)
{
WTL3132(config, m_fpu, clock());
- m_fpu->out_fpcn().set([this](int state) { m_fpu_c = state; });
- m_fpu->out_zero().set([this](int state) { m_fpu_z = state; });
- m_fpu->out_port_x().set([this](u32 data) { m_bus = data; LOG("m_bus = %x\n", data); });
+ m_fpu->out_fpcn().set([this](int state) { m_fpu_c = bool(state); });
+ m_fpu->out_port_x().set([this](u32 data) { m_bus = data; });
}
@@ -77,33 +176,33 @@ void sgi_ge5_device::device_start()
state_add(1, "MEMPTR", m_memptr).formatstr("%04X");
state_add(2, "REPTR", m_reptr).formatstr("%04X");
+ state_add(3, "BUS", m_bus).formatstr("%08X");
+ state_add(4, "DMACNT", m_dma_count).formatstr("%04X");
+
+ m_fpu->state_add(*this, 5);
set_icountptr(m_icount);
}
void sgi_ge5_device::device_reset()
{
+ m_sp = 0;
m_reptr = 0;
m_memptr = 0;
+ m_memptr_temp = 0;
- m_sp = 0;
-
- if (m_int_state)
- {
- m_int_state = 0;
- m_int_cb(m_int_state);
- }
+ set_int(false);
+ m_state = DECODE;
suspend(SUSPEND_REASON_HALT, false);
- LOG("stalled\n");
}
device_memory_interface::space_config_vector sgi_ge5_device::memory_space_config() const
{
return space_config_vector
{
- std::make_pair(AS_PROGRAM, &m_code_config),
- std::make_pair(AS_DATA, &m_data_config),
+ std::make_pair(0, &m_code_config),
+ std::make_pair(1, &m_data_config),
};
}
@@ -112,258 +211,363 @@ std::unique_ptr<util::disasm_interface> sgi_ge5_device::create_disassembler()
return std::make_unique<sgi_ge5_disassembler>();
}
-enum cx_mask : u8
-{
- INCMEM = 0x08, // increment memptr
- FIELD2 = 0x10, // second field active
- INCRE = 0x20, // increment reptr
- SRC = 0xc0, // data bus source
- DST = 0x06, // data bus source
- STALL = 0x01,
-};
-
void sgi_ge5_device::execute_run()
{
- if (m_fetch)
+ while (m_icount > 0)
{
- // stall if fifo empty
- if (m_fifo_empty())
+ switch (m_state)
{
- suspend(SUSPEND_REASON_HALT, false);
- return;
- }
+ case DECODE:
+ debugger_instruction_hook(m_pc);
- // fetch from fifo and set pc
- u64 data = m_fifo_read();
- m_bus = u32(data);
- m_pc = (data >> 31) & 0x1fe;
- m_fetch = false;
- }
+ // decode instruction
+ decode();
- while (m_icount > 0)
- {
- debugger_instruction_hook(m_pc);
-
- u64 const insn = space(AS_PROGRAM).read_qword(m_pc);
- LOG("pc 0x%04x code 0x%011x\n", m_pc, insn);
-
- u8 const hq1_op = (insn >> 32) & 0xff;
- unsigned const src = (hq1_op & SRC) >> 6;
- unsigned const dst = (hq1_op & DST) >> 1;
- bool const stall = (hq1_op & STALL);
- if (hq1_op & FIELD2)
- LOG("hq1 op 0x%02x src %d dst %d stall %d branch %d\n", hq1_op, src, dst, stall, (insn >> 29) & 7);
- else
- LOG("hq1 op 0x%02x src %d dst %d stall %d\n", hq1_op, src, dst, stall);
-
- // stall when fifo empty and reading from fifo or stall flag
- if (((src == 1) || stall) && m_fifo_empty())
- {
- // enter fetch mode if destination is fetch
- m_fetch = (dst == 1);
- LOG(m_fetch ? "FETCH\n" : "STALL\n");
- suspend(SUSPEND_REASON_HALT, false);
- m_icount = 0;
- continue;
- }
+ // execute secondary operation
+ if (m_decode.secondary)
+ secondary(m_bus_latch);
- u16 branch = 0;
- if (hq1_op & FIELD2)
- {
- // handle field2
- u64 const field2 = space(AS_PROGRAM).read_qword(++m_pc);
- u16 const immediate = (field2 >> 19) & 0x7fff;
+ // increment memptr
+ if (m_decode.inc_memptr)
+ m_memptr = (m_memptr + 1) & 0x7fff;
- LOG("pc 0x%04x pref 0x%011x immediate 0x%04x\n", m_pc, field2, immediate);
+ // increment reptr
+ if (m_decode.inc_reptr)
+ m_reptr = (m_reptr + 1) & 0x3f;
- switch ((field2 >> 32) & 0xfc)
+ // update pc to next sequential instruction
+ m_pc += m_decode.secondary ? 2 : 1;
+ m_state = READ;
+ break;
+
+ case READ:
+ m_state = CONTROL;
+
+ // fetch source
+ switch (m_decode.source)
{
- case 0x8c:
- m_reptr = m_bus;
- LOG("REPTR=0x%04x\n", m_reptr);
+ case 0: // reptr
+ if (m_reptr == 0x20 && !m_re_drq)
+ {
+ // re read stall
+ m_state = READ;
+ m_icount = 0;
+ }
+ else
+ m_bus = m_re_r(m_reptr);
break;
- case 0x9c:
- m_reptr = immediate;
- LOG("REPTR=0x%04x\n", m_reptr);
+ case 1: // fifo
+ if (m_fifo_empty())
+ {
+ // fifo read stall
+ m_state = READ;
+ m_icount = 0;
+ suspend(SUSPEND_REASON_TRIGGER, false);
+ }
+ else
+ m_bus = m_fifo_read();
+ break;
+ case 2: // memptr
+ m_bus = space(1).read_dword(m_memptr);
break;
- case 0xb0:
- m_memptr = m_bus;
- branch = immediate;
- LOG("MEMPTR=0x%04x BRANCH=0x%04x\n", m_memptr, branch);
+ case 3: // fpu
+ m_decode.fpu |= (2ULL << wtl3132_device::S_IOCT);
+ break;
+ }
+ break;
+
+ case CONTROL:
+ m_state = WRITE;
+
+ switch (m_decode.control)
+ {
+ case 0x0: // sequential execution
break;
- case 0xb4:
- m_memptr = immediate;
- LOG("MEMPTR=0x%04x\n", m_memptr);
+ case 0x1: // unconditional branch
+ m_pc = m_decode.immediate;
break;
- case 0xb8:
- m_memptr_temp = immediate;
- LOG("MEMPTR_TMP=0x%04x\n", m_memptr_temp);
+ case 0x2: // branch fpu less than
+ if (m_fpu_c_latch)
+ m_pc = m_decode.immediate;
break;
- case 0xbc:
- branch = immediate;
- LOG("BRANCH=0x%04x\n", branch);
+ case 0x3: // branch fpu greater or equal
+ if (!m_fpu_c_latch)
+ m_pc = m_decode.immediate;
break;
- case 0xfc: // also clear interrupt?
- if (!m_int_state)
+ case 0x4: // unconditional call
+ m_stack[m_sp] = m_pc;
+ m_sp = (m_sp + 1) & 7;
+ m_pc = m_decode.immediate;
+ break;
+ case 0x5: // call fpu less than
+ if (m_fpu_c_latch)
{
- LOG("ge interrupt asserted\n");
- m_int_state = 1;
- m_int_cb(m_int_state);
+ m_stack[m_sp] = m_pc;
+ m_sp = (m_sp + 1) & 7;
+ m_pc = m_decode.immediate;
}
break;
- //case 0xfe: // set dma count?
- default:
- LOG("unknown pref 0x%02x\n", (field2 >> 32) & 0xfc);
+ case 0x6: // call fpu greater or equal
+ if (!m_fpu_c_latch)
+ {
+ m_stack[m_sp] = m_pc;
+ m_sp = (m_sp + 1) & 7;
+ m_pc = m_decode.immediate;
+ }
break;
- }
- }
-
- // increment memptr
- if (hq1_op & INCMEM)
- {
- m_memptr++;
- LOG("MEMPTR++\n");
- }
-
- // increment reptr
- if (hq1_op & INCRE)
- {
- m_reptr++;
- LOG("REPTR++\n");
- }
+ case 0x7: // return
+ m_sp = (m_sp + 7) & 7;
+ m_pc = m_stack[m_sp];
+ break;
+ case 0x8: // fetch
+ m_pc = (m_bus >> 31) & 0x1fe;
- // xx - source (re, fifo, ram, fpu)
- // x - increment reptr
- // x - field2
- // x - increment memptr
- // xx - destination (re, fetch, ram, fpu)
- // x - stall? (if fifo empty)
- // xxx - branch
-
- // 00xx xxxx -> ?
- // 01xx xxxx -> read fifo
- // 10xx xxxx -> read ram
- // 11xx xxxx -> read fpu
-
- u64 fpu_ctrl =
- (m_cwen ? wtl3132_device::M_CWEN : 0) |
- (2ULL << wtl3132_device::S_ENCN);
-
- // 43 - get fifo tag
- // 46 - get fifo data
- // 83 - stall?
- // generally reading the fifo causes stalls
- // 83 also causes a stall (because can't read code from data ram?
-
- switch (src)
- {
- case 0:
- m_bus = m_re_r(m_reptr);
- LOG("LOAD RE offset 0x%08x data 0x%08x\n", m_reptr, m_bus);
- break;
- case 1:
- m_bus = m_fifo_read();
- LOG("LOAD FIFO 0x%08x\n", m_bus);
- break;
- case 2:
- m_bus = space(AS_DATA).read_dword(m_memptr);
- LOG("LOAD MEM offset 0x%04x data 0x%08x\n", m_memptr, m_bus);
- break;
- case 3:
- // tells this instruction to write to the bus in two cycles from now
- LOG("FSTORE\n");
- fpu_ctrl |= (2ULL << wtl3132_device::S_IOCT);
- break;
- }
+ debugger_exception_hook(m_bus >> 32);
- // i/o dst
- switch (dst)
- {
- case 0:
- LOG("STORE RE offset 0x%02x data 0x%08x\n", m_reptr, m_bus);
- m_re_w(m_reptr, m_bus);
- break;
- case 1: // fetch
- if (stall)
- {
- m_pc = (m_bus >> 31) & 0x1fe;
- m_icount--;
- // skip pc update and fpu step?
- continue;
- }
- break;
- case 2:
- space(AS_DATA).write_dword(m_memptr, m_bus);
- LOG("STORE MEM offset 0x%02x data 0x%08x\n", m_memptr, m_bus);
- break;
- case 3:
- m_fpu->x_port_w(m_bus);
- fpu_ctrl |= (3ULL << wtl3132_device::S_IOCT);
- LOG("FLOAD 0x%08x\n", m_bus);
- break;
- }
+ if (VERBOSE & LOG_TOKEN)
+ {
+ auto const suppressor(machine().disable_side_effects());
+
+ u8 const token = m_bus >> 32;
+ char const *string = nullptr;
+
+ /*
+ * Magic numbers stored at specific data memory locations
+ * are used to identify specific microcode programs. Other
+ * variations may exist but are not known at this time.
+ */
+ if (space(1).read_dword(0x50b) == 0x004d0003)
+ {
+ if (token < ARRAY_LENGTH(token_puc))
+ string = token_puc[token];
+ }
+ else if (space(1).read_dword(0x50d) == 0x004d0005 || space(1).read_dword(0x536) == 0x12345678)
+ {
+ if (token < ARRAY_LENGTH(token_gl))
+ string = token_gl[token];
+ }
+ else if (token < ARRAY_LENGTH(token_diag))
+ string = token_diag[token];
+
+ if (string)
+ LOGMASKED(LOG_TOKEN, "fetch 0x%02x (%s)\n", token, string);
+ else
+ LOGMASKED(LOG_TOKEN, "fetch 0x%02x (unknown)\n", token);
+ }
+ else
+ LOG("fetch 0x%02x\n", m_bus >> 32);
- // hq1 branch
- if (hq1_op & FIELD2)
- {
- switch ((insn >> 29) & 7)
- {
- case 0: m_pc++; break;
- case 1:
- m_pc = branch;
- LOG("J 0x%04x\n", m_pc);
+ // neutralize previous instruction writeback
+ m_fpu->neut_w(0);
+ break;
+ case 0x9: // branch indirect
+ // TODO: verify value
+ m_pc = m_bus;
+ break;
+ case 0xa: // branch less than
+ if (BIT(m_bus, 31))
+ m_pc = m_decode.immediate;
break;
- case 2:
- if (m_fpu_c)
+ case 0xb: // branch greater or equal
+ if (!BIT(m_bus, 31))
+ m_pc = m_decode.immediate;
+ break;
+ case 0xc: // stall
+ LOG("stall\n");
+ suspend(SUSPEND_REASON_HALT, false);
+ m_icount = 0;
+ break;
+ case 0xd: // call less than
+ if (BIT(m_bus, 31))
{
- m_pc = branch;
- LOG("JC 0x%04x\n", m_pc);
+ m_stack[m_sp] = m_pc;
+ m_sp = (m_sp + 1) & 7;
+ m_pc = m_decode.immediate;
}
break;
- case 3:
- if (!m_fpu_c)
+ case 0xe: // call greater or equal
+ if (!BIT(m_bus, 31))
{
- m_pc = branch;
- LOG("JNC 0x%04x\n", m_pc);
+ m_stack[m_sp] = m_pc;
+ m_sp = (m_sp + 1) & 7;
+ m_pc = m_decode.immediate;
}
break;
- case 4:
- m_stack[m_sp] = m_pc + 1;
- m_sp = (m_sp + 1) & 7;
- m_pc = branch;
- LOG("CALL 0x%04x\n", m_pc);
+ case 0xf: // dma cycle
+ if (--m_dma_count)
+ m_pc -= m_decode.secondary ? 2 : 1;
break;
- case 5:
- if (m_fpu_z)
+ }
+ break;
+
+ case WRITE:
+ m_state = COMPLETE;
+
+ // store destination
+ switch (m_decode.destination)
+ {
+ case 0: // reptr
+ if (m_reptr == 0x20 && !m_re_rdy && !m_re_drq)
{
- m_pc = branch;
- LOG("JZ 0x%04x\n", m_pc);
+ // re write stall
+ m_state = WRITE;
+ m_icount = 0;
}
- break;
- case 6:
- if (!m_fpu_z)
+ else if (m_reptr > 0x20 && !m_re_rdy)
{
- m_pc = branch;
- LOG("JNZ 0x%04x\n", m_pc);
+ // re unbuffered register write stall
+ m_state = WRITE;
+ m_icount = 0;
}
+ else
+ m_re_w(m_reptr, m_bus);
break;
- case 7:
- m_sp = (m_sp + 7) & 7;
- m_pc = m_stack[m_sp];
- LOG("RET 0x%04x\n", m_pc);
+ case 1: // TODO: bus?
+ break;
+ case 2: // memptr
+ space(1).write_dword(m_memptr, m_bus);
+ break;
+ case 3: // fpu
+ m_fpu->x_port_w(m_bus);
+ m_decode.fpu |= (3ULL << wtl3132_device::S_IOCT);
break;
}
+ break;
+
+ case COMPLETE:
+ m_state = DECODE;
+
+ // restore memptr
+ if (m_memptr_temp & 0x8000)
+ {
+ m_memptr = m_memptr_temp & 0x7fff;
+ m_memptr_temp = 0;
+ }
+
+ // FIXME: fpu condition has additional 1 cycle latency
+ m_bus_latch = m_bus;
+ m_fpu_c_latch = m_fpu_c;
+
+ // fpu operation
+ m_fpu->c_port_w(m_decode.fpu);
+ m_fpu->clk_w(1);
+ m_fpu->neut_w(1);
+
+ m_icount--;
+ break;
+ }
+ }
+}
+
+void sgi_ge5_device::decode()
+{
+ // fetch primary word
+ u64 const primary = space(0).read_qword(m_pc + 0);
+
+ // decode primary word
+ m_decode.source = (primary >> 38) & 3;
+ m_decode.inc_reptr = BIT(primary, 37);
+ m_decode.secondary = BIT(primary, 36);
+ m_decode.inc_memptr = BIT(primary, 35);
+ m_decode.destination = (primary >> 33) & 3;
+ m_decode.control = (primary >> 29) & 0xf;
+
+ // decode fpu instruction
+ m_decode.fpu = ((primary & 0x1fff'f800ULL) << 5) | ((primary & 0x0000'07ffULL) << 2) | (2ULL << wtl3132_device::S_ENCN);
+ if (m_cwen)
+ m_decode.fpu |= wtl3132_device::M_CWEN;
+
+ // decode secondary word
+ if (m_decode.secondary)
+ {
+ u64 const secondary = space(0).read_qword(m_pc + 1);
+
+ m_decode.operation = (secondary >> 32) & 0xfe;
+ m_decode.immediate = (secondary >> 19) & 0x3fff;
+ }
+}
+
+void sgi_ge5_device::secondary(u64 bus)
+{
+ switch (m_decode.operation)
+ {
+ case 0x3c: // store register
+ switch (m_decode.immediate)
+ {
+ case 0: // TODO: store pcsave?
+ break;
+
+ case 1: // store memptr
+ m_bus = m_memptr;
+ break;
+
+ case 2: // store reptr
+ m_bus = m_reptr;
}
- else
- m_pc++;
+ break;
+
+ case 0x8c: // load reptr
+ m_reptr = m_bus & 0x3f;
+ break;
- // step fpu
- u64 const fpu = ((insn & 0x1fff'f800ULL) << 5) | ((insn & 0x0000'07ffULL) << 2);
+ case 0x90: // load memptr; set reptr
+ m_memptr = m_bus & 0x7fff;
+ m_reptr = m_decode.immediate & 0x3f;
+ break;
- m_fpu->c_port_w(fpu | fpu_ctrl);
- m_fpu->clk_w(1);
+ case 0x9c: // set reptr
+ m_reptr = m_decode.immediate & 0x3f;
+ break;
- m_icount--;
+ case 0xb0: // load memptr
+ m_memptr = bus & 0x7fff;
+ break;
+
+ case 0xb4: // set memptr
+ m_memptr = m_decode.immediate & 0x7fff;
+ break;
+
+ case 0xb6: // set memptr; set finish flag
+ m_memptr = m_decode.immediate & 0x7fff;
+ m_finish[m_decode.immediate & 1] = 1;
+ break;
+
+ case 0xb8: // set memptr_temp
+ m_memptr_temp = m_memptr | 0x8000;
+ m_memptr = m_decode.immediate & 0x7fff;
+ break;
+
+ case 0xbc: // nop?
+ break;
+
+ case 0xfc:
+ switch (m_decode.immediate)
+ {
+ case 0: // TODO: assert dma ready
+ break;
+
+ default: // assert interrupt
+ LOG("interrupt asserted\n");
+ set_int(true);
+ break;
+ }
+ break;
+
+ case 0xfe:
+ switch (m_decode.immediate)
+ {
+ case 0: // TODO: reset dma?
+ break;
+
+ default: // load dma count
+ m_dma_count = m_bus;
+ break;
+ }
+ break;
+
+ default:
+ logerror("unknown secondary operation 0x%02x\n", m_decode.operation);
+ break;
}
}
@@ -372,22 +576,19 @@ void sgi_ge5_device::command_w(offs_t offset, u16 data, u16 mem_mask)
switch (offset)
{
case 0x00: // clear stall
- //resume(SUSPEND_REASON_HALT);
- LOG("unstalled\n");
+ LOG("clear stall\n");
+ resume(SUSPEND_REASON_HALT);
+ debugger_exception_hook(0);
break;
- case 0x10: // setss
- case 0x20: // clearss
- case 0x30: // executess
+ case 0x10: // set single step
+ case 0x20: // clear single step
+ case 0x30: // execute single step
break;
- case 0x50: // clearintr
- if (m_int_state)
- {
- LOG("ge interrupt cleared\n");
- m_int_state = 0;
- m_int_cb(m_int_state);
- }
+ case 0x50: // clear interrupt
+ LOG("interrupt cleared\n");
+ set_int(false);
break;
}
}
@@ -395,7 +596,7 @@ void sgi_ge5_device::command_w(offs_t offset, u16 data, u16 mem_mask)
u32 sgi_ge5_device::code_r(offs_t offset)
{
m_pc = offset | offs_t(m_mar & 0x7f) << 8;
- u64 const data = space(AS_PROGRAM).read_qword(m_pc);
+ u64 const data = space(0).read_qword(m_pc);
return m_mar_msb ? u32(data >> 32) : u32(data);
}
@@ -404,106 +605,124 @@ void sgi_ge5_device::code_w(offs_t offset, u32 data, u32 mem_mask)
{
m_pc = offset | offs_t(m_mar & 0x7f) << 8;
- LOG("code_w msb %d offset 0x%08x data 0x%08x mask 0x%08x (%s)\n", m_mar_msb, m_pc, data, mem_mask, machine().describe_context());
+ LOGMASKED(LOG_MEMORY, "code_w msb %d offset 0x%08x data 0x%08x mask 0x%08x (%s)\n", m_mar_msb, m_pc, data, mem_mask, machine().describe_context());
if (m_mar_msb)
{
u64 const mask = u64(mem_mask & 0x000000ffU) << 32;
- space(AS_PROGRAM).write_qword(m_pc, u64(data) << 32, mask);
+ if (BIT(data, 8) && !BIT(data, 4))
+ {
+ // FIXME: this is required, but not very satisfactory
+ LOGMASKED(LOG_MEMORY, "correcting unset secondary instruction bit\n");
+ data |= 0x10;
+ }
+
+ space(0).write_qword(m_pc, u64(data) << 32, mask);
}
else
- space(AS_PROGRAM).write_qword(m_pc, data, mem_mask);
+ space(0).write_qword(m_pc, data, mem_mask);
}
u32 sgi_ge5_device::data_r(offs_t offset)
{
+ // FIXME: 5 or 6 bits from MAR?
m_memptr = offset | offs_t(m_mar & 0x1f) << 8;
- return space(AS_DATA).read_dword(m_memptr);
+ return space(1).read_dword(m_memptr);
}
void sgi_ge5_device::data_w(offs_t offset, u32 data, u32 mem_mask)
{
+ // FIXME: 5 or 6 bits from MAR?
m_memptr = offset | offs_t(m_mar & 0x1f) << 8;
- LOG("data_w offset 0x%08x data 0x%08x mask 0x%08x (%s)\n", m_memptr, data, mem_mask, machine().describe_context());
-
- space(AS_DATA).write_dword(m_memptr, data, mem_mask);
+ space(1).write_dword(m_memptr, data, mem_mask);
}
offs_t sgi_ge5_disassembler::disassemble(std::ostream &stream, offs_t pc, data_buffer const &opcodes, data_buffer const &params)
{
- std::string prefix = "";
std::string src, dst;
- u16 branch;
+ u16 immediate = 0;
+ u32 flags = 0;
- u64 const insn = opcodes.r64(pc);
+ u64 const primary = opcodes.r64(pc);
- if (BIT(insn, 36))
+ if (BIT(primary, 36))
{
- u64 const insn_prefix = opcodes.r64(pc + 1);
- u16 const immediate = (insn_prefix >> 19) & 0x7fff;
+ std::string prefix;
+
+ u64 const secondary = opcodes.r64(pc + 1);
+ u8 const opcode = (secondary >> 32) & 0xfe;
+ immediate = (secondary >> 19) & 0x3fff;
- switch ((insn_prefix >> 32) & 0xfc)
+ switch (opcode)
{
+ case 0x3c:
+ switch (immediate)
+ {
+ case 0: prefix = std::string("STORE PCSAVE"); break;
+ case 1: prefix = std::string("STORE MEMPTR"); break;
+ case 2: prefix = std::string("STORE REPTR"); break;
+ }
+ break;
case 0x8c: prefix = std::string("LOAD REPTR"); break;
- case 0x9c: prefix = util::string_format("REPTR=%04x", immediate); break;
- case 0xb0: prefix = std::string("LOAD MEMPTR"); branch = immediate; break;
- case 0xb4: prefix = util::string_format("MEMPTR=%04x", immediate); break;
- case 0xb8: prefix = util::string_format("MEMPTR_TEMP=%04x", immediate); break;
- case 0xbc: branch = immediate; break;
- case 0xfc: prefix = std::string("SET_INT"); break;
- //case 0xfe: // set dma count?
+ case 0x8e: prefix = std::string("LOAD MEMPTR"); break;
+ case 0x90: prefix = util::string_format("LOAD MEMPTR; SET REPTR,0x%04x", immediate); break;
+ case 0x9c: prefix = util::string_format("SET REPTR,0x%04x", immediate); break;
+ case 0xb0: prefix = std::string("LOAD MEMPTR"); break;
+ case 0xb4: prefix = util::string_format("SET MEMPTR,0x%04x", immediate); break;
+ case 0xb6: prefix = util::string_format("SET MEMPTR,0x%04x; SET FF%d", immediate, immediate & 1); break;
+ case 0xb8: prefix = util::string_format("SET MEMPTR_TEMP,0x%04x", immediate); break;
+ case 0xbc: break;
+ case 0xfc: prefix = immediate ? std::string("SET INT") : std::string("SET DMARDY"); break;
+ case 0xfe: prefix = immediate ? std::string("LOAD DMACNT") : std::string("RESET DMA"); break;
}
- }
- u8 const hq1_op = (insn >> 32) & 0xff;
+ if (!prefix.empty())
+ stream << prefix << "; ";
+ }
- // pre-increment memptr
- //if (BIT(hq1_op, 3))
- // ;
+ u8 const opcode = (primary >> 32) & 0xff;
- // pre-increment reptr
- //if (BIT(hq1_op, 5))
- // ;
+ u64 fpu_ctrl = 0; // ENCN=0, IOCT=0
- // xx - source (?, fifo, ram, fpu)
- // x - increment reptr
- // x - ?
- // x - increment memptr
- // xxx - destination (re, ?, bus, stall?, ram, ?, fpu, ?)
+ switch ((primary >> 29) & 0xf)
+ {
+ case 2:
+ case 3:
+ case 5:
+ case 6:
+ fpu_ctrl |= 0x2'0000'0000; // ENCN=2
+ break;
+ }
- // 00xx xxxx -> ?
- // 01xx xxxx -> read fifo
- // 10xx xxxx -> read ram
- // 11xx xxxx -> read fpu
+ // fstore
+ if (((primary >> 38) & 3) == 3)
+ fpu_ctrl |= 0x8000'0000;
- u64 fpu_ctrl = 0x2'8000'0000; // ENCN=2, IOCT=2
+ // fload
+ if (((primary >> 33) & 3) == 3)
+ fpu_ctrl |= 0xc000'0000;
- switch (hq1_op >> 6)
+ switch (opcode >> 6)
{
- case 0: src = std::string("0?"); break;
- case 1: src = std::string("fifo"); break;
- case 2: src = std::string("bus"); break;
- case 3: src = std::string("fpu"); break; // IOCT=2
+ case 0: src = std::string("RE"); break;
+ case 1: src = std::string("FIFO"); break;
+ case 2: src = std::string("MEM"); break;
+ case 3: src = std::string("FPU"); break;
}
- // i/o dst
- switch (hq1_op & 7)
+ switch ((opcode >> 1) & 3)
{
- case 0: dst = std::string("REPTR"); break;
- case 1: dst = std::string("1?"); break;
- case 2: dst = std::string("bus?"); break;
- case 3: dst = std::string("stall?"); break;
- case 4: dst = std::string("MEMPTR"); break;
- case 5: dst = std::string("5?"); break;
- case 6: dst = std::string("FPU"); fpu_ctrl |= 0x4000'0000; break; // fpu IOCT=3
- case 7: dst = std::string("7?"); break;
+ case 0: dst = std::string("RE"); break;
+ case 1: dst = std::string("BUS"); break;
+ case 2: dst = std::string("MEM"); break;
+ case 3: dst = std::string("FPU"); break;
}
- std::string fpu = wtl3132_device::disassemble(
- bitswap<34>((insn & 0x0fff'ffff) | fpu_ctrl,
+ stream << wtl3132_device::disassemble(
+ bitswap<34>((primary & 0x0fff'ffff) | fpu_ctrl,
28, 27, 26, // f
25, 24, 23, 22, 21, // aadd
20, 19, 18, 17, 16, // badd
@@ -514,20 +733,37 @@ offs_t sgi_ge5_disassembler::disassemble(std::ostream &stream, offs_t pc, data_b
5, 4, 3, // abin
2, 1, // adst
0, // mbin
- 33, 32)); // encn*
+ 33, 32)) // encn*
+ << "; ";
+
+ switch ((primary >> 29) & 0x140)
+ {
+ case 0x040: stream << std::string("MEMPTR++; "); break;
+ case 0x100: stream << std::string("REPTR++; "); break;
+ case 0x140: stream << std::string("MEMPTR++; REPTR++; "); break;
+ }
+
+ stream << util::string_format("R:%s; W:%s", src, dst);
- // hq1 branch
- switch ((insn >> 29) & 7)
+ // branch
+ switch ((primary >> 29) & 0xf)
{
- case 0: util::stream_format(stream, "%s; %s; R:%s, W:%s", prefix, fpu, src, dst); break;
- case 1: util::stream_format(stream, "%s; %s; R:%s, W:%s; J:%04x", prefix, fpu, src, dst, branch); break;
- case 2: util::stream_format(stream, "%s; %s; R:%s, W:%s; JC:%04x", prefix, fpu, src, dst, branch); break;
- case 3: util::stream_format(stream, "%s; %s; R:%s, W:%s; JNC:%04x", prefix, fpu, src, dst, branch); break;
- case 4: util::stream_format(stream, "%s; %s; R:%s, W:%s; CALL:%04x", prefix, fpu, src, dst, branch); break;
- case 5: util::stream_format(stream, "%s; %s; R:%s, W:%s; JZ:%04x", prefix, fpu, src, dst, branch); break;
- case 6: util::stream_format(stream, "%s; %s; R:%s, W:%s; JNZ:%04x", prefix, fpu, src, dst, branch); break;
- case 7: util::stream_format(stream, "%s; %s; R:%s, W:%s; RET", prefix, fpu, src, dst); break;
+ case 0x1: stream << util::string_format("; BRA 0x%04x", immediate); break;
+ case 0x2: stream << util::string_format("; BLTF 0x%04x", immediate); break;
+ case 0x3: stream << util::string_format("; BGEF 0x%04x", immediate); break;
+ case 0x4: stream << util::string_format("; CALL 0x%04x", immediate); flags = STEP_OVER; break;
+ case 0x5: stream << util::string_format("; CLTF 0x%04x", immediate); flags = STEP_OVER; break;
+ case 0x6: stream << util::string_format("; CGEF 0x%04x", immediate); flags = STEP_OVER; break;
+ case 0x7: stream << "; RET"; flags = STEP_OUT; break;
+ case 0x8: stream << "; FETCH"; break;
+ case 0x9: stream << util::string_format("; BRI 0x%04x", immediate); break;
+ case 0xa: stream << util::string_format("; BLT 0x%04x", immediate); break;
+ case 0xb: stream << util::string_format("; BGE 0x%04x", immediate); break;
+ case 0xc: stream << "; STALL"; break;
+ case 0xd: stream << util::string_format("; CLT 0x%04x", immediate); flags = STEP_OVER; break;
+ case 0xe: stream << util::string_format("; CGE 0x%04x", immediate); flags = STEP_OVER; break;
+ case 0xf: stream << "; DMA?"; flags = STEP_OVER; break;
}
- return BIT(insn, 36) ? 2 : 1;
+ return SUPPORTED | flags | (BIT(primary, 36) ? 2 : 1);
}
diff --git a/src/mame/video/sgi_ge5.h b/src/mame/video/sgi_ge5.h
index 91cf029a211..95ca695ef66 100644
--- a/src/mame/video/sgi_ge5.h
+++ b/src/mame/video/sgi_ge5.h
@@ -13,10 +13,14 @@ class sgi_ge5_device : public cpu_device
public:
sgi_ge5_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
+ // host interface
auto out_int() { return m_int_cb.bind(); }
auto fifo_empty() { return m_fifo_empty.bind(); }
auto fifo_read() { return m_fifo_read.bind(); }
+ // raster engine interface
+ void re_rdy_w(int state) { m_re_rdy = bool(state); }
+ void re_drq_w(int state) { m_re_drq = bool(state); }
auto re_r() { return m_re_r.bind(); }
auto re_w() { return m_re_w.bind(); }
@@ -49,10 +53,25 @@ public:
void mar_msb_w(offs_t offset, u32 data, u32 mem_mask) { m_mar_msb = bool(offset); }
void cwen_w(int state) { m_cwen = bool(state); }
+ u32 finish_r(offs_t offset) { return m_finish[offset]; }
+ void finish_w(offs_t offset, u32 data, u32 mem_mask) { m_finish[offset] = data; }
+
protected:
void code_map(address_map &map);
void data_map(address_map &map);
+ void decode();
+ void secondary(u64 bus);
+
+ void set_int(bool state)
+ {
+ if (state != m_int_state)
+ {
+ m_int_state = state;
+ m_int_cb(m_int_state);
+ }
+ }
+
private:
// device configuration state
address_space_config m_code_config;
@@ -61,8 +80,6 @@ private:
required_device<wtl3132_device> m_fpu;
devcb_write_line m_int_cb;
- int m_int_state;
-
devcb_read_line m_fifo_empty;
devcb_read64 m_fifo_read;
devcb_read32 m_re_r;
@@ -70,27 +87,57 @@ private:
// runtime state
int m_icount;
+ enum ge5_state : unsigned
+ {
+ DECODE, // fetch and decode instruction, update pointers
+ READ, // read source
+ CONTROL, // flow control
+ WRITE, // write destination
+ COMPLETE, // cycle fpu and complete
+ }
+ m_state;
+
+ // line state
+ bool m_int_state;
+ bool m_cwen;
+ bool m_fpu_c;
+ bool m_re_rdy;
+ bool m_re_drq;
- // cpu state
- bool m_fetch;
+ // hq1 registers
+ bool m_mar_msb;
+ u8 m_mar;
u16 m_pc;
unsigned m_sp;
u16 m_stack[8];
-
+ u8 m_reptr;
u16 m_memptr;
u16 m_memptr_temp;
- u8 m_reptr;
u16 m_dma_count;
-
+ u32 m_finish[2];
+
+ // decoded instruction
+ struct ge5_decode
+ {
+ // primary
+ unsigned source;
+ bool inc_reptr;
+ bool secondary;
+ bool inc_memptr;
+ unsigned destination;
+ unsigned control;
+ u64 fpu;
+
+ // secondary
+ u8 operation;
+ u16 immediate;
+ }
+ m_decode;
+
+ // dynamic state
u64 m_bus;
-
- u8 m_mar;
- bool m_mar_msb;
-
- int m_fpu_c;
- int m_fpu_z;
-
- bool m_cwen;
+ u64 m_bus_latch;
+ bool m_fpu_c_latch;
};
class sgi_ge5_disassembler : public util::disasm_interface
diff --git a/src/mame/video/sgi_gr1.cpp b/src/mame/video/sgi_gr1.cpp
index cd29fe65f61..264c52d18a6 100644
--- a/src/mame/video/sgi_gr1.cpp
+++ b/src/mame/video/sgi_gr1.cpp
@@ -37,11 +37,23 @@
* - http://archive.irix.cc/sgistuff/hardware/graphics/eclipse.html
*
* TODO:
- * - ge5/hq1
- * - raster engine
- * - dma
+ * - host dma
+ * - display registers
+ * - save state
* - slotify (SGI, MCA, ISA)
- * - everything else
+ * - separate raster and display systems?
+ */
+/*
+ * Irix 4.0.5 IDE WIP
+ *
+ * usage: buffon; ge5load; <test>; gr_exit; buffoff
+ *
+ * these diagnostics fail (all others pass):
+ * bitp - options not detected
+ * ctl2 - graphics strobe
+ * gedma - ge5 failed to finish
+ * re - fails line drawing test
+ * redma - ge5 failed to finish
*/
#include "emu.h"
@@ -54,31 +66,30 @@
#include "logmacro.h"
-DEFINE_DEVICE_TYPE(SGI_GR11, sgi_gr11_device, "sgi_gr11", "SGI GR1.1 Graphics")
-DEFINE_DEVICE_TYPE(SGI_GR12, sgi_gr12_device, "sgi_gr12", "SGI GR1.2 Graphics")
+DEFINE_DEVICE_TYPE(SGI_GR1, sgi_gr1_device, "sgi_gr1", "SGI GR1 Graphics")
-sgi_gr1_device::sgi_gr1_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock)
- : device_t(mconfig, type, tag, owner, clock)
+sgi_gr1_device::sgi_gr1_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, SGI_GR1, tag, owner, clock)
, m_screen(*this, "screen")
- , m_re(*this, "re2")
, m_ge(*this, "ge5")
+ , m_re(*this, "re2")
+ , m_xmap(*this, "xmap%u", 0U)
, m_cursor(*this, "cursor%u", 0U)
+ , m_ramdac(*this, "ramdac%u", 0U)
, m_vblank_cb(*this)
, m_int_fifo_cb(*this)
{
}
-sgi_gr11_device::sgi_gr11_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
- : sgi_gr1_device(mconfig, SGI_GR11, tag, owner, clock)
- , m_ramdac(*this, "ramdac")
-{
-}
-
-sgi_gr12_device::sgi_gr12_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
- : sgi_gr1_device(mconfig, SGI_GR12, tag, owner, clock)
- , m_ramdac(*this, "ramdac%u", 0U)
-{
-}
+static INPUT_PORTS_START(sgi_gr1)
+ PORT_START("options")
+ PORT_DIPNAME(0x08, 0x08, "Turbo")
+ PORT_DIPSETTING(0x00, DEF_STR(Yes))
+ PORT_DIPSETTING(0x08, DEF_STR(No))
+ PORT_DIPNAME(0x10, 0x00, "Z Buffer")
+ PORT_DIPSETTING(0x00, DEF_STR(Yes))
+ PORT_DIPSETTING(0x10, DEF_STR(No))
+INPUT_PORTS_END
void sgi_gr1_device::map(address_map &map)
{
@@ -86,11 +97,27 @@ void sgi_gr1_device::map(address_map &map)
map(0x0000, 0x03ff).rw(m_ge, FUNC(sgi_ge5_device::code_r), FUNC(sgi_ge5_device::code_w));
+ map(0x0400, 0x041f).rw(m_xmap[0], FUNC(sgi_xmap2_device::reg_r), FUNC(sgi_xmap2_device::reg_w)).umask32(0x000000ff);
+ map(0x0420, 0x043f).rw(m_xmap[1], FUNC(sgi_xmap2_device::reg_r), FUNC(sgi_xmap2_device::reg_w)).umask32(0x000000ff);
+ map(0x0440, 0x045f).rw(m_xmap[2], FUNC(sgi_xmap2_device::reg_r), FUNC(sgi_xmap2_device::reg_w)).umask32(0x000000ff);
+ map(0x0460, 0x047f).rw(m_xmap[3], FUNC(sgi_xmap2_device::reg_r), FUNC(sgi_xmap2_device::reg_w)).umask32(0x000000ff);
+ map(0x0480, 0x049f).rw(m_xmap[4], FUNC(sgi_xmap2_device::reg_r), FUNC(sgi_xmap2_device::reg_w)).umask32(0x000000ff);
+ map(0x04a0, 0x04bf).lw8("xmap_broadcast",
+ [this](offs_t offset, u8 data)
+ {
+ for (sgi_xmap2_device *xmap : m_xmap)
+ xmap->reg_w(offset, data);
+ }).umask32(0x000000ff);
+
map(0x04c0, 0x04c3).rw(FUNC(sgi_gr1_device::dr1_r), FUNC(sgi_gr1_device::dr1_w)).umask32(0xff000000);
map(0x04e0, 0x04e3).rw(FUNC(sgi_gr1_device::dr0_r), FUNC(sgi_gr1_device::dr0_w)).umask32(0xff000000);
- map(0x0560, 0x056f).m(m_cursor[0], FUNC(bt431_device::map)).umask32(0xff000000);
- map(0x0580, 0x058f).m(m_cursor[1], FUNC(bt431_device::map)).umask32(0xff000000);
+ map(0x0500, 0x050f).m(m_ramdac[0], FUNC(bt457_device::map)).umask32(0x000000ff);
+ map(0x0520, 0x052f).m(m_ramdac[1], FUNC(bt457_device::map)).umask32(0x000000ff);
+ map(0x0540, 0x054f).m(m_ramdac[2], FUNC(bt457_device::map)).umask32(0x000000ff);
+
+ map(0x0560, 0x056f).m(m_cursor[0], FUNC(bt431_device::map)).umask32(0x000000ff);
+ map(0x0580, 0x058f).m(m_cursor[1], FUNC(bt431_device::map)).umask32(0x000000ff);
map(0x05a0, 0x05a3).rw(FUNC(sgi_gr1_device::dr4_r), FUNC(sgi_gr1_device::dr4_w)).umask32(0xff000000);
map(0x05c0, 0x05c3).rw(FUNC(sgi_gr1_device::dr3_r), FUNC(sgi_gr1_device::dr3_w)).umask32(0xff000000);
@@ -99,46 +126,14 @@ void sgi_gr1_device::map(address_map &map)
map(0x0640, 0x783).w(m_ge, FUNC(sgi_ge5_device::command_w)).umask32(0xffff0000);
map(0x0740, 0x743).r(m_ge, FUNC(sgi_ge5_device::pc_r)).umask32(0xffff0000);
- map(0x0800, 0x0bff).w(FUNC(sgi_gr1_device::fifo_w));
+ map(0x0800, 0x0bff).rw(FUNC(sgi_gr1_device::fifo_r), FUNC(sgi_gr1_device::fifo_w));
map(0x0c00, 0x0dff).w(m_ge, FUNC(sgi_ge5_device::mar_w));
map(0x0e00, 0x0e07).w(m_ge, FUNC(sgi_ge5_device::mar_msb_w));
map(0x1400, 0x17ff).rw(m_ge, FUNC(sgi_ge5_device::data_r), FUNC(sgi_ge5_device::data_w));
- map(0x2000, 0x2007).lrw32("ff",
- [this](offs_t offset) { LOG("read finish flag %d\n", offset); return m_ff[offset]; },
- [this](offs_t offset, u32 data, u32 mem_mask) { LOG("write finish flag %d data %d\n", offset, data); m_ff[offset] = data; });
- //map(0x207c, 0x207f); // gr1 vs gr2
-}
+ map(0x2000, 0x2007).rw(m_ge, FUNC(sgi_ge5_device::finish_r), FUNC(sgi_ge5_device::finish_w));
-void sgi_gr11_device::map(address_map &map)
-{
- sgi_gr1_device::map(map);
-
- map(0x0510, 0x0517).rw(FUNC(sgi_gr11_device::xpc1_r<0>), FUNC(sgi_gr11_device::xpc1_w<0>)).umask32(0x000000ff);
- map(0x0530, 0x0537).rw(FUNC(sgi_gr11_device::xpc1_r<1>), FUNC(sgi_gr11_device::xpc1_w<1>)).umask32(0x000000ff);
- map(0x0550, 0x0557).rw(FUNC(sgi_gr11_device::xpc1_r<2>), FUNC(sgi_gr11_device::xpc1_w<2>)).umask32(0x000000ff);
- map(0x0570, 0x0577).rw(FUNC(sgi_gr11_device::xpc1_r<3>), FUNC(sgi_gr11_device::xpc1_w<3>)).umask32(0x000000ff);
- map(0x0590, 0x0597).rw(FUNC(sgi_gr11_device::xpc1_r<4>), FUNC(sgi_gr11_device::xpc1_w<4>)).umask32(0x000000ff);
-
- map(0x05b0, 0x05b7).w(FUNC(sgi_gr11_device::xpc1_bc_w)).umask32(0x000000ff);
-
- map(0x05d0, 0x05df).m(m_ramdac, FUNC(bt458_device::map));
-}
-
-void sgi_gr12_device::map(address_map &map)
-{
- sgi_gr1_device::map(map);
-
- map(0x0400, 0x041f).rw(FUNC(sgi_gr12_device::xmap2_r<0>), FUNC(sgi_gr12_device::xmap2_w<0>)).umask32(0x000000ff);
- map(0x0420, 0x043f).rw(FUNC(sgi_gr12_device::xmap2_r<1>), FUNC(sgi_gr12_device::xmap2_w<1>)).umask32(0x000000ff);
- map(0x0440, 0x045f).rw(FUNC(sgi_gr12_device::xmap2_r<2>), FUNC(sgi_gr12_device::xmap2_w<2>)).umask32(0x000000ff);
- map(0x0460, 0x047f).rw(FUNC(sgi_gr12_device::xmap2_r<3>), FUNC(sgi_gr12_device::xmap2_w<3>)).umask32(0x000000ff);
- map(0x0480, 0x049f).rw(FUNC(sgi_gr12_device::xmap2_r<4>), FUNC(sgi_gr12_device::xmap2_w<4>)).umask32(0x000000ff);
- map(0x04a0, 0x04bf).w(FUNC(sgi_gr12_device::xmap2_bc_w)).umask32(0x000000ff);
-
- map(0x0500, 0x050f).m(m_ramdac[0], FUNC(bt457_device::map)).umask32(0x000000ff);
- map(0x0520, 0x052f).m(m_ramdac[1], FUNC(bt457_device::map)).umask32(0x000000ff);
- map(0x0540, 0x054f).m(m_ramdac[2], FUNC(bt457_device::map)).umask32(0x000000ff);
+ //map(0x207c, 0x207f); // gr1 vs gr2
}
void sgi_gr1_device::device_add_mconfig(machine_config &config)
@@ -164,35 +159,37 @@ void sgi_gr1_device::device_add_mconfig(machine_config &config)
*/
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(pixel_clock, 1680, 246, 246 + 1280, 1065, 39, 39 + 1024);
- m_screen->set_screen_update(FUNC(sgi_gr1_device::screen_update));
+ m_screen->set_screen_update(m_re.finder_tag(), FUNC(sgi_re2_device::screen_update));
m_screen->screen_vblank().set([this](int state) { m_vblank_cb(state); });
- SGI_RE2(config, m_re, 0);
-
SGI_GE5(config, m_ge, 10_MHz_XTAL);
m_ge->fifo_empty().set([this]() { return int(m_fifo.empty()); });
- m_ge->fifo_read().set([this]() { return m_fifo.dequeue(); });
+ m_ge->fifo_read().set(FUNC(sgi_gr1_device::ge_fifo_r));
m_ge->re_r().set(m_re, FUNC(sgi_re2_device::reg_r));
m_ge->re_w().set(m_re, FUNC(sgi_re2_device::reg_w));
+ SGI_RE2(config, m_re, 0);
+ m_re->out_rdy().set(m_ge, FUNC(sgi_ge5_device::re_rdy_w));
+ m_re->out_drq().set(m_ge, FUNC(sgi_ge5_device::re_drq_w));
+
+ SGI_XMAP2(config, m_xmap[0], pixel_clock / 5);
+ SGI_XMAP2(config, m_xmap[1], pixel_clock / 5);
+ SGI_XMAP2(config, m_xmap[2], pixel_clock / 5);
+ SGI_XMAP2(config, m_xmap[3], pixel_clock / 5);
+ SGI_XMAP2(config, m_xmap[4], pixel_clock / 5);
+
BT431(config, m_cursor[0], pixel_clock / 5);
BT431(config, m_cursor[1], pixel_clock / 5);
-}
-
-void sgi_gr11_device::device_add_mconfig(machine_config &config)
-{
- sgi_gr1_device::device_add_mconfig(config);
- BT458(config, m_ramdac, 107'352'000);
+ BT457(config, m_ramdac[0], pixel_clock);
+ BT457(config, m_ramdac[1], pixel_clock);
+ BT457(config, m_ramdac[2], pixel_clock);
}
-void sgi_gr12_device::device_add_mconfig(machine_config &config)
-{
- sgi_gr1_device::device_add_mconfig(config);
- BT457(config, m_ramdac[0], 107'352'000);
- BT457(config, m_ramdac[1], 107'352'000);
- BT457(config, m_ramdac[2], 107'352'000);
+ioport_constructor sgi_gr1_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(sgi_gr1);
}
void sgi_gr1_device::device_start()
@@ -201,272 +198,74 @@ void sgi_gr1_device::device_start()
m_int_fifo_cb.resolve_safe();
//save_item(NAME());
-}
-void sgi_gr11_device::device_start()
-{
- sgi_gr1_device::device_start();
-}
-
-void sgi_gr12_device::device_start()
-{
- sgi_gr1_device::device_start();
-
- m_vram = std::make_unique<u32[]>(1280 * 1024);
+ m_reset = true;
}
void sgi_gr1_device::device_reset()
{
- //m_dr0 = DR0_ZBIN;
- //m_dr2 = DR2_BPIN;
- //m_dr3 = DR3_MS;
- m_dr4 = 0;
+ m_dr0 = DR0_GRF1EN | DR0_SMALLMON0;
+ m_dr1 = DR1_TURBO;
+ //m_dr2 = 0;
+ //m_dr3 = DR3_FIFOFULL;
+ m_dr4 = DR4_MEGOPT;
m_fifo.clear();
}
-void sgi_gr11_device::device_reset()
+void sgi_gr1_device::dr4_w(u8 data)
{
- sgi_gr1_device::device_reset();
-}
+ LOG("dr4_w 0x%02x\n", data);
-void sgi_gr12_device::device_reset()
-{
- sgi_gr1_device::device_reset();
+ m_dr4 = (m_dr4 & ~DR4_WM) | (data & DR4_WM);
- //m_dr0 &= ~DR0_ZBIN;
- //m_dr2 &= ~DR2_BPIN;
+ for (sgi_xmap2_device *xmap : m_xmap)
+ xmap->map_select_w(m_dr4 & DR4_MS);
}
-u32 sgi_gr11_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect)
+u64 sgi_gr1_device::ge_fifo_r()
{
- /*
- * fb_pixel (8) bits, cursor (2 bits), pup (2 bits), wid (2 bits)
- *
- * iterate through 5 xpc1 channels
- * mode = xpc1[channel][wid]
- *
- */
+ u64 data = m_fifo.dequeue();
- return 0;
-}
+ if (m_fifo.empty())
+ m_dr3 &= DR3_FIFOEMPTY;
-u32 sgi_gr12_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect)
-{
- // TODO: underlay
-
- unsigned offset = 0;
-
- for (unsigned y = screen.visible_area().min_y; y <= screen.visible_area().max_y; y++)
- for (unsigned x = screen.visible_area().min_x; x <= screen.visible_area().max_x; x += 5)
- for (unsigned c = 0; c < 5; c++)
- {
- u8 const overlay = (m_cursor[0]->cur_r(x + c, y) ? 1 : 0) | (m_cursor[1]->cur_r(x + c, y) ? 2 : 0);
- u32 const data = m_vram[offset++];
- u16 const mode = m_xmap2[c].mode[data >> 28];
-
- switch (mode & 0x07)
- {
- case 0: // 8 bit ci single buffer
- {
- u16 const ci = BIT(mode, 9) ? (mode & 0x0f00) | u8(data) : u8(data);
- rgb_t const cm = m_xmap2[c].color[(m_dr4 & DR4_MS) ? ci | 0x1000 : ci];
-
- bitmap.pix(y, x) = rgb_t(
- m_ramdac[0]->lookup(cm.r(), overlay),
- m_ramdac[1]->lookup(cm.g(), overlay),
- m_ramdac[2]->lookup(cm.b(), overlay));
- }
- break;
-
- case 1: // 4 bit ci double buffer
- {
- u8 const fb = BIT(mode, 3) ? u8(data) >> 4 : data & 0x0f;
- u16 const ci = BIT(mode, 9) ? (mode & 0x0f00) | fb : fb;
- rgb_t const cm = m_xmap2[c].color[(m_dr4 & DR4_MS) ? ci | 0x1000 : ci];
-
- bitmap.pix(y, x) = rgb_t(
- m_ramdac[0]->lookup(cm.r(), overlay),
- m_ramdac[1]->lookup(cm.g(), overlay),
- m_ramdac[2]->lookup(cm.b(), overlay));
- }
- break;
-
- case 2: // 12 bit ci double buffer
- {
- u8 const fb = u16(BIT(mode, 3) ? data >> 12 : data) & 0x0fff;
- u16 const ci = BIT(mode, 9) ? (mode & 0x0f00) | (fb & 0xff) : fb;
- rgb_t const cm = m_xmap2[c].color[(m_dr4 & DR4_MS) ? ci | 0x1000 : ci];
-
- bitmap.pix(y, x) = rgb_t(
- m_ramdac[0]->lookup(cm.r(), overlay),
- m_ramdac[1]->lookup(cm.g(), overlay),
- m_ramdac[2]->lookup(cm.b(), overlay));
- }
- break;
-
- case 4: // 24 bit rgb single buffer
- bitmap.pix(y, x) = rgb_t(
- m_ramdac[0]->lookup(u8(data >> 0), overlay),
- m_ramdac[1]->lookup(u8(data >> 8), overlay),
- m_ramdac[2]->lookup(u8(data >> 16), overlay));
- break;
-
- case 5: // 12 bit rgb double buffer
- bitmap.pix(y, x) = BIT(mode, 3) ?
- rgb_t(
- m_ramdac[0]->lookup((u8(data >> 0) & 0xf0) | (u8(data >> 4) & 0x0f), overlay),
- m_ramdac[1]->lookup((u8(data >> 8) & 0xf0) | (u8(data >> 12) & 0x0f), overlay),
- m_ramdac[2]->lookup((u8(data >> 16) & 0xf0) | (u8(data >> 20) & 0x0f), overlay)) :
- rgb_t(
- m_ramdac[0]->lookup((u8(data << 4) & 0xf0) | (u8(data >> 0) & 0x0f), overlay),
- m_ramdac[1]->lookup((u8(data >> 4) & 0xf0) | (u8(data >> 8) & 0x0f), overlay),
- m_ramdac[2]->lookup((u8(data >> 12) & 0xf0) | (u8(data >> 16) & 0x0f), overlay));
- break;
- }
- }
-
- return 0;
+ if (!(m_dr3 & DR3_FIFOFULL) && (m_fifo.queue_length() <= 256))
+ {
+ m_dr3 |= DR3_FIFOFULL;
+ m_int_fifo_cb(CLEAR_LINE);
+ }
+
+ return data;
}
void sgi_gr1_device::fifo_w(offs_t offset, u32 data, u32 mem_mask)
{
- if (m_fifo.full())
- fatalerror("fifo_w: fifo overflow (%s)", machine().describe_context().c_str());
-
LOG("fifo_w 0x%010x\n", (u64(offset) << 32) | data);
m_fifo.enqueue((u64(offset) << 32) | data);
- if (m_fifo.queue_length() > 256)
+ if (!(m_dr3 & DR3_FIFOEMPTY))
+ m_dr3 |= DR3_FIFOEMPTY;
+
+ if ((m_dr3 & DR3_FIFOFULL) && (m_fifo.queue_length() > 256))
+ {
+ m_dr3 &= ~DR3_FIFOFULL;
m_int_fifo_cb(ASSERT_LINE);
+ }
- //if (m_ge->suspended())
- // m_ge->resume(SUSPEND_REASON_HALT);
+ if (m_ge->suspended())
+ m_ge->resume(SUSPEND_REASON_TRIGGER);
}
void sgi_gr1_device::reset_w(int state)
{
- if (state)
+ if (!m_reset && !state)
{
- LOG("reset_w %d\n", state);
+ LOG("reset_w %d (%s)\n", state, machine().describe_context());
m_ge->pulse_input_line(INPUT_LINE_RESET, attotime::from_ticks(1, 10_MHz_XTAL));
+ m_re->reset();
}
-}
-
-template <unsigned Channel> u8 sgi_gr12_device::xmap2_r(offs_t offset)
-{
- xmap2 const x = m_xmap2[Channel];
-
- switch (offset)
- {
- case 0: // nop
- break;
-
- case 1: // blue data
- if (x.addr & 0x1000)
- return x.color[(m_dr4 & DR4_MS) ? x.addr : (x.addr & 0xfff)].b();
- else if (x.addr < 0x10)
- return x.overlay[x.addr].b();
- break;
-
- case 2: // green data
- if (x.addr & 0x1000)
- return x.color[(m_dr4 & DR4_MS) ? x.addr : (x.addr & 0xfff)].g();
- else if (x.addr < 0x10)
- return x.overlay[x.addr].g();
- break;
-
- case 3: // red data
- if (x.addr & 0x1000)
- return x.color[(m_dr4 & DR4_MS) ? x.addr : (x.addr & 0xfff)].r();
- else if (x.addr < 0x10)
- return x.overlay[x.addr].r();
- break;
-
- case 4: // increment address
- // TODO: should reading increment the address register?
- //x.addr = (x.addr + 1) & 0x1fff;
- LOG("read address increment\n");
- break;
-
- case 5: // other data
- if (x.addr < 0x20)
- {
- u16 const mode = x.mode[(x.addr >> 1) & 0xf];
-
- return BIT(x.addr, 0) ? (mode >> 8) : u8(mode);
- }
- else if (x.addr == 0x20)
- return x.wid_aux;
- else if (x.addr == 0x21)
- return 0x18; // z-buffer and bit-plane expansion not present?
- break;
-
- case 6: // address msb
- return x.addr >> 8;
-
- case 7: // address lsb
- return u8(x.addr);
- }
-
- return 0;
-}
-template <unsigned Channel> void sgi_gr12_device::xmap2_w(offs_t offset, u8 data)
-{
- xmap2 &x = m_xmap2[Channel];
-
- switch (offset)
- {
- case 0: // nop
- break;
-
- case 1: // blue data
- if (x.addr & 0x1000)
- x.color[(m_dr4 & DR4_MS) ? x.addr : (x.addr & 0xfff)].set_b(data);
- else if (x.addr < 0x10)
- x.overlay[x.addr].set_b(data);
- break;
-
- case 2: // green data
- if (x.addr & 0x1000)
- x.color[(m_dr4 & DR4_MS) ? x.addr : (x.addr & 0xfff)].set_g(data);
- else if (x.addr < 0x10)
- x.overlay[x.addr].set_g(data);
- break;
-
- case 3: // red data
- if (x.addr & 0x1000)
- x.color[(m_dr4 & DR4_MS) ? x.addr : (x.addr & 0xfff)].set_r(data);
- else if (x.addr < 0x10)
- x.overlay[x.addr].set_r(data);
- break;
-
- case 4: // increment address
- x.addr = (x.addr + 1) & 0x1fff;
- break;
-
- case 5: // other data
- if (x.addr < 0x20)
- {
- u16 &mode = x.mode[(x.addr >> 1) & 0xf];
-
- if (BIT(x.addr, 0))
- mode = (u16(data & 0x3f) << 8) | (mode & 0x00ff);
- else
- mode = (mode & 0x3f00) | data;
- }
- else if (x.addr == 0x20)
- x.wid_aux = BIT(data, 0);
- break;
-
- case 6: // address msb
- x.addr = u16((data & 0x1f) << 8) | (x.addr & 0x00ff);
- break;
-
- case 7: // address lsb
- x.addr = (x.addr & 0x1f00) | data;
- break;
- }
+ m_reset = !state;
}
diff --git a/src/mame/video/sgi_gr1.h b/src/mame/video/sgi_gr1.h
index 40b3196c01b..51a9304417f 100644
--- a/src/mame/video/sgi_gr1.h
+++ b/src/mame/video/sgi_gr1.h
@@ -10,12 +10,15 @@
#include "screen.h"
#include "video/sgi_ge5.h"
#include "video/sgi_re2.h"
+#include "video/sgi_xmap2.h"
#include "video/bt45x.h"
#include "video/bt431.h"
class sgi_gr1_device : public device_t
{
public:
+ sgi_gr1_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
+
static constexpr feature_type imperfect_features() { return feature::GRAPHICS; }
// configuration
@@ -28,33 +31,34 @@ public:
virtual void map(address_map &map);
protected:
- sgi_gr1_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
-
// device_t overrides
+ virtual ioport_constructor device_input_ports() const override;
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
- virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) = 0;
-
u8 dr0_r() { return m_dr0; }
u8 dr1_r() { return m_dr1; }
u8 dr2_r() { return m_dr2; }
- u8 dr3_r() { return m_dr3 | (m_fifo.empty() ? 0 : DR3_FIFOEMPTY); }
- u8 dr4_r() { return m_dr4 & DR4_RM; }
+ u8 dr3_r() { return m_dr3; }
+ u8 dr4_r() { return (m_dr4 | (m_ge->suspended() ? 0 : DR4_GESTALL)) & DR4_RM; }
void dr0_w(u8 data) { m_dr0 = (m_dr0 & ~DR0_WM) | (data & DR0_WM); }
void dr1_w(u8 data) { m_dr1 = (m_dr1 & ~DR1_WM) | (data & DR1_WM); m_ge->cwen_w(BIT(data, 1)); }
void dr2_w(u8 data) { m_dr2 = (m_dr2 & ~DR2_WM) | (data & DR2_WM); }
void dr3_w(u8 data) { m_dr3 = (m_dr3 & ~DR3_WM) | (data & DR3_WM); }
- void dr4_w(u8 data) { m_dr4 = (m_dr4 & ~DR4_WM) | (data & DR4_WM); }
+ void dr4_w(u8 data);
+ u64 ge_fifo_r();
+ u32 fifo_r() { return u32(ge_fifo_r()); }
void fifo_w(offs_t offset, u32 data, u32 mem_mask);
-//private:
+private:
required_device<screen_device> m_screen;
- required_device<sgi_re2_device> m_re;
required_device<sgi_ge5_device> m_ge;
+ required_device<sgi_re2_device> m_re;
+ required_device_array<sgi_xmap2_device, 5> m_xmap;
required_device_array<bt431_device, 2> m_cursor;
+ required_device_array<bt457_device, 3> m_ramdac;
devcb_write_line m_vblank_cb;
devcb_write_line m_int_fifo_cb;
@@ -78,7 +82,7 @@ protected:
DR1_TURBO = 0x08, // turbo option installed (active low, ro)
DR1_OVERLAY0A = 0x10, // dac overlay bit 0 bank a (ro)
- DR1_WM = 0xf7, // write mask
+ DR1_WM = 0xe7, // write mask
};
enum dr2_mask : u8
{
@@ -88,18 +92,18 @@ protected:
DR2_BITPLANES = 0x08, // extra bitplanes installed (active low, ro)
DR2_ZBUF = 0x10, // z-buffer installed (active low, non-MGR, ro)
- DR2_WM = 0xf1, // write mask
+ DR2_WM = 0xe7, // write mask
};
enum dr3_mask : u8
{
DR3_GENSTATEN = 0x01, // enable genlock status out
DR3_LSBBLUEOUT = 0x01, // latch blue lsb out (VGR only)
- DR3_LCARESET = 0x02, // reset xilix lca (active low, rw)
- DR3_MONITORRESET = 0x04, // monitor set (rw)
+ DR3_LCARESET = 0x02, // reset xilinx lca (active low, rw)
+ DR3_MONITORRESET = 0x04, // reset monitor type (rw)
DR3_FIFOEMPTY = 0x08, // fifo empty (active low, ro)
DR3_FIFOFULL = 0x10, // fifo half full (active low, ro)
- DR3_WM = 0xf7, // write mask
+ DR3_WM = 0xe7, // write mask
};
enum dr4_mask : u8
{
@@ -112,7 +116,7 @@ protected:
DR4_MS = 0x80, // select upper 4K color map (rw)
DR4_RM = 0x9f, // read mask
- DR4_WM = 0xff, // write mask
+ DR4_WM = 0xe7, // write mask
};
u8 m_dr0;
@@ -122,111 +126,10 @@ protected:
u8 m_dr4;
util::fifo<u64, 512> m_fifo;
- u32 m_ff[2];
-};
-
-class sgi_gr11_device : public sgi_gr1_device
-{
-public:
- sgi_gr11_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
-
- virtual void map(address_map &map) override;
-
-protected:
- // device_t overrides
- virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
- virtual void device_reset() override;
-
- virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) override;
-
- template <unsigned Channel> u8 xpc1_r(offs_t offset)
- {
- if (offset)
- {
- unsigned const address = m_xpc1_addr[Channel];
- u16 const mode = m_xpc1_mode[Channel][address >> 1];
-
- return BIT(address, 0) ? (mode >> 8) : u8(mode);
- }
- else
- return m_xpc1_addr[Channel];
- }
-
- template <unsigned Channel> void xpc1_w(offs_t offset, u8 data)
- {
- if (offset)
- {
- unsigned const address = m_xpc1_addr[Channel];
- u16 &mode = m_xpc1_mode[Channel][address >> 1];
-
- if (BIT(address, 0))
- mode = (u16(data & 0x3f) << 8) | (mode & 0x00ff);
- else
- mode = (mode & 0x3f00) | data;
- }
- else
- m_xpc1_addr[Channel] = data & 7;
- }
- void xpc1_bc_w(offs_t offset, u8 data)
- {
- xpc1_w<0>(offset, data);
- xpc1_w<1>(offset, data);
- xpc1_w<2>(offset, data);
- xpc1_w<3>(offset, data);
- xpc1_w<4>(offset, data);
- }
-private:
- required_device<bt458_device> m_ramdac;
-
- u8 m_xpc1_addr[5];
- u16 m_xpc1_mode[5][4];
-};
-
-class sgi_gr12_device : public sgi_gr1_device
-{
-public:
- sgi_gr12_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
-
- virtual void map(address_map &map) override;
-
-protected:
- // device_t overrides
- virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override;
- virtual void device_reset() override;
-
- virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) override;
-
- template <unsigned Channel> u8 xmap2_r(offs_t offset);
- template <unsigned Channel> void xmap2_w(offs_t offset, u8 data);
- void xmap2_bc_w(offs_t offset, u8 data)
- {
- xmap2_w<0>(offset, data);
- xmap2_w<1>(offset, data);
- xmap2_w<2>(offset, data);
- xmap2_w<3>(offset, data);
- xmap2_w<4>(offset, data);
- }
-
-private:
- required_device_array<bt457_device, 3> m_ramdac;
-
- std::unique_ptr<u32[]> m_vram;
-
- struct xmap2
- {
- u16 addr;
- rgb_t color[8192];
- rgb_t overlay[16];
- u16 mode[16];
- bool wid_aux;
- }
- m_xmap2[5];
+ bool m_reset;
};
-DECLARE_DEVICE_TYPE(SGI_GR11, sgi_gr11_device)
-DECLARE_DEVICE_TYPE(SGI_GR12, sgi_gr12_device)
+DECLARE_DEVICE_TYPE(SGI_GR1, sgi_gr1_device)
#endif // MAME_VIDEO_SGI_GR1_H
diff --git a/src/mame/video/sgi_re2.cpp b/src/mame/video/sgi_re2.cpp
index 225ab16a598..348f12c2bda 100644
--- a/src/mame/video/sgi_re2.cpp
+++ b/src/mame/video/sgi_re2.cpp
@@ -5,8 +5,10 @@
* Silicon Graphics RE2 device.
*
* TODO:
- * - skeleton only
- *
+ * - z buffer r/w and function
+ * - stipple, dither, raster operations
+ * - other pixel modes
+ * - line drawing
*/
#include "emu.h"
@@ -19,7 +21,7 @@
//#define VERBOSE (LOG_GENERAL|LOG_REG)
#include "logmacro.h"
-static char const *const regnames[] =
+static char const *const regname[] =
{
nullptr, nullptr, nullptr, nullptr, "ENABRGB", "BIGENDIAN", "FUNC", "HADDR",
"NOPUP", "XYFRAC", "RGB", "YX", "PUPDATA", "PATL", "PATH", "DZI",
@@ -28,37 +30,105 @@ static char const *const regnames[] =
"RWDATA", "PIXMASK", "AUXMASK", "WIDDATA", "UAUXDATA", "RWMODE", "READBUF", "PIXTYPE",
"ASELECT", "ALIGNPAT", "ENABPAT", "ENABSTIP", "ENABDITH", "ENABWID", "CURWID", "DEPTHFN",
- "REPSTIP", "ENABLWID", "FBOPTION", "TOPSCAN", nullptr, nullptr, "ZBOPTION", "XZOOM",
+ "REPSTIP", "ENABLWID", "FBOPTION", "TOPSCAN", "TESTMODE", "TESTDATA", "ZBOPTION", "XZOOM",
"UPACMODE", "YMIN", "YMAX", "XMIN", "XMAX", "COLORCMP", "MEGOPTION", nullptr,
};
+static u32 const regmask[] =
+{
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000f, 0x00000003,
+ 0x00000001, 0x0000000f, 0x07ffffff, 0x003fffff, 0x00000003, 0x0000ffff, 0x0000ffff, 0x00ffffff,
+ 0x00003fff, 0x00ffffff, 0x000fffff, 0x000fffff, 0x00ffffff, 0x007fffff, 0x0007ffff, 0x0007ffff,
+ 0x0000ffff, 0x000000ff, 0x0000ffff, 0x0000ffff, 0x000007ff, 0x0000ffff, 0x000007ff, 0x00000007,
+
+ 0xffffffff, 0x00ffffff, 0x000001ff, 0x0000000f, 0x0000000f, 0x00000007, 0x00000001, 0x00000003,
+ 0x0000003f, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x0000000f, 0x0000000f,
+ 0x000000ff, 0x00000001, 0x00000003, 0x0003ffff, 0x00000001, 0x00003fff, 0x00000001, 0x000000ff,
+ 0x00000003, 0x000007ff, 0x000007ff, 0x00000fff, 0x00000fff, 0x00000001, 0x00000001, 0x00000000,
+};
+
DEFINE_DEVICE_TYPE(SGI_RE2, sgi_re2_device, "sgi_re2", "SGI Raster Engine 2")
sgi_re2_device::sgi_re2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
: device_t(mconfig, SGI_RE2, tag, owner, clock)
+ , m_xmap(*this, "^xmap%u", 0U)
+ , m_cursor(*this, "^cursor%u", 0U)
+ , m_ramdac(*this, "^ramdac%u", 0U)
+ , m_options_port(*this, "^options")
+ , m_rdy_cb(*this)
+ , m_drq_cb(*this)
+ , m_rdy(false)
+ , m_drq(false)
{
}
void sgi_re2_device::device_start()
{
- // TODO: save state
+ m_rdy_cb.resolve();
+ m_drq_cb.resolve();
+
+ m_vram = std::make_unique<u32[]>(1280 * 1024);
+ m_dram = std::make_unique<u32[]>(1280 * 1024);
+
+ // save state
+ for (unsigned i = 0; i < ARRAY_LENGTH(m_reg); i++)
+ if (regmask[i])
+ save_item(m_reg[i], regname[i]);
+
+ set_rdy(true);
+ set_drq(false);
+
+ m_step = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sgi_re2_device::step), this));
}
void sgi_re2_device::device_reset()
{
+ u8 const options = m_options_port->read();
+ m_vram_mask = 0xffffffffU;
+ m_dram_mask = (options & 0x10) ? 0xffffffff : 0;
+
+ m_state = IDLE;
+ m_ir_pending = false;
+
+ set_rdy(true);
+ set_drq(false);
+
+ // reset register values indicate presence of RE2
+ m_reg[REG_DZF] = 0;
+ m_reg[REG_DZF] = ~u32(0);
+
+ // FIXME: how is clipping disabled on reset?
+ m_clip.set(0, 1279, 0, 1023);
}
u32 sgi_re2_device::reg_r(offs_t offset)
{
- u32 data = 0;
+ u32 data = 0xffffffff & regmask[offset];
+ // only some registers can be read
switch (offset)
{
- case RE2_STIP: data = m_stip; break;
- case RE2_STIPCOUNT: data = m_stipcount; break;
- case RE2_RWDATA: data = m_rwdata; break;
+ case REG_RWDATA:
+ if (m_state == DMA_R)
+ {
+ data = m_reg[REG_RWDATA];
+ read_buffer();
+ step();
+ }
+ else
+ logerror("rwdata read when empty\n");
+ break;
+
+ case REG_DZI:
+ case REG_DZF:
+ case REG_STIP:
+ case REG_STIPCOUNT:
+ data = m_reg[offset];
+ LOGMASKED(LOG_REG, "reg_r register 0x%02x (%s) data 0x%x\n", offset, regname[offset], data);
+ break;
+
default:
- logerror("reg_r unhandled register 0x%x\n", offset);
+ logerror("reg_r unhandled register 0x%02x\n", offset);
break;
}
@@ -67,14 +137,407 @@ u32 sgi_re2_device::reg_r(offs_t offset)
void sgi_re2_device::reg_w(offs_t offset, u32 data)
{
- if ((offset < 64) && regnames[offset])
- LOGMASKED(LOG_REG, "reg_w register 0x%x (%s) data 0x%x\n", offset, regnames[offset], data);
+ if (regmask[offset])
+ {
+ if (offset != REG_RWDATA)
+ LOGMASKED(LOG_REG, "reg_w register 0x%02x (%s) data 0x%x\n", offset, regname[offset], data);
+
+ m_reg[offset] = data & regmask[offset];
+
+ // special case register handling
+ switch (offset)
+ {
+ case REG_RGB:
+ m_reg[REG_B] = (data & 0x000000ff) << 11;
+ m_reg[REG_G] = (data & 0x0000ff00) << 3;
+ m_reg[REG_R] = (data & 0x0fff0000) >> 5;
+ break;
+
+ case REG_YX:
+ m_reg[REG_X] = (data & 0x00000fff) >> 0;
+ m_reg[REG_Y] = (data & 0x007ff000) >> 12;
+ break;
+
+ case REG_IR:
+ m_ir_pending = true;
+ if (m_state == IDLE)
+ step();
+ break;
+
+ case REG_RWDATA:
+ if (m_state == DMA_W)
+ {
+ write_buffer();
+ step();
+ }
+ break;
+
+ case REG_YMIN:
+ case REG_YMAX:
+ case REG_XMIN:
+ case REG_XMAX:
+ m_clip.set(
+ (m_reg[REG_XMIN] >> 3) * 5 + (m_reg[REG_XMIN] & 0x7),
+ (m_reg[REG_XMAX] >> 3) * 5 + (m_reg[REG_XMAX] & 0x7),
+ m_reg[REG_YMIN],
+ m_reg[REG_YMAX]);
+ break;
+ }
+ }
else
- logerror("reg_w unhandled register 0x%x data 0x%x\n", offset, data);
+ logerror("reg_w unhandled register 0x%02x data 0x%x\n", offset, data);
+}
- switch (offset)
+void sgi_re2_device::step(void *ptr, int param)
+{
+ switch (m_state)
+ {
+ case IDLE:
+ set_rdy(!m_ir_pending);
+ if (m_ir_pending)
+ {
+ m_ir_pending = false;
+ m_state = EXECUTE;
+ m_step->adjust(attotime::zero);
+ }
+ break;
+
+ case EXECUTE:
+ execute();
+ if (m_state == IDLE)
+ step();
+ break;
+
+ default:
+ break;
+ }
+}
+
+void sgi_re2_device::execute()
+{
+ // load buffered registers
+ m_enabrgb = bool(m_reg[REG_ENABRGB]);
+ m_bigendian = bool(m_reg[REG_BIGENDIAN]);
+ m_func[0] = BIT(m_reg[REG_FUNC], 0) ? ~u32(0) : 0;
+ m_func[1] = BIT(m_reg[REG_FUNC], 1) ? ~u32(0) : 0;
+ m_func[2] = BIT(m_reg[REG_FUNC], 2) ? ~u32(0) : 0;
+ m_func[3] = BIT(m_reg[REG_FUNC], 3) ? ~u32(0) : 0;
+ // TODO: haddr
+ m_nopup = bool(m_reg[REG_NOPUP]);
+ // TODO: xyfrac
+ m_pupdata = m_reg[REG_PUPDATA];
+ m_pat = (m_reg[REG_PATH] << 16) | m_reg[REG_PATL];
+ m_dz = (s64(u64(m_reg[REG_DZI]) << 40) >> 26) | m_reg[REG_DZF];
+ m_dr = s32(m_reg[REG_DR] << 8) >> 8;
+ m_dg = s32(m_reg[REG_DG] << 12) >> 12;
+ m_db = s32(m_reg[REG_DB] << 12) >> 12;
+ m_z = s64(u64(m_reg[REG_Z]) << 40) >> 26;
+ m_r = m_reg[REG_R];
+ m_g = m_reg[REG_G];
+ m_b = m_reg[REG_B];
+ m_stip = m_reg[REG_STIP];
+ m_stipcount = m_reg[REG_STIPCOUNT];
+ m_dx = s32(s16(m_reg[REG_DX]));
+ m_dy = s32(s16(m_reg[REG_DY]));
+ m_numpix = m_reg[REG_NUMPIX];
+ m_x = ((m_reg[REG_X] >> 3) * 5 + (m_reg[REG_X] & 0x7)) << 14;
+ m_y = m_reg[REG_Y] << 14;
+ m_ir = m_reg[REG_IR];
+
+ switch (m_ir)
+ {
+ case IR_SHADED:
+ LOG("ri draw shaded span\n");
+ draw_shaded_span();
+ break;
+
+ case IR_FLAT:
+ LOG("ri draw 1x5 flat span\n");
+ draw_flat_span(5);
+ break;
+
+ case IR_FLAT4:
+ LOG("ri draw 1x20 flat span\n");
+ draw_flat_span(20);
+ break;
+
+ case IR_TOPLINE:
+ LOG("ri draw top of anti-aliased line\n");
+ m_state = IDLE;
+ break;
+
+ case IR_BOTLINE:
+ LOG("ri draw bottom of anti-aliased line\n");
+ m_state = IDLE;
+ break;
+
+ case IR_READBUF:
+ LOG("ri read buffer\n");
+ read_buffer();
+ break;
+
+ case IR_WRITEBUF:
+ LOG("write buffer\n");
+ write_buffer();
+ break;
+ }
+}
+
+void sgi_re2_device::draw_shaded_span()
+{
+/*
+ * raster operation logic:
+ *
+ u32 const result =
+ (m_func[0] & src & dst) +
+ (m_func[1] & src & ~dst) +
+ (m_func[2] & ~src & dst) +
+ (m_func[3] & ~src & ~dst);
+*/
+
+ u32 const mask = (m_reg[REG_AUXMASK] << 24) | m_reg[REG_PIXMASK];
+ u32 const aux = m_nopup ?
+ (m_reg[REG_WIDDATA] << 28) | (m_reg[REG_UAUXDATA] << 24) :
+ (m_reg[REG_WIDDATA] << 28) | ((m_reg[REG_UAUXDATA] & 0x3) << 26) | (m_pupdata << 24);
+
+ for (unsigned n = 0; m_numpix--; n++)
+ {
+ // TODO: z buffer check
+
+ if (m_clip.contains(m_x >> 14, m_y >> 14))
+ {
+ if (pattern(m_x >> 14, n))
+ {
+ offs_t const offset = (m_y >> 14) * 0x500 + (m_x >> 14);
+ if (wid(IR_SHADED, offset))
+ {
+ u32 const color = (m_r >> 11) << 0 | (m_g >> 11) << 8 | (m_b >> 11) << 16;
+
+ vram_w(offset, aux | color, mask);
+ }
+ }
+ }
+
+ increment();
+ }
+
+ m_state = IDLE;
+}
+
+void sgi_re2_device::draw_flat_span(unsigned const n)
+{
+ u32 const mask = (m_reg[REG_AUXMASK] << 24) | m_reg[REG_PIXMASK];
+ u32 const aux = m_nopup ?
+ (m_reg[REG_WIDDATA] << 28) | (m_reg[REG_UAUXDATA] << 24) :
+ (m_reg[REG_WIDDATA] << 28) | ((m_reg[REG_UAUXDATA] & 0x3) << 26) | (m_pupdata << 24);
+ offs_t const offset = (m_y >> 14) * 0x500 + (m_x >> 14);
+
+ for (unsigned i = 0; i < m_numpix; i++)
+ {
+ if (m_clip.contains((m_x >> 14) + i, m_y >> 14))
+ {
+ u32 const color = (m_r >> 11) << 0 | (m_g >> 11) << 8 | (m_b >> 11) << 16;
+
+ vram_w(offset + i, aux | color, mask);
+ }
+
+ if ((i % n) == 0)
+ increment();
+ }
+
+ m_state = IDLE;
+}
+
+void sgi_re2_device::increment()
+{
+ m_x += m_dx;
+ m_y += m_dy;
+ m_z += m_dz;
+
+ m_r += m_dr;
+ m_g += m_dg;
+ m_b += m_db;
+}
+
+void sgi_re2_device::read_buffer()
+{
+ if (m_numpix > 0)
+ {
+ switch (m_reg[REG_RWMODE])
+ {
+ case RWMODE_FB_P:
+ m_reg[REG_RWDATA] = m_vram[(m_y >> 14) * 0x500 + (m_x >> 14)];
+ break;
+ }
+
+ increment();
+ m_numpix--;
+
+ m_state = DMA_R;
+ }
+ else
+ m_state = IDLE;
+
+ set_drq(m_state == DMA_R);
+}
+
+void sgi_re2_device::write_buffer()
+{
+ if (m_state == DMA_W)
+ {
+ for (unsigned i = 0; i <= m_reg[REG_UPACMODE]; i++)
+ {
+ if (m_clip.contains(m_x >> 14, m_y >> 14))
+ {
+ offs_t const offset = (m_y >> 14) * 0x500 + (m_x >> 14);
+
+ // FIXME: wid only for rwmode 0, 1, 2, 6
+ if (wid(IR_WRITEBUF, offset))
+ {
+ // unpack pixel (TODO: HADDR != 0)
+ u32 const data = unpack(m_reg[REG_RWDATA], i, m_reg[REG_UPACMODE]);
+
+ // TODO: xzoom
+ // TODO: pattern
+
+ // format and write
+ // TODO: raster op
+
+ // write the pixel
+ switch (m_reg[REG_RWMODE])
+ {
+ case RWMODE_UAUX:
+ vram_w(offset, data << 24, (m_reg[REG_AUXMASK] & (m_nopup ? 0xf : 0xc)) << 24);
+ break;
+ }
+ }
+ }
+
+ increment();
+ m_numpix--;
+ }
+ }
+
+ if (m_numpix > 0)
+ m_state = DMA_W;
+ else
+ m_state = IDLE;
+
+ set_drq(m_state == DMA_W);
+}
+
+u32 sgi_re2_device::unpack(u32 data, unsigned const n, u32 const mode) const
+{
+ switch (mode)
{
- case RE2_STIP: m_stip = data; break;
- case RE2_STIPCOUNT: m_stipcount = data; break;
+ case 1: data = u16(data >> (16 * (1 - n))); break;
+ case 3: data = u8(data >> (8 * (3 - n))); break;
}
+
+ return data;
+}
+
+bool sgi_re2_device::wid(unsigned const ir, offs_t const offset)
+{
+ if (!m_reg[REG_ENABWID])
+ return true;
+
+ if ((ir == IR_TOPLINE || ir == IR_BOTLINE) && !m_reg[REG_ENABLWID])
+ return true;
+
+ unsigned const wid = m_vram[offset] >> 28;
+
+ // 2 or 4 wid bitplanes?
+ if (m_reg[REG_FBOPTION] & 1)
+ {
+ if (BIT(m_reg[REG_DEPTHFN], 3))
+ return (wid & 0xe) == (m_reg[REG_CURWID] & 0xe);
+ else
+ return (wid & 0xf) == (m_reg[REG_CURWID] & 0xf);
+ }
+ else
+ return (wid & 0x3) == (m_reg[REG_CURWID] & 0x3);
+}
+
+bool sgi_re2_device::pattern(unsigned const x, unsigned const n) const
+{
+ if (!m_reg[REG_ENABPAT])
+ return true;
+
+ unsigned const index = (m_reg[REG_ALIGNPAT] ? x : n) % 32;
+
+ return BIT(m_pat, 31 - index);
+}
+
+u32 sgi_re2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect)
+{
+ // TODO: variable topscan row and column
+ for (unsigned screen_y = screen.visible_area().min_y, mem_y = 1023; screen_y <= screen.visible_area().max_y; screen_y++, mem_y--)
+ for (unsigned screen_x = screen.visible_area().min_x, mem_x = 0; screen_x <= screen.visible_area().max_x; screen_x++, mem_x++)
+ {
+ unsigned const channel = mem_x % 5;
+ u32 const data = m_vram[(mem_y * 0x500) + mem_x];
+ u16 const mode = m_xmap[channel]->mode_r(data >> 28);
+
+ // default is 24 bit rgb single buffered
+ rgb_t color = rgb_t(data >> 0, data >> 8, data >> 16);
+
+ // check overlay or underlay
+ if (((data >> 20) & mode & sgi_xmap2_device::MODE_OE) || ((mode & sgi_xmap2_device::MODE_UE) && !(data & 0x00ffffffU)))
+ color = m_xmap[channel]->overlay_r(data >> 24);
+ else
+ switch (mode & sgi_xmap2_device::MODE_DM)
+ {
+ case 0: // 8 bit indexed single buffered
+ {
+ u16 const index = BIT(mode, sgi_xmap2_device::BIT_ME) ? ((mode & sgi_xmap2_device::MODE_MC) >> 2) | u8(data) : u8(data);
+
+ color = m_xmap[channel]->pen_color(index);
+ }
+ break;
+
+ case 1: // 4 bit indexed double buffered
+ {
+ u8 const buffer = BIT(mode, sgi_xmap2_device::BIT_BS) ? u8(data) >> 4 : data & 0x0f;
+ u16 const index = BIT(mode, sgi_xmap2_device::BIT_ME) ? ((mode & sgi_xmap2_device::MODE_MC) >> 2) | buffer : buffer;
+
+ color = m_xmap[channel]->pen_color(index);
+ }
+ break;
+
+ case 2: // 12 bit indexed double buffered
+ {
+ u16 const buffer = u16(BIT(mode, sgi_xmap2_device::BIT_BS) ? data >> 12 : data) & 0x0fff;
+ u16 const index = BIT(mode, sgi_xmap2_device::BIT_ME) ? ((mode & sgi_xmap2_device::MODE_MC) >> 2) | (buffer & 0xff) : buffer;
+
+ color = m_xmap[channel]->pen_color(index);
+ }
+ break;
+
+ case 5: // 12 bit rgb double buffered
+ color = BIT(mode, sgi_xmap2_device::BIT_BS) ?
+ rgb_t(
+ ((data >> 0x00) & 0xf0) | ((data >> 0x04) & 0x0f),
+ ((data >> 0x08) & 0xf0) | ((data >> 0x0c) & 0x0f),
+ ((data >> 0x10) & 0xf0) | ((data >> 0x14) & 0x0f)) :
+ rgb_t(
+ ((data << 0x04) & 0xf0) | ((data >> 0x00) & 0x0f),
+ ((data >> 0x04) & 0xf0) | ((data >> 0x08) & 0x0f),
+ ((data >> 0x0c) & 0xf0) | ((data >> 0x10) & 0x0f));
+ break;
+ }
+
+ // read the cursor devices
+ u8 const cursor =
+ (m_cursor[0]->cur_r(screen_x, screen_y) ? 1 : 0) |
+ (m_cursor[1]->cur_r(screen_x, screen_y) ? 2 : 0);
+
+ // apply the gamma ramp and output the pixel
+ bitmap.pix(screen_y, screen_x) = rgb_t(
+ m_ramdac[0]->lookup(color.r(), cursor),
+ m_ramdac[1]->lookup(color.g(), cursor),
+ m_ramdac[2]->lookup(color.b(), cursor));
+ }
+
+ return 0;
}
diff --git a/src/mame/video/sgi_re2.h b/src/mame/video/sgi_re2.h
index c82708aa85b..48b424bb04f 100644
--- a/src/mame/video/sgi_re2.h
+++ b/src/mame/video/sgi_re2.h
@@ -6,89 +6,215 @@
#pragma once
+#include "video/sgi_xmap2.h"
+#include "video/bt45x.h"
+#include "video/bt431.h"
+#include "screen.h"
+
class sgi_re2_device : public device_t
{
public:
sgi_re2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
+ auto out_rdy() { return m_rdy_cb.bind(); }
+ auto out_drq() { return m_drq_cb.bind(); }
+
// device_t overrides
virtual void device_start() override;
virtual void device_reset() override;
- enum register_number : unsigned
+ u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect);
+
+ enum re_register : unsigned
{
// buffered registers (write only unless noted)
- RE2_ENABRGB = 0x04, // enable 8 bit rgb (1)
- RE2_BIGENDIAN = 0x05, // enable big endian mode (1)
- RE2_FUNC = 0x06, // raster op function (4)
- RE2_HADDR = 0x07, // starting pixel location (2)
- RE2_NOPUP = 0x08, // size of uaux (1)
- RE2_XYFRAC = 0x09, // initial xyfrac (4)
- RE2_RGB = 0x0a, // initial color values (27)
- RE2_YX = 0x0b, // initial y and x (22)
- RE2_PUPDATA = 0x0c, // pup data (2)
- RE2_PATL = 0x0d, // pattern mask low (16)
- RE2_PATH = 0x0e, // pattern mask high (16)
- RE2_DZI = 0x0f, // delta z integer (24)
- RE2_DZF = 0x10, // delta z fraction (14)
- RE2_DR = 0x11, // delta red (24)
- RE2_DG = 0x12, // delta green (20)
- RE2_DB = 0x13, // delta blue (20)
- RE2_Z = 0x14, // initial z integer (24)
- RE2_R = 0x15, // initial red (23)
- RE2_G = 0x16, // initial green (19)
- RE2_B = 0x17, // initial blue (19)
- RE2_STIP = 0x18, // stipple pattern (16, rw)
- RE2_STIPCOUNT = 0x19, // stipple repeat (8, rw)
- RE2_DX = 0x1a, // delta x (16)
- RE2_DY = 0x1b, // delta y (16)
- RE2_NUMPIX = 0x1c, // pixel count (11)
- RE2_X = 0x1d, // initial x (12)
- RE2_Y = 0x1e, // initial y (11)
- RE2_IR = 0x1f, // instruction (3)
+ REG_ENABRGB = 0x04, // enable 8 bit rgb (re2 only) (1)
+ REG_BIGENDIAN = 0x05, // enable big endian mode (1)
+ REG_FUNC = 0x06, // raster op function (4)
+ REG_HADDR = 0x07, // starting pixel location (2)
+ REG_NOPUP = 0x08, // size of uaux (1)
+ REG_XYFRAC = 0x09, // initial xyfrac (4)
+ REG_RGB = 0x0a, // initial color values (27)
+ REG_YX = 0x0b, // initial y and x (22)
+ REG_PUPDATA = 0x0c, // pup data (2)
+ REG_PATL = 0x0d, // pattern mask low (16)
+ REG_PATH = 0x0e, // pattern mask high (16)
+ REG_DZI = 0x0f, // delta z integer (24)
+ REG_DZF = 0x10, // delta z fraction (14)
+ REG_DR = 0x11, // delta red (24)
+ REG_DG = 0x12, // delta green (20)
+ REG_DB = 0x13, // delta blue (20)
+ REG_Z = 0x14, // initial z integer (24)
+ REG_R = 0x15, // initial red (23)
+ REG_G = 0x16, // initial green (19)
+ REG_B = 0x17, // initial blue (19)
+ REG_STIP = 0x18, // stipple pattern (16, rw)
+ REG_STIPCOUNT = 0x19, // stipple repeat (8, rw)
+ REG_DX = 0x1a, // delta x (16)
+ REG_DY = 0x1b, // delta y (16)
+ REG_NUMPIX = 0x1c, // pixel count (11)
+ REG_X = 0x1d, // initial x (12)
+ REG_Y = 0x1e, // initial y (11)
+ REG_IR = 0x1f, // instruction (3)
// unbuffered registers (write only unless noted)
- RE2_RWDATA = 0x20, // read/write data (32, rw)
- RE2_PIXMASK = 0x21, // pixel mask (24)
- RE2_AUXMASK = 0x22, // auxiliary mask (9)
- RE2_WIDDATA = 0x23, // window id (4)
- RE2_UAUXDATA = 0x24, // uaux data (4)
- RE2_RWMODE = 0x25, // read/write mode (3)
- RE2_READBUF = 0x26, // buffer select (1)
- RE2_PIXTYPE = 0x27, // pixel type (2)
- RE2_ASELECT = 0x28, // antialias select (6)
- RE2_ALIGNPAT = 0x29, // pattern alignment (1)
- RE2_ENABPAT = 0x2a, // enable pattern mask (1)
- RE2_ENABSTIP = 0x2b, // enable stipple (1)
- RE2_ENABDITH = 0x2c, // enable dithering (1)
- RE2_ENABWID = 0x2d, // enable wid check (1)
- RE2_CURWID = 0x2e, // current wid (4)
- RE2_DEPTHFN = 0x2f, // depth function (4)
- RE2_REPSTIP = 0x30, // stipple repeat (8)
- RE2_ENABLWID = 0x31, // enable line wid (1)
- RE2_FBOPTION = 0x32, // frame buffer option (2)
- RE2_TOPSCAN = 0x33, // first row/column (18)
- RE2_ZBOPTION = 0x36, // z buffer option (1)
- RE2_XZOOM = 0x37, // x zoom factor (8)
- RE2_UPACMODE = 0x38, // packing mode (2)
- RE2_YMIN = 0x39, // bottom screen mask (11)
- RE2_YMAX = 0x3a, // top screen mask (11)
- RE2_XMIN = 0x3b, // left screen mask (12)
- RE2_XMAX = 0x3c, // right screen mask (12)
- RE2_COLORCMP = 0x3d, // z compare source (1)
- RE2_MEGOPTION = 0x3e, // vram size (1)
+ REG_RWDATA = 0x20, // read/write data (32, rw)
+ REG_PIXMASK = 0x21, // pixel mask (24)
+ REG_AUXMASK = 0x22, // auxiliary mask (9)
+ REG_WIDDATA = 0x23, // window id (4)
+ REG_UAUXDATA = 0x24, // uaux data (4)
+ REG_RWMODE = 0x25, // read/write mode (3)
+ REG_READBUF = 0x26, // buffer select (1)
+ REG_PIXTYPE = 0x27, // pixel type (2)
+ REG_ASELECT = 0x28, // antialias select (6)
+ REG_ALIGNPAT = 0x29, // pattern alignment (1)
+ REG_ENABPAT = 0x2a, // enable pattern mask (1)
+ REG_ENABSTIP = 0x2b, // enable stipple (1)
+ REG_ENABDITH = 0x2c, // enable dithering (1)
+ REG_ENABWID = 0x2d, // enable wid check (1)
+ REG_CURWID = 0x2e, // current wid (4)
+ REG_DEPTHFN = 0x2f, // depth function (4)
+ REG_REPSTIP = 0x30, // stipple repeat (8)
+ REG_ENABLWID = 0x31, // enable line wid (1)
+ REG_FBOPTION = 0x32, // frame buffer option (2)
+ REG_TOPSCAN = 0x33, // first row/column (18)
+ REG_TESTMODE = 0x34, // ??
+ REG_TESTDATA = 0x35, // ??
+ REG_ZBOPTION = 0x36, // z buffer option (1)
+ REG_XZOOM = 0x37, // x zoom factor (8)
+ REG_UPACMODE = 0x38, // packing mode (2)
+ REG_YMIN = 0x39, // bottom screen mask (11)
+ REG_YMAX = 0x3a, // top screen mask (11)
+ REG_XMIN = 0x3b, // left screen mask (12)
+ REG_XMAX = 0x3c, // right screen mask (12)
+ REG_COLORCMP = 0x3d, // z compare source (1)
+ REG_MEGOPTION = 0x3e, // vram size (1)
+ };
+
+ enum re_rwmode : unsigned
+ {
+ RWMODE_FB = 0, // frame buffer bitplanes
+ RWMODE_PUP = 1, // pup bitplanes
+ RWMODE_UAUX = 2, // uaux bitplanes
+ RWMODE_ZB = 3, // z buffer bitplanes
+ RWMODE_WID = 4, // wid bitplanes
+ RWMODE_FB_P = 6, // frame buffer port
+ RWMODE_ZB_P = 7, // z buffer port
+ };
+
+ enum re_ir : unsigned
+ {
+ IR_SHADED = 1, // draw shaded span
+ IR_FLAT = 2, // draw 1x5 flat span
+ IR_FLAT4 = 3, // draw 1x20 flat span (megoption=0)
+ IR_BLOCKWRITE = 3, // 20 pix blkwrt mode (megoption=1)
+ IR_TOPLINE = 4, // draw top of antialised line
+ IR_BOTLINE = 5, // draw bottom of antialised line
+ IR_READBUF = 6, // read buffer
+ IR_WRITEBUF = 7, // write buffer
};
u32 reg_r(offs_t offset);
void reg_w(offs_t offset, u32 data);
protected:
+ // state machine
+ void step(void *ptr = nullptr, int param = 0);
+ void execute();
+
+ // drawing functions
+ void draw_shaded_span();
+ void draw_flat_span(unsigned const n);
+ void read_buffer();
+ void write_buffer();
+
+ // line helpers
+ void set_rdy(bool state)
+ {
+ if (state != m_rdy)
+ {
+ m_rdy = state;
+ m_rdy_cb(m_rdy);
+ }
+ }
+ void set_drq(bool state)
+ {
+ if (state != m_drq)
+ {
+ m_drq = state;
+ m_drq_cb(m_drq);
+ }
+ }
+
+ // write condition helpers
+ u32 unpack(u32 data, unsigned const n, u32 const mode) const;
+ bool wid(unsigned const ir, offs_t const offset);
+ bool pattern(unsigned const x, unsigned const n) const;
+
+ void increment();
+
+ void vram_w(offs_t const offset, u32 const data, u32 const mem_mask) { m_vram[offset] = (m_vram[offset] & ~mem_mask) | (data & mem_mask & m_vram_mask); }
private:
+ required_device_array<sgi_xmap2_device, 5> m_xmap;
+ required_device_array<bt431_device, 2> m_cursor;
+ required_device_array<bt457_device, 3> m_ramdac;
+ required_ioport m_options_port;
+
+ devcb_write_line m_rdy_cb;
+ devcb_write_line m_drq_cb;
+
+ // state machine
+ emu_timer *m_step;
+ enum re_state : unsigned
+ {
+ IDLE,
+ EXECUTE,
+ DMA_R,
+ DMA_W,
+ }
+ m_state;
+ bool m_ir_pending;
+
+ // line state
+ bool m_rdy;
+ bool m_drq;
+
+ // registers
+ u32 m_reg[64];
+
+ // active command state
+ bool m_enabrgb;
+ bool m_bigendian;
+ u32 m_func[4];
+ // haddr
+ bool m_nopup;
+ // xyfrac
+ unsigned m_pupdata;
+ u32 m_pat;
+ s32 m_dz;
+ s32 m_dr;
+ s32 m_dg;
+ s32 m_db;
+ s64 m_z;
+ u32 m_r;
+ u32 m_g;
+ u32 m_b;
u16 m_stip;
u8 m_stipcount;
+ s32 m_dx;
+ s32 m_dy;
+ unsigned m_numpix;
+ u32 m_x;
+ u32 m_y;
+ unsigned m_ir;
+
+ rectangle m_clip;
- u32 m_rwdata;
+ std::unique_ptr<u32[]> m_vram;
+ std::unique_ptr<u32[]> m_dram;
+ u32 m_vram_mask;
+ u32 m_dram_mask;
};
DECLARE_DEVICE_TYPE(SGI_RE2, sgi_re2_device)
diff --git a/src/mame/video/sgi_xmap2.cpp b/src/mame/video/sgi_xmap2.cpp
new file mode 100644
index 00000000000..82375db26d1
--- /dev/null
+++ b/src/mame/video/sgi_xmap2.cpp
@@ -0,0 +1,190 @@
+// license:BSD-3-Clause
+// copyright-holders:Patrick Mackinlay
+
+/*
+ * Silicon Graphics Multiplexed Multimode Graphics Processor (XMAP2).
+ */
+
+#include "emu.h"
+#include "sgi_xmap2.h"
+
+#define LOG_GENERAL (1U << 0)
+
+//#define VERBOSE (LOG_GENERAL)
+#include "logmacro.h"
+
+DEFINE_DEVICE_TYPE(SGI_XMAP2, sgi_xmap2_device, "sgi_xmap2", "SGI XMAP2")
+
+sgi_xmap2_device::sgi_xmap2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, SGI_XMAP2, tag, owner, clock)
+ , device_palette_interface(mconfig, *this)
+ , m_options_port(*this, "^options")
+ , m_map_select(false)
+{
+}
+
+void sgi_xmap2_device::device_start()
+{
+ // save state
+ save_item(NAME(m_addr));
+ save_item(NAME(m_color));
+ save_item(NAME(m_overlay));
+ save_item(NAME(m_mode));
+ save_item(NAME(m_wid_aux));
+ save_item(NAME(m_map_select));
+}
+
+void sgi_xmap2_device::device_reset()
+{
+ m_options = m_options_port->read();
+}
+
+u8 sgi_xmap2_device::reg_r(offs_t offset)
+{
+ switch (offset)
+ {
+ case 0: // nop
+ break;
+
+ case 1: // blue data
+ if (m_addr & 0x1000)
+ return m_color[m_map_select ? m_addr : (m_addr & 0xfff)].b();
+ else if (m_addr < 0x10)
+ return m_overlay[m_addr].b();
+ break;
+
+ case 2: // green data
+ if (m_addr & 0x1000)
+ return m_color[m_map_select ? m_addr : (m_addr & 0xfff)].g();
+ else if (m_addr < 0x10)
+ return m_overlay[m_addr].g();
+ break;
+
+ case 3: // red data
+ if (m_addr & 0x1000)
+ return m_color[m_map_select ? m_addr : (m_addr & 0xfff)].r();
+ else if (m_addr < 0x10)
+ return m_overlay[m_addr].r();
+ break;
+
+ case 4: // increment address
+ // TODO: should reading increment the address register?
+ //m_addr = (m_addr + 1) & 0x1fff;
+ LOG("read address increment\n");
+ break;
+
+ case 5: // other data
+ if (m_addr < 0x20)
+ {
+ u16 const mode = m_mode[(m_addr >> 1) & 0xf];
+
+ return BIT(m_addr, 0) ? (mode >> 8) : u8(mode);
+ }
+ else if (m_addr == 0x20)
+ return m_wid_aux;
+ else if (m_addr == 0x21)
+ return m_options;
+ break;
+
+ case 6: // address msb
+ return m_addr >> 8;
+
+ case 7: // address lsb
+ return u8(m_addr);
+ }
+
+ return 0;
+}
+
+void sgi_xmap2_device::reg_w(offs_t offset, u8 data)
+{
+ switch (offset)
+ {
+ case 0: // nop
+ break;
+
+ case 1: // blue data
+ if (m_addr & 0x1000)
+ {
+ unsigned const index = m_map_select ? m_addr : (m_addr & 0xfff);
+
+ m_color[index].set_b(data);
+ set_pen_blue_level(index & 0xfff, data);
+ }
+ else if (m_addr < 0x10)
+ {
+ m_overlay[m_addr].set_b(data);
+ set_pen_blue_level(0x1000 + m_addr, data);
+ }
+ break;
+
+ case 2: // green data
+ if (m_addr & 0x1000)
+ {
+ unsigned const index = m_map_select ? m_addr : (m_addr & 0xfff);
+
+ m_color[index].set_g(data);
+ set_pen_green_level(index & 0xfff, data);
+ }
+ else if (m_addr < 0x10)
+ {
+ m_overlay[m_addr].set_g(data);
+ set_pen_green_level(0x1000 + m_addr, data);
+ }
+ break;
+
+ case 3: // red data
+ if (m_addr & 0x1000)
+ {
+ unsigned const index = m_map_select ? m_addr : (m_addr & 0xfff);
+
+ m_color[index].set_r(data);
+ set_pen_red_level(index & 0xfff, data);
+ }
+ else if (m_addr < 0x10)
+ {
+ m_overlay[m_addr].set_r(data);
+ set_pen_red_level(0x1000 + m_addr, data);
+ }
+ break;
+
+ case 4: // increment address
+ m_addr = (m_addr + 1) & 0x1fff;
+ break;
+
+ case 5: // other data
+ if (m_addr < 0x20)
+ {
+ u16 &mode = m_mode[(m_addr >> 1) & 0xf];
+
+ if (BIT(m_addr, 0))
+ mode = (u16(data & 0x3f) << 8) | (mode & 0x00ff);
+ else
+ mode = (mode & 0x3f00) | data;
+ }
+ else if (m_addr == 0x20)
+ m_wid_aux = BIT(data, 0);
+ break;
+
+ case 6: // address msb
+ m_addr = u16((data & 0x1f) << 8) | (m_addr & 0x00ff);
+ break;
+
+ case 7: // address lsb
+ m_addr = (m_addr & 0x1f00) | data;
+ break;
+ }
+}
+
+void sgi_xmap2_device::map_select_w(int state)
+{
+ if (m_map_select ^ bool(state))
+ {
+ m_map_select = bool(state);
+
+ // update mame palette
+ unsigned const base = m_map_select ? 4096 : 0;
+ for (unsigned i = 0; i < 4096; i++)
+ set_pen_color(i, m_color[base + i]);
+ }
+}
diff --git a/src/mame/video/sgi_xmap2.h b/src/mame/video/sgi_xmap2.h
new file mode 100644
index 00000000000..01bc35c48b7
--- /dev/null
+++ b/src/mame/video/sgi_xmap2.h
@@ -0,0 +1,60 @@
+// license:BSD-3-Clause
+// copyright-holders:Patrick Mackinlay
+
+#ifndef MAME_VIDEO_SGI_XMAP2_H
+#define MAME_VIDEO_SGI_XMAP2_H
+
+#pragma once
+
+class sgi_xmap2_device
+ : public device_t
+ , public device_palette_interface
+{
+public:
+ sgi_xmap2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
+
+ // device_t overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // device_palette_interface overrides
+ virtual u32 palette_entries() const override { return 4096 + 16; }
+
+ u8 reg_r(offs_t offset);
+ void reg_w(offs_t offset, u8 data);
+
+ void map_select_w(int state);
+
+ u16 mode_r(unsigned const index) const { return m_mode[index]; }
+ rgb_t overlay_r(u8 data) const { return m_wid_aux ? m_overlay[data & 0x3] : m_overlay[data & 0xf]; }
+
+ enum mode_mask : u16
+ {
+ MODE_MC = 0x3c00, // multimap constant
+ MODE_ME = 0x0200, // multimap enable
+ MODE_UE = 0x0100, // underlay enable
+ MODE_OE = 0x00f0, // overlay enable
+ MODE_BS = 0x0008, // buffer select
+ MODE_DM = 0x0007, // display mode
+ };
+ enum mode_bits : unsigned
+ {
+ BIT_ME = 9, // multimap enable
+ BIT_UE = 8, // underlay enable
+ BIT_BS = 3, // buffer select
+ };
+private:
+ required_ioport m_options_port;
+
+ u16 m_addr;
+ rgb_t m_color[8192];
+ rgb_t m_overlay[16];
+ u16 m_mode[16];
+ bool m_wid_aux;
+ bool m_map_select;
+ u8 m_options;
+};
+
+DECLARE_DEVICE_TYPE(SGI_XMAP2, sgi_xmap2_device)
+
+#endif // MAME_VIDEO_SGI_XMAP2_H
diff --git a/src/mame/video/tank8.cpp b/src/mame/video/tank8.cpp
index 0507640e84a..e0919d373fd 100644
--- a/src/mame/video/tank8.cpp
+++ b/src/mame/video/tank8.cpp
@@ -175,7 +175,7 @@ void tank8_state::device_timer(emu_timer &timer, device_timer_id id, int param,
set_collision(param);
break;
default:
- assert_always(false, "Unknown id in tank8_state::device_timer");
+ throw emu_fatalerror("Unknown id in tank8_state::device_timer");
}
}
diff --git a/src/mame/video/tecmo_spr.cpp b/src/mame/video/tecmo_spr.cpp
index cf1e6b448ee..9d520f39eb5 100644
--- a/src/mame/video/tecmo_spr.cpp
+++ b/src/mame/video/tecmo_spr.cpp
@@ -74,7 +74,7 @@ void tecmo_spr_device::gaiden_draw_sprites(screen_device &screen, gfx_element *g
int sourceinc = 8;
int count = NUM_SPRITES;
- int screenwidth = screen.width();
+ int screenwidth = screen.visible_area().width();
int attributes_word = 0;
int tilenumber_word = 1;
diff --git a/src/mame/video/triplhnt.cpp b/src/mame/video/triplhnt.cpp
index 922ab970b19..b211a167460 100644
--- a/src/mame/video/triplhnt.cpp
+++ b/src/mame/video/triplhnt.cpp
@@ -43,7 +43,7 @@ void triplhnt_state::device_timer(emu_timer &timer, device_timer_id id, int para
set_collision(param);
break;
default:
- assert_always(false, "Unknown id in triplhnt_state::device_timer");
+ throw emu_fatalerror("Unknown id in triplhnt_state::device_timer");
}
}
diff --git a/src/mame/video/x1.cpp b/src/mame/video/x1.cpp
index dc872754dd8..69bc60cc4fa 100644
--- a/src/mame/video/x1.cpp
+++ b/src/mame/video/x1.cpp
@@ -19,7 +19,7 @@
*
*************************************/
-VIDEO_START_MEMBER(x1_state,x1)
+void x1_state::video_start()
{
m_gfx_bitmap_ram = make_unique_clear<uint8_t[]>(0xc000*2);
m_bitmapbank->configure_entries(0, 2, m_gfx_bitmap_ram.get(), 0xc000);
diff --git a/src/mame/video/x68k_crtc.cpp b/src/mame/video/x68k_crtc.cpp
index 5a82583f725..a05082b2377 100644
--- a/src/mame/video/x68k_crtc.cpp
+++ b/src/mame/video/x68k_crtc.cpp
@@ -136,7 +136,7 @@ void x68k_crtc_device::text_copy(unsigned src, unsigned dest, u8 planes)
// update RAM in each plane
for (int words = 256; words > 0; words--, src_ram++, dest_ram++)
{
- for (u8 plane = 0; plane < 3; plane++)
+ for (u8 plane = 0; plane <= 3; plane++)
if (BIT(planes, plane))
m_tvram_write_callback(dest_ram + 0x10000 * plane, m_tvram_read_callback(src_ram + 0x10000 * plane, 0xffff), 0xffff);
}
diff --git a/src/mame/video/zx.cpp b/src/mame/video/zx.cpp
index c3c7904861f..755c2eb8b8b 100644
--- a/src/mame/video/zx.cpp
+++ b/src/mame/video/zx.cpp
@@ -33,7 +33,7 @@ void zx_state::device_timer(emu_timer &timer, device_timer_id id, int param, voi
zx_ula_hsync();
break;
default:
- assert_always(false, "Unknown id in zx_state::device_timer");
+ throw emu_fatalerror("Unknown id in zx_state::device_timer");
}
}
diff --git a/src/osd/mac/appdelegate.mm b/src/osd/mac/appdelegate.mm
index 4207f515beb..8aa80e4fdb8 100644
--- a/src/osd/mac/appdelegate.mm
+++ b/src/osd/mac/appdelegate.mm
@@ -10,29 +10,13 @@
#import "appdelegate.h"
-extern int mac_run_emulator();
-
-@interface MAMEThread : NSThread
-@end
-
-@implementation MAMEThread
-- (void)main
-{
- mac_run_emulator();
-}
-@end
-
@interface MAMEAppDelegate ()
@end
@implementation MAMEAppDelegate
-MAMEThread *appThread;
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
- // run MAME on a thread so event dispatching happens normally
- appThread = [[MAMEThread alloc] init];
- [appThread start];
}
- (void)applicationWillTerminate:(NSNotification *)notification
diff --git a/src/osd/mac/macmain.cpp b/src/osd/mac/macmain.cpp
index 8e50361a2b1..40bcd7d1882 100644
--- a/src/osd/mac/macmain.cpp
+++ b/src/osd/mac/macmain.cpp
@@ -62,15 +62,12 @@ mac_options::mac_options()
}
//============================================================
-// main
+// mac_run_emulator - this is the MAME entry point from the
+// Cocoa shell
//============================================================
-// we do some special sauce on Win32...
-int mac_run_emulator()
+int mac_run_emulator(int argc, char *argv[])
{
- int argc = *_NSGetArgc();
- char **argv = *_NSGetArgv();
-
std::vector<std::string> args = osd_get_command_line(argc, argv);
int res = 0;
@@ -81,14 +78,12 @@ int mac_run_emulator()
// Initialize crash diagnostics
diagnostics_module::get_instance()->init_crash_diagnostics();
- {
- mac_options options;
- mac_osd_interface osd(options);
- osd.register_options();
- res = emulator_info::start_frontend(options, osd, args);
- }
+ mac_options options;
+ mac_osd_interface osd(options);
+ osd.register_options();
+ res = emulator_info::start_frontend(options, osd, args);
- exit(res);
+ return res;
}
//============================================================
diff --git a/src/osd/mac/main.mm b/src/osd/mac/main.mm
index fdc50be53fe..d11eb0c79a8 100644
--- a/src/osd/mac/main.mm
+++ b/src/osd/mac/main.mm
@@ -10,10 +10,33 @@
#import "appdelegate.h"
+extern int mac_run_emulator(int argc, char *argv[]);
+
int main(int argc, char * argv[])
{
[NSApplication sharedApplication];
[NSApp setDelegate: [MAMEAppDelegate new]];
+ [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+ [NSApp activateIgnoringOtherApps:YES];
+ [NSApp finishLaunching];
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:NSApplicationWillFinishLaunchingNotification
+ object:NSApp];
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:NSApplicationDidFinishLaunchingNotification
+ object:NSApp];
+ id quitMenuItem = [NSMenuItem new];
+ [quitMenuItem
+ initWithTitle:@"Quit"
+ action:@selector(terminate:)
+ keyEquivalent:@"q"];
+ id appMenu = [NSMenu new];
+ [appMenu addItem:quitMenuItem];
+ id appMenuItem = [NSMenuItem new];
+ [appMenuItem setSubmenu:appMenu];
+ id menubar = [[NSMenu new] autorelease];
+ [menubar addItem:appMenuItem];
+ [NSApp setMainMenu:menubar];
- return NSApplicationMain(argc, (const char**)argv);
+ return mac_run_emulator(argc, argv);
}
diff --git a/src/osd/mac/windowcontroller.mm b/src/osd/mac/windowcontroller.mm
index aa09e96b0d5..dd49d559b0b 100644
--- a/src/osd/mac/windowcontroller.mm
+++ b/src/osd/mac/windowcontroller.mm
@@ -88,6 +88,20 @@
}
@end
+void MacPollInputs()
+{
+ NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny
+ untilDate:[NSDate distantPast] // do not wait for event
+ inMode:NSDefaultRunLoopMode
+ dequeue:YES];
+
+ if (event)
+ {
+ [NSApp sendEvent:event];
+ [NSApp updateWindows];
+ }
+}
+
void *GetOSWindow(void *wincontroller)
{
MAMEWindowController *wc = (MAMEWindowController *)wincontroller;
@@ -102,30 +116,22 @@ void *CreateMAMEWindow(char *title, int x, int y, int w, int h, bool isFullscree
NSWindow *window = [NSWindow alloc];
MAMEWindowController *controller = [MAMEWindowController alloc];
- /* To avoid event handling issues like SDL has, we run MAME in
- a separate NSThread. This means all UI calls from MAME
- must be delegated over to the main thread because the
- Cocoa UI stuff is not thread-safe */
- dispatch_sync(dispatch_get_main_queue(), ^{
- [window initWithContentRect:bounds
- styleMask:style
- backing:NSBackingStoreBuffered
- defer:NO];
- [controller initWithWindow:window];
-
- NSString *nstitle = [[NSString alloc] initWithUTF8String:title];
- [window setTitle:nstitle];
- [nstitle release];
-
- if (isFullscreen)
- {
- [controller goFullscreen];
- }
- else
- {
- [window makeKeyAndOrderFront:nil];
- }
- });
+ [window initWithContentRect:bounds
+ styleMask:style
+ backing:NSBackingStoreBuffered
+ defer:NO];
+ [controller initWithWindow:window];
+ NSString *nstitle = [[NSString alloc] initWithUTF8String:title];
+ [window setTitle:nstitle];
+ [nstitle release];
+ if (isFullscreen)
+ {
+ [controller goFullscreen];
+ }
+ else
+ {
+ [window makeKeyAndOrderFront:nil];
+ }
return (void *)controller;
}
diff --git a/src/osd/modules/diagnostics/diagnostics_win32.cpp b/src/osd/modules/diagnostics/diagnostics_win32.cpp
index 3bd1e48fa10..677cd93bff7 100644
--- a/src/osd/modules/diagnostics/diagnostics_win32.cpp
+++ b/src/osd/modules/diagnostics/diagnostics_win32.cpp
@@ -670,16 +670,20 @@ sampling_profiler::~sampling_profiler()
void sampling_profiler::start()
{
// do the dance to get a handle to ourself
- BOOL result = DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &m_target_thread,
- THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME | THREAD_QUERY_INFORMATION, FALSE, 0);
- assert_always(result, "Failed to get thread handle for main thread");
+ BOOL const result = DuplicateHandle(
+ GetCurrentProcess(), GetCurrentThread(),
+ GetCurrentProcess(), &m_target_thread,
+ THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME | THREAD_QUERY_INFORMATION, FALSE, 0);
+ if (!result)
+ throw emu_fatalerror("sampling_profiler::start: Failed to get thread handle for main thread");
// reset the exit flag
m_thread_exit = false;
// start the thread
m_thread = CreateThread(nullptr, 0, thread_entry, (LPVOID)this, 0, &m_thread_id);
- assert_always(m_thread != nullptr, "Failed to create profiler thread\n");
+ if (!m_thread)
+ throw emu_fatalerror("sampling_profiler::start: Failed to create profiler thread");
// max out the priority
SetThreadPriority(m_thread, THREAD_PRIORITY_TIME_CRITICAL);
diff --git a/src/osd/modules/input/input_mac.cpp b/src/osd/modules/input/input_mac.cpp
index ac2d4e4e5b6..4dd030b331a 100644
--- a/src/osd/modules/input/input_mac.cpp
+++ b/src/osd/modules/input/input_mac.cpp
@@ -31,12 +31,15 @@
#include "../../mac/osdmac.h"
#include "input_common.h"
+extern void MacPollInputs();
+
void mac_osd_interface::customize_input_type_list(simple_list<input_type_entry> &typelist)
{
}
void mac_osd_interface::poll_inputs(running_machine &machine)
{
+ MacPollInputs();
}
void mac_osd_interface::release_keys()
diff --git a/src/osd/modules/lib/osdlib.h b/src/osd/modules/lib/osdlib.h
index d126ed7f2ce..0095244d6fe 100644
--- a/src/osd/modules/lib/osdlib.h
+++ b/src/osd/modules/lib/osdlib.h
@@ -54,7 +54,7 @@ int osd_setenv(const char *name, const char *value, int overwrite);
/*-----------------------------------------------------------------------------
- osd_get_clipboard_text: retrieves text from the clipboard
+ osd_get_clipboard_text: retrieves text from the clipboard
-----------------------------------------------------------------------------*/
std::string osd_get_clipboard_text(void);
diff --git a/src/osd/modules/monitor/monitor_mac.cpp b/src/osd/modules/monitor/monitor_mac.cpp
index 338911cafdb..74523105cf0 100644
--- a/src/osd/modules/monitor/monitor_mac.cpp
+++ b/src/osd/modules/monitor/monitor_mac.cpp
@@ -84,11 +84,11 @@ public:
std::shared_ptr<osd_monitor_info> monitor_from_window(const osd_window& window) override
{
-// if (!m_initialized)
+// if (!m_initialized)
return nullptr;
-// std::uint64_t display = SDL_GetWindowDisplayIndex(static_cast<const mac_window_info &>(window).platform_window());
-// return monitor_from_handle(display);
+// std::uint64_t display = SDL_GetWindowDisplayIndex(static_cast<const mac_window_info &>(window).platform_window());
+// return monitor_from_handle(display);
}
protected:
diff --git a/src/osd/modules/osdmodule.cpp b/src/osd/modules/osdmodule.cpp
index 45664295cfb..75adc5c75bb 100644
--- a/src/osd/modules/osdmodule.cpp
+++ b/src/osd/modules/osdmodule.cpp
@@ -7,6 +7,9 @@
#include "modules/osdmodule.h"
+#include <algorithm>
+
+
osd_module_manager::osd_module_manager()
{
for (int i=0; i<MAX_MODULES; i++)
@@ -25,17 +28,15 @@ osd_module_manager::~osd_module_manager()
void osd_module_manager::register_module(const module_type &mod_type)
{
+ auto const slot = std::find(std::begin(m_modules), std::end(m_modules), nullptr);
+ if (std::end(m_modules) == slot)
+ throw emu_fatalerror("osd_module_manager::register_module: Module registration beyond MAX_MODULES!");
+
osd_module *module = mod_type();
if (module->probe())
{
osd_printf_verbose("===> registered module %s %s\n", module->name(), module->type());
-
- int i;
- for (i = 0; i < MAX_MODULES && m_modules[i] != nullptr; i++)
- ;
-
- assert_always(i < MAX_MODULES, "Module registration beyond MAX_MODULES!");
- m_modules[i] = module;
+ *slot = module;
}
else
{
@@ -51,8 +52,8 @@ bool osd_module_manager::type_has_name(const char *type, const char *name) const
osd_module *osd_module_manager::get_module_generic(const char *type, const char *name)
{
- int i = get_module_index(type, name);
- if (i>=0)
+ int const i = get_module_index(type, name);
+ if (i >= 0)
return m_modules[i];
else
return nullptr;
diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h
index 506b4978161..3fe020c56fe 100644
--- a/src/osd/modules/osdwindow.h
+++ b/src/osd/modules/osdwindow.h
@@ -178,14 +178,16 @@ public:
static const int FLAG_NEEDS_ASYNCBLIT = 0x0200;
osd_renderer(std::shared_ptr<osd_window> window, const int flags)
- : m_sliders_dirty(false), m_window(window), m_flags(flags) { }
+ : m_sliders_dirty(false), m_window(window), m_flags(flags)
+ { }
virtual ~osd_renderer() { }
std::shared_ptr<osd_window> assert_window() const
{
auto win = m_window.lock();
- assert_always(win != nullptr, "Window weak_ptr is not available!");
+ if (!win)
+ throw emu_fatalerror("osd_renderer::assert_window: Window weak_ptr is not available!");
return win;
}
diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp
index bd4648be474..6837e63bbe3 100644
--- a/src/osd/modules/render/drawogl.cpp
+++ b/src/osd/modules/render/drawogl.cpp
@@ -2026,10 +2026,11 @@ ogl_texture_info *renderer_ogl::texture_create(const render_texinfo *texsource,
m_texhash[i] = texture;
break;
}
- assert_always(i < HASH_SIZE + OVERFLOW_SIZE, "texture hash exhausted ...");
+ if ((HASH_SIZE + OVERFLOW_SIZE) <= i)
+ throw emu_fatalerror("renderer_ogl::texture_create: texture hash exhausted ...");
}
- if(m_usevbo)
+ if (m_usevbo)
{
// Generate And Bind The Texture Coordinate Buffer
pfn_glGenBuffers( 1, &(texture->texCoordBufferName) );
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index b2361ff7ffd..cd164db7776 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -354,6 +354,7 @@ static const dasm_table_entry dasm_table[] =
{ "dsp32c", le, 0, []() -> util::disasm_interface * { return new dsp32c_disassembler; } },
{ "dsp56156", le, -1, []() -> util::disasm_interface * { return new dsp56156_disassembler; } },
{ "e0c6200", be, -1, []() -> util::disasm_interface * { return new e0c6200_disassembler; } },
+ { "epg3231", le, -1, []() -> util::disasm_interface * { return new epg3231_disassembler; } },
// { "es5510", be, 0, []() -> util::disasm_interface * { return new es5510_disassembler; } }, // Currently does nothing
{ "esrip", be, 0, []() -> util::disasm_interface * { return new esrip_disassembler; } },
{ "f2mc16", le, 0, []() -> util::disasm_interface * { return new f2mc16_disassembler; } },
@@ -448,7 +449,6 @@ static const dasm_table_entry dasm_table[] =
{ "pps4", le, 0, []() -> util::disasm_interface * { return new pps4_disassembler; } },
{ "psxcpu", le, 0, []() -> util::disasm_interface * { return new psxcpu_disassembler; } },
{ "r65c02", le, 0, []() -> util::disasm_interface * { return new r65c02_disassembler; } },
- { "rii", le, -1, []() -> util::disasm_interface * { return new riscii_disassembler; } },
{ "rsp", le, 0, []() -> util::disasm_interface * { return new rsp_disassembler; } },
{ "s2650", le, 0, []() -> util::disasm_interface * { return new s2650_disassembler(&s2650_unidasm); } },
{ "saturn", le, 0, []() -> util::disasm_interface * { return new saturn_disassembler(&saturn_unidasm); } },